Transport Tablespaces with Reduced Downtime using Cross Platform Incremental Backup

OVERVIEW

1 目的

传统的传输表空间方式要求数据第一次由远端到目标端传输时,表空间必须置于read only模式,从而生产不可用。而XTTS方式则只需要在最后一次增量备份时将表空间置于read only模式,显著的减少了停机的时间

XTTS can significantly reduce the amount of downtime required to move data between platforms using enhanced RMAN‘s bility

2 oracle建议使用场景

from a big endian platform to linux:XTTS

from a little endian platform to  Linux:DATAGUARD

3 平台、数据库版本要求

DATABASE:source端:Oracle Database - Enterprise Edition - Version 10.2.0.1 to 12.1.0.2
        dest端:如果使用dbms_file_transfer(DFT),必须是11.2.0.4以上
               如何是Recovery Manager (RMAN),版本低于11.2.0.4时需要安装11.2.0.4的RDBMS运行11.2.0.4的实例

OS:source端: any platform provided the prerequisites:cannot be Windows
     dest端: only 64-bit Oracle Linux or RedHat Linux certified

4 常见平台字节

SQL> COLUMN PLATFORM_NAME FORMAT A36
SQL> SELECT * FROM V$TRANSPORTABLE_PLATFORM ORDER BY PLATFORM_NAME;

PLATFORM_ID PLATFORM_NAME                        ENDIAN_FORMAT
----------- ------------------------------------ --------------
      6 AIX-Based Systems (64-bit)           Big
     16 Apple Mac OS                         Big
     19 HP IA Open VMS                       Little
     15 HP Open VMS                          Little
      5 HP Tru64 UNIX                        Little
      3 HP-UX (64-bit)                       Big
      4 HP-UX IA (64-bit)                    Big
     18 IBM Power Based Linux                Big
      9 IBM zSeries Based Linux              Big
     10 Linux IA (32-bit)                    Little
     11 Linux IA (64-bit)                    Little

PLATFORM_ID PLATFORM_NAME                        ENDIAN_FORMAT
----------- ------------------------------------ --------------
     13 Linux x86 64-bit                     Little
      7 Microsoft Windows IA (32-bit)        Little
      8 Microsoft Windows IA (64-bit)        Little
     12 Microsoft Windows x86 64-bit         Little
     17 Solaris Operating System (x86)       Little
     20 Solaris Operating System (x86-64)    Little
      1 Solaris[tm] OE (32-bit)              Big
      2 Solaris[tm] OE (64-bit)              Big

19 rows selected.

XTTS 测试

1 测试环境overview

source端:
# oslevel -s
6100-06-05-1115

SQL> select * from v$version;     
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
NLSRTL Version 10.2.0.4.0 - Production

dest端:
[[email protected] /root]
#uname -a
Linux rac1 2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

[email protected]>select * from v$version;

BANNER
------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE    11.2.0.4.0      Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

2 Prerequisites

P1:source端和dest端的要使用兼容性数据库字符集及国家语言字符集

source端:
SQL> select * from nls_database_parameters where parameter=‘NLS_CHARACTERSET‘ or parameter=‘NLS_LANGUAGE‘;

PARAMETER            VALUE
-------------------- --------------------
NLS_LANGUAGE         AMERICAN
NLS_CHARACTERSET     ZHS16GBK

dest端:
[email protected]>select * from nls_database_parameters where parameter=‘NLS_CHARACTERSET‘ or parameter=‘NLS_LANGUAGE‘;

PARAMETER                      VALUE
----------------------------------------------------------
NLS_LANGUAGE                   AMERICAN
NLS_CHARACTERSET               ZHS16GBK

P2:dest端表空间名不能与source端migration的表空间名相同,否则source端或者dest端的表空间需要rename

source端:    
SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
TEMP
USERS
EXAMPLE
TEST1
TEST2

dest端:    
[email protected]>select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
UNDOTBS2

本次测试使用TEST1及TEST2表空间进行migration

P3:传输的表空间必须自包涵,诸如物化视图,分区表,索引要特别注意检查

对于test1进行检查
SQL> exec dbms_tts.transport_set_check(‘TEST1‘, TRUE, True);
PL/SQL procedure successfully completed.
SQL> select * from transport_set_violations;
no rows selected

对于test2进行检查
SQL> exec dbms_tts.transport_set_check(‘TEST2‘, TRUE, True);
PL/SQL procedure successfully completed.
SQL> select * from transport_set_violations;
no rows selected

P4:如果migration的表空间是加密表空间,source端和dest端endianness不同不可以使用此方法

P5:不可以传输system表空间或者sys用户对象

P6: source端不可以是windows P7: source端的compatible.rdbms必须大于10.2.0,且小于目标端compatible.rdbms

source端
SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------- ----------- ------------------------------
compatible                           string      10.2.0.3.0

dest端:
[email protected]>show parameter compatible

NAME                                 TYPE        VALUE
-------------------------------- ----------- ------------------------------
compatible                           string      11.2.0.4.0

P8:source端必须处于归档模式

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /oracle/app/oracle/product/11.2.0/db_1/dbs/arch
Oldest online log sequence     77
Next log sequence to archive   79
Current log sequence           79

P9:dest端OS必须是64-bit Oracle Linux或者认证的redhat linux

P10:source端RMAN默认是设备类型必须是DISK,且不能配置压缩,否则会报如下错误:

Entering RollForward
After applySetDataFile
Done: applyDataFileTo
Done: RestoreSetPiece
DECLARE
*
ERROR at line 1:
ORA-19624: operation failed, retry possible
ORA-19870: error while restoring backup piece
/dbfs_direct/FS1/xtts/incrementals/xtts_incr_backup
ORA-19608: /dbfs_direct/FS1/xtts/incrementals/xtts_incr_backup is not a backup
piece
ORA-19837: invalid blocksize 0 in backup piece header
ORA-06512: at "SYS.X$DBMS_BACKUP_RESTORE", line 2338
ORA-06512: at line 40

P11:数据库操作用户必须属于DBA组,

3 XTSS操作步骤: 使用dbmsfiletransfer方式

Phase 1 Initial Setup

step 1:source创建directory:sourcedir,路径使用当前数据文件使用的路径

