ExaGridDba

12c non pdb to pdb, with errors

Oct 3rd, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.65 KB | None | 0 0
  1. [oracle@waipio1 POLOLU pdbcreate]$ sqlplus / as sysdba
  2.  
  3. SQL*Plus: Release 12.1.0.1.0 Production on Thu Oct 3 05:47:55 2013
  4.  
  5. Copyright (c) 1982, 2013, Oracle. All rights reserved.
  6.  
  7. Connected to an idle instance.
  8.  
  9. SQL> startup mount
  10. ORACLE instance started.
  11.  
  12. Total System Global Area 2505338880 bytes
  13. Fixed Size 2684688 bytes
  14. Variable Size 721422576 bytes
  15. Database Buffers 1761607680 bytes
  16. Redo Buffers 19623936 bytes
  17. Database mounted.
  18. SQL> alter database open read only;
  19.  
  20. Database altered.
  21.  
  22. [oracle@waipio1 pdbcreate]$ cat pdbdescribe.sql
  23. @ abortIfNotReadOnly.sql
  24. column db_name new_value db_name format a8
  25. select sys_context ( 'userenv', 'db_name' ) db_name from dual;
  26.  
  27. define xmlfile=/home/oracle/sql/multitenant/pdbcreate/pdb.&&db_name..xml
  28.  
  29. begin
  30. dbms_pdb.describe(
  31. pdb_descr_file => '/home/oracle/sql/multitenant/pdbcreate/pdb.&&db_name..xml'
  32. );
  33. end;
  34. /
  35. [oracle@waipio1 pdbcreate]$ cat abortIfNotReadOnly.sql
  36. whenever sqlerror exit 1
  37.  
  38. select to_number ( 'NaN' ) from v$database where open_mode != 'READ ONLY';
  39.  
  40. prompt Database is open READ ONLY
  41.  
  42.  
  43.  
  44. [oracle@waipio1 POLOLU pdbcreate]$ sqlplus / as sysdba @ pdbdescribe.sql
  45.  
  46. SQL*Plus: Release 12.1.0.1.0 Production on Thu Oct 3 05:55:38 2013
  47.  
  48. Copyright (c) 1982, 2013, Oracle. All rights reserved.
  49.  
  50.  
  51. Connected to:
  52. Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
  53. With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
  54. and Real Application Testing options
  55.  
  56.  
  57. no rows selected
  58.  
  59. Database is open READ ONLY
  60.  
  61. DB_NAME
  62. --------
  63. POLOLU
  64.  
  65. old 3: pdb_descr_file => '/home/oracle/sql/multitenant/pdbcreate/pdb.&&db_name..xml'
  66. new 3: pdb_descr_file => '/home/oracle/sql/multitenant/pdbcreate/pdb.POLOLU.xml'
  67.  
  68. PL/SQL procedure successfully completed.
  69.  
  70. SQL> shutdown immediate
  71. Database closed.
  72. Database dismounted.
  73. ORACLE instance shut down.
  74.  
  75.  
  76. [oracle@waipio1 KILAUEA pdbcreate]$ cat createpdb.nocopyunplugged.sql
  77. create pluggable database &&1
  78. using '&&2' nocopy
  79. ;
  80.  
  81. quit
  82.  
  83.  
  84. [oracle@waipio1 POLOLU pdbcreate]$ sqlplus sys/sys.n1te@kilauea as sysdba @ createpdb.nocopyunplugged.sql POLOLU '/home/oracle/sql/multitenant/pdbcreate/pdb.POLOLU.xml'
  85.  
  86. SQL*Plus: Release 12.1.0.1.0 Production on Thu Oct 3 06:04:42 2013
  87.  
  88. Copyright (c) 1982, 2013, Oracle. All rights reserved.
  89.  
  90.  
  91. Connected to:
  92. Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
  93. With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
  94. and Real Application Testing options
  95.  
  96. old 1: create pluggable database &&1
  97. new 1: create pluggable database POLOLU
  98. old 2: using '&&2' nocopy
  99. new 2: using '/home/oracle/sql/multitenant/pdbcreate/pdb.POLOLU.xml' nocopy
  100.  
  101. Pluggable database created.
  102.  
  103. Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
  104. With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
  105. and Real Application Testing options
  106.  
  107. [oracle@waipio1 POLOLU pdbcreate]$ cat noncdb.to.cdb.sql
  108.  
  109. alter session set container = &&1;
  110.  
  111. column containername new_value containername
  112.  
  113. select sys_context( 'userenv', 'con_name' ) containername from dual;
  114.  
  115. spool noncdb_to_pdb.&&containername..txt
  116. @ ?/rdbms/admin/noncdb_to_pdb.sql
  117.  
  118. quit
  119.  
  120. [oracle@waipio1 POLOLU pdbcreate]$ sqlplus sys/sys.n1te@kilauea as sysdba @ noncdb.to.cdb.sql POLOLU
  121.  
  122. SQL*Plus: Release 12.1.0.1.0 Production on Thu Oct 3 06:07:51 2013
  123.  
  124. Copyright (c) 1982, 2013, Oracle. All rights reserved.
  125.  
  126.  
  127. Connected to:
  128. Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
  129. With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
  130. and Real Application Testing options
  131.  
  132. old 1: alter session set container = &&1
  133. new 1: alter session set container = POLOLU
  134.  
  135. Session altered.
  136.  
  137.  
  138. CONTAINERNAME
  139. --------------------------------------------------------------------------------
  140. POLOLU
  141.  
  142. refer to
  143. http://pastebin.com/mXd776Bc
  144. for the full output
  145.  
  146.  
  147. [oracle@waipio1 POLOLU pdbcreate]$ sqlplus sys/sys.n1te@kilauea as sysdba @ alterpdbopen.sql POLOLU
  148.  
  149. SQL*Plus: Release 12.1.0.1.0 Production on Thu Oct 3 06:54:05 2013
  150.  
  151. Copyright (c) 1982, 2013, Oracle. All rights reserved.
  152.  
  153.  
  154. Connected to:
  155. Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
  156. With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
  157. and Real Application Testing options
  158.  
  159. old 1: alter pluggable database &&1 open
  160. new 1: alter pluggable database POLOLU open
  161.  
  162. Warning: PDB altered with errors.
  163.  
  164.  
  165.  
  166. =============================
  167. cleanup file locations
  168.  
  169. SQL> select file# from v$datafile where name like '+DATA/POLOLU/DATAFILE%';
  170.  
  171. FILE#
  172. ----------
  173. 63
  174. 64
  175. 65
  176. 66
  177.  
  178.  
  179. SQL> alter database move datafile 63 to '+DATA';
  180.  
  181. Database altered.
  182.  
  183. SQL> alter database move datafile 64 to '+DATA';
  184.  
  185. Database altered.
  186.  
  187. SQL> alter database move datafile 65 to '+DATA';
  188.  
  189. Database altered.
  190.  
  191. SQL> alter database move datafile 66 to '+DATA';
  192.  
  193. Database altered.
  194.  
  195. SQL> select file# from v$datafile where name like '+DATA/POLOLU/DATAFILE%';
  196.  
  197. no rows selected
  198.  
  199.  
  200. SQL> select name from v$datafile;
  201.  
  202. NAME
  203. --------------------------------------------------------------------------------
  204. +DATA/KILAUEA/DATAFILE/undotbs1.332.824921837
  205. +DATA/KILAUEA/E6290320C01779F4E0437901A8C0A488/DATAFILE/system.351.827825773
  206. +DATA/KILAUEA/E6290320C01779F4E0437901A8C0A488/DATAFILE/sysaux.583.827826199
  207. +DATA/KILAUEA/E6290320C01779F4E0437901A8C0A488/DATAFILE/users.580.827826371
  208. +DATA/KILAUEA/E6290320C01779F4E0437901A8C0A488/DATAFILE/hexts.584.827826387
  209.  
  210. SQL>
Advertisement
Add Comment
Please, Sign In to add comment