共计 781 个字符,预计需要花费 2 分钟才能阅读完成。
在 Oracle 目录 app\orcl\product\12.1.0\dbhome_1\NETWORK\ADMIN\ 下 tnsnames.ora 文件最后加入以下内容
PDBORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PDBORCL)
)
)
然后进入 sqlplus 连接登陆 sys 账号,运行以下语句
SQL > conn sysYouPassword as sysdba;
SQL > alter session set container = PDBORCL;
SQL > startup
SQL > conn sys@pdborclYouPassword as sysdba;
SQL > alter user scott account unlock identified by tiger;
SQL > conn sysYouPassword as sysdba;
SQL > CREATE OR REPLACE TRIGGER open_all_pdbs
AFTER STARTUP
ON DATABASE
BEGIN
EXECUTE IMMEDIATE ‘alter pluggable database all open’;
END open_all_pdbs;
SQL > shutdown immediate
SQL > startup
至此已经可以使用账号 scott@pdborcl 密码 tiger 登陆了
更多 Oracle 相关信息见 Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12
本文永久更新链接地址 :http://www.linuxidc.com/Linux/2017-05/143309.htm