SQL> select file_name from dba_data_files;
FILE_NAME
--------------------------------------------------------------------
/oracle/app/oracle/oradata/orcl/users01.dbf
/oracle/app/oracle/oradata/orcl/sysaux01.dbf
/oracle/app/oracle/oradata/orcl/undotbs01.dbf
/oracle/app/oracle/oradata/orcl/system01.dbf
/oracle/app/oracle/oradata/orcl/example01.dbf
/oracle/app/oracle/oradata/orcl/test1.dbf
/oracle/app/oracle/oradata/orcl/test2.dbf
/oracle/app/oracle/oradata/orcl/test3.dbf
/oracle/app/oracle/oradata/orcl/test21.dbf
/oracle/app/oracle/oradata/orcl/test22.dbf
/oracle/app/oracle/oradata/orcl/test1_4.dbf
/oracle/app/oracle/oradata/orcl/test1_88.dbf
/oracle/app/oracle/oradata/orcl/test1_1988.dbf
/oracle/app/oracle/oradata/orcl/test1_1989.dbf
/oracle/app/oracle/oradata/orcl/test1990.dbf
/oracle/app/oracle/oradata/orcl/test1991.dbf

SQL> create directory sourcedir as ‘/oracle/app/oracle/oradata/orcl‘; 
Directory created.

step 2:dest创建directory:destdir,路径使用当前数据文件使用的路径

[email protected]>select file_name from dba_data_files;
FILE_NAME
-----------------------------------------------------------------
 +DATADG/orcl/datafile/users.932.890771737
 +DATADG/orcl/datafile/undotbs1.928.890771737
 +DATADG/orcl/datafile/sysaux.875.890771737
 +DATADG/orcl/datafile/system.263.890771735
 +DATADG/orcl/datafile/undotbs2.929.890771853

[email protected]>create directory destdir as ‘+DATADG/orcl/datafile‘;
Directory created.

step 3:创建dest端到source端的dblink

step 3.1:创建dblink

[email protected]>create public database link ttslink connect to system identified by oracle using ‘orcl‘;
Database link created.

step 3.2:验证创建的dblink

[email protected]>select * from [email protected];

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
NLSRTL Version 10.2.0.4.0 - Production

其中orcl是在tnsname.ora中配置的service name,参考配置文件:

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.20.61)(PORT = 1521))
(CONNECT_DATA =
  (SERVER = DEDICATED)
  (SERVICE_NAME = orcl)
)
)

step 4:source端和dest端创建migration需要使用的目录

source端:
$ mkdir -p /home/oracle/rman-xtt

dest端:
$ mkdir -p /home/oracle/rman-xtt

在source端解压XTTS使用的脚本,同时将解压后的文件传到dest端

$ pwd                                   
/home/oracle
$ unzip rman-xttconvert_2.0.zip -d rman-xtt
Archive:  rman-xttconvert_2.0.zip
inflating: rman-xtt/xttcnvrtbkupdest.sql  
inflating: rman-xtt/xttdbopen.sql  
inflating: rman-xtt/xttdriver.pl   
inflating: rman-xtt/xttprep.tmpl   
inflating: rman-xtt/xtt.properties  
inflating: rman-xtt/xttstartupnomount.sql

解压后共计6个脚本,其中最重要的两个脚本是:xttdriver.pl,xtt.properties

step 5 添加source端和dest端temdir到环境变量里面,路径为step 4创建的路径

$ more .profile
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.
export PATH
if [ -s "$MAIL" ]           # This is at Shell startup.  In normal
then echo "$MAILMSG"        # operation, the Shell checks
fi                          # periodically.
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
export TMPDIR=/home/oracle/rman-xtt

说明:定义tmpdir是为了存放下面步骤中perl脚本产生的文件,如果不定义,产生的文件会生成到/tmp下

step 6:编辑xtt.properties文件

 $vi xtt.properties
  tablespaces=TEST1,TEST2  
  platformid=6
  srcdir=SOURCEDIR
  dstdir=DESTDIR
  srclink=TTSLINK
  backupformat=/oracle/app/oracle/backup
  stageondest=/home/oracle/source
  backupondest=+DATADG

参数说明:
 1)TEST1,TEST2是source端migration的表空间名
 2)platformid值得是source端平台ID,可以通过以下方式查询
  SQL> col PLATFORM_NAME for a40
  SQL> set pages 200
  SQL> select * from v$transportable_platform ;
  PLATFORM_ID PLATFORM_NAME                            ENDIAN_FORMAT
  ----------- ---------------------------------------- --------------
      1 Solaris[tm] OE (32-bit)                  Big
      2 Solaris[tm] OE (64-bit)                  Big
      7 Microsoft Windows IA (32-bit)            Little
     10 Linux IA (32-bit)                        Little
      6 AIX-Based Systems (64-bit)               Big
      3 HP-UX (64-bit)                           Big
      5 HP Tru64 UNIX                            Little
      4 HP-UX IA (64-bit)                        Big
     11 Linux IA (64-bit)                        Little
     15 HP Open VMS                              Little
      8 Microsoft Windows IA (64-bit)            Little
      9 IBM zSeries Based Linux                  Big
     13 Linux x86 64-bit                         Little
     16 Apple Mac OS                             Big
     12 Microsoft Windows x86 64-bit             Little
     17 Solaris Operating System (x86)           Little
     18 IBM Power Based Linux                    Big
     20 Solaris Operating System (x86-64)        Little
     19 HP IA Open VMS                           Little
 3)srcdir:source端数据库数据库文件存放路径,也即在directory:sourcedir定义的路径
 4)dstdir:dest端数据库数据库文件存放路径,也即在directory:destdir定义的路径
 5)srclink:指定dest端到source端使用的dblink
 6)backupformat:定义source端rman备份产生的文件存在位置
 7)stageondest:定义dest端存放source端发送的copies和incremental backups

step 7:将source的XTTS脚本传到dest端:

 $ scp -r /home/oracle/rman-xtt 10.10.20.1:`pwd`

phase 2:Prepare Phase:only once

step 1:source端开启debug模式

$ export XTTDEBUG=1

step 2:source端prepare

$ perl xttdriver.pl -S
--------------------------------------------------------------------
Parsing properties
--------------------------------------------------------------------
Key: backupondest
Values: +RECO
Key: platformid
Values: 6
Key: backupformat
Values: /oracle/app/oracle/backup
Key: parallel
Values: 3
Key: srclink
Values: TTSLINK
Key: storageondest
Values: +DATA
Key: dfcopydir
Values: /stage_source
Key: dstdir
Values: DESTDIR
Key: srcdir
Values: SOURCEDIR
Key: rollparallel
Values: 2
Key: stageondest
Values: /home/oracle/source
Key: tablespaces
Values: TEST1,TEST2
Key: getfileparallel
Values: 4

--------------------------------------------------------------------
Done parsing properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Checking properties
--------------------------------------------------------------------
ARGUMENT tablespaces
ARGUMENT platformid
ARGUMENT backupformat
ARGUMENT stageondest
ARGUMENT srcdir
ARGUMENT dstdir
ARGUMENT srclink

