Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use DBMS_FILE_TRANSFER to migrate database from AIX to Linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Environment description

Source end

Target end

Operating system

AIX 6100-03-10-1119

RHEL6.5 x64

Cluster

Oracle RAC+ASM

Oracle RAC+ASM

Database version

11.2.0.3.0

11.2.0.4.0

1. Initialization phase

1.1. Source-side database

Source-side database testdb, database version 11.2.0.3.0, running on AIX 64-bit

Db1:/oracle/db/bin$echo $ORACLE_SID

Testdb1

Db1:/oracle/db/bin$echo $ORACLE_HOME

/ oracle/db

SYS@testdb1 > select * from v$version where banner like'%Database%'

BANNER

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0-64bit Production

SYS@testdb1 > select name, platform_id, platform_name fromv$database

NAME PLATFORM_IDPLATFORM_NAME

-

TESTDB 6 AIX-BasedSystems (64-bit)

The tablespace that needs to be migrated is XTTSTEST:

Select t.name "Tablespace", f.file# "File#", f.name "Filename", f.status "Status"

From v$datafile f, v$tablespace t

Where f.ts#=t.ts# and t.name like 'XTTS%'

Order by 1, 2

Tablespace File# Filename Status

-

XTTSTEST 41 + ORADATA/testdb/datafile/xttstest.362.959887907 ONLINE

SYS@testdb1 >

Create a directory SOURCEDIR for DBMS_FILE_TRANSFER on the source side, whose path is to migrate the tablespace data file path

SYS@testdb1 > create directory sourcedir as'+ ORADATA/testdb/datafile'

Directory created.

The source database must be in archive mode

SYS@testdb1 > archive log list

Database log mode Archive Mode

Automatic archival Enabled

Archive destination USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence 11771

Next log sequence to archive 11775

Current log sequence 11775

Set the TMPDR environment variable for oracle users as follows

Export TMPDIR=/home/oracle/tts

Upload rman-xttconvert_2.0.zip to / home/oracle/tts directory and extract it

Db1:/home/oracle/tts$unzip rman-xttconvert_2.0.zip

Archive: rman-xttconvert_2.0.zip

Inflating: xttcnvrtbkupdest.sql

Inflating: xttdbopen.sql

Inflating: xttdriver.pl

Inflating: xttprep.tmpl

Inflating: xtt.properties

Inflating: xttstartupnomount.sql

Configure the xtt.properties file as follows

Db1:/home/oracle/tts$grep ^ [a Murz] xtt.properties

Tablespaces=XTTSTEST

Platformid=6

Srcdir=SOURCEDIR

Dstdir=DESTDIR

Srclink=TTSLINK

Dfcopydir=/home/oracle/stage_source

Backupformat=/home/oracle/stage_source

Stageondest=/home/oracle/stage_dest

Backupondest=+FRA_SB

Asm_home=/testdb/orgrid/oracle/product/112

Asm_sid=+ASM1

Most of the parameters in the xtt.properties file are described and can be configured according to the instructions. It should be noted that platformid must be set to the source-side database platformid, and platformid can be queried from v$database.

After the xtt.properties is configured on the source side, copy it to the destination side:

Db1:/home/oracle$scp-r tts x.x.x.81:/home/oracle

Oracle@x.x.x.81's password:

Rman-xttconvert_2.0.zip 100% 26KB 26.3KB/s 00:00

Xtt.properties 100% 7820 7.6KB/s 00:00

Xttcnvrtbkupdest.sql 100% 1390 1.4KB/s 00:00

Xttdbopen.sql 100% 71 0.1KB/s 00:00

Xttdriver.pl 100% 90KB 89.6KB/s 00:00

Xttprep.tmpl 100% 11KB 11.3KB/s 00:00

Xttstartupnomount.sql 100% 52 0.1KB/s 00:00

Create directories for xtt.properties file parameter configuration on both the source side and the destination side

1.2. Target database

Source-side database testdb, database version 11.2.0.4.0, running on Linux x86 64-bit

