ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 12C Plug No_cdb Into Cdb

12C Plug No_cdb Into Cdb

原创 Linux操作系统 作者:yyp2009 时间:2013-10-17 14:09:04 0 删除 编辑
1  only nocdb operation:

  SQL> set linesize 500
SQL> set pagesize 500
SQL>  show pdbs
SQL>  select cdb,NAME,dbid from v$database;
CDB NAME            DBID
--- --------- ----------
NO  CRMNOC    2880313921
SQL>  shutdown immediate
Database closed.
Database dismounted.
 startup mount;
ORACLE instance shut down.
SQL>
ORACLE instance started.
Total System Global Area 2037673984 bytes
Fixed Size                  2290120 bytes
Variable Size            1040191032 bytes
Database Buffers          973078528 bytes
Redo Buffers               22114304 bytes
Database mounted.
SQL> SQL> SQL> alter database open read only;
Database altered.
SQL> EXEC DBMS_PDB.DESCRIBE( pdb_descr_file => '/home/oracle/crmnocdb.xml');
PL/SQL procedure successfully completed.
SQL>  shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
 
 
2  only other nocdb operation:
 
SQL>  set linesize 500
SQL> set pagesize 500
SQL> select cdb,NAME,dbid from v$database;
CDB NAME            DBID
--- --------- ----------
NO  ESSNOC     983511936
SQL>  shutdown immediate
Database closed.
Database dismounted.
 startup mount;
 
ORACLE instance shut down.
SQL>
ORACLE instance started.
Total System Global Area 1803841536 bytes
Fixed Size                  2289448 bytes
Variable Size            1023410392 bytes
Database Buffers          754974720 bytes
Redo Buffers               23166976 bytes
alter database open read only;Database mounted.
SQL> SQL> SQL> SQL> SQL> SQL>
Database altered.
SQL>
SQL>
SQL> EXEC DBMS_PDB.DESCRIBE( pdb_descr_file => '/home/oracle/essnoc.xml');
PL/SQL procedure successfully completed.
SQL>  shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

3 plug nocdb  into cdb operation:

[oracle@oratest2 ~]$ sqlplus '/ as sysdba'
SQL*Plus: Release 12.1.0.1.0 Production on Thu Oct 17 12:53:51 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
SQL> set linesize 500
SQL> set pagesize 500
SQL> select cdb,NAME,dbid from v$database;
CDB NAME            DBID
--- --------- ----------
YES TESTDB    2609949231
SQL>  show pdbs
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 TESTCS1                        MOUNTED
         4 TESTCS2                        MOUNTED
SQL> set serveroutput on;
SQL>  declare
  2           compat boolean := FALSE;
  3      begin
  4         compat := dbms_pdb.check_plug_compatibility(pdb_descr_file => '/home/oracle/crmnocdb.xml');
  5          if compat
  6          then
  7                 dbms_output.put_line('Yes');
  8         else
  9                 dbms_output.put_line('No');
 10        end if;
 11     end;
 12     /
No
PL/SQL procedure successfully completed.
SQL> set serveroutput on;
SQL>  declare
  2           compat boolean := FALSE;
  3      begin
  4         compat := dbms_pdb.check_plug_compatibility(pdb_descr_file => '/home/oracle/essnoc.xml');
  5          if compat
  6          then
  7                 dbms_output.put_line('Yes');
  8         else
  9                 dbms_output.put_line('No');
 10        end if;
 11     end;
 12  /
No
PL/SQL procedure successfully completed.
SQL> CREATE PLUGGABLE DATABASE crm USING '/home/oracle/crmnocdb.xml' NOCOPY;
Pluggable database created.
SQL> CREATE PLUGGABLE DATABASE essdb USING '/home/oracle/essnoc.xml' NOCOPY;
Pluggable database created.
SQL>  show pdbs
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 TESTCS1                        MOUNTED
         4 TESTCS2                        MOUNTED
         5 CRM                            MOUNTED
         6 ESSDB                          MOUNTED
SQL>  alter pluggable database all open;
 show pdbs