--------------------------------------------------------------------
Done checking properties
--------------------------------------------------------------------
ORACLE_SID  : orcl
ORACLE_HOME : /oracle/app/oracle/product/11.2.0/db_1

--------------------------------------------------------------------
Starting prepare phase
--------------------------------------------------------------------
Parallel:3
fetchCheckDirObjectsSRC=\‘#\‘" /home/oracle/source
xttpreparesrc.sql for ‘TEST1‘ started at Sat Sep 19 16:26:02 2015
xttpreparesrc.sql for  ended at Sat Sep 19 16:26:02 2015
#DNAME:/oracle/app/oracle/oradata/orcl
#FNAME:test1.dbf
#PLAN:TEST1::::2800517
#TRANSFER:source_file_name=TEST1,/oracle/app/oracle/oradata/orcl,test1.dbf
#NEWDESTDF:6,DESTDIR:/oracle/app/oracle/oradata/orcl,/test1.dbf
#PLAN:6
#DNAME:/oracle/app/oracle/oradata/orcl
#FNAME:test2.dbf
#TRANSFER:source_file_name=TEST1,/oracle/app/oracle/oradata/orcl,test2.dbf
#NEWDESTDF:7,DESTDIR:/oracle/app/oracle/oradata/orcl,/test2.dbf
#PLAN:7
#DNAME:/oracle/app/oracle/oradata/orcl
#FNAME:test3.dbf
#TRANSFER:source_file_name=TEST1,/oracle/app/oracle/oradata/orcl,test3.dbf
#NEWDESTDF:8,DESTDIR:/oracle/app/oracle/oradata/orcl,/test3.dbf
#PLAN:8
#DNAME:/oracle/app/oracle/oradata/orcl
#FNAME:test1_4.dbf
#TRANSFER:source_file_name=TEST1,/oracle/app/oracle/oradata/orcl,test1_4.dbf
#NEWDESTDF:11,DESTDIR:/oracle/app/oracle/oradata/orcl,/test1_4.dbf
#PLAN:11
#DNAME:/oracle/app/oracle/oradata/orcl
#FNAME:test1_88.dbf
#TRANSFER:source_file_name=TEST1,/oracle/app/oracle/oradata/orcl,test1_88.dbf
#NEWDESTDF:12,DESTDIR:/oracle/app/oracle/oradata/orcl,/test1_88.dbf
#PLAN:12
#DNAME:/oracle/app/oracle/oradata/orcl
#FNAME:test1_1988.dbf
#TRANSFER:source_file_name=TEST1,/oracle/app/oracle/oradata/orcl,test1_1988.dbf
#NEWDESTDF:16,DESTDIR:/oracle/app/oracle/oradata/orcl,/test1_1988.dbf
#PLAN:16
#DNAME:/oracle/app/oracle/oradata/orcl
#FNAME:test1_1989.dbf
#TRANSFER:source_file_name=TEST1,/oracle/app/oracle/oradata/orcl,test1_1989.dbf
#NEWDESTDF:17,DESTDIR:/oracle/app/oracle/oradata/orcl,/test1_1989.dbf
#PLAN:17
#DNAME:/oracle/app/oracle/oradata/orcl
#FNAME:test1990.dbf
#TRANSFER:source_file_name=TEST1,/oracle/app/oracle/oradata/orcl,test1990.dbf
#NEWDESTDF:18,DESTDIR:/oracle/app/oracle/oradata/orcl,/test1990.dbf
#PLAN:18
#DNAME:/oracle/app/oracle/oradata/orcl
#FNAME:test1991.dbf
#TRANSFER:source_file_name=TEST1,/oracle/app/oracle/oradata/orcl,test1991.dbf
#NEWDESTDF:19,DESTDIR:/oracle/app/oracle/oradata/orcl,/test1991.dbf
#PLAN:19
verifySrcdirDatafiles: Entered
TABLESPACE STRING :‘TEST2‘
Prepare source for Tablespaces:
              ‘TEST2‘  /home/oracle/source
xttpreparesrc.sql for ‘TEST2‘ started at Sat Sep 19 16:26:02 2015
xttpreparesrc.sql for  ended at Sat Sep 19 16:26:02 2015
#DNAME:/oracle/app/oracle/oradata/orcl
#FNAME:test21.dbf
#PLAN:TEST2::::2800532
#TRANSFER:source_file_name=TEST2,/oracle/app/oracle/oradata/orcl,test21.dbf
#NEWDESTDF:9,DESTDIR:/oracle/app/oracle/oradata/orcl,/test21.dbf
#PLAN:9
#DNAME:/oracle/app/oracle/oradata/orcl
#FNAME:test22.dbf
#TRANSFER:source_file_name=TEST2,/oracle/app/oracle/oradata/orcl,test22.dbf
#NEWDESTDF:10,DESTDIR:/oracle/app/oracle/oradata/orcl,/test22.dbf
#PLAN:10
verifySrcdirDatafiles: Entered
TABLESPACE STRING :‘‘
Prepare source for Tablespaces:
              ‘‘  /home/oracle/source
xttpreparesrc.sql for ‘‘ started at Sat Sep 19 16:26:02 2015
xttpreparesrc.sql for  ended at Sat Sep 19 16:26:02 2015

verifySrcdirDatafiles: Entered
fixXTTNewDatafiles: Entered
TEST1: /oracle/app/oracle/oradata/orcl/test1.dbf /oracle/app/oracle/oradata/orcl/test2.dbf /oracle/app/oracle/oradata/orcl/test3.dbf /oracle/app/oracle/oradata/orcl/test1_4.dbf /oracle/app/oracle/oradata/orcl/test1_88.dbf /oracle/app/oracle/oradata/orcl/test1_1988.dbf /oracle/app/oracle/oradata/orcl/test1_1989.dbf /oracle/app/oracle/oradata/orcl/test1990.dbf /oracle/app/oracle/oradata/orcl/test1991.dbf

TEST2: /oracle/app/oracle/oradata/orcl/test21.dbf /oracle/app/oracle/oradata/orcl/test22.dbf

--------------------------------------------------------------------
Done with prepare phase


说明:这一步XTTS主要做以下两件事

1)验证migration的表空间test1,test2是read write状态,且不存在offline状态的文件

2)本阶段生成八个文件:其中xttnewdatafiles.txt,getfile.sql需要传送到dest端,

$ more xttnewdatafiles.txt
::TEST1
6,DESTDIR:/test1.dbf
7,DESTDIR:/test2.dbf
8,DESTDIR:/test3.dbf
11,DESTDIR:/test1_4.dbf
12,DESTDIR:/test1_88.dbf
16,DESTDIR:/test1_1988.dbf
17,DESTDIR:/test1_1989.dbf
18,DESTDIR:/test1990.dbf
19,DESTDIR:/test1991.dbf
::TEST2
9,DESTDIR:/test21.dbf
10,DESTDIR:/test22.dbf

