Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3327903
  • 博文数量: 631
  • 博客积分: 10716
  • 博客等级: 上将
  • 技术积分: 8397
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-01 22:35
文章分类

全部博文(631)

文章存档

2020年(2)

2019年(22)

2018年(4)

2017年(37)

2016年(22)

2015年(1)

2013年(12)

2012年(20)

2011年(19)

2010年(20)

2009年(282)

2008年(190)

分类: Oracle

2020-04-14 16:43:17

一、准备工作

1.1、平台检查

column platform_name format a30

SQL> select * from V$TRANSPORTABLE_PLATFORM order by 1;

PLATFORM_ID PLATFORM_NAME                            ENDIAN_FORMAT

----------- ---------------------------------------- --------------

          1 Solaris[tm] OE (32-bit)                  Big

          2 Solaris[tm] OE (64-bit)                  Big

          3 HP-UX (64-bit)                           Big

          4 HP-UX IA (64-bit)                        Big

          5 HP Tru64 UNIX                            Little

          6 AIX-Based Systems (64-bit)               Big

          7 Microsoft Windows IA (32-bit)            Little

          8 Microsoft Windows IA (64-bit)            Little

          9 IBM zSeries Based Linux                  Big

         10 Linux IA (32-bit)                        Little

         11 Linux IA (64-bit)                        Little

PLATFORM_ID PLATFORM_NAME                            ENDIAN_FORMAT

----------- ---------------------------------------- --------------

         12 Microsoft Windows x86 64-bit             Little

         13 Linux x86 64-bit                         Little

         15 HP Open VMS                              Little

         16 Apple Mac OS                             Big

         17 Solaris Operating System (x86)           Little

         18 IBM Power Based Linux                    Big

         19 HP IA Open VMS                           Little

         20 Solaris Operating System (x86-64)        Little

         21 Apple Mac OS (x86-64)                    Little

20 rows selected.

 

角色

代号

系统版本

平台名称

字序

2

Solaris11

Solaris[tm] OE (64-bit)                 

Big

目标

13

SUSE 11.2

Linux x86 64-bit              

Little

 

此次为跨字节序的迁移动作。

 

1.2、待传输表空间检查

确定要传输的表空间是否字包含,如果传输多个表空间,中间加逗号。

EXECUTE DBMS_TTS.TRANSPORT_SET_CHECK('TEST1,TEST2,TEST3',true) ;

 

SELECT * FROM TRANSPORT_SET_VIOLATIONS;

 

 

 

1.3、Xtts全量+增量流程


源端上传rman-xttconvert_2.0

 

软件上传目录:

源端          sourcedir   /soft/sourcedir

目标端       targetdir    /soft/targetdir

TMP目录   export TMPDIR=/soft/tempdir/

 

 

1.3.1、xtt.properties

tablespaces=TEST1,TEST2,TEST3,ROCK

platformid=2

dfcopydir=/soft/dfcopydir                         --源端创建

backupformat=/soft/backupformat           --源端创建

stageondest=/soft/stageondest               --目标端创建

storageondest=+DATA/ROCK/datafile

backupondest=+DATA/ROCK/datafile

1.3.1.1、 参数说明:

tablespaces=xttbs,xtidx 要迁移的表空间

platformid=2 source端platform编号,查看V$TRANSPORTABLE_PLATFORM视图

srcdir=/u01/app/oracle/oradata/startrek 与dstdir联合使用,有点像dg中的convert,当数据文件在源端以及target端不一致的时候可以使用

dstdir=/u01/app/oracle/oradata/startrek

dfcopydir=/u01/sourcedir/dfcopy 源端目录,使用rmanbackup的时候,将datafile copy放置在源端的目录

backupformat=/u01/sourcedir/incbk 源端目录,源端增量备份生成的目录

stageondest=/u01/targetdir/datafiledir 目标端目录,源端的datafilecopy 传输到目标段临时存放的目录。(未转换前)

storageondest=/u01/target/rmanbk 目标端目录,datafile copy以及incremental backup 使用-c转换后的目录。正经需要使用的目录,转换后的数据文件会在这个目录生成。如果目标端为asm可以设定为+DATA磁盘组名称。

