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

What is the method of data migration in XTTS cross-platform transfer table space?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "what is the method of realizing data migration in XTTS cross-platform transfer table space". In daily operation, I believe that many people have doubts about the method of realizing data migration in XTTS cross-platform transfer table space. The editor consulted all kinds of materials and sorted out simple and useful operation methods. I hope it will be helpful to answer the question of "what is the method of data migration in XTTS cross-platform transport tablespace?" Next, please follow the editor to study!

I. Overview of XTTS

XTTS (Cross-Platform transport tablespace) means to transfer tablespaces across platforms. XTTS is actually an enhancement to TTS. TTS means transfer tablespace, the principle is to transfer business tablespace from one library to another, in order to achieve the purpose of data migration. XTTS can support cross-platform byte format and incremental transfer (cross-platform transport tablespace only supports oracle 11g or above).

This paper uses xtts v4 version and uses RMAN incremental backup to transfer tablespaces between the two libraries to achieve minimum downtime.

II. Planning

The source library uses RMAN incremental xtts to migrate the tablespace tbs1 & tbs2 to the target library. The whole operation step is divided into preparation stage, roll forward stage and transmission stage.

In the preparation phase, you need to prepare a software package: rman_xttconvert_VER4.zip. After unzipping the zip package, there will be a xttdriver.pl script in it. The functions and parameters of the script are as follows:

III. Transmission restrictions

The main library operating system does not support windows

ü xtts v4 version only supports oracle 11.2.0.4 or above

The compatible parameter of the source library must not be larger than that of the target library (backward compatible), so XTTS can be used for upgrade operations

The source library must be in archiving mode

The default device type of RMAN in the source library needs to be configured as DISK, and COMPRESSED cannot be set in the configuration of RMAN. If so, the following error may be reported:

ORA-19994:cross-platform backup of compressed backups different endianess

The source library RMAN configuration cannot be set to BACKUP TYPE TO COPY, but must be configured as BACKUP TYPE TO BAKCUPSET

U Source Library RMAN configuration cannot be configured the default channel configuration is SBT

The tablespace to be transferred must be online and there must be no offline data file. The tablespace must be read write

If the tablespace is in read only mode, then there is no need to use RMAN increments and DFT to migrate, you can migrate directly in the traditional XTTS way.

ü ASM can only be used for the final storage path on the target side. This version of xtts cannot put backups on ASM.

The oracle user must have read and write access to the location where the backup is stored.

Fourth, clear thinking 1. Preparation stage

1) create a tablespace level 0 backup

2) transfer backup files from the source side to the destination side

3) restore the data file to the target side in the target side byte format

two。 Roll forward phase

1) create incremental backup for source database

2) transfer incremental backups and necessary files to the destination side

3) the target side converts the incremental backup and applies the backup to the target library data file

4) repeat until you are ready for the final tablespace transfer.

3. Transmission stage

1) the tablespace in the source database is set to read only

2) perform the roll forward phase for the last time

3) the target side uses DataPump to import metadata objects

4) the target library sets the tablespace to read write.

Fifth, operation step 1. Initialization setup phase

1) the target side installs the database software and creates the database, which requires that the character set and country set are consistent with the source database, and the version of the database software is not less than that of the source database.

2) confirm that the target library creates the appropriate user and grants permissions

Source database checks user information

SQL > select 'create user' | | username | | 'identified by' | |'| | password | |'| |'; 'from dba_users where default_tablespace in (' TBS1','TBS2')

Source database check role permissions

SQL > select 'grant' | | GRANTED_ROLE | |'to'| | grantee | |'; 'from dba_role_privs where grantee in (select username from dba_users where default_tablespace in (' TBS1','TBS2'))

The target library is created based on the above query results.

3) decompress rman_xttconvert_VER4.zip to the / home/oracle/xtts directory

$cd / home/oracle/xtts

$unzip rman_xttconvert_VER4.zip

4) configure xtt.properties file

Tablespaces=tbs1,tbs2

Platformid=13

Src_scratch_location=/home/oracle/xtts/bak

Dest_datafile_location=+DATA/ORCL/datafile

Dest_scratch_location=/home/oracle/xtts/bak

Asm_home=/u01/app/11.2.0/grid

Asm_sid=+ASM1

Parallel=2

Parameter description:

Create directories for source and target libraries:

$mkdir-p / home/oracle/xtts/bak

5) the source side will transfer all files under / home/oracle/xtts to the destination side