$ more getfile.sql        
0,SOURCEDIR,test1.dbf,DESTDIR,test1.dbf
0,SOURCEDIR,test2.dbf,DESTDIR,test2.dbf
0,SOURCEDIR,test3.dbf,DESTDIR,test3.dbf
0,SOURCEDIR,test1_4.dbf,DESTDIR,test1_4.dbf
0,SOURCEDIR,test1_88.dbf,DESTDIR,test1_88.dbf
0,SOURCEDIR,test1_1988.dbf,DESTDIR,test1_1988.dbf
0,SOURCEDIR,test1_1989.dbf,DESTDIR,test1_1989.dbf
0,SOURCEDIR,test1990.dbf,DESTDIR,test1990.dbf
0,SOURCEDIR,test1991.dbf,DESTDIR,test1991.dbf
1,SOURCEDIR,test21.dbf,DESTDIR,test21.dbf
1,SOURCEDIR,test22.dbf,DESTDIR,test22.dbf

同时XTTS会生成xttplan.txt,记录数据库SCN号,其内容如下:

$ more xttplan.txt
TEST1::::2800517
6
7
8
11
12
16
17
18
19
TEST2::::2800532
9
10

step 3:source端将rman-xtt内的所有内容传输到dest端

$  scp  xttnewdatafiles.txt getfile.sql 10.10.20.1:`pwd`

step 4:dest端get所有文件

[email protected]:/home/oracle/rman-xtt>perl xttdriver.pl -G
--------------------------------------------------------------------
Parsing properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Done parsing properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Checking properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Done checking properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Getting datafiles from source
--------------------------------------------------------------------
sh: line 5: warning: here-document at line 0 delimited by end-of-file (wanted `EOF‘)
sh: line 6: warning: here-document at line 0 delimited by end-of-file (wanted `EOF‘)

--------------------------------------------------------------------
Executing getfile for getfile_sourcedir_test1.dbf_0.sql
-------------------------------------------------------------------

--------------------------------------------------------------------
Executing getfile for getfile_sourcedir_test2.dbf_0.sql
--------------------------------------------------------------------

--------------------------------------------------------------------
Executing getfile for getfile_sourcedir_test3.dbf_0.sql
--------------------------------------------------------------------

--------------------------------------------------------------------
Executing getfile for getfile_sourcedir_test1_4.dbf_0.sql
--------------------------------------------------------------------

--------------------------------------------------------------------
Executing getfile for getfile_sourcedir_test1_88.dbf_0.sql
--------------------------------------------------------------------

--------------------------------------------------------------------
Executing getfile for getfile_sourcedir_test1_1988.dbf_0.sql
--------------------------------------------------------------------

--------------------------------------------------------------------
Executing getfile for getfile_sourcedir_test1_1989.dbf_0.sql
--------------------------------------------------------------------

--------------------------------------------------------------------
Executing getfile for getfile_sourcedir_test1990.dbf_0.sql
--------------------------------------------------------------------

--------------------------------------------------------------------
Executing getfile for getfile_sourcedir_test1991.dbf_0.sql
--------------------------------------------------------------------

--------------------------------------------------------------------
Executing getfile for getfile_sourcedir_test21.dbf_1.sql
--------------------------------------------------------------------

--------------------------------------------------------------------
Executing getfile for getfile_sourcedir_test22.dbf_1.sql
--------------------------------------------------------------------

--------------------------------------------------------------------
Completed getting datafiles from source
--------------------------------------------------------------------

phase 2:roll forward Phase

step 1:source 端做第一次增量备份

$ perl xttdriver.pl -i
--------------------------------------------------------------------
Parsing properties
--------------------------------------------------------------------
Key: backupondest
Values: +RECO
Key: platformid
Values: 6
Key: backupformat
Values: /oracle/app/oracle/backup
Key: parallel
Values: 3
Key: srclink
Values: TTSLINK
Key: storageondest
Values: +DATA
Key: dfcopydir
Values: /stage_source
Key: dstdir
Values: DESTDIR
Key: srcdir
Values: SOURCEDIR
Key: rollparallel
Values: 2
Key: stageondest
Values: /home/oracle/source
Key: tablespaces
Values: TEST1,TEST2
Key: getfileparallel
Values: 4

--------------------------------------------------------------------
Done parsing properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Checking properties
--------------------------------------------------------------------
ARGUMENT tablespaces
ARGUMENT platformid
ARGUMENT backupformat
ARGUMENT stageondest

--------------------------------------------------------------------
Done checking properties
--------------------------------------------------------------------
ORACLE_SID  : orcl
ORACLE_HOME : /oracle/app/oracle/product/11.2.0/db_1

--------------------------------------------------------------------
Backup incremental
--------------------------------------------------------------------
TABLESPACE STRING :‘TEST1‘
Prepare newscn for Tablespaces: ‘TEST1‘ 
TEST1::::2800517
6
7
8
11
12
16
17
18
19
TABLESPACE STRING :‘TEST2‘
Prepare newscn for Tablespaces: ‘TEST2‘ 
TEST2::::2800532
9
10
TABLESPACE STRING :‘‘
Prepare newscn for Tablespaces: ‘‘ 

Start backup incremental
Crossed mv 
Crossed mv /oracle/app/oracle/backup
Generate /home/oracle/rman-xtt/rmanincr.cmd
rman target / debug trace /home/oracle/rman-xtt/rmantrc_13041886_159_incrbackup.trc cmdfile /home/oracle/rman-xtt/rmanincr.cmd

Recovery Manager: Release 10.2.0.4.0 - Production on Sat Sep 19 17:04:41 2015

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

RMAN-06005: connected to target database: ORCL (DBID=1418362679)

RMAN> set nocfau;
2> host ‘echo ts::TEST1‘;
3> backup incremental from scn 2800517 
4>   tag tts_incr_update tablespace ‘TEST1‘  format
5>  ‘/oracle/app/oracle/backup/%U‘;
6> set nocfau;
7> host ‘echo ts::TEST2‘;
8> backup incremental from scn 2800532 
9>   tag tts_incr_update tablespace ‘TEST2‘  format
10>  ‘/oracle/app/oracle/backup/%U‘;
11> 
RMAN-03023: executing command: SET NOCFAU
RMAN-06009: using target database control file instead of recovery catalog

ts::TEST1
RMAN-06134: host command complete

