[oracle@12cr2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Sat May 27 22:35:43 2017
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> 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 MOUNTED
SQL> 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_PDB
ORA-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 sysdba
Connected.
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_PDB
SQL*Plus: Release 12.2.0.1.0 Production on Sat May 27 22:56:29 2017
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> show pdbs;
SP2-0382: The SHOW PDBS command is not available