Transportable Database from Linux to Windows
Overview : –
- TDB requires that data files be converted to the target platform format.
- The data file conversion can occur on either the source system or the target system. When performing a source system conversion, TDB creates a second copy of all data files on the source system in the format of the target system.
- The converted data files must then be transferred to the
- proper location on the target system.
- Using TDB to migrate a database to a new platform of the same endian format consists of the following high-level steps :
- Check prerequisites
- Prepare for the platform migration
- . Start the database in READ ONLY mode
- Verify the database is ready for migration
- Run the RMAN CONVERT DATABASE command
- Move necessary files to the target system
- Complete the migration
Details :
DETAILS | SOURCE | TARGET |
OS_VERSION | OEL 6.4 | Microsoft Windows(64-bit) |
DB_VERSION | 11.2.0.4 | 12.2.0.1 |
DB_NAME | ORCL | ORCL |
Source Database :- (Linux Platform 64-bit)
check the platform name of current database :
Check the endian format of current platform :
Check that endian format of the target platform
- Windows IA(64-bit) is also little
If the target platform does not appear in the output from V$TRANSPORTABLE_PLATFORM, then the database cannot be migrated using TDB.
Startup database in READ ONLY mode :
Make a folder to hold converted datafiles :
RMAN Transportable Database Method :
Execute DBMS_TDB.CHECK_EXTERNAL function to identify any external tables, directories, or BINARY FILES.RMAN cannot transport of these files, so you must copy the files manually and re-create the database directories.
EXECUTE THE BELOW SCRIPT TO VERIFY THE DATABASE IS READY FOR MIGRATION :
Run the RMAN CONVERT DATABASE Command
The CONVERT DATABASE command specified in the example creates
A transport script named /home/oracle/backup/transporting.sql which contains SQL statements used to create the new database on the destination platform,
A PFILE initorcl.ora in file /home/oracle/backup for use with the new database on the destination platform, containing settings used from the source database.
Several entries at the top of the PFILE should be edited when the database is moved to the destination platform
A copy of all data files in the /home/oracle/backup directory in the format of the target platform Microsoft Windows IA (64-bit)
[oracle@dr dbs]$ rman target /Recovery Manager: Release 11.2.0.4.0 – Production on Wed Feb 19 19:20:32 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1560519435)
RMAN> convert database new database ‘orcl’ transport script ‘/home/oracle/backup/transporting.sql’ to platform ‘Microsoft Windows IA (64-bit)’ format ‘/home/oracle/backup/’ db_file_name_convert ‘/u02/app/oracle/orcl’ ‘/home/oracle/backup/’;
Starting conversion at source at 19-FEB-20
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=17 device type=DISK
External table SH.SALES_TRANSACTIONS_EXT found in the database
Directory SYS.LOG_FILE_DIR found in the database
Directory SYS.DATA_FILE_DIR found in the database
Directory SYS.SS_OE_XMLDIR found in the database
Directory SYS.MEDIA_DIR found in the database
Directory SYS.XMLDIR found in the database
Directory SYS.SUBDIR found in the database
Directory SYS.ORACLE_OCM_CONFIG_DIR2 found in the database
Directory SYS.ORACLE_OCM_CONFIG_DIR found in the database
Directory SYS.DATA_PUMP_DIR found in the database
BFILE PM.PRINT_MEDIA found in the database
User SYS with SYSDBA and SYSOPER privilege found in password file
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00001 name=/u02/app/oracle/orcl/system01.dbf
converted datafile=/home/oracle/backup/system01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00002 name=/u02/app/oracle/orcl/sysaux01.dbf
converted datafile=/home/oracle/backup/sysaux01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00005 name=/u02/app/oracle/orcl/example01.dbf
converted datafile=/home/oracle/backup/example01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00003 name=/u02/app/oracle/orcl/undotbs01.dbf
converted datafile=/home/oracle/backup/undotbs01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00004 name=/u02/app/oracle/orcl/users01.dbf
converted datafile=/home/oracle/backup/users01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
Edit init.ora file /home/oracle/backup/init_.ora. This PFILE will be used to create the database on the target platform
Run SQL script /home/oracle/backup/transporting.sql on the target platform to create database
To recompile all PL/SQL modules, run utlirp.sql and utlrp.sql on the target platform
To change the internal database identifier, use DBNEWID Utility
Finished conversion at source at 19-FEB-20
EDIT THE PFILE
This Pfile is used to create a database on target platform.
Run the SQL Script on the target platform
Copy all the files in /home/oracle/backup folder to D:\app\sathish\orcl
- Datafiles
- Pfile
- Transport script
Move PFILE to $ORACLE_HOME/database
Copy the Pfile file from the folder and move the pfile to $ORACLE_HOME/database
create a service for newdb on windows
oradim -new -sid orcl
Execute the transport script in SQL*Plus to create the new database on the destination host.
- Edit the PFILE to change DB_NAME and necessary directories to create database in TARGET side.
- Change control_files, audit_file_dest,db_name parameters as below:
- Run the TRANSPORTING.SQL file in SQL plus to create new database on TARGET side.It will create control files and redo log files and open database with resetlogs.After open resetlogs,it will also run utlrp.sql and utlirp.sql on target side.
- Check the database status and invalid objects count.
- Check the data is transported to the new database.