RMAN-03090: Starting backup at 19-SEP-15
RMAN-08030: allocated channel: ORA_DISK_1
RMAN-08500: channel ORA_DISK_1: sid=147 devtype=DISK
RMAN-08008: channel ORA_DISK_1: starting full datafile backupset
RMAN-08010: channel ORA_DISK_1: specifying datafile(s) in backupset
RMAN-08522: input datafile fno=00006 name=/oracle/app/oracle/oradata/orcl/test1.dbf
RMAN-08522: input datafile fno=00017 name=/oracle/app/oracle/oradata/orcl/test1_1989.dbf
RMAN-08522: input datafile fno=00018 name=/oracle/app/oracle/oradata/orcl/test1990.dbf
RMAN-08522: input datafile fno=00007 name=/oracle/app/oracle/oradata/orcl/test2.dbf
RMAN-08522: input datafile fno=00008 name=/oracle/app/oracle/oradata/orcl/test3.dbf
RMAN-08522: input datafile fno=00011 name=/oracle/app/oracle/oradata/orcl/test1_4.dbf
RMAN-08522: input datafile fno=00012 name=/oracle/app/oracle/oradata/orcl/test1_88.dbf
RMAN-08522: input datafile fno=00016 name=/oracle/app/oracle/oradata/orcl/test1_1988.dbf
RMAN-08522: input datafile fno=00019 name=/oracle/app/oracle/oradata/orcl/test1991.dbf
RMAN-08038: channel ORA_DISK_1: starting piece 1 at 19-SEP-15
RMAN-08044: channel ORA_DISK_1: finished piece 1 at 19-SEP-15
RMAN-08530: piece handle=/oracle/app/oracle/backup/1kqhie9c_1_1 tag=TTS_INCR_UPDATE comment=NONE
RMAN-08540: channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
RMAN-03091: Finished backup at 19-SEP-15

RMAN-03023: executing command: SET NOCFAU

ts::TEST2
RMAN-06134: host command complete

RMAN-03090: Starting backup at 19-SEP-15
RMAN-12016: using channel ORA_DISK_1
RMAN-08008: channel ORA_DISK_1: starting full datafile backupset
RMAN-08010: channel ORA_DISK_1: specifying datafile(s) in backupset
RMAN-08522: input datafile fno=00009 name=/oracle/app/oracle/oradata/orcl/test21.dbf
RMAN-08522: input datafile fno=00010 name=/oracle/app/oracle/oradata/orcl/test22.dbf
RMAN-08038: channel ORA_DISK_1: starting piece 1 at 19-SEP-15
RMAN-08044: channel ORA_DISK_1: finished piece 1 at 19-SEP-15
RMAN-08530: piece handle=/oracle/app/oracle/backup/1lqhie9g_1_1 tag=TTS_INCR_UPDATE comment=NONE
RMAN-08540: channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
RMAN-03091: Finished backup at 19-SEP-15

Recovery Manager complete.

TSNAME:TEST1
TSNAME:TEST2

--------------------------------------------------------------------
Done backing up incrementals
--------------------------------------------------------------------

该step产生两个文件tsbkupmap.txt、incrbackups.txt需要传到dest端,内容如下:

$ more tsbkupmap.txt
TEST1::6,17,18,7,8,11,12,16,19:::1=1kqhie9c_1_1
TEST2::9,10:::1=1lqhie9g_1_1  

$ more incrbackups.txt
/oracle/app/oracle/backup/1kqhie9c_1_1
/oracle/app/oracle/backup/1lqhie9g_1_1

同时其会产生一个新的记录scn的文件:xttplan.txt.new,

$ more xttplan.txt.new
TEST1::::2818317
6
7
8
11
12
16
17
18
19
TEST2::::2818328
9
10

step 2 将tsbkupmap.txt,incrbackups.txt,xttplan.txt传到dest端

$ scp `cat incrbackups.txt` [email protected]:/home/oracle/source
1kqhie9c_1_1    100%  104KB 104.0KB/s   00:00                                                                                           
1lqhie9g_1_1    100%   48KB  48.0KB/s   00:00    

$ scp xttplan.txt tsbkupmap.txt [email protected]:/home/oracle/rman-xtt
[email protected]‘s password: 
xttplan.txt      100%   63     0.1KB/s   00:00                                                                                            
tsbkupmap.txt     100%   77     0.1KB/s   00:00

step 3:dest 端应用增量备份

[email protected]:/home/oracle/rman-xtt>perl xttdriver.pl -r

--------------------------------------------------------------------
Parsing properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Done parsing properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Checking properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Done checking properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Start rollforward
--------------------------------------------------------------------

--------------------------------------------------------------------
End of rollforward phase
-------------------------------------------------------------------

step 3:确定下一次增量备份的from_scn

$ perl xttdriver.pl -s
--------------------------------------------------------------------
Parsing properties
--------------------------------------------------------------------
Key: backupondest
Values: +RECO
Key: platformid
Values: 6
Key: backupformat
Values: /oracle/app/oracle/backup
Key: parallel
Values: 3
Key: srclink
Values: TTSLINK
Key: storageondest
Values: +DATA
Key: dfcopydir
Values: /stage_source
Key: dstdir
Values: DESTDIR
Key: srcdir
Values: SOURCEDIR
Key: rollparallel
Values: 2
Key: stageondest
Values: /home/oracle/source
Key: tablespaces
Values: TEST1,TEST2
Key: getfileparallel
Values: 4

--------------------------------------------------------------------
Done parsing properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Checking properties
--------------------------------------------------------------------
ARGUMENT tablespaces
ARGUMENT platformid
ARGUMENT backupformat
ARGUMENT stageondest

-------------------------------------------------------------------
Done checking properties
--------------------------------------------------------------------
ORACLE_SID  : orcl
ORACLE_HOME : /oracle/app/oracle/product/11.2.0/db_1
TABLESPACE STRING :‘TEST1‘
Prepare newscn for Tablespaces: ‘TEST1‘ 

TABLESPACE STRING :‘TEST2‘
Prepare newscn for Tablespaces: ‘TEST2‘ 

TABLESPACE STRING :‘‘
Prepare newscn for Tablespaces: ‘‘ 

New /home/oracle/rman-xtt/xttplan.txt with FROM SCN‘s generated

查看from_scn

$ more xttplan.txt
TEST1::::2818317
6
7
8
11
12
16
17
18
19
TEST2::::2818328
9
10
xttplan.txt: END

step 4:第二次增量备份

$ perl xttdriver.pl -i

查看生成的文件:

$ more xttplan.txt.new
TEST1::::2831341
6
7
8
11
12
16
17
18
19
TEST2::::2831341
9
10        
$ more tsbkupmap.txt
TEST1::6,17,18,7,8,11,12,16,19:::1=1oqhikk6_1_1
TEST2::9,10:::1=1pqhikka_1_1    