$scp-r / home/oracle/xtts/* 172.16.70.170:/home/oracle/xtts/

6) set TMPDIR on source side and destination side

(oracle user environment variable)

Source library: $export TMPDIR=/home/oracle/xtts

Target library: $export TMPDIR=/home/oracle/xtts

two。 Preparation stage

At this stage, the source tablespace data files are backed up and the backup is transferred to the destination side

1) create backup on the source side

Execute the following command

$perl xttdriver.pl-backup

This command performs the following actions:

-create a backup and place it in the src_scratch_location directory

-create a res.txt file and place it in TMPDIR

2) transfer the files generated in the first step to the destination

$scp res.txt 172.16.70.170:/home/oracle/xtts/

$scp / home/oracle/xtts/bak/* 172.16.70.170:/home/oracle/xtts/bak/

Note: data files should be transferred to the destination dest_scratch_location directory, and res.txt should be transferred to the destination TMPDIR.

3) restore the data file on the target side

Execute the following command

$perl xttdriver.pl-restore

When this step is complete, the data file will be transferred to the final location of the target side dest_datafile_location.

3. Roll forward phase

During this phase, the source database creates an incremental backup and transfers it to the target library. And will be converted to the target library byte format and applied to the target library. This phase can be run multiple times, and each successful incremental backup should take less time than the previous one, and bring the data of the target database closer to the source database.

1) the source database creates an incremental backup set of tablespaces.

The source library executes the following command

$perl xttdriver.pl-backup

This command produces an incremental backup set for the transferred tablespace. The backup set is located in the src_scratch_location directory.

And two files will be generated: tsbkupmap.txt,incrbackups.txt

2) transfer incremental backup sets to the destination side

Transfer the incremental backup set generated in the previous step to the destination dest_scratch_location directory, and the res.txt will be transferred to the destination TMPDIR.

$scp `cat incrbackups.txt` 172.16.70.170:/home/oracle/xtts/bak/

$scp res.txt 172.16.70.170:/home/oracle/xtts/

3) the target side executes the following command

$perl xttdriver.pl-restore

The target applies an incremental backup to the tablespace data file.

4) repeat the roll forward phase (optional)

If you need to bring the target library closer to the source library, you need to repeat the roll forward phase; if the target library is close enough to the source library, proceed directly to the transfer phase.

4. Transmission stage

During the transfer phase, the source database needs to be set to read only mode, and the target database will be applied for the last incremental backup. After the target data file is consistent, a normal step of transferring the tablespace is performed to export the metadata object from the source library and import it into the target library. Until the end of this phase, the source library can only access data through read only.

1) the source database sets the tablespace to read only

SQL > alter tablespace tbs1 read only

SQL > alter tablespace tbs2 read only

2) the source database creates the last incremental backup set

$perl xttdriver.pl-backup

Note: because the tablespace is set to read only, performing a backup warns:

#

Warning:

-

Warnings found in executing / home/oracle/xtts/backup_Jul28_Tue_14_33_57_440//xttpreparenextiter.sql

#

Prepare newscn for Tablespaces: 'TBS2'

DECLARE*

ERROR at line 1:

ORA-20001: TABLESPACE (S) IS READONLY OR

OFFLINE JUST CONVERT, COPY

ORA-06512: at line 284

3) transfer to the destination

$scp `cat incrbackups.txt` 172.16.70.170:/home/oracle/xtts/bak/

$scp res.txt 172.16.70.170:/home/oracle/xtts/

4) the last application on the target side

$perl xttdriver.pl-restore

5) the source database exports metadata

SQL > create directory xtts_dir as'/ home/oracle/xtts/bak'

$expdp system/oracle dumpfile=xtts.dmp directory=xtts_dir logfile=expdp_xtts.log transport_tablespaces=tbs1,tbs2 exclude=statistics

Export other object

$expdp system/oracle directory=xtts_dir dumpfile=expdp_other_mets.dmp logfile=expdp_other_meta.log content=metadata_only schemas=tbs1,tbs2

6) transfer the exported dmp file to the same directory on the destination side

$scp * .dmp 172.16.70.170:/home/oracle/xtts/bak/

7) Target library imports metadata

SQL > create directory xtts_dir as'/ home/oracle/xtts/bak'

$impdp system/oracle dumpfile=xtts.dmp directory=xtts_dir transport_tablespace=y datafiles='+DATA/orcl/datafile/tbs1_5.dbf','+DATA/orcl/datafile/tbs2_6.dbf'

Import other object metadata

$impdp system/oracle dumpfile=expdp_other_mets.dmp directory=xtts_dir

8) the target library sets the tablespace read write

SQL > select tablespace_name,file_name from dba_data_files

SQL > alter tablespace tbs1 read write

SQL > alter tablespace tbs2 read write

9) Target database statistics are collected manually

SQL > exec dbms_stats.gather_schema_stats (ownname = > 'tbs1',options = >' GATHER AUTO')

SQL > exec dbms_stats.gather_schema_stats (ownname = > 'tbs2',options = >' GATHER AUTO')

10) check for physical and logical block corruption and verify data

RMAN > validate tablespace tbs1,tbs2 check logical

Verification data outline

At this point, the study on "what is the method of XTTS cross-platform transfer table space to achieve data migration" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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