[oracle@testdb1 ~] $env | egrep "ORACLE_SID | ORACLE_HOME"

ORACLE_SID=testdb1

ORACLE_HOME=/testdb/ordb/oracle/product/112

SQL > select * from v$version where banner like'% Database%'

BANNER

Oracle Database 11g Enterprise EditionRelease 11.2.0.4.0-64bit Production

SQL > select name, platform_id, platform_name from v$database

NAME PLATFORM_ID PLATFORM_NAME

TESTDB 13 Linux x86 64-bit

It is important to note that the character sets of the source-side and target-side databases must be consistent.

Source side:

SYS@testdb1 > select PARAMETER, VALUE

2 from v$nls_parameters

3 where PARAMETER in ('NLS_CHARACTERSET','NLS_NCHAR_CHARACTERSET')

PARAMETER VALUE

NLS_CHARACTERSET ZHS16GBK

NLS_NCHAR_CHARACTERSET UTF8

Destination side:

SQL > select PARAMETER, VALUE

2 from v$nls_parameters

3 where PARAMETER in ('NLS_CHARACTERSET','NLS_NCHAR_CHARACTERSET')

PARAMETER VALUE

NLS_CHARACTERSET ZHS16GBK

NLS_NCHAR_CHARACTERSET UTF8

Create a database link TTSLINK from the destination side to the source side:

SQL > create public database link ttslink connect to systemidentified by oracle_test using 'source'

Database link created.

SQL > select * from dual@ttslink

D

-

X

Create a directory DESTDIR for DBMS_FILE_TRANSFER on the target side, and its path is the path of the database data file on the target side

SQL > create directory destdir as'+ DATA_SB/dest/datafile'

Directory created.

SQL >

Set the TMPDR environment variable for oracle users as follows

Export TMPDIR=/home/oracle/tts

2. Data file transfer phase

At this stage, the data files of the XTTSTEST tablespace will be transferred from the source database to the target database, and the byte conversion will be completed automatically by the DBMS_FILE_TRANSFER package. This step needs to be performed only once, and the normal access of the source database will not be affected during the data file transfer.

Log in as the oracle user on the source side and set the database and TMPDIR variables.

2.1. Create a transfer script on the source side

Run 'perl xttdriver.pl-slots:

Db1:/home/oracle$cd $TMPDIR

Db1:/home/oracle/tts$$ORACLE_HOME/perl/bin/perl xttdriver.pl-S

Parsing properties

Done parsing properties

Checking properties

Done checking properties

Starting prepare phase

Prepare source for Tablespaces:

'XTTSTEST' / home/oracle/stage_dest

Xttpreparesrc.sql for 'XTTSTEST' started atMon Nov 13 15:00:39 2017

Xttpreparesrc.sql for ended at Mon Nov 13 15:00:39 2017

Prepare source for Tablespaces:

'' / home/oracle/stage_dest

Xttpreparesrc.sql for 'started at Mon Nov13 15:00:39 2017

Xttpreparesrc.sql for ended at Mon Nov 13 15:00:39 2017

Prepare source for Tablespaces:

'' / home/oracle/stage_dest

Xttpreparesrc.sql for 'started at Mon Nov13 15:00:39 2017

Xttpreparesrc.sql for ended at Mon Nov 13 15:00:39 2017

Prepare source for Tablespaces:

'' / home/oracle/stage_dest

Xttpreparesrc.sql for 'started at Mon Nov13 15:00:39 2017

Xttpreparesrc.sql for ended at Mon Nov 13 15:00:39 2017

Prepare source for Tablespaces:

'' / home/oracle/stage_dest

Xttpreparesrc.sql for 'started at Mon Nov13 15:00:39 2017

Xttpreparesrc.sql for ended at Mon Nov 13 15:00:40 2017

Prepare source for Tablespaces:

'' / home/oracle/stage_dest

Xttpreparesrc.sql for 'started at Mon Nov13 15:00:40 2017

Xttpreparesrc.sql for ended at Mon Nov 13 15:00:40 2017

Prepare source for Tablespaces:

'' / home/oracle/stage_dest