$ more incrbackups.txt
/oracle/app/oracle/backup/1oqhikk6_1_1
/oracle/app/oracle/backup/1pqhikka_1_1

step5:将生成的文件传到dest端

$ scp `cat incrbackups.txt` [email protected]:/home/oracle/source  
$ scp xttplan.txt tsbkupmap.txt [email protected]:/home/oracle/rman-xtt

step 6:在目标端应用增量备份

[email protected]:/home/oracle/rman-xtt>perl xttdriver.pl -r

--------------------------------------------------------------------
Parsing properties
--------------------------------------------------------------------

-------------------------------------------------------------------
Done parsing properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Checking properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Done checking properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Start rollforward
--------------------------------------------------------------------

--------------------------------------------------------------------
End of rollforward phase
--------------------------------------------------------------------

step 7:最后一次增量备份

***********************************************************************
 XTTS 不支持在phase 1 结束后新增的数据文件rman备份在dest端的恢复应用

 step 7.1 source端增加一个测试数据文件

 SQL>  alter tablespace test2 add datafile ‘/oracle/app/oracle/oradata/orcl/ test_sylar.dbf‘ size 12M;
 Tablespace altered.

 查看新增的数据库的文件号:

 SQL> select file#,NAME from v$datafile;
    FILE# NAME
---------- --------------------------------------------------
     1 /oracle/app/oracle/oradata/orcl/system01.dbf
     2 /oracle/app/oracle/oradata/orcl/undotbs01.dbf
     3 /oracle/app/oracle/oradata/orcl/sysaux01.dbf
     4 /oracle/app/oracle/oradata/orcl/users01.dbf
     5 /oracle/app/oracle/oradata/orcl/example01.dbf
     6 /oracle/app/oracle/oradata/orcl/test1.dbf
     7 /oracle/app/oracle/oradata/orcl/test2.dbf
     8 /oracle/app/oracle/oradata/orcl/test3.dbf
     9 /oracle/app/oracle/oradata/orcl/test21.dbf
    10 /oracle/app/oracle/oradata/orcl/test22.dbf
    11 /oracle/app/oracle/oradata/orcl/test1_4.dbf
    12 /oracle/app/oracle/oradata/orcl/test1_88.dbf
    13 /oracle/app/oracle/oradata/orcl/test_sylar.dbf
    16 /oracle/app/oracle/oradata/orcl/test1_1988.dbf
    17 /oracle/app/oracle/oradata/orcl/test1_1989.dbf
    18 /oracle/app/oracle/oradata/orcl/test1990.dbf
    19 /oracle/app/oracle/oradata/orcl/test1991.dbf

即新增的文件号是13
**************************************************************************
 step 7.2:将source端migration的表空间置于read only状态

 SQL> alter tablespace test1 read only;

 Tablespace altered.

 SQL> alter tablespace test2 read only;

 Tablespace altered.  

 step 7.3:在source端进行最后一次增量备份

 $  perl xttdriver.pl -i

 --------------------------------------------------------------------
 Parsing properties
  --------------------------------------------------------------------
 Key: backupondest
Values: +RECO
Key: platformid
Values: 6
Key: backupformat
Values: /oracle/app/oracle/backup
Key: parallel
Values: 3
Key: srclink
Values: TTSLINK
Key: storageondest
Values: +DATA
Key: dfcopydir
Values: /stage_source
Key: dstdir
Values: DESTDIR
Key: srcdir
Values: SOURCEDIR
Key: rollparallel
Values: 2
Key: stageondest
Values: /home/oracle/source
Key: tablespaces
Values: TEST1,TEST2
Key: getfileparallel
Values: 4

--------------------------------------------------------------------
Done parsing properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Checking properties
--------------------------------------------------------------------
ARGUMENT tablespaces
ARGUMENT platformid
ARGUMENT backupformat
ARGUMENT stageondest

--------------------------------------------------------------------
Done checking properties
--------------------------------------------------------------------
ORACLE_SID  : orcl
ORACLE_HOME : /oracle/app/oracle/product/11.2.0/db_1

--------------------------------------------------------------------
Backup incremental
--------------------------------------------------------------------
TABLESPACE STRING :‘TEST1‘
Prepare newscn for Tablespaces: ‘TEST1‘ 
TEST1::::2934992
 6
TABLESPACE STRING :‘TEST2‘
Prepare newscn for Tablespaces: ‘TEST2‘ 
TEST2::::2935487
 9
TABLESPACE STRING :‘‘
Prepare newscn for Tablespaces: ‘‘ 

Start backup incremental
Crossed mv 
Crossed mv /oracle/app/oracle/backup
Generate /home/oracle/rman-xtt/rmanincr.cmd
rman target / debug trace /home/oracle/rman-xtt/rmantrc_11272298_766_incrbackup.trc cmdfile /home/oracle/rman-xtt/rmanincr.cmd

Recovery Manager: Release 10.2.0.4.0 - Production on Sat Sep 19 19:13:27 2015

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

RMAN-06005: connected to target database: ORCL (DBID=1418362679)

RMAN> set nocfau;
2> host ‘echo ts::TEST1‘;
3> backup incremental from scn 2818317 
4>   tag tts_incr_update tablespace ‘TEST1‘  format
5>  ‘/oracle/app/oracle/backup/%U‘;
6> set nocfau;
7> host ‘echo ts::TEST2‘;
8> backup incremental from scn 2818328 
9>   tag tts_incr_update tablespace ‘TEST2‘  format
10>  ‘/oracle/app/oracle/backup/%U‘;
11> 
RMAN-03023: executing command: SET NOCFAU
RMAN-06009: using target database control file instead of recovery catalog

ts::TEST1
RMAN-06134: host command complete