backupondest=/u01/target/rmaninc 目标段目录,当使用-r roll forward datafiles 阶段,inc backup存放的目录。使用rman incremental recover的时候不需要这个参数。如果目标端为asm可以设定为+DATA磁盘组名称。

 

 

1.3.2、源端首次全量导出

$ORACLE_HOME/perl/bin/perl xttdriver.pl -p

[oracle@node1 sourcedir]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl -p

--------------------------------------------------------------------

Parsing properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Done parsing properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Checking properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Done checking properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Starting prepare phase

--------------------------------------------------------------------

Prepare source for Tablespaces:

                  'TEST1'  /soft/stageondest

xttpreparesrc.sql for 'TEST1' started at Wed Dec 21 17:21:45 2016

xttpreparesrc.sql for  ended at Wed Dec 21 17:21:45 2016

Prepare source for Tablespaces:

                  'TEST2'  /soft/stageondest

xttpreparesrc.sql for 'TEST2' started at Wed Dec 21 17:22:02 2016

xttpreparesrc.sql for  ended at Wed Dec 21 17:22:02 2016

Prepare source for Tablespaces:

                  'TEST3'  /soft/stageondest

xttpreparesrc.sql for 'TEST3' started at Wed Dec 21 17:22:19 2016

xttpreparesrc.sql for  ended at Wed Dec 21 17:22:19 2016

Prepare source for Tablespaces:

                  'ROCK'  /soft/stageondest

xttpreparesrc.sql for 'ROCK' started at Wed Dec 21 17:22:36 2016

xttpreparesrc.sql for  ended at Wed Dec 21 17:22:36 2016

 

--------------------------------------------------------------------

Done with prepare phase

--------------------------------------------------------------------

[oracle@node1 sourcedir]$

 

 

1.3.2.1、脚本说明:

这个脚本执行三个主要步骤

1、Creates datafile copies of the tablespaces that will be transported in the location specified by the xtt.properties parameterdfcopydir.

创建给定表空间相关的数据文件copy到dfcopydir下面。

 

2、Verifies the tablespaces are online, in READ WRITE mode, and do not contain offline datafiles.

验证给定的表空间为online、readwrite、不包含offline的数据文件

 

3、Creates the following files used later in this procedure:

xttplan.txt

rmanconvert.cmd

创建两个相关的文件xttplan.txt,rmanconvert.cmd,存放于TMPDIR下

1.3.3、目标端首次recover

 

·   将源端的xtts目录复制到目标端

·   将源端生成的rmanconvert.cmd   xttplan.txt   复制到目标端TMP目录

·   ROCK_9.tf  TEST1_6.tf  TEST2_7.tf  TEST3_8.tf  复制到目标端/soft/stageondest 目录

 

 

目标端执行下面的语句:

$ORACLE_HOME/perl/bin/perl xttdriver.pl -c

[oracle@node2 targetdir]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl -c

 

--------------------------------------------------------------------

Parsing properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Done parsing properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Checking properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Done checking properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Performing convert

--------------------------------------------------------------------

--------------------------------------------------------------------

Converted datafiles listed in: /soft/tempdir//xttnewdatafiles.txt

--------------------------------------------------------------------

 

1.3.3.1、 原理:

后台执行rman convert命令。

 

1.3.4、源端增量导出

 

$ORACLE_HOME/perl/bin/perl xttdriver.pl -i

 

[oracle@node1 sourcedir]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl -i

 

--------------------------------------------------------------------

Parsing properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Done parsing properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Checking properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Done checking properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Backup incremental

--------------------------------------------------------------------

Prepare newscn for Tablespaces: 'TEST1'

Prepare newscn for Tablespaces: 'TEST2'

Prepare newscn for Tablespaces: 'TEST3'

Prepare newscn for Tablespaces: 'ROCK'

rman target /  cmdfile /soft/tempdir//rmanincr.cmd

 

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Dec 21 17:37:54 2016

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 

