1. After upgarde from 11.2.0.3 to 12.1.0.1, database(TESTRAC) is NON-CDB: SQL> show parameter db_name; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_name string TESTRAC SQL> select name, cdb from v$database; NAME CDB --------- --- TESTRAC NO SQL> show con_name; CON_NAME ------------------------------ Non Consolidated 2. Verify all datafile locations SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- +DATA/testrac/datafile/system.313.822996543 +DATA/testrac/datafile/sysaux.314.822996543 +DATA/testrac/datafile/undotbs1.315.822996543 +DATA/testrac/datafile/users.316.822996543 +DATA/testrac/datafile/example.327.822996619 +DATA/testrac/datafile/undotbs2.328.822996729 3.Shutdown and Open read only, generate XML pdb description file on source non-cdb(TESTRAC) srvctl stop database -d TESTRAC sqlplus "/as sysdba" SQL> startup mount; ORACLE instance started. Total System Global Area 1068937216 bytes Fixed Size 2296576 bytes Variable Size 968885504 bytes Database Buffers 92274688 bytes Redo Buffers 5480448 bytes Database mounted. SQL> alter database open read only; Database altered. SQL> exec dbms_pdb.describe(PDB_DESCR_FILE=>'/dba/testrac.xml'); ---> make sure created in shared directory PL/SQL procedure successfully completed. 4.Shutdown the source non-CDB (TESTRAC) SQL> shutdown immediate; exit 5. Connect to target CDB(TEST1CDB) and check whether non-cdb (TESTRAC) can be plugged into it. SQL> select name, cdb from v$database; NAME CDB --------- --- TEST1CDB YES SQL> SET SERVEROUTPUT ON DECLARE compatible CONSTANT VARCHAR2(3) := CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY( pdb_descr_file => '/dba/testrac.xml', pdb_name => 'TESTRAC') WHEN TRUE THEN 'YES' ELSE 'NO' END; BEGIN DBMS_OUTPUT.PUT_LINE(compatible); END; / NO 6. If the scripts returns NO, then check PDB_PLUG_IN_VIOLATIONS view SQL> col cause for a10 SQL> col name for a10 SQL> col message for a35 word_wrapped SQL> select name,cause,type,message,status from PDB_PLUG_IN_VIOLATIONS where name='TESTRAC'; NAME CAUSE TYPE MESSAGE STATUS ---------- ---------- --------- ----------------------------------- --------- TESTRAC OPTION WARNING Database option DV mismatch: PDB PENDING installed version NULL. CDB installed version 12.1.0.1.0. TESTRAC OPTION WARNING Database option OLS mismatch: PDB PENDING installed version NULL. CDB installed version 12.1.0.1.0. TESTRAC Non-CDB to WARNING PDB plugged in is a non-CDB, PENDING PDB requires noncdb_to_pdb.sql be run. NAME CAUSE TYPE MESSAGE STATUS ---------- ---------- --------- ----------------------------------- --------- TESTRAC Parameter WARNING CDB parameter memory_target PENDING mismatch: Previous 1073741824 Current 0 TESTRAC Parameter WARNING CDB parameter compatible mismatch: PENDING Previous 11.2.0.0.0 Current 12.1.0.0.0 There are WARNING’s only. We can continue. 7. Plug-in Non-CDB (TESTRAC) as PDB (TESTRAC) into CDB(TEST1CDB): SQL> CREATE PLUGGABLE DATABASE TESTRAC USING '/dba/testrac.xml' NOCOPY; Pluggable database created. 8. Check the newly create pdb(TESTRAC) SQL> select name, open_mode from v$pdbs; NAME OPEN_MODE ------------------------------ ---------- PDB$SEED READ ONLY TEST1PDB READ WRITE TESTRAC MOUNTED SQL> col pdb_name for a15 SQL> select pdb_name, status from dba_pdbs where pdb_name = 'TESTRAC'; PDB_NAME STATUS --------------- ------------- TESTRAC NEW SQL> alter session set container=TESTRAC; Session altered. SQL> show con_name; CON_NAME ------------------------------ TESTRAC SQL> show con_id; CON_ID ------------------------------ 4 SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- +DATA/TEST1CDB/DATAFILE/undotbs2.344.823881825 +DATA/testrac/datafile/system.313.822996543 +DATA/testrac/datafile/sysaux.314.822996543 +DATA/testrac/datafile/users.316.822996543 +DATA/testrac/datafile/example.327.822996619 9. Run the noncdb_to_pdb.sql script: SQL>@$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql 10. Open PDB(TESTRAC) verify that warnings was resolved. SQL> alter session set container= CDB$ROOT; Session altered. SQL> col cause for a10 SQL> col name for a10 SQL> col message for a35 word_wrapped SQL> select name,cause,type,message,status from PDB_PLUG_IN_VIOLATIONS where name='TESTRAC'; NAME CAUSE TYPE MESSAGE STATUS ---------- ---------- --------- ----------------------------------- --------- TESTRAC Parameter WARNING CDB parameter memory_target RESOLVED mismatch: Previous 1073741824 Current 0 TESTRAC Parameter WARNING CDB parameter compatible mismatch: RESOLVED Previous 11.2.0.0.0 Current 12.1.0.0.0 TESTRAC OPTION WARNING Database option DV mismatch: PDB PENDING installed version NULL. CDB installed version 12.1.0.1.0. TESTRAC OPTION WARNING Database option OLS mismatch: PDB PENDING installed version NULL. CDB installed version 12.1.0.1.0. TESTRAC Non-CDB to ERROR PDB plugged in is a non-CDB, PENDING PDB requires noncdb_to_pdb.sql be run. SQL> alter pluggable database TESTRAC open; Pluggable database altered. SQL> select pdb_name, status from dba_pdbs; PDB_NAME STATUS --------------- ------------- TEST1PDB NORMAL PDB$SEED NORMAL TESTRAC NORMAL 3 rows selected. SQL> col cause for a10 SQL> col name for a10 SQL> col message for a35 word_wrapped SQL> select name,cause,type,message,status from PDB_PLUG_IN_VIOLATIONS where name='TESTRAC'; NAME CAUSE TYPE MESSAGE STATUS ---------- ---------- --------- ----------------------------------- --------- TESTRAC Parameter WARNING CDB parameter memory_target RESOLVED mismatch: Previous 1073741824 Current 0 TESTRAC Parameter WARNING CDB parameter compatible mismatch: RESOLVED Previous 11.2.0.0.0 Current 12.1.0.0.0 TESTRAC Non-CDB to ERROR PDB plugged in is a non-CDB, RESOLVED PDB requires noncdb_to_pdb.sql be run. TESTRAC OPTION WARNING Database option DV mismatch: PDB PENDING installed version NULL. CDB installed version 12.1.0.1.0. TESTRAC OPTION WARNING Database option OLS mismatch: PDB PENDING installed version NULL. CDB installed version 12.1.0.1.0.
Tuesday, August 20, 2013
12C: Convert non-cdb into pdb and plug into cdb
Labels:
12c
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment