在多PDB环境中,创建common user,并赋予权限。

来源:互联网 发布:淘宝万艾可 编辑:程序博客网 时间:2024/06/04 01:30


[oracle@12cr2 ~]$ sqlplus / as sysdbaSQL*Plus: Release 12.2.0.1.0 Production on Sat May 27 22:35:43 2017Copyright (c) 1982, 2016, Oracle.  All rights reserved.Connected to:Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit ProductionSQL> show pdbs;    CON_ID CON_NAME                       OPEN MODE  RESTRICTED---------- ------------------------------ ---------- ----------         2 PDB$SEED                       READ ONLY  NO         3 SEED_PDB                       MOUNTED         4 NONCDB_PDP                     MOUNTED         5 CLON_PDB                       MOUNTEDSQL> alter pluggable database all open;Pluggable database altered.SQL> show pdbs;    CON_ID CON_NAME                       OPEN MODE  RESTRICTED---------- ------------------------------ ---------- ----------         2 PDB$SEED                       READ ONLY  NO         3 SEED_PDB                       READ WRITE NO         4 NONCDB_PDP                     READ WRITE NO         5 CLON_PDB                       READ WRITE NO

SQL> create user c##cdbadmin identified by oracle default tablespace users temporary tablespace temp;create user c##cdbadmin identified by oracle default tablespace users temporary tablespace temp*ERROR at line 1:ORA-65048: error encountered when processing the current DDL statement in pluggable database SEED_PDBORA-00959: tablespace 'USERS' does not exist
##需要在所有的PDB中创建USERS表空间
SQL> alter session set container=SEED_PDB;Session altered.SQL> create tablespace users datafile '/u01/app/oracle/oradata/zylong/seed_pdb/users01.dbf' size 100M;   Tablespace created.SQL> alter session set container=CLON_PDB;Session altered.SQL> create tablespace users datafile '/u01/app/oracle/oradata/zylong/clon_pdb/users01.dbf' size 100M;Tablespace created.

SQL> conn / as sysdbaConnected.SQL> create user c##cdbadmin identified by oracle default tablespace users temporary tablespace temp;User created.SQL> grant connect,resource to c##cdbadmin container=all;Grant succeeded.[oracle@12cr2 admin]$ sqlplus c##cdbadmin/oracle@CLON_PDBSQL*Plus: Release 12.2.0.1.0 Production on Sat May 27 22:56:29 2017Copyright (c) 1982, 2016, Oracle.  All rights reserved.Connected to:Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit ProductionSQL> show pdbs;SP2-0382: The SHOW PDBS command is not available


原创粉丝点击