connected to target database: ROCK (DBID=3543480518)

 

RMAN> set nocfau;

2> host 'echo ts::TEST1';

3> backup incremental from scn 3184044

4>   tag tts_incr_update tablespace 'TEST1'  format

5>  '/soft/backupformat/%U';

6> set nocfau;

7> host 'echo ts::TEST2';

8> backup incremental from scn 3157358

9>   tag tts_incr_update tablespace 'TEST2'  format

10>  '/soft/backupformat/%U';

11> set nocfau;

12> host 'echo ts::TEST3';

13> backup incremental from scn 3157443

14>   tag tts_incr_update tablespace 'TEST3'  format

15>  '/soft/backupformat/%U';

16> set nocfau;

17> host 'echo ts::ROCK';

18> backup incremental from scn 3157515

19>   tag tts_incr_update tablespace 'ROCK'  format

20>  '/soft/backupformat/%U';

21>

executing command: SET NOCFAU

using target database control file instead of recovery catalog

 

ts::TEST1

host command complete

 

Starting backup at 21-DEC-16

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=228 instance=rock1 device type=DISK

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00006 name=+DATA/rock/datafile/test1.457.931188729

channel ORA_DISK_1: starting piece 1 at 21-DEC-16

channel ORA_DISK_1: finished piece 1 at 21-DEC-16

piece handle=/soft/backupformat/0nro1rbk_1_1 tag=TTS_INCR_UPDATE comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

Finished backup at 21-DEC-16

 

executing command: SET NOCFAU

 

ts::TEST2

host command complete

 

Starting backup at 21-DEC-16

using channel ORA_DISK_1

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00007 name=+DATA/rock/datafile/test2.458.931188743

channel ORA_DISK_1: starting piece 1 at 21-DEC-16

channel ORA_DISK_1: finished piece 1 at 21-DEC-16

piece handle=/soft/backupformat/0oro1rbo_1_1 tag=TTS_INCR_UPDATE comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

Finished backup at 21-DEC-16

 

executing command: SET NOCFAU

 

ts::TEST3

host command complete

 

Starting backup at 21-DEC-16

using channel ORA_DISK_1

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00008 name=+DATA/rock/datafile/test3.459.931188759

channel ORA_DISK_1: starting piece 1 at 21-DEC-16

channel ORA_DISK_1: finished piece 1 at 21-DEC-16

piece handle=/soft/backupformat/0pro1rbs_1_1 tag=TTS_INCR_UPDATE comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

Finished backup at 21-DEC-16

 

executing command: SET NOCFAU

 

ts::ROCK

host command complete

 

Starting backup at 21-DEC-16

using channel ORA_DISK_1

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00009 name=+DATA/rock/datafile/rock.460.931189679

channel ORA_DISK_1: starting piece 1 at 21-DEC-16

channel ORA_DISK_1: finished piece 1 at 21-DEC-16

piece handle=/soft/backupformat/0qro1rbv_1_1 tag=TTS_INCR_UPDATE comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

Finished backup at 21-DEC-16

 

Recovery Manager complete.

 

 

--------------------------------------------------------------------

Done backing up incrementals

--------------------------------------------------------------------

[oracle@node1 sourcedir]$

 

 

 

1.3.4.1、增量生成文件说明

增量脚本执行后会生成如下六个文件:

0nro1rbk_1_1  0oro1rbo_1_1  0pro1rbs_1_1  0qro1rbv_1_1

tsbkupmap.txt

incrbackups.txt

 

[oracle@node1 tempdir]$ cat rmanincr.cmd

set nocfau;

host 'echo ts::TEST1';

backup incremental from scn 3184044

  tag tts_incr_update tablespace 'TEST1'  format

 '/soft/backupformat/%U';

set nocfau;

host 'echo ts::TEST2';

backup incremental from scn 3157358

  tag tts_incr_update tablespace 'TEST2'  format

 '/soft/backupformat/%U';

set nocfau;

host 'echo ts::TEST3';

backup incremental from scn 3157443

  tag tts_incr_update tablespace 'TEST3'  format

 '/soft/backupformat/%U';