Xttpreparesrc.sql for 'started at Mon Nov13 15:00:40 2017

Xttpreparesrc.sql for ended at Mon Nov 13 15:00:40 2017

Prepare source for Tablespaces:

'' / home/oracle/stage_dest

Xttpreparesrc.sql for 'started at Mon Nov13 15:00:40 2017

Xttpreparesrc.sql for ended at Mon Nov 13 15:00:40 2017

Done with prepare phase

This step will generate the following files in the current directory (TMPDIR)

1. Xttplan.txt-containing the tablespacenames, their current SCNs and their datafile numbers:

Db1:/home/oracle/tts$cat xttplan.txt

XTTSTEST::::15718791765461

forty-one

2. Xttnewdatafiles.txt-containing thetablespace names, datafile numbers, the destination directory object name and thesource filenames:

Db1:/home/oracle/tts$catxttnewdatafiles.txt

:: XTTSTEST

41,DESTDIR:/xttstest.362.959887907

3. Getfile.sql-The PL/SQL script (formatting ours) that will be used at the destination to get the datafilesfrom the source:

Db1:/home/oracle/tts$cat getfile.sql

0,SOURCEDIR,xttstest.362.959887907,DESTDIR,xttstest_362_959887907

4. Xttpreparesrc.sql-the PL/SQL scriptused to create the files in this step.

5. XttprepareNaNd-the command script (empty at this step)

2.2. Transfer data files to the destination

Log in as the oracle user on the target side and set the environment variable.

[oracle@testdb1 ~] $env | egrep "ORACLE_SID | ORACLE_HOME"

ORACLE_SID=dest1

ORACLE_HOME=/testdb/ordb/oracle/product/112

Copy xttnewdatafiles.txt and getfile.sql from source side to destination side

[oracle@testdb1 tts] $scp x.x.x.3:/home/oracle/tts/xttnewdatafiles.txt.

The authenticity of host 'x.x.x.3 (x.x.x.3)' can't be established.

RSA key fingerprint is33:f6:00:32:8c:5d:3e:44:5f:1b:e1:61:40:c4:2d:c1.

Are you sure you want to continueconnecting (yes/no)? Yes

Warning: Permanently added 'x.x.x.3' (RSA) to the list of known hosts.

Oracle@x.x.x.3's password:

Xttnewdatafiles.txt 100% 46 0.0KB/s 00:00

[oracle@testdb1 tts] $ls

Rman-xttconvert_2.0.zip xttdbopen.sql xttnewdatafiles.txt xtt.properties

Xttcnvrtbkupdest.sql xttdriver.pl xttprep.tmpl xttstartupnomount.sql

[oracle@testdb1 tts] $ll

Total 156

-rw-r- 1 oracle oinstall 26975 Nov 131503 rman-xttconvert_2.0.zip

-rwxr-xr-x 1 oracle oinstall 1390 Nov 13 15:03 xttcnvrtbkupdest.sql

-rwxr-xr-x 1 oracle oinstall 71 Nov 13 15:03 xttdbopen.sql

-rwxr-xr-x 1 oracle oinstall 91722 Nov 131503 xttdriver.pl

-rw-r--r-- 1 oracle oinstall 46 Nov 13 15:21 xttnewdatafiles.txt

-rwxr-xr-x 1 oracle oinstall 11549 Nov 131503 xttprep.tmpl

-rwxr-xr-x 1 oracle oinstall 7820 Nov 13 15:03 xtt.properties

-rwxr-xr-x 1 oracle oinstall 52 Nov 13 15:03 xttstartupnomount.sql

[oracle@testdb1 tts] $scp x.x.x.3:/home/oracle/tts/getfile.sql.

Oracle@x.x.x.3's password:

Getfile.sql 100% 66 0.1KB/s 00:01

Transfer data files by executing 'xttdriver.pl-G' on the destination side

