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

Full backup of ORACLE_ database + archived remote recovery

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Full backup:

#! / bin/bash

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

Export ORACLE_SID=ORCL

Export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH

Backtime= `date + "% y%m%d%H%M%S" `

$ORACLE_HOME/bin/rman target / log=/home/oracle/full_backup_$backtime.log create pfile from spfile

Restore to another environment

1. Modify parameter file path

Vi $ORACLE_HOME/dbs/initORCL.ora

two。 Start the database to nomount

SQL > startup pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initORCL.ora'

3. Restore control file

$cd / u01/app/oracle/backup

RMAN > restore controlfile from'/ u01ActionAccording to an oracleplicatbackup.ctlhammer ORCLR 20200311 / 1919 1.bak'

RMAN > alter database mount

3. Restore the database

RMAN > run {

Catalog start with'/ u01amp appUnitionoracleUniverse backup`

Set newname for database to'/ u01qqappActionoradataUniverse Demo Universe% U'

Restore database

Switch datafile all

Switch tempfile all

Recover database

}

Do you really want to catalog the above files (enter YES or NO)? Yes

5. Modify log file

SQL > alter database rename file'/ u01Gap App alter database rename file'/ u01ActionAccording to oracleUniverse redo01.log'log'/ u01ActionApplicationoracleUniplicatoradataUniplex Demodex redo01.log'

SQL > alter database rename file'/ u01qapplash oracle.oradataUniplemoractyredo02.log'log'/ u01qapplemoradataloradataUniplicateoradataUniplicationoradataUniplicationoradataandredo02.log'

SQL > alter database rename file'/ u01Gap App alter database rename file'/ u01ActionApplicationoracleUniplementoradata'oradataUniplicorplaza redo03.log'/ u01ApplicationoracleUniplicoradataUniplicationoradataUnidexdexameoradata 'redo03.log'

SQL > ALTER DATABASE CLEAR LOGFILE GROUP 1

SQL > ALTER DATABASE CLEAR LOGFILE GROUP 2

SQL > ALTER DATABASE CLEAR LOGFILE GROUP 3

6. Open the database

SQL > alter database open resetlogs

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