-------------------------------------------------------------------- Find list of datafiles in system --------------------------------------------------------------------
sqlplus -L -s / as sysdba @/home/oracle/s_xtts/backup_Apr4_Thu_15_03_25_770//diff.sql //u01/app/oracle/oradata/ora12c/xtts/
-------------------------------------------------------------------- Done finding list of datafiles in system --------------------------------------------------------------------
Prepare source for Tablespaces: 'TS1' /backup/dest/ xttpreparesrc.sql for 'TS1' started at Thu Apr 4 15:03:25 2019 xttpreparesrc.sql for ended at Thu Apr 4 15:03:25 2019 Prepare source for Tablespaces: 'TS2' /backup/dest/ xttpreparesrc.sql for 'TS2' started at Thu Apr 4 15:03:28 2019 xttpreparesrc.sql for ended at Thu Apr 4 15:03:28 2019
-------------------------------------------------------------------- Done with prepare phase --------------------------------------------------------------------
Prepare newscn for Tablespaces: 'TS1' Prepare newscn for Tablespaces: 'TS2' New /home/oracle/s_xtts/xttplan.txt with FROM SCN's generated Added fname here 1:/backup/dest//TS1_5.tf Added fname here 1:/backup/dest//TS2_6.tf ============================================================ No new datafiles added =============================================================
Added fname here 1:/backup/dest//TS1_5.tf Added fname here 1:/backup/dest//TS2_6.tf ============================================================ No new datafiles added ============================================================= Prepare newscn for Tablespaces: 'TS1' Prepare newscn for Tablespaces: 'TS2'
Added fname here 1:/backup/dest//TS1_5.tf Added fname here 1:/backup/dest//TS2_6.tf ============================================================ No new datafiles added ============================================================= Prepare newscn for Tablespaces: 'TS1' Prepare newscn for Tablespaces: 'TS2'
-------------------------------------------------------------------- Done backing up incrementals --------------------------------------------------------------------
Prepare newscn for Tablespaces: 'TS1' DECLARE* ERROR at line 1: ORA-20001: TABLESPACE(S) IS READONLY OR, >>>>====这些只读的警告可以忽略 OFFLINE JUST CONVERT, COPY ORA-06512: at line 284
#################################################################### Warning: ------ Warnings found in executing /home/oracle/s_xtts/backup_Apr4_Thu_16_07_50_775//xttpreparenextiter.sql #################################################################### Prepare newscn for Tablespaces: 'TS2' DECLARE* ERROR at line 1: ORA-20001: TABLESPACE(S) IS READONLY OR, OFFLINE JUST CONVERT, COPY ORA-06512: at line 284
#################################################################### Warning: ------ Warnings found in executing /home/oracle/s_xtts/backup_Apr4_Thu_16_07_50_775//xttpreparenextiter.sql #################################################################### New /home/oracle/s_xtts/xttplan.txt with FROM SCN's generated
PARAMETER_NAME TYPE VALUE ------------------------------------------------------------ --------------------------------- ----------------------------------------------- db_name string test sys@TEST> select name, cdb from v$database;
NAME CDB --------------------------- --------- TEST NO
sys@TEST> select instance_name from v$instance;
INSTANCE_NAME ------------------------------------------------ test
NAME CDB --------------------------- --------- ORA12C YES
检查源库是否能被插入到目标库
1 2 3 4 5 6 7 8 9 10 11 12
set serveroutput on DECLARE compatible BOOLEAN := FALSE; BEGIN compatible := DBMS_PDB.CHECK_PLUG_COMPATIBILITY( pdb_descr_file => '/u01/app/oracle/oradata/test/test.xml'); if compatible then DBMS_OUTPUT.PUT_LINE('YES'); else DBMS_OUTPUT.PUT_LINE('NO'); end if; END; /
如果返回NO,则需要检查原因
1 2 3 4
col cause for a30 col name for a10 col message for a80 select name,cause,type,message,status from PDB_PLUG_IN_VIOLATIONS where name='TEST';
用刚才生成的XML文件创建一个新的PDB
1 2 3 4 5
CREATE PLUGGABLE DATABASE test USING '/u01/app/oracle/oradata/test/test.xml' COPY FILE_NAME_CONVERT = ('/u01/app/oracle/oradata/test/', '/u01/app/oracle/oradata/ora12c/test/');