RMAN-03090: Starting backup at 19-SEP-15
RMAN-08030: allocated channel: ORA_DISK_1
RMAN-08500: channel ORA_DISK_1: sid=147 devtype=DISK
RMAN-08008: channel ORA_DISK_1: starting full datafile backupset
RMAN-08010: channel ORA_DISK_1: specifying datafile(s) in backupset
RMAN-08522: input datafile fno=00006 name=/oracle/app/oracle/oradata/orcl/test1.dbf
RMAN-08522: input datafile fno=00017 name=/oracle/app/oracle/oradata/orcl/test1_1989.dbf
RMAN-08522: input datafile fno=00018 name=/oracle/app/oracle/oradata/orcl/test1990.dbf
RMAN-08522: input datafile fno=00007 name=/oracle/app/oracle/oradata/orcl/test2.dbf
RMAN-08522: input datafile fno=00008 name=/oracle/app/oracle/oradata/orcl/test3.dbf
RMAN-08522: input datafile fno=00011 name=/oracle/app/oracle/oradata/orcl/test1_4.dbf
RMAN-08522: input datafile fno=00012 name=/oracle/app/oracle/oradata/orcl/test1_88.dbf
RMAN-08522: input datafile fno=00016 name=/oracle/app/oracle/oradata/orcl/test1_1988.dbf
RMAN-08522: input datafile fno=00019 name=/oracle/app/oracle/oradata/orcl/test1991.dbf
RMAN-08038: channel ORA_DISK_1: starting piece 1 at 19-SEP-15
RMAN-08044: channel ORA_DISK_1: finished piece 1 at 19-SEP-15
RMAN-08530: piece handle=/oracle/app/oracle/backup/1qqhilqq_1_1 tag=TTS_INCR_UPDATE comment=NONE
RMAN-08540: channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
RMAN-03091: Finished backup at 19-SEP-15

RMAN-03023: executing command: SET NOCFAU

ts::TEST2
RMAN-06134: host command complete

RMAN-03090: Starting backup at 19-SEP-15
RMAN-12016: using channel ORA_DISK_1
RMAN-08008: channel ORA_DISK_1: starting full datafile backupset
RMAN-08010: channel ORA_DISK_1: specifying datafile(s) in backupset
RMAN-08522: input datafile fno=00009 name=/oracle/app/oracle/oradata/orcl/test21.dbf
RMAN-08522: input datafile fno=00013 name=/oracle/app/oracle/oradata/orcl/test_sylar.dbf
RMAN-08522: input datafile fno=00010 name=/oracle/app/oracle/oradata/orcl/test22.dbf
RMAN-08038: channel ORA_DISK_1: starting piece 1 at 19-SEP-15
RMAN-08044: channel ORA_DISK_1: finished piece 1 at 19-SEP-15
RMAN-08530: piece handle=/oracle/app/oracle/backup/1rqhilqu_1_1 tag=TTS_INCR_UPDATE comment=NONE
RMAN-08540: channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
RMAN-03091: Finished backup at 19-SEP-15

Recovery Manager complete.

TSNAME:TEST1
TSNAME:TEST2

--------------------------------------------------------------------
 Done backing up incrementals
--------------------------------------------------------------------

查看生成的文件:

 $ more incrbackups.txt
/oracle/app/oracle/backup/1qqhilqq_1_1
/oracle/app/oracle/backup/1rqhilqu_1_1
$ more tsbkupmap.txt
TEST1::6,17,18,7,8,11,12,16,19:::1=1qqhilqq_1_1
TEST2::9,13,10:::1=1rqhilqu_1_1
$ more  xttplan.txt
TEST1::::2818317
6
7
8
11
12
16
17
18
19
TEST2::::2818328
9
10
$ more xttplan.txt.new
TEST1::::2934992
6
TEST2::::2935487
9

step 8:将生成的文件传到dest端

$  scp `cat incrbackups.txt` [email protected]:/home/oracle/source
$ scp xttplan.txt tsbkupmap.txt [email protected]:/home/oracle/rman-xtt


对于新增的数据文件test_sylar,需要执行以下步骤,手动恢复到dest端

step 1:在xttplan.txt文件中对应表空间test2增加文件号13

vi xttplan.txt
TEST1::::2818317
6
7
8
11
12
16
17
18
19
TEST2::::2818328
9
10
13

step 2:在getfile.sql增加相应文件内容

vi getfile.sql
0,SOURCEDIR,test1.dbf,DESTDIR,test1.dbf
0,SOURCEDIR,test2.dbf,DESTDIR,test2.dbf
0,SOURCEDIR,test3.dbf,DESTDIR,test3.dbf
0,SOURCEDIR,test1_4.dbf,DESTDIR,test1_4.dbf
0,SOURCEDIR,test1_88.dbf,DESTDIR,test1_88.dbf
0,SOURCEDIR,test1_1988.dbf,DESTDIR,test1_1988.dbf
0,SOURCEDIR,test1_1989.dbf,DESTDIR,test1_1989.dbf
0,SOURCEDIR,test1990.dbf,DESTDIR,test1990.dbf
0,SOURCEDIR,test1991.dbf,DESTDIR,test1991.dbf
1,SOURCEDIR,test21.dbf,DESTDIR,test21.dbf
1,SOURCEDIR,test22.dbf,DESTDIR,test22.dbf
1,SOURCEDIR,test_sylar.dbf,DESTDIR,test_sylar.dbf

step 3:编辑xttnewdatafiles.txt增加相应内容

::TEST1
6,+DATADG/orcl/datafile/test1.dbf
7,+DATADG/orcl/datafile/test2.dbf
8,+DATADG/orcl/datafile/test3.dbf
11,+DATADG/orcl/datafile/test1_4.dbf
12,+DATADG/orcl/datafile/test1_88.dbf
16,+DATADG/orcl/datafile/test1_1988.dbf
17,+DATADG/orcl/datafile/test1_1989.dbf
18,+DATADG/orcl/datafile/test1990.dbf
19,+DATADG/orcl/datafile/test1991.dbf
::TEST2
9,+DATADG/orcl/datafile/test21.dbf
10,+DATADG/orcl/datafile/test22.dbf
13,+DATADG/orcl/datafile/test_sylar.dbf

step 4:将source端的备份字节convert为目标端的字节

[email protected]:/home/oracle/rman-xtt>pwd
/home/oracle/rman-xtt
[email protected]:/home/oracle/rman-xtt>dba

SQL*Plus: Release 11.2.0.4.0 Production on Sat Sep 19 19:47:30 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

[email protected]>@xttcnvrtbkupdest.sql
Enter value for 1: /home/oracle/source/1rqhilqu_1_1
Enter value for 2: /home/oracle/source
Enter value for 3: 6
ERROR IN CONVERSION ORA-19624: operation failed, retry possible
ORA-19504: failed to create file
"/home/oracle/source/xtts_incr_backup"
ORA-27038: created file already exists
Additional information: 1
ORA-19600: input file is backup
piece  (/home/oracle/source/1rqhilqu_1_1)
ORA-19601: output file is backup piece  (/home/oracle/source/xtts_incr_backup)
CONVERTED BACKUP PIECE/home/oracle/source/xtts_incr_backup

PL/SQL procedure successfully completed.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

step 5:利用dbmsbackuprestore包恢复数据文件test_sylar

DECLARE

devtype varchar2(256);

done boolean;

BEGIN

devtype := dbms_backup_restore.DeviceAllocate (type => ‘‘,ident => ‘t1‘);

