Oracle Database 12c: How to create a PDB from a Non-CDB (12c) using Oracle Data Pump
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Oracle Database 12c: How to create a PDB from a Non-CDB (12c) using Oracle Data Pump

on

  • 584 views

Oracle Database 12c: How to create a PDB from a Non-CDB (12c) using Oracle Data Pump

Oracle Database 12c: How to create a PDB from a Non-CDB (12c) using Oracle Data Pump

Statistics

Views

Total Views
584
Views on SlideShare
584
Embed Views
0

Actions

Likes
0
Downloads
11
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Oracle Database 12c: How to create a PDB from a Non-CDB (12c) using Oracle Data Pump Document Transcript

  • 1. Articles from Database administrator workshop How to create a PDB from a Non-CDB using Oracle Data Pump Beside the DBMS_PDB package you can use Oracle Data Pump to create a pluggable database from a non-container database: it consists to export the non- CDB and import into an empty and already created pluggable database. In my case the non-container database I want to transform into a pluggable database is named ORCL and both the source and the target database are Oracle Database 12c databases. Before proceeding you have to create first a new pluggable database. I used DBCA ("Manage Pluggable Databases" --> "Create a Pluggable Database" and so on...) and selected CDBTEST as container database to host the new pluggable database, named ORCL2 (ORCL was created in this post using DBMS_PDB package). Let me create into the non-container database some tablespaces, users and a table with few rows per user with the following anonymous block. view plainprint? 1. SQL@ORCL> begin 2. 2 for i in 1 .. 10 loop 3. 3 execute immediate 'create tablespace marcov_' || ltrim(to_char(i, '09')) || ' datafile ''/opt/app/oracle/oradata/ORCL/marcov_' || ltrim(to_char(i, '09')) || '.dbf'' size 20M'; 4. 4 execute immediate 'create user marcov_' || ltrim(to_char(i, '09')) || ' identified by oracle default tablespace marcov_' || ltrim(to_char(i, '09')) || ' quota unlimited on marcov_' || ltrim(to_char(i, '09')) ; 5. 5 execute immediate 'create table marcov_' || ltrim(to_char(i, '09')) || '.T1 (A NUMBER)'; 6. 6 execute immediate 'insert into marcov_' || ltrim(to_char(i, '09')) || '.T1 select level from dual connect by level <= 10'; 7. 7 commit; 8. 8 end loop; 9. 9 end; 10. 10 / 11. 12. PL/SQL procedure successfully completed. It's time to start with the export. In the non-container database you need to put all the interested tablespaces in READ ONLY mode. view plainprint? 1. SQL@ORCL> begin 2. 2 for i in 1 .. 10 loop 3. 3 execute immediate 'alter tablespace marcov_' || ltrim(to_char(i, '09')) || ' read only'; 4. 4 end loop; 5. 5 end; 6. 6 / 7. 8. PL/SQL procedure successfully completed. I cannot of course modify any data on those tablespaces. view plainprint? 1. SQL@ORCL> insert into marcov_01.t1 values (1); 2. insert into marcov_01.t1 values (1) 3. * 4. ERROR at line 1: 5. ORA-00372: file 5 cannot be modified at this time 6. ORA-01110: data file 5: '/opt/app/oracle/oradata/ORCL/marcov_01.dbf' Here is the list of the available tablespaces. I forgot to set in READ ONLY mode the USERS tablespace. view plainprint? 1. SQL@ORCL> select TABLESPACE_NAME, STATUS from dba_tablespaces; 2. 3. TABLESPACE_NAME STATUS 4. ------------------------------ --------- 5. SYSTEM ONLINE 6. SYSAUX ONLINE 7. UNDOTBS1 ONLINE 8. TEMP ONLINE 9. USERS ONLINE 10. MARCOV_01 READ ONLY 11. MARCOV_02 READ ONLY 12. MARCOV_03 READ ONLY 13. MARCOV_04 READ ONLY 14. MARCOV_05 READ ONLY 15. MARCOV_06 READ ONLY 16. MARCOV_07 READ ONLY 17. MARCOV_08 READ ONLY 18. MARCOV_09 READ ONLY 19. MARCOV_10 READ ONLY All tablespace in the transportable set must be set to READ ONLY mode, including the USERS tablespace. SYS and SYSAUX tablespace are not transportable. view plainprint? 1. SQL@ORCL> alter tablespace users read only; 2. 3. Tablespace altered. Now I can export the non-container database ORCL using the option TRANSPORTABLE=ALWAYS and FULL=Y. view plainprint? 1. [oracle@vsi08devpom ~]$ expdp system/oracle TRANSPORTABLE=ALWAYS FULL=Y dumpfile=full_orcl.dmp logfile=full_orcl.log 2. 3. Export: Release 12.1.0.1.0 - Production on Thu Aug 8 12:16:46 2013 4. 5. Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. 6. 7. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production 8. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options 9. Starting "SYSTEM"."SYS_EXPORT_FULL_01": system/******** TRANSPORTABLE=ALWAYS FULL=Y dumpfile=full_orcl.dmp logfile=full_orcl.log 10. Estimate in progress using BLOCKS method... 11. Processing object type DATABASE_EXPORT/PLUGTS_FULL/FULL/PLUGTS_TABLESPACE 12. Processing object type DATABASE_EXPORT/PLUGTS_FULL/PLUGTS_BLK 13. Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA 14. Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE_DATA 15. Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA 16. Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA 17. Total estimation using BLOCKS method: 1.140 MB 18. Processing object type DATABASE_EXPORT/PRE_SYSTEM_IMPCALLOUT/MARKER 19. Processing object type DATABASE_EXPORT/PRE_INSTANCE_IMPCALLOUT/MARKER 20. Processing object type DATABASE_EXPORT/TABLESPACE 21. Processing object type DATABASE_EXPORT/PROFILE 22. Processing object type DATABASE_EXPORT/SYS_USER/USER 23. Processing object type DATABASE_EXPORT/SCHEMA/USER 24. Processing object type DATABASE_EXPORT/RADM_FPTM 25. Processing object type DATABASE_EXPORT/GRANT/SYSTEM_GRANT/PROC_SYSTEM_GRANT 26. Processing object type DATABASE_EXPORT/SCHEMA/DEFAULT_ROLE 27. Processing object type DATABASE_EXPORT/SCHEMA/ON_USER_GRANT 28. Processing object type DATABASE_EXPORT/SCHEMA/TABLESPACE_QUOTA 29. Processing object type DATABASE_EXPORT/RESOURCE_COST 30. Processing object type DATABASE_EXPORT/TRUSTED_DB_LINK 31. Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PRE_SYSTEM_ACTIONS/PROCACT_SYSTEM 32. Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PROCOBJ 33. Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/POST_SYSTEM_ACTIONS/PROCACT_SYSTEM 34. Processing object type DATABASE_EXPORT/SCHEMA/PROCACT_SCHEMA 35. Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE 36. Processing object type DATABASE_EXPORT/EARLY_POST_INSTANCE_IMPCALLOUT/MARKER 37. Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE 38. Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE 39. Processing object type DATABASE_EXPORT/NORMAL_POST_INSTANCE_IMPCALLOU/MARKER 40. Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE 41. Processing object type DATABASE_EXPORT/SCHEMA/TABLE/COMMENT 42. Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/INDEX 43. Processing object type DATABASE_EXPORT/SCHEMA/TABLE/CONSTRAINT/CONSTRAINT 44. Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/STATISTICS/INDEX_STATISTICS 45. Processing object type DATABASE_EXPORT/SCHEMA/TABLE/STATISTICS/TABLE_STATISTICS 46. Processing object type DATABASE_EXPORT/STATISTICS/MARKER 47. Processing object type DATABASE_EXPORT/END_PLUGTS_BLK 48. Processing object type DATABASE_EXPORT/FINAL_POST_INSTANCE_IMPCALLOUT/MARKER 49. Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCACT_SCHEMA 50. Processing object type DATABASE_EXPORT/AUDIT_UNIFIED/AUDIT_POLICY_ENABLE 51. Processing object type DATABASE_EXPORT/POST_SYSTEM_IMPCALLOUT/MARKER 52. . . exported "SYS"."KU$_USER_MAPPING_VIEW" 5.906 KB 28 rows 53. . . exported "SYS"."DAM_CONFIG_PARAM$" 6.507 KB 14 rows 54. . . exported "SYS"."TSDP_PARAMETER$" 5.929 KB 1 rows 55. . . exported "SYS"."TSDP_POLICY$" 5.898 KB 1 rows 56. . . exported "SYS"."TSDP_SUBPOL$" 6.304 KB 1 rows 57. . . exported "SYSTEM"."REDO_DB" 23.42 KB 1 rows 58. . . exported "WMSYS"."WM$ENV_VARS$" 6.062 KB 5 rows 59. . . exported "WMSYS"."WM$EVENTS_INFO$" 5.796 KB 12 rows 60. . . exported "WMSYS"."WM$HINT_TABLE$" 9.437 KB 75 rows 61. . . exported "WMSYS"."WM$NEXTVER_TABLE$" 6.359 KB 1 rows 62. . . exported "WMSYS"."WM$VERSION_HIERARCHY_TABLE$" 5.960 KB 1 rows 63. . . exported "WMSYS"."WM$WORKSPACES_TABLE$" 12.08 KB 1 rows 64. . . exported "WMSYS"."WM$WORKSPACE_PRIV_TABLE$" 6.546 KB 8 rows 65. . . exported "SYS"."AUD$" 0 KB 0 rows 66. . . exported "SYS"."DAM_CLEANUP_EVENTS$" 0 KB 0 rows 67. . . exported "SYS"."DAM_CLEANUP_JOBS$" 0 KB 0 rows 68. . . exported "SYS"."TSDP_ASSOCIATION$" 0 KB 0 rows 69. . . exported "SYS"."TSDP_CONDITION$" 0 KB 0 rows 70. . . exported "SYS"."TSDP_FEATURE_POLICY$" 0 KB 0 rows 71. . . exported "SYS"."TSDP_PROTECTION$" 0 KB 0 rows 72. . . exported "SYS"."TSDP_SENSITIVE_DATA$" 0 KB 0 rows 73. . . exported "SYS"."TSDP_SENSITIVE_TYPE$" 0 KB 0 rows 74. . . exported "SYS"."TSDP_SOURCE$" 0 KB 0 rows 75. . . exported "SYSTEM"."REDO_LOG" 0 KB 0 rows 76. . . exported "WMSYS"."WM$BATCH_COMPRESSIBLE_TABLES$" 0 KB 0 rows 77. . . exported "WMSYS"."WM$CONSTRAINTS_TABLE$" 0 KB 0 rows 78. . . exported "WMSYS"."WM$CONS_COLUMNS$" 0 KB 0 rows 79. . . exported "WMSYS"."WM$LOCKROWS_INFO$" 0 KB 0 rows 80. . . exported "WMSYS"."WM$MODIFIED_TABLES$" 0 KB 0 rows 81. . . exported "WMSYS"."WM$MP_GRAPH_WORKSPACES_TABLE$" 0 KB 0 rows 82. . . exported "WMSYS"."WM$MP_PARENT_WORKSPACES_TABLE$" 0 KB 0 rows 83. . . exported "WMSYS"."WM$NESTED_COLUMNS_TABLE$" 0 KB 0 rows 84. . . exported "WMSYS"."WM$REMOVED_WORKSPACES_TABLE$" 0 KB 0 rows 85. . . exported "WMSYS"."WM$RESOLVE_WORKSPACES_TABLE$" 0 KB 0 rows 86. . . exported "WMSYS"."WM$RIC_LOCKING_TABLE$" 0 KB 0 rows 87. . . exported "WMSYS"."WM$RIC_TABLE$" 0 KB 0 rows 88. . . exported "WMSYS"."WM$RIC_TRIGGERS_TABLE$" 0 KB 0 rows 89. . . exported "WMSYS"."WM$UDTRIG_DISPATCH_PROCS$" 0 KB 0 rows 90. . . exported "WMSYS"."WM$UDTRIG_INFO$" 0 KB 0 rows 91. . . exported "WMSYS"."WM$VERSION_TABLE$" 0 KB 0 rows 92. . . exported "WMSYS"."WM$VT_ERRORS_TABLE$" 0 KB 0 rows 93. . . exported "WMSYS"."WM$WORKSPACE_SAVEPOINTS_TABLE$" 0 KB 0 rows 94. . . exported "SYSTEM"."SCHEDULER_PROGRAM_ARGS" 9.484 KB 12 rows 95. . . exported "SYS"."AUDTAB$TBS$FOR_EXPORT" 5.937 KB 2 rows 96. . . exported "SYS"."NACL$_ACE_EXP" 9.914 KB 1 rows 97. . . exported "SYS"."NACL$_HOST_EXP" 6.898 KB 1 rows 98. . . exported "WMSYS"."WM$EXP_MAP" 7.703 KB 3 rows 99. . . exported "SYS"."DBA_SENSITIVE_DATA" 0 KB 0 rows 100. . . exported "SYS"."DBA_TSDP_POLICY_PROTECTION" 0 KB 0 rows 101. . . exported "SYS"."FGA_LOG$FOR_EXPORT" 0 KB 0 rows 102. . . exported "SYS"."NACL$_WALLET_EXP" 0 KB 0 rows 103. . . exported "SYSTEM"."SCHEDULER_JOB_ARGS" 0 KB 0 rows 104. Master table "SYSTEM"."SYS_EXPORT_FULL_01" successfully loaded/unloaded 105. ****************************************************************************** 106. Dump file set for SYSTEM.SYS_EXPORT_FULL_01 is: 107. /opt/app/oracle/admin/ORCL/dpdump/full_orcl.dmp 108. ****************************************************************************** 109. Datafiles required for transportable tablespace MARCOV_01: 110. /opt/app/oracle/oradata/ORCL/marcov_01.dbf 111. Datafiles required for transportable tablespace MARCOV_02: 112. /opt/app/oracle/oradata/ORCL/marcov_02.dbf 113. Datafiles required for transportable tablespace MARCOV_03: 114. /opt/app/oracle/oradata/ORCL/marcov_03.dbf 115. Datafiles required for transportable tablespace MARCOV_04: 116. /opt/app/oracle/oradata/ORCL/marcov_04.dbf 117. Datafiles required for transportable tablespace MARCOV_05: 118. /opt/app/oracle/oradata/ORCL/marcov_05.dbf 119. Datafiles required for transportable tablespace MARCOV_06: 120. /opt/app/oracle/oradata/ORCL/marcov_06.dbf 121. Datafiles required for transportable tablespace MARCOV_07: 122. /opt/app/oracle/oradata/ORCL/marcov_07.dbf 123. Datafiles required for transportable tablespace MARCOV_08: 124. /opt/app/oracle/oradata/ORCL/marcov_08.dbf 125. Datafiles required for transportable tablespace MARCOV_09: 126. /opt/app/oracle/oradata/ORCL/marcov_09.dbf 127. Datafiles required for transportable tablespace MARCOV_10: 128. /opt/app/oracle/oradata/ORCL/marcov_10.dbf 129. Datafiles required for transportable tablespace USERS: 130. /opt/app/oracle/oradata/ORCL/users01.dbf 131. Job "SYSTEM"."SYS_EXPORT_FULL_01" successfully completed at Thu Aug 8 12:19:16 2013 elapsed 0 00:02:26 At the end of the log file you can see the datafiles I have to transport to the source pluggable database. In the new pluggable database the DATA_PUMP_DIR directory object is not created automatically, so before proceeding I have to create a new directory object and granting all the necessary privileges. view plainprint? 1. [oracle@vsi08devpom ~]$ export ORACLE_SID=CDBTEST 2. [oracle@vsi08devpom ~]$ sqlplus / as sysdba 3. 4. SQL*Plus: Release 12.1.0.1.0 Production on Thu Aug 8 12:36:46 2013 5. 6. Copyright (c) 1982, 2013, Oracle. All rights reserved. 7. 8. Connected to: 9. Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production 10. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options 11. 12. SQL@CDBTEST> alter session set container=ORCL2; 13. 14. Session altered. 15. 16. SQL@ORCL2> create directory ORCL2_DATA_PUMP_DIR as '/opt/app/oracle/admin/CDBTEST/dpdump/'; 17. 18. Directory created. 19. 20. SQL@ORCL2> grant read,write on directory ORCL2_DATA_PUMP_DIR to system; 21. 22. Grant succeeded. 23. 24. SQL@ORCL2> SELECT * FROM DBA_DIRECTORIES WHERE DIRECTORY_NAME = 'ORCL2_DATA_PUMP_DIR'; 25. 26. OWNER DIRECTORY_NAME DIRECTORY_PATH ORIGIN_CON_ID 27. ----- -------------------- ---------------------------------------- ------------- 28. SYS ORCL2_DATA_PUMP_DIR /opt/app/oracle/admin/CDBTEST/dpdump/ 8 I need to copy the dump file to the directory pointed to by the ORCL2_DATA_PUMP_DIR directory object. In my case the non-container database and the new pluggable database are on the same machine so I can use a simple cp command. view plainprint? 1. [oracle@vsi08devpom ~]$ cp /opt/app/oracle/admin/ORCL/dpdump/full_orcl.dmp /opt/app/oracle/admin/CDBTEST/dpdump/ I need also to copy the datafiles of the transportable tablespaces from the source non-container database to a place accessible to the pluggable database. The default directory currently contains the following datafiles: view plainprint? 1. [oracle@vsi08devpom ORCL2]$ pwd 2. /opt/app/oracle/oradata/CDBTEST/ORCL2 3. [oracle@vsi08devpom ORCL2]$ ll 4. total 922608 5. -rw-r----- 1 oracle oinstall 5251072 Aug 8 12:37 ORCL2_users01.dbf 6. -rw-r----- 1 oracle oinstall 665853952 Aug 8 14:45 sysaux01.dbf 7. -rw-r----- 1 oracle oinstall 272637952 Aug 8 14:45 system01.dbf 8. -rw-r----- 1 oracle oinstall 20979712 Aug 8 13:22 temp01.dbf My transportable tablespaces coming from the non-container database ORCL are now copied into a directory accessible by the pluggable database ORCL2. view plainprint? 1. [oracle@vsi08devpom ~]$ cp /opt/app/oracle/oradata/ORCL/users01.dbf /opt/app/oracle/oradata/ORCL/marcov_* /opt/app/oracle/oradata/CDBTEST/ORCL2/ 2. [oracle@vsi08devpom ORCL2]$ ll 3. total 1132868 4. -rw-r----- 1 oracle oinstall 20979712 Aug 8 14:49 marcov_01.dbf 5. -rw-r----- 1 oracle oinstall 20979712 Aug 8 14:49 marcov_02.dbf 6. -rw-r----- 1 oracle oinstall 20979712 Aug 8 14:49 marcov_03.dbf 7. -rw-r----- 1 oracle oinstall 20979712 Aug 8 14:49 marcov_04.dbf 8. -rw-r----- 1 oracle oinstall 20979712 Aug 8 14:49 marcov_05.dbf 9. -rw-r----- 1 oracle oinstall 20979712 Aug 8 14:49 marcov_06.dbf 10. -rw-r----- 1 oracle oinstall 20979712 Aug 8 14:49 marcov_07.dbf 11. -rw-r----- 1 oracle oinstall 20979712 Aug 8 14:49 marcov_08.dbf 12. -rw-r----- 1 oracle oinstall 20979712 Aug 8 14:49 marcov_09.dbf 13. -rw-r----- 1 oracle oinstall 20979712 Aug 8 14:49 marcov_10.dbf 14. -rw-r----- 1 oracle oinstall 5251072 Aug 8 12:37 ORCL2_users01.dbf 15. -rw-r----- 1 oracle oinstall 665853952 Aug 8 14:45 sysaux01.dbf 16. -rw-r----- 1 oracle oinstall 272637952 Aug 8 14:45 system01.dbf 17. -rw-r----- 1 oracle oinstall 20979712 Aug 8 13:22 temp01.dbf 18. -rw-r----- 1 oracle oinstall 5251072 Aug 8 14:49 users01.dbf Add an entry to the tnsnames.ora file referencing to the service of the pluggable database. view plainprint? 1. [oracle@vsi08devpom ~]$ vi /opt/app/oracle/product/12.1.0/db_1/network/admin/tnsnames.ora 2. 3. ORCL2 = 4. (DESCRIPTION = 5. (ADDRESS = (PROTOCOL = TCP)(HOST = vsi08devpom.mydomain.it)(PORT = 1521)) 6. (CONNECT_DATA = 7. (SERVER = DEDICATED) 8. (SERVICE_NAME = ORCL2) 9. ) 10. ) List all your datafiles in the TRANSPORT_DATAFILES option of the Data Dump Import utility (or use a parameter file if you have many datafiles to specify). view plainprint? 1. [oracle@vsi08devpom ~]$ impdp system/oracle@orcl2 TRANSPORT_DATAFILES='/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_01.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_02.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_03.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_04.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_05.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_06.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_07.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_08.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_09.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_10.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/users01.dbf' FULL=Y DIRECTORY=ORCL2_DATA_PUMP_DIR dumpfile=full_orcl.dmp 2. 3. Import: Release 12.1.0.1.0 - Production on Thu Aug 8 15:27:18 2013 4. 5. Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. 6. 7. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production 8. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options 9. Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded 10. Starting "SYSTEM"."SYS_IMPORT_FULL_01": system/********@orcl2 TRANSPORT_DATAFILES=/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_01.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_02.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_03.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_04.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_05.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_06.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_07.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_08.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_09.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_10.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/users01.dbf FULL=Y DIRECTORY=ORCL2_DATA_PUMP_DIR dumpfile=full_orcl.dmp 11. Processing object type DATABASE_EXPORT/PRE_SYSTEM_IMPCALLOUT/MARKER 12. Processing object type DATABASE_EXPORT/PRE_INSTANCE_IMPCALLOUT/MARKER 13. Processing object type DATABASE_EXPORT/PLUGTS_FULL/PLUGTS_BLK 14. ORA-39123: Data Pump transportable tablespace job aborted 15. ORA-29349: tablespace 'USERS' already exists 16. 17. Job "SYSTEM"."SYS_IMPORT_FULL_01" stopped due to fatal error at Thu Aug 8 15:27:28 2013 elapsed 0 00:00:08 The new pluggable database ORCL2 has already a tablespace named USERS so the Data Pump Import utility aborted its job with the error "ORA-29349: tablespace 'USERS' already exists". I decided to rename the already existing tablespace to USERS_ORCL2. view plainprint? 1. SQL@ORCL2> alter tablespace USERS rename to USERS_ORCL2; 2. 3. Tablespace altered. Now I can run the import job again. view plainprint? 1. [oracle@vsi08devpom ~]$ impdp system/oracle@orcl2 TRANSPORT_DATAFILES='/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_01.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_02.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_03.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_04.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_05.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_06.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_07.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_08.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_09.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_10.dbf','/opt/app/oracle/oradata/CDBTEST/ORCL2/users01.dbf' FULL=Y DIRECTORY=ORCL2_DATA_PUMP_DIR dumpfile=full_orcl.dmp 2. 3. Import: Release 12.1.0.1.0 - Production on Thu Aug 8 15:30:33 2013 4. 5. Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. 6. 7. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production 8. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options 9. Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded 10. Starting "SYSTEM"."SYS_IMPORT_FULL_01": system/********@orcl2 TRANSPORT_DATAFILES=/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_01.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_02.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_03.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_04.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_05.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_06.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_07.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_08.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_09.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/marcov_10.dbf,/opt/app/oracle/oradata/CDBTEST/ORCL2/users01.dbf FULL=Y DIRECTORY=ORCL2_DATA_PUMP_DIR dumpfile=full_orcl.dmp 11. Processing object type DATABASE_EXPORT/PRE_SYSTEM_IMPCALLOUT/MARKER 12. ORA-39342: Internal error - failed to import internal objects tagged with LABEL_SECURITY due to ORA- 00955: name is already used by an existing object. 13. Processing object type DATABASE_EXPORT/PRE_INSTANCE_IMPCALLOUT/MARKER 14. Processing object type DATABASE_EXPORT/PLUGTS_FULL/PLUGTS_BLK 15. Processing object type DATABASE_EXPORT/TABLESPACE 16. ORA- 39083: Object type TABLESPACE:"UNDOTBS1" failed to create with error: 17. ORA- 01516: nonexistent log file, data file, or temporary file "/opt/app/oracle/oradata/ORCL/undotbs01.dbf" 18. Failing sql is: 19. ALTER DATABASE DATAFILE '/opt/app/oracle/oradata/ORCL/undotbs01.dbf' RESIZE 241172480 20. ORA-31684: Object type TABLESPACE:"TEMP" already exists 21. Processing object type DATABASE_EXPORT/PROFILE 22. Processing object type DATABASE_EXPORT/SYS_USER/USER 23. Processing object type DATABASE_EXPORT/SCHEMA/USER 24. ORA-31684: Object type USER:"OUTLN" already exists 25. Processing object type DATABASE_EXPORT/RADM_FPTM 26. Processing object type DATABASE_EXPORT/GRANT/SYSTEM_GRANT/PROC_SYSTEM_GRANT 27. Processing object type DATABASE_EXPORT/SCHEMA/DEFAULT_ROLE 28. Processing object type DATABASE_EXPORT/SCHEMA/ON_USER_GRANT 29. Processing object type DATABASE_EXPORT/SCHEMA/TABLESPACE_QUOTA 30. Processing object type DATABASE_EXPORT/RESOURCE_COST 31. Processing object type DATABASE_EXPORT/TRUSTED_DB_LINK 32. Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PRE_SYSTEM_ACTIONS/PROCACT_SYSTEM 33. Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PROCOBJ 34. Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/POST_SYSTEM_ACTIONS/PROCACT_SYSTEM 35. Processing object type DATABASE_EXPORT/SCHEMA/PROCACT_SCHEMA 36. Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE 37. Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA 38. . . imported "SYS"."KU$_EXPORT_USER_MAP" 5.906 KB 28 rows 39. Processing object type DATABASE_EXPORT/EARLY_POST_INSTANCE_IMPCALLOUT/MARKER 40. Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE 41. Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE_DATA 42. . . imported "SYS"."AMGT$DP$DAM_CONFIG_PARAM$" 6.507 KB 14 rows 43. . . imported "SYS"."DP$TSDP_PARAMETER$" 5.929 KB 1 rows 44. . . imported "SYS"."DP$TSDP_POLICY$" 5.898 KB 1 rows 45. . . imported "SYS"."DP$TSDP_SUBPOL$" 6.304 KB 1 rows 46. . . imported "SYSTEM"."REDO_DB_TMP" 23.42 KB 1 rows 47. . . imported "WMSYS"."E$ENV_VARS$" 6.062 KB 5 rows 48. . . imported "WMSYS"."E$EVENTS_INFO$" 5.796 KB 12 rows 49. . . imported "WMSYS"."E$HINT_TABLE$" 9.437 KB 75 rows 50. . . imported "WMSYS"."E$NEXTVER_TABLE$" 6.359 KB 1 rows 51. . . imported "WMSYS"."E$VERSION_HIERARCHY_TABLE$" 5.960 KB 1 rows 52. . . imported "WMSYS"."E$WORKSPACES_TABLE$" 12.08 KB 1 rows 53. . . imported "WMSYS"."E$WORKSPACE_PRIV_TABLE$" 6.546 KB 8 rows 54. . . imported "SYS"."AMGT$DP$AUD$" 0 KB 0 rows 55. . . imported "SYS"."AMGT$DP$DAM_CLEANUP_EVENTS$" 0 KB 0 rows 56. . . imported "SYS"."AMGT$DP$DAM_CLEANUP_JOBS$" 0 KB 0 rows 57. . . imported "SYS"."DP$TSDP_ASSOCIATION$" 0 KB 0 rows 58. . . imported "SYS"."DP$TSDP_CONDITION$" 0 KB 0 rows 59. . . imported "SYS"."DP$TSDP_FEATURE_POLICY$" 0 KB 0 rows 60. . . imported "SYS"."DP$TSDP_PROTECTION$" 0 KB 0 rows 61. . . imported "SYS"."DP$TSDP_SENSITIVE_DATA$" 0 KB 0 rows 62. . . imported "SYS"."DP$TSDP_SENSITIVE_TYPE$" 0 KB 0 rows 63. . . imported "SYS"."DP$TSDP_SOURCE$" 0 KB 0 rows 64. . . imported "SYSTEM"."REDO_LOG_TMP" 0 KB 0 rows 65. . . imported "WMSYS"."E$BATCH_COMPRESSIBLE_TABLES$" 0 KB 0 rows 66. . . imported "WMSYS"."E$CONSTRAINTS_TABLE$" 0 KB 0 rows 67. . . imported "WMSYS"."E$CONS_COLUMNS$" 0 KB 0 rows 68. . . imported "WMSYS"."E$LOCKROWS_INFO$" 0 KB 0 rows 69. . . imported "WMSYS"."E$MODIFIED_TABLES$" 0 KB 0 rows 70. . . imported "WMSYS"."E$MP_GRAPH_WORKSPACES_TABLE$" 0 KB 0 rows 71. . . imported "WMSYS"."E$MP_PARENT_WORKSPACES_TABLE$" 0 KB 0 rows 72. . . imported "WMSYS"."E$NESTED_COLUMNS_TABLE$" 0 KB 0 rows 73. . . imported "WMSYS"."E$REMOVED_WORKSPACES_TABLE$" 0 KB 0 rows 74. . . imported "WMSYS"."E$RESOLVE_WORKSPACES_TABLE$" 0 KB 0 rows 75. . . imported "WMSYS"."E$RIC_LOCKING_TABLE$" 0 KB 0 rows 76. . . imported "WMSYS"."E$RIC_TABLE$" 0 KB 0 rows 77. . . imported "WMSYS"."E$RIC_TRIGGERS_TABLE$" 0 KB 0 rows 78. . . imported "WMSYS"."E$UDTRIG_DISPATCH_PROCS$" 0 KB 0 rows 79. . . imported "WMSYS"."E$UDTRIG_INFO$" 0 KB 0 rows 80. . . imported "WMSYS"."E$VERSION_TABLE$" 0 KB 0 rows 81. . . imported "WMSYS"."E$VT_ERRORS_TABLE$" 0 KB 0 rows 82. . . imported "WMSYS"."E$WORKSPACE_SAVEPOINTS_TABLE$" 0 KB 0 rows 83. Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE 84. Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA 85. . . imported "SYSTEM"."SCHEDULER_PROGRAM_ARGS_TMP" 9.484 KB 12 rows 86. . . imported "SYS"."AMGT$DP$AUDTAB$TBS$FOR_EXPORT" 5.937 KB 2 rows 87. . . imported "SYS"."NACL$_ACE_IMP" 9.914 KB 1 rows 88. . . imported "SYS"."NACL$_HOST_IMP" 6.898 KB 1 rows 89. . . imported "WMSYS"."E$EXP_MAP" 7.703 KB 3 rows 90. . . imported "SYS"."DP$DBA_SENSITIVE_DATA" 0 KB 0 rows 91. . . imported "SYS"."DP$DBA_TSDP_POLICY_PROTECTION" 0 KB 0 rows 92. . . imported "SYS"."AMGT$DP$FGA_LOG$FOR_EXPORT" 0 KB 0 rows 93. . . imported "SYS"."NACL$_WALLET_IMP" 0 KB 0 rows 94. . . imported "SYSTEM"."SCHEDULER_JOB_ARGS_TMP" 0 KB 0 rows 95. Processing object type DATABASE_EXPORT/NORMAL_POST_INSTANCE_IMPCALLOU/MARKER
  • 2. 96. Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE 97. Processing object type DATABASE_EXPORT/SCHEMA/TABLE/STATISTICS/TABLE_STATISTICS 98. Processing object type DATABASE_EXPORT/STATISTICS/MARKER 99. Processing object type DATABASE_EXPORT/END_PLUGTS_BLK 100. Processing object type DATABASE_EXPORT/FINAL_POST_INSTANCE_IMPCALLOUT/MARKER 101. Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCACT_SCHEMA 102. Processing object type DATABASE_EXPORT/AUDIT_UNIFIED/AUDIT_POLICY_ENABLE 103. Processing object type DATABASE_EXPORT/POST_SYSTEM_IMPCALLOUT/MARKER 104. Job "SYSTEM"."SYS_IMPORT_FULL_01" completed with 4 error(s) at Thu Aug 8 15:31:59 2013 elapsed 0 00:01:25 After the import job is completed (the above errors can be ignored in my case) I'm able to use the new pluggable database ORCL2: it contains all the data previously used in the non-container database ORCL. view plainprint? 1. [oracle@vsi08devpom CDBTEST]$ sqlplus / as sysdba 2. 3. SQL*Plus: Release 12.1.0.1.0 Production on Thu Aug 8 15:50:21 2013 4. 5. Copyright (c) 1982, 2013, Oracle. All rights reserved. 6. 7. Connected to: 8. Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production 9. With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options 10. 11. SQL@CDBTEST> alter session set container=ORCL2; 12. 13. Session altered. 14. 15. SQL@ORCL2> select count(*) from marcov_01.t1; 16. 17. COUNT(*) 18. ---------- 19. 10 20. 21. SQL@ORCL2> select count(*) from marcov_10.t1; 22. 23. COUNT(*) 24. ---------- 25. 10 That's all.