Oracle single-instance database migration to the OracleRAC environment-data export and import system environment: Operating System: RedHatEL55Oracle: Oracle11.2.0.1.0 cluster software: OracleGI11.2.0.1.0 this case uses
Oracle single-instance database migration to the OracleRAC environment-data export and import system environment: Operating System: RedHatEL55Oracle: Oracle11.2.0.1.0 cluster software: OracleGI11.2.0.1.0 this case uses
Migration from a single Oracle instance database to an Oracle RAC environment-data export and import
System Environment:
Operating System: RedHat EL55
Oracle: Oracle 11.2.0.1.0
Cluster software: Oracle GI 11.2.0.1.0
This case uses the data import/export (EXPDP/IMPDP) migration method.
There are multiple ways to migrate data from a single-instance database to the RAC environment, either through data export or import, provided that the database uses the same character set.
1. database environment
Single Instance:
At 17:35:59 SYS @ test1> SELECT * from v $ VERSION;
BANNER batch Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit ProductionPL/SQL Release 11.2.0.1.0-ProductionCORE 11.2.0.1.0 ProductionTNS for Linux: Version 11.2.0.1.0-ProductionNLSRTL Version 11.2.0.1.0-ProductionElapsed: 00:00:00. 02
17:35:36 SYS @ test1> select userenv ('language') from dual;
USERENV ('language') ---------------------------------------------------- AMERICAN_AMERICA.ZHS16GBK
RAC environment:
17:46:03 SYS @ prod1> SELECT * from v $ VERSION;
BANNER implements Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-ProductionPL/SQL Release 11.2.0.1.0-ProductionCORE 11.2.0.1.0 ProductionTNS for Linux: Version 11.2.0.1.0-ProductionNLSRTL Version 11.2.0.1.0-ProductionElapsed: 00:00:00. 16
At 17:46:29 SYS @ prod1> select instance_name, status from gv $ instance;
INSTANCE_NAME STATUS ---------------- ------------ prod1 OPENprod2 OPEN
17:45:40 SYS @ prod1> select userenv ('language') from dual;
USERENV ('language') ---------------------------------------------------- AMERICAN_AMERICA.ZHS16GBK
2. Establish a test environment
Single Instance:
At 17:38:26 SYS @ test1> create tablespace test01
17:41:40 2 datafile '/dsk1/oradata/test1/test01.dbf' size 100 m;
Tablespace created.
At 17:43:49 SYS @ test1> create user test1 identified by test1
17:44:00 2 default tablespace test01
17:44:00 3 temporary tablespace tmpgp1
17:44:00 4 quota unlimited on test01
17:44:00 5 account unlock;
17:44:00 SYS @ test1> grant connect, resource to test1;
Grant succeeded.
At 17:50:34 SYS @ test1> conn test1/test1
Connected.
17:50:41 TEST1 @ test1> create table testtb1 tablespace test01 as select * from scott. emp;
Table created.
Elapsed: 00:00:00. 25
17:50:52 TEST1 @ test1> create index test_empno_ind on testtb1 (empno) tablespace indx;
Index created.
Elapsed: 00:00:00. 05
If you want to perform table space transfer, you need to perform a self-contained check on the table space:
17:51:15 SYS @ test1> EXECUTE DBMS_TTS.TRANSPORT_SET_CHECK ('test01', TRUE );
PL/SQL procedure successfully completed.
Elapsed: 00:01:04. 07
17:52:25 SYS @ test1> SELECT * FROM TRANSPORT_SET_VIOLATIONS;
No rows selected
Elapsed: 00:00:00. 05
Create an export transmission directory:
17:52:43 SYS @ test1> create directory exp_dir as '/home/oracle/exp ';
Directory created.
Elapsed: 00:00:00. 07
17:53:24 SYS @ test1> grant read and write on directory exp_dir to test1;
Grant succeeded.
Elapsed: 00:00:00. 06
17:53:39 SYS @ test1>! Mkdir ~ /Exp
Export schema:
[Oracle @ rh6 exp] $ expdp test1/test1 directory = exp_dir dumpfile = test. dmp logfile = test. log schemas = test1
Export: Release 11.2.0.1.0-Production on Thu Jul 10 17:59:05 2014 Copyright (c) 1982,200 9, Oracle and/or its affiliates. all rights reserved. connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsStarting "TEST1 ". "SYS_EXPORT_SCHEMA_02": test1/********* directory = exp_dir dumpfile = test. dmp logfile = test. log schemas = test1 Estimate in progress using BLOCKS method... processing object type SCHEMA_EXPORT/TABLE/TABLE_DATATotal estimation using BLOCKS method: 256 KBProcessing object type SCHEMA_EXPORT/PRE_SCHEMA/jsonobject type SCHEMA_EXPORT/TABLE/TABLEProcessing object type partition/TABLE/INDEX/INDEXProcessing object type partition/TABLE/CONSTRAINT/CONSTRAINTProcessing object type partition/TABLE/ INDEX/STATISTICS/INDEX_STATISTICSProcessing object type SCHEMA_EXPORT/TABLE/COMMENT .. exported "TEST1 ". "SYS_EXPORT_SCHEMA_01" 139.4 KB 1073 rows .. exported "TEST1 ". "TESTTB1" 8.570 KB 14 rowsMaster table "TEST1 ". "SYS_EXPORT_SCHEMA_02" successfully loaded/unloaded ********************************* **************************************** ***** Dump file set for TEST1.SYS _ EXPORT_SCHEMA_02 is: /home/oracle/exp/test. dmpJob "TEST1 ". "SYS_EXPORT_SCHEMA_02" successfully completed at 17:59:28
3. import data in the RAC environment:
Transfer a dump file from a single instance to the RAC environment: