Cross-platform cross-version database migration using RMAN in the same byte sequence

Source: Internet
Author: User

Cross-platform cross-version database migration using RMAN in the same byte sequence

Cross-platform transmission Database
RMAN's convert database command is used to move the entire database from one platform to another. When the source platform and the target platform are in the same byte sequence, RMAN automatically completes most operations for creating a new database on the target platform. The convertdatabase command takes a long time to process when the database is transferred across platforms. The convert database command of RMAN can be executed on the source or target platform, just like the tablespace to be transmitted.

When the database is transferred across platforms, files are automatically transmitted to the target platform. These files include:
1. it is a data file of a permanent tablespace. Note that no matter whether the source platform and the target platform have the same byte order, data files of the database to be transferred must be converted. data files cannot be copied from one platform to another. Unlike the cross-platform table space, data blocks of specific types, such as undo segments, must be reformatted to ensure compatibility with the target platform.

2. If PFILE is used, the PFILE will be transmitted. If SPFILE is used, PFILE is generated and transmitted Based on SPFILE, and a new SPFILE is generated based on PFILE on the target platform. Note: In most cases, some parameters in the PFILE file need to be manually modified for the new database. For example, db_name, control_files

Cross-platform database transmission restrictions
The primary limit for cross-platform database transmission is that the source and target platforms must have the same byte order. For example, when a database is transferred from a Windows platform to a Linux platform (both in small byte order) or from a HP-UX to AIX (both in large byte order ), the entire database cannot be transferred from the HP-UX to the Linux platform. However, you can create a new database on the target platform and use the tablespace transfer function to transmit the required tablespace from the source database to the target database using cross-platform and cross-byte sequence.

-------------------------------------- Recommended reading --------------------------------------

RMAN: Configure an archive log deletion policy

Basic Oracle tutorial-copying a database through RMAN

Reference for RMAN backup policy formulation

RMAN backup learning notes

Oracle Database Backup encryption RMAN Encryption

-------------------------------------- Split line --------------------------------------

Perform conversion on the source platform
Migrate the database jingyong (10.2.0.1) on the 32-bit windows platform to the 32-bit Linux platform (10.2.0.5 ). The steps for running the RMAN convert database operation on the source platform are as follows:
1. Open the source database in read-only mode
C: \ Users \ Administrator> sqlplus/as sysdba

SQL * Plus: Release 10.2.0.1.0-Production on Tuesday March 31 15:08:36 2015

Copyright (c) 1982,200 5, Oracle. All rights reserved.


Connect:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate
The database has been closed.
The database has been detached.
The ORACLE routine has been disabled.
SQL> startup mount
The ORACLE routine has been started.

Total System Global Area 419430400 bytes
Fixed Size 1249320 bytes
Variable Size 125833176 bytes
Database Buffers 285212672 bytes
Redo Buffers 7135232 bytes
The database has been loaded.
SQL> alter database open read only;

The database has been changed.

 

2. Run dbms_tdb.check_db check on the source database.
SQL> set serveroutput on
SQL> declare
2 db_ready boolean;
3 begin
4 db_ready: = dbms_tdb.check_db ('linux IA (32-bit) ', dbms_tdb.skip_readonly );
5 end;
6/

PL/SQL procedure successfully completed


3. Execute dbms_tdb.check_external on the source database to identify external objects.
SQL> set serveroutput on;
SQL> declare
2 external boolean;
3 begin
4 external: = dbms_tdb.check_external;
5 end;
6/

The following external tables exist in the database:
SH. SALES_TRANSACTIONS_EXT
The following directories exist in the database:
SYS. TEST_DUMP, SYS. SUBDIR, SYS. XMLDIR, SYS. MEDIA_DIR, SYS. LOG_FILE_DIR, SYS. DATA_FILE_DIR, SYS. WORK_DIR, SYS. ADMIN_DIR, SYS. DATA_PUMP_DIR
The following BFILEs exist in the database:
PM. PRINT_MEDIA

PL/SQL procedure successfully completed


