In this Document
APPLIES TO:Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and laterOracle Database Exadata Express Cloud Service - Version N/A and later Oracle Database Cloud Service - Version N/A and later Oracle Database - Enterprise Edition - Version 11.2.0.4 and later Oracle Database Cloud Schema Service - Version N/A and later Linux x86-64 Updated 09-Nov-2018 -- Version 4 PURPOSEThis article covers the steps needed to use V4 Cross Platform Transportable Tablespaces (XTTS) with RMAN incremental backups to migrate data between systems that have different endian formats, with the least amount of application down time. The first step will be to copy a full backup from the source to the destination. Then, by using a series of incremental backups, each smaller than the last, the data at the destination system can be brought nearly current with the source system, before any downtime is required. This procedure requires down time only during the final incremental backup, and the meta-data export/import. This document describes the V4 procedures for Cross Platform Incremental Backup which can be used with 11.2.0.4 and higher. This new procedure is simplified version of previous XTTs versions. This version has the following differences:
NOTE: There are a reported issues with multiple incremental backup recovery and large number of datafiles. The recover command creation may cause backups to not be found (ORA-19625) and/or the recovery attempts to apply the backups in the wrong order resulting in:
ORA-19638: file /<path>/<datafile name> is not current enough to apply this incremental backup ORA-19642: start SCN of incremental backup is <scn> ORA-19641: backup datafile checkpoint is SCN <scn> time MM/DD/YYYY HH:MM:SS ORA-19640: datafile checkpoint is SCN <scn> time MM/DD/YYYY HH:MM:SS Review the following for details and workaround: V4 XTTs: Restore Returns Errors (ORA-19625 or ORA-19641) With Large Number of Datafiles (Note 2689397.1)
The Cross Platform Incremental Backup feature does not affect the amount of time it takes to perform other actions for XTTS, such as metadata export and import. Hence, databases that have very large amounts of metadata (DDL) will see limited benefit from Cross Platform Incremental Backup because migration in these environments is typically dominated by metadata operations, not datafile transfer and conversion.
NOTE: Only those database objects that are physically located in the tablespace(s) being transported will be copied to the destination system. Other objects, such as users, pl/sql objects, sequences, views etc., located in the SYSTEM tablespace will not be transported. You will need to pre-create the users and copy such objects to the destination system, possibly using data pump.
The following may help: Oracle Database 12c: Full Transportable Export/Import and/or MAA paper Platform Migration Using Transportable Tablespaces: Oracle Database. The high-level steps for Cross Platform Incremental Backup are: 1. Initial setup 2. Prepare phase (source data remains online)
3. Roll Forward phase (source data remains online - Repeat this phase as many times as necessary to catch destination datafile copies up to source database)
NOTE: In Version 4, added files will automatically be added in the destination with no additional intervention required. I.e., if a datafile is added to the tablespace OR a new tablespace name is added to the xtt.properties file.
4. Transport phase (source data is READ ONLY)
SCOPEThe source system may be any platform provided the prerequisites referenced and listed below for both platform and database are met. DETAILSNOTE: Before proceeding with this procedure, review the following notes to understand all the restrictions and issues associated with the transportable tablespace feature (TTS). All such restrictions/limitations of TTS apply.Transportable Tablespace (TTS) Restrictions and Limitations: Details, Reference, and Version Where Applicable (Note 1454872.1) OverviewThis document provides a procedural example of transporting two tablespaces called TS1 and TS2 from an Oracle Solaris SPARC system to Oracle Linux, incorporating Oracle's Cross Platform Incremental Backup capability to reduce downtime. Prepare Cross Platform Incremental Backup Supporting ScriptsThe Cross Platform Incremental Backup core functionality was delivered in Oracle Database 11.2.0.4 and later. Some of the features in the prior versions (such as using DBMS_FILE_TRANSFER) are not available in this Version 4. If you need such functionality, use the standard procedure for 11g outlined in Note 1389592.1. The procedures outlined in this note applies to both Oracle 11.2.0.4 , 12c and later. See the Requirements and Recommendations section for details. In addition, a set of supporting scripts in the file rman_xttconvert_VER4.zip is attached to this document that are used to manage the procedure required to perform XTTS with Cross Platform Incremental Backup using Version 4. The two primary supporting scripts files are the following:
PrerequisitesThe following prerequisites must be met before starting this procedure:
Whole Database Migration If Cross Platform Incremental Backups will be used to reduce downtime for a whole database migration, then the steps in this document can be combined with the XTTS guidance provided in the MAA paper Platform Migration Using Transportable Tablespaces: Oracle Database. TroubleshootingDebug mode enables additional screen output and causes all RMAN executions to be performed with the debug command line option. To enable debug mode, set the environment variable XTTDEBUG=1 before running xttdriver.pl OR Known Issues
V4 Transport Tablespaces with Reduced Downtime using Cross Platform Incremental BackupThe XTTS with Cross Platform Incremental Backups procedure is divided into the following phases:
Conventions Used in This Document
Phase 1 - Initial SetupPerform the following steps to configure the environment to use Cross Platform Incremental Backups: Step 1.1 - Install the destination database software and create the destination databaseInstall the desired Oracle Database software on the destination system that will run the destination database. Identify (or create) a database on the destination system to transport the tablespace(s) into and create the schema users required for the tablespace transport. I.e., users who own the objects within the tablespaces being transported. Per generic TTS requirement, ensure that the schema users required for the tablespace transport exist in the destination database.
Step 1.2 - Identify tablespaces to be transportedIdentify the tablespace(s) in the source database that will be transported. Tablespaces TS1 and TS2 will be used in the examples in this document. As indicated above, the limitations and considerations for transportable tablespaces must still be followed. Step 1.3 - Install xttconvert scripts on the source systemOn the source system, as the oracle software owner, download and extract the supporting scripts attached as rman_xttconvert_VER4.zip to this document. [oracle@source]$ pwd
/home/oracle/xtt [oracle@source]$ unzip rman_xttconvert_VER4.zip Archive: rman_xttconvert_v3.zip inflating: xtt.properties inflating: xttcnvrtbkupdest.sql inflating: xttdbopen.sql inflating: xttdriver.pl inflating: xttprep.tmpl extracting: xttstartupnomount.sql Step 1.4 - Create necessary directories
Step 1.5 - Configure xtt.properties on the source systemEdit the xtt.properties file on the source system with your site-specific configuration. For more information about the parameters in the xtt.properties file, refer to the Description of Parameters in Configuration File xtt.properties section in the Appendix below. For this procedure, only the following parameters are mandatory. Others are optional and/or available for use.
Step 1.6 - Copy xttconvert scripts and xtt.properties to the destination system<As the oracle software owner copy all xttconvert scripts and the modified xtt.properties file to the destination system. [oracle@source]$ scp -r /home/oracle/xtt oracle@dest:/home/oracle/xtt
Step 1.7 - Set TMPDIR environment variableIn the shell environment on both source and destination systems, set environment variable TMPDIR to the location where the supporting scripts exist. Use this shell to run the Perl script xttdriver.pl as shown in the steps below. If TMPDIR is not set, output files are created in and input files are expected to be in /tmp. [oracle@source]$ export TMPDIR=/home/oracle/xtt
[oracle@dest]$ export TMPDIR=/home/oracle/xtt Phase 2 - Prepare PhaseDuring the Prepare phase, datafiles of the tablespaces to be transported are backed up on source, backups transferred to the destination system and restored by the xttdriver.pl script. NOTE: For large number of files, if you wish to use dbms_file_transfer you will not be able to use V4, you will have to use 11G - Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Note 1389592.1). It has been found to be the fastest method for transferring datafiles to destination. This method can be used by ALL Oracle version migrations wanting to use dbms_file_transfer.
Step 2.1 - Run the backup on the source system
Step 2.2 - Transfer the following files to the destination system:
Step 2.3 - Restore the datafiles on the destination system
Phase 3 - Roll Forward PhaseDuring this phase an incremental backup is created from the source database, transferred to the destination system, converted to the destination system endian format, then applied to the converted destination datafile copies to roll them forward. This phase may be run multiple times. Each successive incremental backup should take less time than the prior incremental backup, and will bring the destination datafile copies more current with the source database. The data being transported (source) is fully accessible during this phase. NOTE: Multiple backups can be executed against the source without applying them to the destination. The backup files and the res.txt must be copied before the '--restore' is executed at the destination.
NOTE: The script will shutdown and startup, in NOMOUNT, the destination database before the --restore. Step 3.1 - Create an incremental backup of the tablespaces being transported on the source system
Step 3.2 - Transfer incremental backups and res.txt to the destination system
Step 3.3 - Apply the incremental backup to the datafile copies on the destination system
Step 3.4 - Repeat the roll forward phase 3 (3.1 - 3.3) or proceed to phase 4, final incremental backup
Phase 4 - Final Incremental Backup -- If you are running 12c, this step can be replaced by Phase 4 in Note 2005729.1:During this phase the source data is made READ ONLY and the destination datafiles are made consistent with the source database by creating and applying a final incremental backup. After the destination datafiles are made consistent, the normal transportable tablespace steps are performed to export object metadata from the source database and import it into the destination database. The data being transported is accessible only in READ ONLY mode until the end of this phase. Step 4.1 - Alter source tablespace(s) to READ ONLY in the source databaseOn the source system, logged in as the oracle user with the environment (ORACLE_HOME and ORACLE_SID environment variables) pointing to the source database, alter the tablespaces being transported to READ ONLY. Step 4.2 - Create the final incremental backup of the tablespaces being transported on the source system:On the source system, logged in as the oracle user with the environment (ORACLE_HOME and ORACLE_SID environment variables) pointing to the source database, run the backup as follows: [oracle@source]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl --backup
NOTE: As the tablespaces are in READ ONLY mode, the following warning received can be ignored:
#################################################################### Warning: ------ Warnings found in executing /home/oracle/convert_source/backup_Nov9_Fri_09_08_26_213//xttpreparenextiter.sql #################################################################### Prepare newscn for Tablespaces: 'SECOND' DECLARE* ERROR at line 1: ORA-20001: TABLESPACE(S) IS READONLY OR, OFFLINE JUST CONVERT, COPY ORA-06512: at line 284 Step 4.3- Transfer incremental backups and res.txt to the destination system[oracle@source]$ scp 'cat incrbackups.txt' oracle@dest:/dest_scratch_location Step 4.4 - Apply last incremental backup to destination datafilesThe final incremental backup must be applied to the destination datafiles: [oracle@dest]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl --restore
This step will apply the last incremental backup to the datafiles on the destination. Phase 5 - Transport Phase: Import Object Metadata into Destination DatabaseNOTE: Be sure the destination database has the necessary objects to allow the import to succeed. This includes pre-creating the owners of the tables in the tablespace being plugged in. See information on Transportable Tablespace and the guidance provided in the MAA paper Platform Migration Using Transportable Tablespaces: Oracle Database 11g.
During this phase, you need an export of the metadata of the tablespaces from the source and plug in the tablespace(s) into the destination. NOTE: This would be skipped if you are running 12c and chose to use "Phase 4 "in Note 2005729.1.
There are two options, running manually or running across sqlnet: OPTION #1. Manually running export and import command.Option1.A: Run datapump export on source database:Perform the tablespace transport by running transportable mode Data Pump export on the source database to export the object metadata being transported into a dump file. The below example assumes a directory (DATA_PUMP_DIR) already exists in the source. For example: [oracle@source]$ cat exp.par
dumpfile=xttdump.dmp directory=DATA_PUMP_DIR statistics=NONE transport_tablespaces=TS1,TS2 transport_full_check=y logfile=tts_export.log [oracle@source]$ expdp system/manager parfile=exp.par Refer to the following manuals for details: Oracle Database Administrator's Guide Option1.B: Transfer the export file to destination directory used by datapump
|
Option | Description |
---|---|
--backup |
Creates a level 0 or level 1 backup of the datafiles belonging to the selected tablespaces. These backups will be written into the location pointed to by the xtt.properties variable “src_scratch_location”. These backups need to be copied over to the destination to the location pointed to by the variable “dest_scratch_location”. |
--restore |
Restores and converts the datafiles from the backups copied to the location “dest_scratch_location” in destination. The restored files will be placed in the path defined by the variable “dest_datafile_location”. |
-e | Generates Data Pump TTS command step is run once on the destination system with the environment (ORACLE_HOME and ORACLE_SID) set to the destination database. This step creates the template of a Data Pump Import command that uses a network_link to import metadata of objects that are in the tablespaces being transported. |
--debug | Enables debug mode for xttdriver.pl and RMAN commands it executes. Debug mode can also be enabled by setting environment variable XTTDEBUG=1. Debug allows for 1,2,3 levels of debug. I.e., xttdriver.pl -debug 3 |
The following table describes the parameters used by xttdriver.pl which must be defined in the xtt.properties file that are needed for this 12c procedure. Other parameters may exist which are needed for backward compatibility.
Parameter | Description | Example Setting |
---|---|---|
tablespaces | Comma-separated list of tablespaces to transport from source database to destination database. Must be a single line, any subsequent lines will not be read. | tablespaces=TS1,TS2 |
platformid | Source database platform id, obtained from V$DATABASE.PLATFORM_ID. | platformid=13 |
dest_datafile_location |
Directory object in the destination database that defines where the destination datafiles will be created. |
dest_datafile_location=/u01/oradata/V122 i.e.: dest_datafile_location=+DATA |
src_scratch_location | Location on the source system where backups are created. This location must have sufficient free space to hold the level=0 backup of the tablespace datafiles and all subsequent incremental backups created for one iteration through the process documented above. This location may be an NFS-mounted filesystem that is shared with the destination system, in which case it should reference the same NFS location as the dest_scratch_location parameter for the destination system. |
scr_scratch_location=/stage_source |
dest_scratch_location | Location on the destination system where backups are placed by the user when they are transferred manually from the source system. This location must have sufficient free space to hold level=0 backup and all subsequent incremental backups transferred from the source. This location may be a DBFS-mounted filesystem. This location may be an NFS-mounted filesystem that is shared with the source system, in which case it should reference the same NFS location as the src_scratch_location parameters for the source system. See Note 359515.1 for mount option guidelines. |
dest_scratch_location=/stage_dest |
asm_home | ORACLE_HOME for the ASM instance that runs on the destination system. |
asm_home=/u01/app/12.2.0.1/grid |
asm_sid | ORACLE_SID for the ASM instance that runs on the destination system. | asm_sid=+ASM1 |
parallel |
Defines the degree of parallelism used in copying (prepare phase), converting. Incremental backup creation parallelism is defined by RMAN configuration for DEVICE TYPE DISK PARALLELISM.
|
parallel=3 |
srcconnstr |
In CDB environment, specifies connect string of the source pluggable database. |
srcconnstr=sys/passwd@sourc_cdb_PDB1 |
destconnstr |
In CDB environment, specifies connect string of the destination pluggable database. |
destconnstr=sys/passwd@dest_cdb_PDB1 |
usermantransport |
Set this parameter to 1 if using 12c to use the 12c functionality. |
usermantransport=1 |
Change | Date |
---|---|
rman_xttconvert_VER4.zip released |
29-Nov-2018 |