Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Data migration in ORACLE 12C cold backup mode (rename mode)

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Previously, I wrote an article about modifying the problem of different paths by modifying the control file, but now we use method 2 to modify the problem of different paths through rename.

Experimental subjects: two linux stand-alone oracle 12C databases (large version and small version are the same), data migration adopts cold backup.

Migration steps

First of all, turn off the applications that listen and disconnect with kill.

Ps-ef | grep LOCAL=NO | awk'{print ($2)}'| xargs kill-9

Create pfile

Create pfile='/tmp/inittest.ora1012' from spfile

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

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 shutting down the database, copy the parameter file, data file, log file, control file.

Shutdown immediate

Copy all the required files locally for better transfer.

Cp.

Copy the file to the target server.

Scp...

Modify the pfile information on the target server.

Source and sink

[oracle@test 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 are performed on the target database

Modified the path of the control file

* .control_files='/u01/app/oracle/oradata/test/controlfile/control01.ctl'

Modify the path of the data file

Alter database rename file'/ u01qaphort oracle to'/ u01andapplicaloracleandoradataPlacement TestSystem01.dbf' / u01andapplicable oradataloradata'/ u01andapplicaloradaplemoradataandtestClearSyste01.dbf'

Alter database rename file'/ u01Greater appActionorActionoradaPlacement TestUniverse sysaux01.dbf' / u01Lapplicaloradata to'/ u01LapplicaloradataUniplicationsysaux01.dbf'

Alter database rename file'/ u01qappActionoracleCharacleoradataUniplicateUndotbs01.dbf' / u01Lax alter database rename file'/ u01Lash oradataS01.dbf'appActionoradataS01.dbf'

Alter database rename file'/ u01qqappActionorActionoradataPlacement TestUniverse users01.dbf' to'/ u01LigasApplameorActionoradataUniteS01.dbf'

Alter database rename file'/ u01qqwerty.dbf' to'/ u01qqwerty.dbf' / u01qwerty.dbf'

Alter database rename file'/ u01Greater appActionorActionoradataPlacement testbig.dbf' to'/ u01LigApplement oradataGrease testbig.dbf'

Alter database rename file'/ u01ActionActionoradale _ to'/ u01 _ apprenticement _ oradale _ to'/ u01 _ apprenticement _ oradale _ Universe

Alter database rename file'/ u01ActionAccording to alter database rename file'/ u01GreatActionoracleGrexoradataPlacement TestUnigram tempact asyncwords 01.dbf'dbf'/ u01UniplicationappLexorActionoradataPlacement oradataPlancesdatafileRandtempact asyncwords 01.dbf'

Alter database rename file'/ u01qqappActionorActionoradataPlacement TestUniverse temp01.dbf' to'/ u01Lax oradataPlacement oradataPlus TestCall datafileCan temp01.dbf'

Alter database rename file'/ u01qqappActionorActionoradataUniplicateTestUniverse temp02.dbf' to'/ u01Lax oradataPlacement oradataGrease TestRafileStemp02.dbf'

Modify the path of the log file

Alter database rename file'/ u01qaphort oracle.oradata to'/ u01qapplicateoradata'/ u01 apprenticeschedonlinelog.redo01.log'

Alter database rename file'/ u01qaphort oracle.oradataPlacement TestUniverse redo02.log' to'/ u01andapplicable oradataonlinelog.redo02.log'

Alter database rename file'/ u01qaphort oraclehelplexoradataUniplicatetestUniverse redo03.log'log'/ u01andapplicaloracleexoradataplicatableoradataPlacement oradataOnlinelog.redo03.log'

Alter database open

At this point, the data migration is completed.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report