dbms_backup_restore.RestoreSetDatafile;

dbms_backup_restore.RestoreDatafileTo(dfnumber => 13,toname => ‘+datadg/orcl/datafile/TEST_SYLAR.DBF‘);

dbms_backup_restore.RestoreBackupPiece(done => done,handle => ‘/home/oracle/source/xtts_incr_backup‘, params => null);

dbms_backup_restore.DeviceDeallocate;

END;

step 6:检查数据库是否存在此文件

ASMCMD> ls -l +DATADG/orcl/datafile/test_sylar.dbf
Type      Redund  Striped  Time             Sys  Name
 N    test_sylar.dbf => +DATADG/ORCL/DATAFILE/UNKNOWN.1074.890857729


step 9 在dest端应用备份

[email protected]:/home/oracle/rman-xtt>perl xttdriver.pl -r

--------------------------------------------------------------------
Parsing properties
--------------------------------------------------------------------

 --------------------------------------------------------------------
Done parsing properties
--------------------------------------------------------------------

--------------------------------------------------------------------
Checking properties


Done checking properties


Start rollforward


End of rollforward phase


step 10 在dest端利用dblink抽取source端元数据

step 10.1 在dest端创建想用schema

[email protected]>create user sysbench identified by sysbench;

User created.

[email protected]>create user sysbench2 identified by sysbench;

User created.

step 10.2 在dest端只执行以下命令

perl xttdriver.pl -e

step 10.3 在dest端抽取元数据

impdp system/oracle directory=DATA_PUMP_DIR logfile=tts_imp.log  network_link=ttslink \ 
transport_full_check=no \ 
transport_tablespaces=TEST1,TEST2 \ 
transport_datafiles=‘+datadg/orcl/datafile/test1.dbf, \ 
‘+datadg/orcl/datafile/test1990.dbf‘, \ 
‘+datadg/orcl/datafile/test1991.dbf‘, ‘+datadg/orcl/datafile/test1_1998.dbf‘, ‘+datadg/orcl/datafile/test1_1989.dbf‘, ‘+datadg/orcl/datafile/test1_4.dbf‘, ‘+datadg/orcl/datafile/test1_88.dbf‘, ‘+datadg/orcl/datafile/test2.dbf‘, ‘+datadg/orcl/datafile/test21.dbf‘, ‘+datadg/orcl/datafile/test22.dbf‘, ‘+datadg/orcl/datafile/test3.dbf‘, ‘+datadg/orcl/datafile/test_sylar.dbf‘ \

step 11 dest端验证transported的数据

RMAN> validate tablespace TEST1, TEST2 check logical;
时间: 2024-10-11 21:42:22

Transport Tablespaces with Reduced Downtime using Cross Platform Incremental Backup的相关文章

Updated: EBS 12.1 + Transportable Tablespaces with Incremental Backup Option

Database migration across platforms of different "endian" (byte ordering) formats using the Transportable Tablespaces (TTS) process has been certified for Oracle E-Business Suite Release R12.1 for several years. This certification has recently b

Cross Platform Note: STD C++ Preprocessor directives & pre-defined macros

ref: http://www.cplusplus.com/doc/tutorial/preprocessor/ concolusion: directives: #define #undef #include #if #else #elif #endif #ifdef #ifndef #error ( #warning is NOT A STANDARD DIRECTIVE,  since not shown in the page above, but most compilers have

Cross platform GUI for creating SSL certs with OpenSSL

Someone said: from : https://micksmix.wordpress.com/2012/08/09/xca-cross-platform-gui-for-creating-ssl-certs-with-openssl/ Download: http://sourceforge.net/projects/xca/ There are some of you that know your way around OpenSSL’s options in your sleep,

如何通过RMAN使用传输表空间迁移到不同的Endian平台 (Doc ID 371556.1)

How to Migrate to different Endian Platform Using Transportable Tablespaces With RMAN (Doc ID 371556.1) APPLIES TO: Oracle Database - Enterprise Edition - Version 12.1.0.2 to 12.2.0.1 [Release 12.1 to 12.2]Oracle Database - Enterprise Edition - Versi

perl xttdriver.pl fails: Can't locate Getopt/Long.pm in @INC (Doc ID 1912400.1)

  Copyright (c) 2019, Oracle. All rights reserved. Oracle Confidential.   perl xttdriver.pl fails: Can't locate Getopt/Long.pm in @INC (Doc ID 1912400.1) To Bottom In this Document   Symptoms   Cause   Solution This document is being delivered to you

xtrabackup增量备份恢复

一.安装percona-xtrabackup 1.下载软件 percona-xtrabackup-2.2.10.tar.gz 下载网址 http://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.2.10/source/ 2.修改profile export LD_LIBRARY_PATH=/opt/mysql/lib 3.编译安装 tar zxvf percona-xtrabackup-2.2.10.tar.gz cd pe

Xtrabackup 增量备份、恢复、原理

整合了网上的一些资料,结合自己的理解,并进行了实验验证 理解一: 1,Xtrabackup是什么 Xtrabackup是一个对InnoDB做数据备份的工具,支持在线热备份(备份时不影响数据读写),是商业备份工具InnoDB Hotbackup的一个很好的替代品. Xtrabackup有两个主要的工具:xtrabackup.innobackupex (1).xtrabackup只能备份InnoDB和XtraDB两种数据表,而不能备份MyISAM数据表 (2). innobackupex是参考了In

xtrabackup备份还原mariadb数据库

一.xtrabackup 简介 xtrabackup 是由percona公司开源免费的数据库热备软件,它能对InnoDB数据库和XtraDB存储引擎的数据库非阻塞地备份,对于myisam的备份同样需要加表锁.mysqldump备份方式是通过用户名密码连接到数据库,将其要备份的数据库用SQL语句的形式输出到标准输出,这种逻辑备份的方式最大的缺点是备份和恢复的速度较慢,如果数据库过大,mysqldump备份就显得力不从心了.这时选择用xtrabackup来备份就能很好解决数据库过大而导致备份过慢的问

A quick introduction to Source Insight for seamless development platform between Linux and Windows

前言 Source Insight是一个面向项目开发的程序编辑器和代码浏览器,它拥有内置的对C/C++, C#和Java等程序的分析.能分析源代码并在工作的同时动态维护它自己的符号数据库,并自动显示有用的上下文信息.越是大规模的代码,越能显示出SI的强大之处.Linux服务器开发领域,很多时候代码往往是从Linux主机上copy一份到Windows,然后SI为其创建项目.代码在Windows上修改好后,用WinSCP上传到Linux主机替换源代码,挥着使用Beyond Compare对比合并代码