ITPub博客

首页 > 数据库 > Oracle > Oracle 12c 创建 SCOTT 用户

Oracle 12c 创建 SCOTT 用户

原创 Oracle 作者:feelpurple 时间:2016-01-02 20:46:55 0 删除 编辑
--查看 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博客 ” ,链接:https://blog.itpub.net/26506993/viewspace-1970032/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: Oracle 索引的优化
请登录后发表评论 登录
全部评论

注册时间:2014-08-01

  • 博文量
    404
  • 访问量
    1673940