set nocfau;

host 'echo ts::ROCK';

backup incremental from scn 3157515

  tag tts_incr_update tablespace 'ROCK'  format

 '/soft/backupformat/%U';

[oracle@node1 tempdir]$

 

-[oracle@node1 tempdir]$ cat tsbkupmap.txt

TEST1::6:::1=0nro1rbk_1_1

TEST3::8:::1=0pro1rbs_1_1

ROCK::9:::1=0qro1rbv_1_1

TEST2::7:::1=0oro1rbo_1_1

 

1.3.5、增量导出传输至目标端

 

将/soft/dfcopydir目录下的增量导出文件copy到target端的stageondest目录下。

将tsbkupmap.txt以及新生成的xttplan.txt.new文件copy到target端的TMPDIR目录

重命名xttplan.txt.new为xttplan.txt

[oracle@node2 tempdir]$ mv xttplan.txt.new xttplan.txt

 

1.3.6、目标端增量导入

 

$ORACLE_HOME/perl/bin/perl xttdriver.pl -r

[oracle@node2 targetdir]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl -r

 

--------------------------------------------------------------------

Parsing properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Done parsing properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Checking properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Done checking properties

--------------------------------------------------------------------

--------------------------------------------------------------------

Start rollforward

--------------------------------------------------------------------

--------------------------------------------------------------------

End of rollforward phase

--------------------------------------------------------------------

1.3.7、源端刷新FROM_SCN

 

源端执行下面的脚本以确定下一次执行incremental backup的 from_scn

$ORACLE_HOME/perl/bin/perl xttdriver.pl -s

 

1.3.8、goto 1.3.4

 

在最后一次增量导出前repeat重复1.3.4至1.3.7的内容。

每次增量前执行:$ORACLE_HOME/perl/bin/perl xttdriver.pl –s

 

 

二、停机时间

2.1、将生产系统待传输表空间设置为readonly

通过脚本生成批量语句,并删除不需要传输的表空间语句:

select ‘alter tablespace ‘||tablespace_name||’ read only;’||from dba_tablespaces;


SQL> alter tablespace xttbs read only ;

Tablespace altered.

SQL> alter tablespace xtidx read only ;

Tablespace altered.

SQL>

 

2.2、执行最后一次增量备份

$ORACLE_HOME/perl/bin/perl xttdriver.pl –i

 

2.3、增量传输

将/soft/dfcopydir目录下的增量导出文件copy到target端的stageondest目录下。

将tsbkupmap.txt以及新生成的xttplan.txt.new文件copy到target端的TMPDIR目录

重命名xttplan.txt.new为xttplan.txt

 

 

2.4、执行最后一次增量恢复

[oracle@dest]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl –r

 

 

2.5、目标端生成impdp脚本

? 如下命令可以生成一个impdp的脚本,适当修改即可。(此处不使用dblink,仅使用以下脚本的transport_datafiles项)

 

[oracle@dest]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl -e

 [oracle@node2 tempdir]$ cat xttplugin.txt

impdp directory= logfile= \

network_link= transport_full_check=no \

transport_tablespaces=TEST1,TEST2,TEST3 \

transport_datafiles='+DATA/rock/datafile/test1_6.xtf','+DATA/rock/datafile/test2_7.xtf','+DATA/rock/datafile/test3_8.xtf'

[oracle@node2 tempdir]$

 

 

 

2.6、源端表空间元数据导出

 

? 创建directory

CREATE DIRECTORY test as ‘/soft/dump’

 

? Expdp导出元数据

[oracle@node1 dump]$ expdp rock/rock dumpfile=test.dump directory=test transport_tablespaces=test1,test2,test3 logfile=dump.log

 

Export: Release 11.2.0.4.0 - Production on Wed Dec 21 18:35:57 2016

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  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