Warning: PDB altered with errors.
SQL>
    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 TESTCS1                        READ WRITE NO
         4 TESTCS2                        READ WRITE NO
         5 CRM                            READ WRITE YES
         6 ESSDB                          READ WRITE YES
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+DATA/TESTDB/DATAFILE/system.258.826620971
+DATA/TESTDB/DATAFILE/sysaux.257.826620895
+DATA/TESTDB/DATAFILE/undotbs1.260.826621057
+DATA/TESTDB/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/system.267.826621143
+DATA/TESTDB/DATAFILE/users.259.826621055
+DATA/TESTDB/DD7C48AA5A4404A2E04325AAE80A403C/DATAFILE/sysaux.266.826621143
+DATA/TESTDB/E684595D5E563211E04315160A0AE718/DATAFILE/system.271.826334121
+DATA/TESTDB/E684595D5E563211E04315160A0AE718/DATAFILE/sysaux.270.826334121
+DATA/TESTDB/E684595D5E563211E04315160A0AE718/DATAFILE/users.273.826334159
+DATA/TESTDB/E6845C263D8532AFE04315160A0ADEE9/DATAFILE/system.275.826334171
+DATA/TESTDB/E6845C263D8532AFE04315160A0ADEE9/DATAFILE/sysaux.274.826334171
+DATA/TESTDB/E6845C263D8532AFE04315160A0ADEE9/DATAFILE/users.277.826334211
+DATA/TESTDB/DATAFILE/undotbs2.281.826340347
+DATA/TESTDB/E684595D5E563211E04315160A0AE718/DATAFILE/ts_ecp.282.828812921
+DATA/TESTDB/E684595D5E563211E04315160A0AE718/DATAFILE/ts_ecp.283.828813437
+DATA/CRMNOC/DATAFILE/system.284.829052929
+DATA/CRMNOC/DATAFILE/sysaux.285.829052847
+DATA/CRMNOC/DATAFILE/users.295.829053015
+DATA/CRMNOC/DATAFILE/example.300.829053077
+DATA/ESSNOC/DATAFILE/system.302.829053239
+DATA/ESSNOC/DATAFILE/sysaux.301.829053157
+DATA/ESSNOC/DATAFILE/users.303.829053325
+DATA/ESSNOC/DATAFILE/example.310.829053403
23 rows selected.
SQL>
SQL>
SQL>
SQL> select con_id,dbid,NAME,OPEN_MODE from v$pdbs;
    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 4069264041 PDB$SEED                       READ ONLY
         3 4133352937 TESTCS1                        READ WRITE
         4  518394074 TESTCS2                        READ WRITE
         5 2880313921 CRM                            READ WRITE
         6  983511936 ESSDB                          READ WRITE
SQL>  exec DBMS_PDB.SYNC_PDB();
PL/SQL procedure successfully completed.
SQL>  select con_id,dbid,NAME,OPEN_MODE from v$pdbs;
    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 4069264041 PDB$SEED                       READ ONLY
         3 4133352937 TESTCS1                        READ WRITE
         4  518394074 TESTCS2                        READ WRITE
         5 2880313921 CRM                            READ WRITE
         6  983511936 ESSDB                          READ WRITE
SQL> SELECT PDB, NETWORK_NAME, CON_ID FROM CDB_SERVICES
  2   WHERE PDB IS NOT NULL AND                   
  3   CON_ID > 2                                  
  4   ORDER BY PDB;                               
PDB                            NETWORK_NAME                       CON_ID
------------------------------ ------------------------------ ----------
TESTCS1                        app1                                    3
TESTCS1                        testcs1                                 3
TESTCS2                        app2                                    4
TESTCS2                        testcs2                                 4

SQL> select con_id,dbid,NAME,OPEN_MODE from v$pdbs;
    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 4069264041 PDB$SEED                       READ ONLY
         3 4133352937 TESTCS1                        READ WRITE
         4  518394074 TESTCS2                        READ WRITE
         5 2880313921 CRM                            READ WRITE
         6  983511936 ESSDB                          READ WRITE
SQL> select pdb_id,pdb_name,dbid,STATUS,CREATION_SCN  from dba_pdbs;
    PDB_ID PDB_NAME                        DBID STATUS        CREATION_SCN
---------- ------------------------- ---------- ------------- ------------
         3 TESTCS1                   4133352937 NORMAL             1926816
         2 PDB$SEED                  4069264041 NORMAL             1720375
         4 TESTCS2                    518394074 NORMAL             1928562
         6 ESSDB                      983511936 NEW                4655097
         5 CRM                       2880313921 NEW                4654321
SQL>  exec DBMS_PDB.SYNC_PDB();
PL/SQL procedure successfully completed.
SQL>  select con_id,dbid,NAME,OPEN_MODE from v$pdbs;
    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 4069264041 PDB$SEED                       READ ONLY
         3 4133352937 TESTCS1                        READ WRITE
         4  518394074 TESTCS2                        READ WRITE
         5 2880313921 CRM                            READ WRITE
         6  983511936 ESSDB                          READ WRITE

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13750068/viewspace-774531/,如需转载,请注明出处,否则将追究法律责任。

下一篇: DEINSTALL 11g r2 Rac
请登录后发表评论 登录
全部评论

注册时间:2008-10-17

  • 博文量
    330
  • 访问量
    1028392