[oracle@testdb1 tts] $$ORACLE_HOME/perl/bin/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 line0 delimited by end-of-file (wanted `EOF')

Sh: line 6: warning: here-document at line0 delimited by end-of-file (wanted `EOF')

Executing getfile forgetfile_sourcedir_xttstest.362.959887907_0.sql

Completed getting datafiles from source

This step does not produce any output. This step will take most of the time of the database migration because this step will transfer the data files from the source side to the target side.

With the completion of this step, the data files transferred from the source side can be found in the database data file storage directory on the target side.

ASMCMD > ls

FILE_TRANSFER.339.959959381

SYSAUX.259.959957695

SYSTEM.303.959957695

UNDOTBS1.264.959957697

UNDOTBS2.335.959957845

USERS.256.959957697

Xttstest_362_959887907

3. Incremental update backup phase

Incremental update backups are achieved through RMAN incremental backups. However, this phase of incremental backup is achieved through DBMS_FILE_TRANSFER.GET_FILE, not RMANBACKUP AS COPY. In this stage, the incremental backup is created in the source-side database, then transferred to the target-side database, and finally merged with the data files transferred in the second phase.

The steps in this phase can be run multiple times to bring the datafiles in the target closer to the time / SCN of the source file. At this stage, the source database is fully accessible.

3.1. Create incremental backup for source-side database

Log in as the oracle user in the source database, set the environment variable, and execute 'xttdriver.pl-iSuppli':

Db1:/home/oracle/tts$$ORACLE_HOME/perl/bin/perl xttdriver.pl-I

Parsing properties

Done parsing properties

Checking properties

Done checking properties

Backup incremental

Prepare newscn for Tablespaces: 'XTTSTEST'

Prepare newscn for Tablespaces:''

Prepare newscn for Tablespaces:''

Prepare newscn for Tablespaces:''

Prepare newscn for Tablespaces:''

Prepare newscn for Tablespaces:''

Prepare newscn for Tablespaces:''

Prepare newscn for Tablespaces:''

Rman target / cmdfile / home/oracle/tts/rmanincrNaNd

Recovery Manager: Release 11.2.0.3.0-Production on Mon Nov 13 15:14:31 2017

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

Connected to target database: TESTDB (DBID=2896936214)

RMAN > set nocfau

2 > host 'echo ts::XTTSTEST'

3 > backup incremental from scn15718791765461

4 > tag tts_incr_update tablespace 'XTTSTEST' format

5 >'/ home/oracle/stage_source/%U'

6 >

Executing command: SET NOCFAU

Using target database control file insteadof recovery catalog

Ts::XTTSTEST

Host command complete

Starting backup at 2017-11-13 15:14:33

Allocated channel: ORA_DISK_1

Channel ORA_DISK_1: SID=1443 instance=testdb1device type=DISK

Allocated channel: ORA_DISK_2

Channel ORA_DISK_2: SID=1490 instance=testdb1device type=DISK

Allocated channel: ORA_DISK_3

Channel ORA_DISK_3: SID=2 instance=testdb1device type=DISK

Allocated channel: ORA_DISK_4

Channel ORA_DISK_4: SID=98 instance=testdb1device type=DISK

Allocated channel: ORA_DISK_5

Channel ORA_DISK_5: SID=148 instance=testdb1device type=DISK

Allocated channel: ORA_DISK_6

Channel ORA_DISK_6: SID=196 instance=testdb1device type=DISK

Allocated channel: ORA_DISK_7

Channel ORA_DISK_7: SID=244 instance=testdb1device type=DISK

Allocated channel: ORA_DISK_8

Channel ORA_DISK_8: SID=292 instance=testdb1device type=DISK

Backup will be obsolete on date 2017-11-2015 14 14 36

Archived logs will not be kept or backed up

Channel ORA_DISK_1: starting compressedfull datafile backup set

Channel ORA_DISK_1: specifying datafile (s) in backup set

Input datafile file number=00041name=+ORADATA/testdb/datafile/xttstest.362.959887907

Channel ORA_DISK_1: starting piece 1 at2017-11-13 15:14:36

Channel ORA_DISK_1: finished piece 1 at2017-11-13 15:14:43

Piece handle=/home/oracle/stage_source/k8sjfjqs_1_1tag=TTS_INCR_UPDATE comment=NONE

Channel ORA_DISK_1: backup set complete,elapsed time: 00:00:07

Using channel ORA_DISK_1

Using channel ORA_DISK_2

Using channel ORA_DISK_3

Using channel ORA_DISK_4

Using channel ORA_DISK_5

Using channel ORA_DISK_6

Using channel ORA_DISK_7

Using channel ORA_DISK_8

Backup will be obsolete on date 2017-11-2015 1414

Archived logs will not be kept or backed up

Channel ORA_DISK_1: starting compressedfull datafile backup set

Channel ORA_DISK_1: specifying datafile (s) in backup set

Including current control file in backupset

Channel ORA_DISK_1: starting piece 1 at2017-11-13 15:14:44

Channel ORA_DISK_1: finished piece 1 at2017-11-13 15:14:45

Piece handle=/home/oracle/stage_source/k9sjfjr3_1_1tag=TTS_INCR_UPDATE comment=NONE

Channel ORA_DISK_1: backup set complete,elapsed time: 00:00:01

Finished backup at 2017-11-13 15:14:45

Recovery Manager complete.

Done backing up incrementals

Db1:/home/oracle/tts$

This step creates the following files in the current directory (TMPDIR):

1. Tsbkupmap.txt-containing thetablespace names, datafile numbers and the incremental backup pieces:

Db1:/home/oracle/tts$cat tsbkupmap.txt

XTTSTEST::41:::1=k8sjfjqs_1_1

2. Incrbackups.txt-containing the actuallocation of the incremental backup pieces:

Db1:/home/oracle/tts$cat incrbackups.txt

/ home/oracle/stage_source/k8sjfjqs_1_1

3. RmanincrNaNd-containing the RMANscripts used to create the incremental backups.

4. Xttdetnewfromscnsrc.sql-the PL/SQLscript used to create the files in this step

5. Xttplan.txt.new- after the first run of'xttdriver.pl-I 'this is just a copy of the xttplan.txt

3.2. Transfer incremental backup to the destination side

Transfer incremental backup to the stageondest directory on the destination side

Db1:/home/oracle/tts$scp `cat incrbackups.txt` x.x.x.81:/home/oracle/stage_dest

Oracle@x.x.x.81's password:

K8sjfjqs_1_1 100% 88KB 88.0KB/s 00:00

Db1:/home/oracle/tts$

3.3. Apply incremental backup on the destination side

Log in as the oracle user on the target side and set the environment variable. Copy the xttplan.txt and tsbkupmap.txt files from the source side.

[oracle@testdb1 ~] $cd $TMPDIR

[oracle@testdb1 tts] $scp x.x.x.3:/home/oracle/tts/xttplan.txt.

Oracle@x.x.x.3's password:

Xttplan.txt 100% 30 0.0KB/s 00:00

[oracle@testdb1 tts] $scp x.x.x.3:/home/oracle/tts/tsbkupmap.txt.

Oracle@x.x.x.3's password:

Tsbkupmap.txt 100% 30 0.0KB/s 00:00

Run 'xttdriver.pl-ringing' to merge the incremental backup with the data files transferred from the second phase

[oracle@testdb1 tts] $$ORACLE_HOME/perl/bin/perl xttdriver.pl-r

Parsing properties

Done parsing properties

Checking properties

Done checking properties

Start rollforward

!

Error:

-

/ tmp/xxttconv_k3sjf6tk_1_1_41.sql executionfailed

!

Run the sql script directly:

[oracle@testdb1 staging] $sqlplus-L-s "/ as sysdba" @ / tmp/xxttconv_k3sjf6tk_1_1_41.sql/home/oracle/tts/staging/k3sjf6tk_1_1 / home/oracle/tts/backupondest 6

ERROR IN CONVERSION ORA-19994: Message19994 not found; product=RDBMS

Facility=ORA

ORA-19600: input file is backup piece

(/ home/oracle/tts/staging/k3sjf6tk_1_1)

ORA-19601: output file is backup piece

(/ home/oracle/tts/backupondest/xib_k3sjf6tk_1_1_41)

CONVERTED BACKUPPIECE/home/oracle/tts/backupondest/xib_k3sjf6tk_1_1_41

PL/SQL procedure successfully completed.

If there is still an error, refer to the following file. The rmant backup of the source database cannot start compress.

ORA-19837: INVALID BLOCKSIZE 0 IN BACKUPPIECE HEADER USING RMAN TTS BACKUPS DOING RECOVER (document ID 1486655.1)

[oracle@testdb1 tts] $$ORACLE_HOME/perl/bin/perl xttdriver.pl-r

=

Trace file is/home/oracle/tts/rollforward_Nov13_Mon_17_14_36_931//Nov13_Mon_17_14_36_931_.log

=

Parsing properties

Done parsing properties

Checking properties

Done checking properties

Start rollforward

Can't locate DBI.pm in @ INC (@ INC contains: / testdb/orgrid/oracle/product/112/perl/lib/5.10.0/x86_64-linux-thread-multi/testdb/orgrid/oracle/product/112/perl/lib/5.10.0 / testdb/orgrid/oracle/product/112/perl/lib/site_perl/5.10.0/x86_64-linux-thread-multi/testdb/orgrid/oracle/product/112/perl/lib/site_perl/5 . 10.0/testdb/ orgrid/oracle/product/112/lib/testdb/orgrid/oracle/product/112/lib/asmcmd / testdb/orgrid/oracle/product/112/rdbms/lib/asmcmd/testdb/ordb/oracle/product/112/perl/lib/5.10.0/x86_64-linux-thread-multi / testdb/ordb/oracle/product/112/perl/lib/5.10.0/testdb/ordb/oracle/product/112/perl/lib / testdb/orgrid/oracle/product/112 / perl/lib/5.10.0/x86_64-linux-thread-multi/testdb/orgrid/oracle/product/112/perl/lib/5.10.0 / testdb/orgrid/oracle/product/112/perl/lib/site_perl/5.10.0/x86_64-linux-thread-multi/testdb/orgrid/oracle/product/112/perl/lib/site_perl/5.10.0 / testdb/orgrid/oracle/product/112/perl/lib/5.10.0/x86 _ 64-linux-thread-multi/testdb/orgrid/oracle/product/112/perl/lib/5.10.0/x86_64-linux-thread-multi / testdb/orgrid/oracle/product/112/perl/lib/5.10.0/testdb/orgrid/oracle/product/112/perl/lib/site_perl/5.10.0/x86_64-linux-thread-multi/testdb/orgrid/oracle/product/112/perl/lib/site_perl/5.10.0 / testdb/orgrid / oracle/product/112/perl/lib/site_perl.) At / testdb/orgrid/oracle/product/112/lib/asmcmdshare.pm line 205.

BEGIN failed--compilation aborted at / testdb/orgrid/oracle/product/112/lib/asmcmdshare.pmline 205.

Compilation failed in require at / testdb/orgrid/oracle/product/112/bin/asmcmdcoreline 147.

BEGIN failed--compilation aborted at / testdb/orgrid/oracle/product/112/bin/asmcmdcoreline 147.

End of rollforward phase

The "Can't locate DBI.pm in @ INC" error can be ignored as a result of Perl pragma's use of "strict mode" in asmcmdcore.

The incremental backup in this step will be placed in the backup target directory and merged with the copy of the data file. This operation will restart the database and start only one database instance on the target side in the RAC environment.

You can view backup data in the backup target directory:

Grep ^ backupondest xtt.properties

Backupondest=+fra_sb

ASMCMD > ls

Nnndn0_0.256.959966091

Nnndn0_0.257.959966945

ASMCMD > pwd

+ fra_sb/dest/backupset/2017_11_13

3.4. Determine the starting SCN of the next incremental backup

The source side logs in as oracle user, sets the environment variable, and executes' xttdriver.pl-s'

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

Prepare newscn for Tablespaces: 'XTTSTEST'

New / home/oracle/tts/xttplan.txt with FROMSCN's generated

The original xttplan.txt of this step will be backed up as xttplan.txt, and the initial SCN will be recorded in xttplan.txt. If necessary, execute 'xttdriver.pl-I' for the next incremental backup.

The third phase can be executed multiple times, and each execution requires running 'xttdriver.pl-xttplan.txt', copying incremental backup files, xttplan.txt, and tsbkupmap.txt to the destination side, running 'xttdriver.pl-rushing' on the target side, and finally running 'xttdriver.pl-s' on the source side.

This operation does not repeat the implementation of phase 3, direct implementation of phase 4.

4. Complete the tablespace transfer phase

At this stage, the source-side data files are in read-only mode, and the destination-side data files create and merge the final incremental backup consistent with the source-side data files. Finally, the tablespace metadata is transferred and imported into the target database. The source-side database tablespace is set to read-only mode until this phase is complete.

4.1. set the tablespace to READ ONLY

Log in as the oracle user on the source side and set the environment variable to set the XTTSTEST tablespace to READ ONLY mode.

SYS@testdb1 > alter tablespace xttstest read only

Tablespace altered.

4.2. Last incremental backup

Source side:

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

$scp `cat incrbackups.txt` x.x.x.81:/home/oracle/stage_dest

Destination side:

[oracle@testdb1 tts] $scp x.x.x.3:/home/oracle/tts/xttplan.txt.

Oracle@x.x.x.3's password:

Xttplan.txt 100% 32 0.0KB/s 00:00

[oracle@testdb1 tts] $scp x.x.x.3:/home/oracle/tts/tsbkupmap.txt.

Oracle@x.x.x.3's password:

Tsbkupmap.txt 100% 30 0.0KB/s 00:00

[oracle@testdb1 tts] $

4.3. Final incremental backup merge

[oracle@testdb1 tts] $$ORACLE_HOME/perl/bin/perl xttdriver.pl-r

=

Trace file is / home/oracle/tts/rollforward_Nov13_Mon_17_28_50_404//Nov13_Mon_17_28_50_404_.log

=

Parsing properties

Done parsing properties

Checking properties

Done checking properties

Start rollforward

Can't locate DBI.pm in @ INC (@ INC contains:/testdb/orgrid/oracle/product/112/perl/lib/5.10.0/x86_64-linux-thread-multi / testdb/orgrid/oracle/product/112/perl/lib/5.10.0/testdb/orgrid/oracle/product/112/perl/lib/site_perl/5.10.0/x86_64-linux-thread-multi/testdb/orgrid/oracle/product/112/perl/lib/site_perl/5. 10.0/testdb/ orgrid/oracle/product/112/lib/testdb/orgrid/oracle/product/112/lib/asmcmd / testdb/orgrid/oracle/product/112/rdbms/lib/asmcmd/testdb/ordb/oracle/product/112/perl/lib/5.10.0/x86_64-linux-thread-multi / testdb/ordb/oracle/product/112/perl/lib/5.10.0/testdb/ordb/oracle/product/112/perl/lib / testdb/orgrid/oracle/product/112/ Perl/lib/5.10.0/x86_64-linux-thread-multi/testdb/orgrid/oracle/product/112/perl/lib/5.10.0 / testdb/orgrid/oracle/product/112/perl/lib/site_perl/5.10.0/x86_64-linux-thread-multi/testdb/orgrid/oracle/product/112/perl/lib/site_perl/5.10.0 / testdb/orgrid/oracle/product/112/perl/lib/5.10.0/x86_ 64-linux-thread-multi/testdb/orgrid/oracle/product/112/perl/lib/5.10.0/x86_64-linux-thread-multi / testdb/orgrid/oracle/product/112/perl/lib/5.10.0/testdb/orgrid/oracle/product/112/perl/lib/site_perl/5.10.0/x86_64-linux-thread-multi/testdb/orgrid/oracle/product/112/perl/lib/site_perl/5.10.0 / testdb/orgrid/ Oracle/product/112/perl/lib/site_perl.) At / testdb/orgrid/oracle/product/112/lib/asmcmdshare.pm line 205.

BEGIN failed--compilation aborted at / testdb/orgrid/oracle/product/112/lib/asmcmdshare.pmline 205.

Compilation failed in require at / testdb/orgrid/oracle/product/112/bin/asmcmdcoreline 147.

BEGIN failed--compilation aborted at / testdb/orgrid/oracle/product/112/bin/asmcmdcoreline 147.

End of rollforward phase

[oracle@testdb1 tts] $

4.4. Import transport tablespace metadata

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

=

Trace file is/home/oracle/tts/generate_Nov13_Mon_17_29_45_222//Nov13_Mon_17_29_45_222_.log

=

Parsing properties

Done parsing properties

Checking properties

Done checking properties

Generating plugin

Done generating plugin file/home/oracle/tts/xttplugin.txt

[oracle@testdb1 tts] $more / home/oracle/tts/xttplugin.txt

Impdp directory=logfile=\

Network_link=transport_full_check=no\

Transport_tablespaces=XTTSTEST\

Transport_datafiles='+DATA_SB/dest/datafile/xttstest_362_959887907'

Impdp "'/ as sysdba'" directory=dump_dirlogfile=tts_imp.log network_link=ttslink transport_full_check=notransport_tablespaces=XTTSTESTtransport_datafiles='+DATA_SB/dest/datafile/xttstest_362_959887907'

SQL > create user xttstest identified by xttstest

User created.

SQL > grant connect,resource to xttstest

Grant succeeded.

SQL > exit

Disconnected from Oracle Database 11gEnterprise Edition Release 11.2.0.4.0-64bit Production

With the Partitioning, Real ApplicationClusters, Automatic Storage Management, OLAP

Data Mining and Real Application Testingoptions

[oracle@testdb1 tts] $impdp "'/ as sysdba'" directory=dump_dir logfile=tts_imp.log network_link=ttslinktransport_full_check=no transport_tablespaces=XTTSTESTtransport_datafiles='+DATA_SB/dest/datafile/xttstest_362_959887907'

Import: Release 11.2.0.4.0-Production onMon Nov 13 17:32:25 2017

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

Connected to: Oracle Database 11gEnterprise Edition Release 11.2.0.4.0-64bit Production

With the Partitioning, Real ApplicationClusters, Automatic Storage Management, OLAP

Data Mining and Real Application Testingoptions

Starting "SYS". "SYS_IMPORT_TRANSPORTABLE_01": "/ * AS SYSDBA" directory=dump_dir logfile=tts_imp.log network_link=ttslinktransport_full_check=no transport_tablespaces=XTTSTESTtransport_datafiles=+DATA_SB/dest/datafile/xttstest_362_959887907

Source timezone is + 08:00 and target timezone is + 00:00.

Processing object typeTRANSPORTABLE_EXPORT/PLUGTS_BLK

Processing object typeTRANSPORTABLE_EXPORT/TABLE

Processing object typeTRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK

Job "SYS". "SYS_IMPORT_TRANSPORTABLE_01" successfully completedat Mon Nov 13 17:32:51 2017 elapsed 0 00:00:25

4.5. Target tablespace check

[oracle@testdb1tts] $sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production onMon Nov 13 17:34:22 2017

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

Connected to:

Oracle Database 11g Enterprise EditionRelease 11.2.0.4.0-64bit Production

With the Partitioning, Real ApplicationClusters, Automatic Storage Management, OLAP

Data Mining and Real Application Testingoptions

SQL > alter tablespace xttstest readwrite

Tablespace altered.

SQL > conn xttstest/xttstest

Connected.

SQL > select table_name from user_tables

TABLE_NAME

-

TEST

XTTS_OBJECTS

XTTS_INDEX

XTTS_TABLES

XTTS_JOB

SQL > select count (1) from test

COUNT (1)

-

four

SQL >

Reference:

Https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=176801744221976&id=1902618.1&_afrWindowMode=0&_adf.ctrl-state=b39z5avbw_124

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report