Starting "ROCK"."SYS_EXPORT_TRANSPORTABLE_01":  rock/******** dumpfile=test.dump directory=test transport_tablespaces=test1,test2,test3 logfile=dump.log

Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK

Processing object type TRANSPORTABLE_EXPORT/TABLE

Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK

Master table "ROCK"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded

******************************************************************************

Dump file set for ROCK.SYS_EXPORT_TRANSPORTABLE_01 is:

  /soft/dump/test.dump

******************************************************************************

Datafiles required for transportable tablespace TEST1:

  +DATA/rock/datafile/test1.460.931198205

Datafiles required for transportable tablespace TEST2:

  +DATA/rock/datafile/test2.467.931198253

Datafiles required for transportable tablespace TEST3:

  +DATA/rock/datafile/test3.466.931198319

Job "ROCK"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at Wed Dec 21 18:36:43 2016 elapsed 0 00:00:45

 

[oracle@node1 dump]$ ll

 

 

2.7、源端获取用户创建语句

 

select 'grant dba to '|| username||';' from dba_users;

 

 

SET verify off;
SET termout off;
SET feedback off;
SET echo off;
SET pagesize 0;
SET timeing off;

SET termout on
SELECT 'Creating user build script...' FROM DUAL;
SET termout off;

CREATE TABLE usr_temp( lineno NUMBER,usr_name VARCHAR2(30),text VARCHAR2(80))
/

DECLARE
CURSOR usr_cursor
IS
SELECT username, PASSWORD, default_tablespace, temporary_tablespace,
PROFILE
FROM SYS.dba_users
where username  not in('PUBLIC','GOLDENGATE','DSG','BGR','BGR1','BGR2','QUEST','MGMT_VIEW','SYS','SYSTEM','DBSNMP','SYSMAN','OUTLN','FLOWS_FILES','MDSYS','ORDSYS','EXFSYS','WMSYS','APPQOSSYS','APEX_030200','OWBSYS_AUDIT','ORDDATA','CTXSYS','ANONYMOUS','XDB','ORDPLUGINS','OWBSYS','SI_INFORMTN_SCHEMA','OLAPSYS','SCOTT','ORACLE_OCM','WKSYS','WKPROXY','QS_ADM','QS_WS','QS_OS','QS_CB','QS_CS','QS_CBADM','QS_ES','QS','ODM','ODM_MTR','EDISPLAT','REDOADMIN','XS\$NULL','BI','PM','MDDATA','IX','SH','DIP','OE','APEX_PUBLIC_USER','HR','CPS','DMSYS','TSMSYS','SPATIAL_CSW_ADMIN_USR','SPATIAL_WFS_ADMIN_USR')  ORDER BY username;

CURSOR qta_cursor (c_usr VARCHAR2)
IS
SELECT tablespace_name, max_bytes
FROM SYS.dba_ts_quotas
WHERE username = c_usr;

lv_username SYS.dba_users.username%TYPE;
lv_password SYS.dba_users.PASSWORD%TYPE;
lv_default_tablespace SYS.dba_users.default_tablespace%TYPE;
lv_temporary_tablespace SYS.dba_users.default_tablespace%TYPE;
lv_profile SYS.dba_users.PROFILE%TYPE;
lv_tablespace_name SYS.dba_ts_quotas.tablespace_name%TYPE;
lv_max_bytes SYS.dba_ts_quotas.max_bytes%TYPE;
lv_string VARCHAR2 (80);
lv_lineno NUMBER := 0;

PROCEDURE write_out (p_line INTEGER, p_name VARCHAR2, p_string VARCHAR2)
IS
BEGIN
INSERT INTO usr_temp
(lineno, usr_name, text
)
VALUES (p_line, p_name, p_string
);
END;
BEGIN
OPEN usr_cursor;

LOOP
FETCH usr_cursor
INTO lv_username, lv_password, lv_default_tablespace,
lv_temporary_tablespace, lv_profile;

EXIT WHEN usr_cursor%NOTFOUND;
lv_lineno := 1;
lv_string := ('CREATE USER ' || LOWER (lv_username));
write_out (lv_lineno, lv_username, lv_string);
lv_lineno := lv_lineno + 1;

IF lv_password IS NULL
THEN
lv_string := 'IDENTIFIED EXTERNALLY';
ELSE
lv_string := ('IDENTIFIED BY VALUES ''' || lv_password || '''');
END IF;

write_out (lv_lineno, lv_username, lv_string);
lv_lineno := lv_lineno + 1;
lv_string := 'DEFAULT TABLESPACE ' || lv_default_tablespace;
write_out (lv_lineno, lv_username, lv_string);
lv_lineno := lv_lineno + 1;
lv_string := 'TEMPORARY TABLESPACE ' || lv_temporary_tablespace;
write_out (lv_lineno, lv_username, lv_string);
lv_lineno := lv_lineno + 1;

OPEN qta_cursor (lv_username);

LOOP
FETCH qta_cursor
INTO lv_tablespace_name, lv_max_bytes;

EXIT WHEN qta_cursor%NOTFOUND;
lv_lineno := lv_lineno + 1;

IF lv_max_bytes IS NULL
THEN
lv_string := 'QUOTA UNLIMITED ON ' || lv_tablespace_name;
ELSE
lv_string :=
'QUOTA ' || lv_max_bytes || ' ON ' || lv_tablespace_name;
END IF;

write_out (lv_lineno, lv_username, lv_string);
END LOOP;

CLOSE qta_cursor;

lv_string := ('PROFILE ' || lv_profile || ';');
write_out (lv_lineno, lv_username, lv_string);
lv_lineno := lv_lineno + 1;
lv_string := ' ';
write_out (lv_lineno, lv_username, lv_string);
END LOOP;

CLOSE usr_cursor;
END;
/

SPOOL create_users.sql
SET heading off
SET recsep off
COL test format a80 word_wrap


SELECT text
FROM usr_temp
ORDER BY usr_name, lineno;

SPOOL off;

DROP TABLE usr_temp;
EXIT

 

 

 

2.8、目标端用户创建

?  修改上面生成的脚本并在目标端运行

?  修改用户的默认表空间

select 'alter user '||username||' '||'default tablespace '||default_tablespace||';' from dba_users;



2.9、目标端表空间元数据导入


? 传送表空间元数据导出文件test.dmp到target端的directory目录并执行导入。

 

 

[oracle@node2 tempdir]$ impdp system/manager directory=test logfile=imp.log dumpfile=test.dump transport_datafiles='+DATA/test1_6.xtf','+DATA/test2_7.xtf','+DATA/test3_8.xtf'

 

Import: Release 11.2.0.4.0 - Production on Wed Dec 21 20:41:18 2016

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  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

Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded

Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01":  system/******** directory=test logfile=imp.log dumpfile=test.dump transport_datafiles=+DATA/test1_6.xtf,+DATA/test2_7.xtf,+DATA/test3_8.xtf

Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK

Processing object type TRANSPORTABLE_EXPORT/TABLE

Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK

Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at Wed Dec 21 20:41:26 2016 elapsed 0 00:00:08

 

[oracle@node2 tempdir]$

 

导入结束后相关的表都级联生成

 

 

 

三、TIPS:方案优势及参考文献

优势:停机时间极少

数据库的down机时间取决于最后一次执行incremental的速度。

随着执行incremental的次数的增加down机时间越来越少。

 

参考文档:

11G - Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (文档 ID 1389592.1)


四、排错

1.报Cant find xttplan.txt, TMPDIR undefined at xttdriver.pl line 1185.

?  设定环境变量TMPDIR=/home/oracle/xtts/script 

2.Unable to fetch platform name

?  执行xttdriver.pl之前指定ORACLE_SID

3.Some failure occurred. Check /home/oracle/xtts/script/FAILED for more details

      If you have fixed the issue, please delete /home/oracle/xtts/script/FAILED and run it

      again OR run xttdriver.pl with -L option

?  执行xttdriver.pl报错后,下次执行要删除FAILED文件.

4.Can't locate strict.pm in @INC

?  使用$ORACLE_HOME/perl/bin/perl而不是使用perl


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

转载于:http://blog.itpub.net/29326234/viewspace-2135614/

阅读(1198) | 评论(0) | 转发(0) |
0

上一篇:XTTS跨平台表空间增量迁移

下一篇:没有了

给主人留下些什么吧!~~