Migrate the Oracle Database from Linux to Solaris

Migrate the Oracle Database from Linux 5.4 to Solaris 10

 
Following are the Steps performed during migration:

Step 1: We have to install Solaris 10 and after that we have to install oracle 11g on Solaris.
 
Step 2: Verify TDB support for target platform
Before attempting a platform migration with TDB, verify the target platform is supported for TDB by your source platform.
Query the view V$DB_TRANSPORTABLE_PLATFORM for the target platform name. Here is example output from a database on ‘Linux  (32-bit)’ platform.

select platform_name from v$db_transportable_platform;

Step 3:  Target system software version
The target system must have the same Oracle software version and patches installed as the source system.
This includes the same patch set version, critical patch updates, and patch set exceptions.
 
Step 4: Identify external files and directories
Identify directories external to the source database that will need to be created on the target system, and external table files and BFILEs that will need to be moved to the target system.
The PL/SQL function CHECK_EXTERNAL identifies external tables, directories, and BFILEs that need to be moved during the migration so the target database is complete when the process is finished.

Note: If there is any external objects take note of them, they will need to be taken care manually because RMAN cannot automate the transport of such objects. “DBMS_TDB.CHECK_EXTERNAL” must be used to identify any external tables, directories or BFILEs.

SQL> set serveroutput on
SQL> declare
2 external boolean;
3 begin
4 external := dbms_tdb.check_external;
5 end;
6 / 

Step 5: Directory objects must be created on the target system. Query DBA_DIRECTORIES on the source database to determine the filesystem locations that must exist on the target system for the directory objects to be usable.

SQL> select directory_path from dba_directories;

Note: Ensure that each directory listed in the view DBA_DIRECTORIES points to a valid file system directory, or ASM disk group or directory on the target system. Accomplish this by either creating each directory on the target system, or altering the DIRECTORY_PATH to a valid directory when the target database is open after the migration process. Identify external table files that will need to be transferred to the target system when indicated in a later step. Do not add additional external tables to the source database until the platform migration is complete.

Step 6: Identify external table files, run the following query.
 
SQL> select directory_path||q'(/)'||location External_file_path from dba_directories a, dba_external_locations b where a.directory_name=b.directory_name;

Step 7: Identify BFILE files that will need to be transferred to the target system when indicated in a later step. Do not initialize additional BFILEs in the source database until the platform migration is complete. To identify directories that contain BFILEs, run the following SQL script.

SQL>@tdb_get_bfile_dirs.sql

The following directories contain external files for BFILE columns
Copy the files within these directories to the same path on the target system
If it is necessary to list all BFILE external files, then run the script tdb_get_bfiles.sql script from the appendix.
 
Step 8: Start the database in READ ONLY mode
TDB requires that the source database be opened in READ ONLY mode. The source database will be unavailable from this step forward.
Before converting the database, we have to be make sure that whether a database can be transported to a desired destination platform, and whether the current state of the database permits transport. We check this using “DBMS_TDB.CHECK_DB” procedure.
If this procedure returns “FALSE” then the output includes the reason why the database cannot be transported like target platform has a different endian format, database is not open read-only, there are active transactions in the database, database compatibility version is below 10 etc.

SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database open read only;
SQL> set serveroutput on
SQL> declare
2 db_ready boolean;
3 begin
4 db_ready := dbms_tdb.check_db('Solaris Operating System (x86)');
5 end;
6 /
PL/SQL procedure successfully completed.

If database is not open in read-only mode, then the above procedure may return error like “Database is not open READ ONLY. Please open database READ ONLY and retry.”

Step 9: Migration Steps
Run RMAN CONVERT DATABASE on Target
When performing a target system conversion, RMAN creates an RMAN script to be used on the target system to convert all datafiles.

CONVERT DATABASE on target platform NEW DATABASE 'orcl' transport script '/u01/app1/transport_testdb.sql' to platform 'Solaris Operating System (x86)' format '/u01/%U' db_file_name_convert '/u01/app1/oradata/orcl/' '/export/home/oracle/oradata/orcl/';

Step 10. shutdown the database.
rman generate these files copy these files from linux to solaris:
 
Step 11. Move necessary files to target system.
Once the CONVERT DATABASE command is complete transfer  directory and files to the target system using operating system utilities (e.g. ftp, scp).

Login to target ahweb.appshosting.com as oraapex
$ scp -pr root@targetserver.appshosting.com:/tmp/convertdb $HOME/

In addition to the common files listed above, if performing a target system conversion, the above files must be transferred to the target system:
Place the datafiles on the actual location on the target database.

Step 12. Edit init.ora file /u01/app1/init_testdb00j60sqd_1_0.ora. This PFILE will be used to create the database on the target platform.

Step 13. Modify the path of files and folders in init_00o297i_1_0.ora file. And startup the database in nomount stage.

Step 14. Edit then run transport_testdb.sql to create the control file of the database change the location of the files where you want to place these datafiles and other files and run the script
 
Step 15. Now the control file and tmp tablespace and other files are created then startup the database with upgrade option.

Step 16. Then run utlrp.sql to fix INVALID objects

Advertisements

One thought on “Migrate the Oracle Database from Linux to Solaris

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s