Oraclele 12c解锁HR模式

Oraclele 12c解锁HR模式

Oracle12 解锁HR模式,开启Oracle学习之路!

Win键+R打开小窗口运行cmd,然后按照下面步骤进行:

1
2
3
4
5
6
7
8
-- 以管理员身份登录数据库
sqlplus / as sysdba
--
show con_name;
--
SELECT name, con_id FROM v$pdbs;
--
SELECT name FROM v$active_services WHERE con_id = 3;

上面的命令详细如下图a001和a002:

下面配置详细如下图a003和a004:

保存并关闭上面文件,以管理员运行控制台,详细如下图a005:

运行下面命令:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--
lsnrctl reload
--
sqlplus / as sysdba
--
SHOW con_name;
--
ALTER SESSION SET CONTAINER = pdborcl;
--
SHOW con_name;
--
SELECT name, open_mode FROM v$pdbs;
--
ALTER USER hr IDENTIFIED By hr ACCOUNT UNLOCK;
--
conn hr/hr@PDBORCL
--
SHOW USER;

上面的命令详细如下图a006、a007和a008:

注意点:

如下图:

1
2
3
4
--
ALTER PLUGGABLE DATABASE open;
--
SELECT name, open_mode FROM v$pdbs;