4. Run the convert database command to specify the name of the target platform and output file. RMAN generates files to be moved to the target platform, including the following files:
-- Complete database data file copy
-- The New PFILE parameter file used on the target platform, including the settings from the source database PFILE or SPFILE. Before using the target platform, modify the settings.
-- Transfer scripts, including SQL statements used to create a new database on the Target Platform
RMAN> convert database new database 'jingyong'
2> transport script 'e: \ oradata \ transport \ transport_db_script. SQL'
3> to platform 'linux IA (32-bit )'
4> db_file_name_convert ('e: \ oradata \ JINGYONG \ datafile', 'e: \ oradata \ transport ','
E: \ oradata \ JINGYONG ', 'e: \ oradata \ transport ');

Start convert from March 3 to march 15
Use the target database control file to replace the recovery directory
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: sid = 152 devtype = DISK

Find the External table SH. SALES_TRANSACTIONS_EXT in the database.

Find the SYS. TEST_DUMP directory in the database.
Find the SYS. SUBDIR directory in the database.
Find the SYS. XMLDIR directory in the database.
Find the SYS. MEDIA_DIR directory in the database.
Find the SYS. LOG_FILE_DIR directory in the database.
Find the SYS. DATA_FILE_DIR directory in the database.
Find the SYS. WORK_DIR directory in the database.
Find the SYS. ADMIN_DIR directory in the database.
Find the SYS. DATA_PUMP_DIR directory in the database.

Find bfile pm. PRINT_MEDIA in the database

Find the user SYS in the password file (with SYSDBA and SYSOPER permissions)
Channel ORA_DISK_1: starts data file conversion
Input data file fno = 00001 name = E: \ ORADATA \ JINGYONG \ DATAFILE \ O1_MF_SYSTEM_BKLLOT8Z _.
DBF
Converted data file = E: \ ORADATA \ TRANSPORT \ O1_MF_SYSTEM_BKLLOT8Z_.DBF
Channel ORA_DISK_1: the data file has been converted, after 00:00:25
Channel ORA_DISK_1: starts data file conversion
Input data file fno = 00003 name = E: \ ORADATA \ JINGYONG \ DATAFILE \ O1_MF_SYSAUX_BKLLOTFL _.
DBF
Converted data file = E: \ ORADATA \ TRANSPORT \ O1_MF_SYSAUX_BKLLOTFL_.DBF
Channel ORA_DISK_1: the data file has been converted, after 00:00:16
Channel ORA_DISK_1: starts data file conversion
Input data file fno = 00005 name = E: \ ORADATA \ JINGYONG \ DATAFILE \ O1_MF_EXAMPLE_BKLLRKG2 _
. DBF
Converted data file = E: \ ORADATA \ TRANSPORT \ omfmf_example_bkllrkg2_.dbf
Channel ORA_DISK_1: the data file has been converted, after 00:00:07
Channel ORA_DISK_1: starts data file conversion
Input data file fno = 00006 name = E: \ ORADATA \ JINGYONG \ TSPITR01.DBF
Converted data file = E: \ ORADATA \ TRANSPORT \ TSPITR01.DBF
Channel ORA_DISK_1: the data file has been converted, after 00:00:03
Channel ORA_DISK_1: starts data file conversion
Input data file fno = 00007 name = E: \ ORADATA \ JINGYONG \ TEST01.DBF
Converted data file = E: \ ORADATA \ TRANSPORT \ TEST01.DBF
Channel ORA_DISK_1: the data file has been converted, after 00:00:03
Channel ORA_DISK_1: starts data file conversion
Input data file fno = 00002 name = E: \ ORADATA \ JINGYONG \ DATAFILE \ O1_MF_UNDOTBS1_BKLLOTM0
_. DBF
Converted data file = E: \ ORADATA \ TRANSPORT \ O1_MF_UNDOTBS1_BKLLOTM0_.DBF
Channel ORA_DISK_1: the data file has been converted, after 00:00:03
Channel ORA_DISK_1: starts data file conversion
Input data file fno = 00004 name = E: \ ORADATA \ JINGYONG \ DATAFILE \ O1_MF_USERS_BKLLOTM6_.D
BF
Converted data file = E: \ ORADATA \ TRANSPORT \ O1_MF_USERS_BKLLOTM6_.DBF
Channel ORA_DISK_1: the data file has been converted, after 00:00:01
Run the SQL script E: \ ORADATA \ TRANSPORT \ TRANSPORT_DB_SCRIPT. SQL on the target platform.
Database
Edit the init. ora file D: \ ORACLE \ PRODUCT \ 10.2.0 \ DB_1 \ DATABASE \ init_00q37gus_00000.ora.
. This PFILE will be used to create database data on the Target Platform
To recompile all PL/SQL modules, run utlirp. SQL and utlrp. SQL on the target platform.
To change the internal database identifier, use the DBNEWID Utility
Backup completed from month 3 to month 15

 

5. transfer all files generated by the conversion operation to the directory where the database files are stored on the target host. After the convert database is executed, the source database can be opened in read/write mode, all generated files will be transmitted to the target host.
Ftp> put init_00q37gus_00000.ora
200 PORT command successful. Consider using PASV.
150 OK to send data.
226 File receive OK.
Ftp: Send 1415 bytes, with 0.00 KB/second in 1415.00 seconds.
Ftp> put O1_MF_EXAMPLE_BKLLRKG2_.DBF
200 PORT command successful. Consider using PASV.
150 OK to send data.
226 File receive OK.
Ftp: Send 104865792 bytes, with 8.57 KB/second in 12233.53 seconds.
Ftp> put O1_MF_SYSTEM_BKLLOT8Z_.DBF
200 PORT command successful. Consider using PASV.
150 OK to send data.
226 File receive OK.
Ftp: Send 503324672 bytes, with 49.54 KB/second in 10160.38 seconds.
Ftp> put TSPITR01.DBF
200 PORT command successful. Consider using PASV.
150 OK to send data.
226 File receive OK.
Ftp: Send 52436992 bytes, with 4.46 KB/second in 11762.45 seconds.
Ftp> put TEST01.DBF
200 PORT command successful. Consider using PASV.
150 OK to send data.
226 File receive OK.
Ftp: Send 52436992 bytes, with 3.48 KB/second in 15050.80 seconds.
Ftp> put O1_MF_UNDOTBS1_BKLLOTM0_.DBF
200 PORT command successful. Consider using PASV.
150 OK to send data.
226 File receive OK.
Ftp: Send 31465472 bytes, with 2.05 KB/second in 15341.53 seconds.
Ftp> put O1_MF_USERS_BKLLOTM6_.DBF
200 PORT command successful. Consider using PASV.
150 OK to send data.
226 File receive OK.
Ftp: Send 5251072 bytes, with 0.20 KB/second in 26520.57 seconds.
Ftp> put TRANSPORT_DB_SCRIPT. SQL
200 PORT command successful. Consider using PASV.
150 OK to send data.
226 File receive OK.
Ftp: Send 2582 bytes, with 0.00 KB/second in 2582000.00 seconds.
Ftp> put O1_MF_SYSAUX_BKLLOTFL_.DBF
200 PORT command successful. Consider using PASV.
150 OK to send data.
226 File receive OK.
Ftp: Send 251666432 bytes, with 19.63 KB/second in 12817.89 seconds.


[Oracle @ oracle11g jingyong] $ ls-lrt
Total 978976
-Rwxrwxrwx 1 oracle oinstall 1415 Mar 31 init_00q37gus_00000.ora
-Rwxrwxrwx 1 oracle oinstall 104865792 Mar 31 O1_MF_EXAMPLE_BKLLRKG2_.DBF
-Rwxrwxrwx 1 oracle oinstall 503324672 Mar 31 O1_MF_SYSTEM_BKLLOT8Z_.DBF
-Rwxrwxrwx 1 oracle oinstall 52436992 Mar 31 TSPITR01.DBF
-Rwxrwxrwx 1 oracle oinstall 52436992 Mar 31 TEST01.DBF
-Rwxrwxrwx 1 oracle oinstall 31465472 Mar 31 O1_MF_UNDOTBS1_BKLLOTM0_.DBF
-Rwxrwxrwx 1 oracle oinstall 5251072 Mar 31 O1_MF_USERS_BKLLOTM6_.DBF
-Rwxrwxrwx 1 oracle oinstall 2582 Mar 31 TRANSPORT_DB_SCRIPT. SQL
-Rwxrwxrwx 1 oracle oinstall 251666432 Mar 31 O1_MF_SYSAUX_BKLLOTFL_.DBF

 

6. Create a directory required by the database on the target host, modify relevant parameters in the PFILE parameter file, and modify the location of the data file in the transmission script.

Create related directories
[Oracle @ oracle11g dbs] $ mkdir-p/u01/app/oracle/admin/jingyong/adump
[Oracle @ oracle11g dbs] $ mkdir-p/u01/app/oracle/admin/jingyong/bdump
[Oracle @ oracle11g dbs] $ mkdir-p/u01/app/oracle/admin/jingyong/cdump
[Oracle @ oracle11g dbs] $ mkdir-p/u01/app/oracle/admin/jingyong/udump
[Oracle @ oracle11g dbs] $ chmod-R 777/u01/app/oracle/admin/jingyong *


Modify the PFILE parameter file
[Oracle @ oracle11g jingyong] $ vi initjingyong. ora
# Please change the values of the following parameters:


Audit_file_dest = '/u01/app/oracle/admin/jingyong/adump'

Background_dump_dest = '/u01/app/oracle/admin/jingyong/bdump'

User_dump_dest = '/u01/app/oracle/admin/jingyong/udump'

Core_dump_dest = '/u01/app/oracle/admin/jingyong/udump'

Db_name = "JINGYONG"
Control_files = '/u01/app/oracle/oradata/test/control01.ctl'


# Please review the values of the following parameters:


Dispatchers = "(PROTOCOL = TCP) (SERVICE = jingyongXDB )"

 

# The values of the following parameters are from source database:

Processes = 150

Nls_language = "simplified chinese"

Nls_territory = "CHINA"

Sga_target = 130 M

DB _ block_size = 8192

Compatible = "10.2.0.1.0"

Db_file_multiblock_read_count = 16

Undo_management = "AUTO"

Undo_tablespace = "UNDOTBS1"

Job_queue_processes = 10

Open_cursors = 300

Pga_aggregate_target = 32 M

 

Modify the transfer script generated by the convert database Command
[Oracle @ oracle11g jingyong] $ vi TRANSPORT_DB_SCRIPT. SQL
-- The contents of online logs will be lost and all backups will
-- Be invalidated. Use this only if online logs are damaged.

-- After mounting the created controlfile, the following SQL
-- Statement will place the database in the appropriate
-- Protection mode:
-- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE

Startup nomount pfile = '/u01/app/oracle/10.2.0/db/dbs/initjingyong. ora'

-- Create SPFILE
Create spfile from pfile = '/u01/app/oracle/10.2.0/db/dbs/initjingyong. ora ';


STARTUP FORCE NOMOUNT
Create controlfile reuse set database "JINGYONG" RESETLOGS NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
# MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/u02/jingyong/redo01.log' SIZE 50 M,
GROUP 2 '/u02/jingyong/redo02.log' SIZE 50 M,
GROUP 3 '/u02/jingyong/redo03.log' SIZE 50 M
DATAFILE
'/U02/jingyong/O1_MF_SYSTEM_BKLLOT8Z_.DBF ',
'/U02/jingyong/ow.mf_undotbs1_bkllotm0_.dbf ',
'/U02/jingyong/ow.mf_sysaux_bkllotfl_.dbf ',
'/U02/jingyong/O1_MF_USERS_BKLLOTM6_.DBF ',
'/U02/jingyong/O1_MF_EXAMPLE_BKLLRKG2_.DBF ',
'/U02/jingyong/tspitr01.dbf ',
'/U02/jingyong/test01.dbf'
Character set ZHS16GBK
;

-- Database can now be opened zeroing the online logs.
Alter database open resetlogs;

-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
Alter tablespace temp add tempfile '/u02/jingyong/temp01.dbf'
SIZE 50 m autoextend off;
-- End of tempfile additions.
--

Set echo off
Prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Prompt * Your database has been created successfully!
Prompt * There are running things to think about for the new database. Here
Prompt * is a checklist to help you stay on track:
Prompt * 1. You may want to redefine the location of the directory objects.
Prompt * 2. You may want to change the internal database identifier (DBID)
Prompt * or the global database name for this database. Use
Prompt * NEWDBID Utility (nid ).
Prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SHUTDOWN IMMEDIATE
STARTUP UPGRADE
@@? /Rdbms/admin/utlirp. SQL
SHUTDOWN IMMEDIATE
STARTUP
-- The following step will recompile all PL/SQL modules.
-- It may take serveral hours to complete.
@@? /Rdbms/admin/utlrp. SQL

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • 3
  • 4
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.