Oracle 12c 建立 SCOTT 使用者

feelpurple發表於2016-01-02
--檢視 PDB 情況
[oracle@DB2 admin]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 2 08:47:19 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select dbid, con_id, name, open_mode from v$pdbs;


      DBID     CON_ID NAME     OPEN_MODE
---------- ---------- ------------------------------ ----------
1686940507    2 PDB$SEED     READ ONLY
3729057642    3 PDB1     READ WRITE

--切換到包所在的目錄

[oracle@DB2 ~]$ cd $ORACLE_HOME/rdbms/admin

--需要在 PDB 下面建立,切換到要建立的 PDB

[oracle@DB2 admin]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 2 20:22:50 2016

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> alter session set container=pdb1;

Session altered.

--建立 SCOTT 使用者

SQL> @utlsampl.sql

--檢視建立的使用者

SQL> select username,ACCOUNT_STATUS,created from dba_users order by created;

USERNAME ACCOUNT_STATUS  CREATED
-------------------------------------------------------------------------------------------------------------------------------- -------------------------------- ---------

SCOTT OPEN  02-JAN-16

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-1970032/,如需轉載,請註明出處,否則將追究法律責任。

相關文章