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

How to use Oracle cold backup mode to realize database migration

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to use Oracle cold backup to achieve database migration". In daily operation, I believe many people have doubts about how to use Oracle cold backup to achieve database migration. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to use Oracle cold backup to achieve database migration". Next, please follow the editor to study!

1. Before cold backup, you need to check the location of database data files, control files, redo log files, spfile and password files.

(1) View the location of the data file

SQL > select file_name from dba_data_files

FILE_NAME

/ u01/app/oracle/oradata/orcl/users01.dbf

/ u01/app/oracle/oradata/orcl/undotbs01.dbf

/ u01/app/oracle/oradata/orcl/sysaux01.dbf

/ u01/app/oracle/oradata/orcl/system01.dbf

(2) View the location of the control file

SQL > select name from v$controlfile

NAME

/ u01/app/oracle/oradata/orcl/control01.ctl

/ u01/app/oracle/fast_recovery_area/orcl/control02.ctl

(3) View the location of the redo log file

SQL > select group#,member,status from v$logfile

GROUP# MEMBER STATUS

-

1/ u01/app/oracle/oradata/orcl/redo03.log

2 / u01/app/oracle/oradata/orcl/redo02.log

3 / u01/app/oracle/oradata/orcl/redo01.log

(4) the location where spfile and password files are stored defaults to

Under the $ORACLE_HOME/dbs directory

(5) the location where monitoring files are stored defaults to

$ORACLE_HOME/network/admin

2. Shut down the database by Shutdown immediate

$lsnrctl stop

SQL > shutdown immediate

3. Back up the above files

(1) create a backup directory / backup

# mkdir-p / backup/datafile

# mkdir-p / backup/controlfile

# mkdir-p / backup/redo

# mkdir-p / backup/spfileorapw

# mkdir-p / backup/listener

# chown-R oracle:dba / backup/

(2) copy data files, control files, redo logs, spfile and password files, and monitor files to the created directory

$cd / u01/app/oracle/oradata/orcl

$cp * .dbf / backup/datafile/

$cp control01.ctl / backup/controlfile/

$cp / u01/app/oracle/fast_recovery_area/orcl/control02.ctl / backup/controlfile/

$cp * .log / backup/redo/

$cd / u01/app/oracle/product/11.2.0/db_1/dbs/

$cp orapworcl spfileorcl.ora / backup/spfileorapw/

$cd / u01/app/oracle/product/11.2.0/network/admin/

$cp listener.ora tnsname.ora / backup/listener

4. Transfer existing files to the target host

(1) tar the contents of the / backup folder

# tar-cvf / backup/backup.tar controlfile/ datafile/ redo/ spfileorapw/

(2) transfer tar packets to the destination host

# scp / backup/backup.tar 192.168.131.101:/backup

5. The target host replaces existing files with backed-up files

$cd / u01/app/oracle/oradata/orcl

$rm-rf *

$cd $ORACLE_HOME/dbs

$rm-rf spfileorcl.ora orapworcl

$cd $ORACLE_HOME/network/admin

$rm-rf listener.ora tnsname.ora

$cd / backup

$cp controlfile/control01.ctl datafile/* redo/* / u01/app/oracle/oradata/orcl/

$cp controlfile/control02.ctl / u01/app/oracle/fast_recovery_area/orcl/

$cp spfileorapw/* $ORACLE_HOME/dbs

$cp listener/* $ORACLE_HOME/network/admin/

6. Verification

$lsnrctl start

$sqlplus / as sysdba

SQL > startup

At this point, the study on "how to use Oracle cold backup to migrate the database" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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