Data migration for ORACLE 12C Cold backup (rename mode)

Source: Internet
Author: User

Previously wrote an article by modifying the control file to modify the path of the problem, now use method two through rename to modify the path of the problem



Experimental object: Two Linux stand-alone Oracle 12C databases (both large and small versions are consistent), data migration takes a cold backup way.



Migration steps

First turn off monitoring, and kill the connected app
Ps-ef | grep Local=no | awk ' {print ($)} ' | Xargs kill-9



Create Pfile
Create pfile= '/tmp/inittest.ora1012 ' from SPFile;


View the path of the data file, log file, log file path

Sql> Set Line 200
Sql> Col file_name for A80

Sql> select Tablespace_name,file_name from Dba_data_files;

Tablespace_name file_name
------------------------------ --------------------------------------------------------------------------------
System/u01/app/oracle/oradata/test/system01.dbf
Sysaux/u01/app/oracle/oradata/test/sysaux01.dbf
Undotbs1/u01/app/oracle/oradata/test/undotbs01.dbf
Users/u01/app/oracle/oradata/test/users01.dbf
Qwerty/u01/app/oracle/oradata/test/qwerty.dbf
Testbig/u01/app/oracle/oradata/test/testbig.dbf
Data/u01/app/oracle/oradata/test/data_01.dbf


Sql> select Tablespace_name,file_name from Dba_temp_files;

Tablespace_name file_name
------------------------------ --------------------------------------------------------------------------------
Temp/u01/app/oracle/oradata/test/temp01.dbf
Temp_async/u01/app/oracle/oradata/test/temp_async_01.dbf



Sql> Set Line 200
Sql> Col MEMBER for A80
Sql> select Group#,member from V$logfile;

group# MEMBER
---------- --------------------------------------------------------------------------------
1/u01/app/oracle/oradata/test/redo01.log
2/u01/app/oracle/oradata/test/redo02.log
3/u01/app/oracle/oradata/test/redo03.log




Sql> Show Parameter Control_files

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
Control_files string/u01/app/oracle/oradata/test/c
Ontrol01.ctl,/u01/app/oracle/
Fast_recovery_area/test/contro
L02.ctl





After closing the database, copy the parameter files, data files, log files, control files.
Shutdown immediate


Copy all the required files locally for better transmission.
Cp......



Copy the file to the destination server.
Scp...



Modify the Pfile information on the destination server.

Source Library
[Email protected] dbs]$ VI Inittest.ora
Test.__data_transfer_cache_size=0
test.__db_cache_size=339738624
test.__java_pool_size=4194304
test.__large_pool_size=8388608
Test.__oracle_base= '/u01/app/oracle ' #ORACLE_BASE set from environment
test.__pga_aggregate_target=293601280
test.__sga_target=545259520
test.__shared_io_pool_size=16777216
test.__shared_pool_size=167772160
Test.__streams_pool_size=0
*.audit_file_dest= '/u01/app/oracle/admin/test/adump '
*.audit_trail= ' DB '
*.compatible= ' 12.1.0.2.0 '
*.control_files= '/u01/app/oracle/oradata/test/control01.ctl '
*.db_block_size=8192
*.db_domain= "
*.db_name= ' Test '
*.db_recovery_file_dest= '/u01/app/oracle/fast_recovery_area '
*.db_recovery_file_dest_size=4815m
*.diagnostic_dest= '/u01/app/oracle '
*.dispatchers= ' (protocol=tcp) (SERVICE=TESTXDB) '
*.log_archive_format= '%t_%s_%r.dbf '
*.memory_target=800m
*.open_cursors=300
*.processes=300
*.remote_login_passwordfile= ' EXCLUSIVE '
*.undo_tablespace= ' UNDOTBS1 '





The following actions operate on the target database


Modified the path of the control file
*.control_files= '/u01/app/oracle/oradata/test/controlfile/control01.ctl '



Modifying the path of a data file
Alter DATABASE rename file '/u01/app/oracle/oradata/test/system01.dbf ' to '/u01/app/oracle/oradata/test/datafile/ SYSTEM01.DBF ';
Alter DATABASE rename file '/u01/app/oracle/oradata/test/sysaux01.dbf ' to '/u01/app/oracle/oradata/test/datafile/ SYSAUX01.DBF ';
Alter DATABASE rename file '/u01/app/oracle/oradata/test/undotbs01.dbf ' to '/u01/app/oracle/oradata/test/datafile/ UNDOTBS01.DBF ';
Alter DATABASE rename file '/u01/app/oracle/oradata/test/users01.dbf ' to '/u01/app/oracle/oradata/test/datafile/ USERS01.DBF ';
Alter DATABASE rename file '/u01/app/oracle/oradata/test/qwerty.dbf ' to '/u01/app/oracle/oradata/test/datafile/ QWERTY.DBF ';
Alter DATABASE rename file '/u01/app/oracle/oradata/test/testbig.dbf ' to '/u01/app/oracle/oradata/test/datafile/ TESTBIG.DBF ';
Alter DATABASE rename file '/u01/app/oracle/oradata/test/data_01.dbf ' to '/u01/app/oracle/oradata/test/datafile/data _01.DBF ';
Alter DATABASE rename file '/u01/app/oracle/oradata/test/temp_async_01.dbf ' to '/u01/app/oracle/oradata/test/ DATAFILE/TEMP_ASYNC_01.DBF ';
Alter DATABASE rename file '/u01/app/oracle/oradata/test/temp01.dbf ' to '/u01/app/oracle/oradata/test/datafile/ TEMP01.DBF ';
Alter DATABASE rename file '/u01/app/oracle/oradata/test/temp02.dbf ' to '/u01/app/oracle/oradata/test/datafile/ TEMP02.DBF ';


Modify the path of the log file
Alter DATABASE rename file '/u01/app/oracle/oradata/test/redo01.log ' to '/u01/app/oracle/oradata/test/onlinelog/ Redo01.log ';
Alter DATABASE rename file '/u01/app/oracle/oradata/test/redo02.log ' to '/u01/app/oracle/oradata/test/onlinelog/ Redo02.log ';
Alter DATABASE rename file '/u01/app/oracle/oradata/test/redo03.log ' to '/u01/app/oracle/oradata/test/onlinelog/ Redo03.log ';



ALTER DATABASE open;



This completes the migration of the data.

This article is from the "SYSDBA" blog, make sure to keep this source http://sysdba.blog.51cto.com/10492366/1702452

Data migration for ORACLE 12C Cold backup (rename mode)

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.