Saturday, November 9, 2013

Oracle Database 12c – Container Database & Pluggable Databases (Part-2)


 


Starting backup at 03-JUL-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/cdb1/sysaux01.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/cdb1/system01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/cdb1/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/cdb1/users01.dbf
channel ORA_DISK_1: starting piece 1 at 03-JUL-13
channel ORA_DISK_1: finished piece 1 at 03-JUL-13
piece handle=/u01/app/oracle/fast_recovery_area/CDB1/backupset/2013_07_03/o1_mf_nnndf_TAG20130703T091644_8x7tzxy7_.bkp tag=TAG20130703T091644 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:46
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/cdb1/pdb1/sysaux01.dbf
input datafile file number=00011 name=/u01/app/oracle/oradata/cdb1/pdb1/example01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/cdb1/pdb1/system01.dbf
input datafile file number=00012 name=/u01/app/oracle/oradata/cdb1/pdb1/APEX_2590625748469154.dbf
input datafile file number=00010 name=/u01/app/oracle/oradata/cdb1/pdb1/SAMPLE_SCHEMA_users01.dbf
channel ORA_DISK_1: starting piece 1 at 03-JUL-13
channel ORA_DISK_1: finished piece 1 at 03-JUL-13
piece handle=/u01/app/oracle/fast_recovery_area/CDB1/DF55887034681BA0E045000000000001/backupset/2013_07_03/o1_mf_nnndf_TAG20130703T091644_8x7v380l_.bkp tag=TAG20130703T091644 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:16
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00014 name=/u01/app/oracle/oradata/cdb1/pdb2/sysaux01.dbf
input datafile file number=00013 name=/u01/app/oracle/oradata/cdb1/pdb2/system01.dbf
channel ORA_DISK_1: starting piece 1 at 03-JUL-13
channel ORA_DISK_1: finished piece 1 at 03-JUL-13
piece handle=/u01/app/oracle/fast_recovery_area/CDB1/DF7C6C5E253B5245E045000000000001/backupset/2013_07_03/o1_mf_nnndf_TAG20130703T091644_8x7v5mg9_.bkp tag=TAG20130703T091644 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/u01/app/oracle/oradata/cdb1/pdbseed/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/cdb1/pdbseed/system01.dbf
channel ORA_DISK_1: starting piece 1 at 03-JUL-13
channel ORA_DISK_1: finished piece 1 at 03-JUL-13
piece handle=/u01/app/oracle/fast_recovery_area/CDB1/DF5542A90C88193FE045000000000001/backupset/2013_07_03/o1_mf_nnndf_TAG20130703T091644_8x7v7ywb_.bkp tag=TAG20130703T091644 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 03-JUL-13

Starting Control File and SPFILE Autobackup at 03-JUL-13
piece handle=/u01/app/oracle/fast_recovery_area/CDB1/autobackup/2013_07_03/o1_mf_s_819795167_8x7v9qty_.bkp comment=NONE 

Finished Control File and SPFILE Autobackup at 03-JUL-13

Connect as ‘SYS’  as user in Container Database:

SQL> connect sys/oracle@localhost:1521/cdb1 as sysdba

Create Pluggable Database:
SQL> create pluggable database plugdb3
admin user odb3_admin identified by oracle
roles = (DBA)
FILE_NAME_CONVERT= ('/u01/app/oracle/oradata/cdb1/pdbseed','/u01/app/oracle/oradata/cdb1/plugdb3');

Check the status:

SQL> select pdb_name, status from cdb_pdbs;
SQL> select name, open_mode from v$pdbs;

Connect as ‘SYS’  as user in newly created Pluggable Database:

SQL> connect  sys/oracle@localhost:1521/plugdb3 as sysdba
SQL> show con_name

CON_NAME
------------------------------
PLUGDB3

Open the Pluggable Database:

SQL> alter pluggable database plugdb3 open;
SQL> select name, open_mode from v$pdbs;

NAME                                                                            OPEN_MODE
-------------------------------------------------------------------------------- ----------
PLUGDB3                                                                      READ WRITE

Close the Pluggable Database:

SQL> alter pluggable database plugdb3 close immediate;
SQL> select name, open_mode from v$pdbs;

NAME                                                                            OPEN_MODE
-------------------------------------------------------------------------------- ----------
PLUGDB3                                                                      MOUNTED


No comments:

Post a Comment