Loading

Oracle12c开启scott账户

在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登陆了

posted @ 2016-11-13 12:03  hackyo  阅读(2434)  评论(0编辑  收藏  举报