adding tablespace to PDB database
connect to the PDB
SQL> ALTER SESSION SET CONTAINER = pdb4;
Session altered.
SQL> SHOW CON_NAME
CON_NAME
------------------------------
PDB4
SQL> create tablespace test datafile '/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/test.dbf' size 200m;
Tablespace created.
SQL> SELECT name FROM v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/cdb1/undotbs01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/system01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/sysaux01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/pdb1_users01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/test.dbf
SQL> DROP TABLESPACE test INCLUDING CONTENTS AND DATAFILES;
Tablespace dropped.
SQL> SELECT name FROM v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/cdb1/undotbs01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/system01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/sysaux01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/pdb1_users01.dbf
SQL> SELECT tablespace_name FROM dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
TEMP
USERS
connect to the PDB
SQL> ALTER SESSION SET CONTAINER = pdb4;
Session altered.
SQL> SHOW CON_NAME
CON_NAME
------------------------------
PDB4
SQL> create tablespace test datafile '/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/test.dbf' size 200m;
Tablespace created.
SQL> SELECT name FROM v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/cdb1/undotbs01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/system01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/sysaux01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/pdb1_users01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/test.dbf
SQL> DROP TABLESPACE test INCLUDING CONTENTS AND DATAFILES;
Tablespace dropped.
SQL> SELECT name FROM v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/cdb1/undotbs01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/system01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/sysaux01.dbf
/media/sf_12cR1/12cDB/cdb1/pdb2/pdb4/pdb1_users01.dbf
SQL> SELECT tablespace_name FROM dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
TEMP
USERS
No comments:
Post a Comment