Cold backup recovery and different machine restore

Source: Internet
Author: User

Cold backup occurs when the database is closed, directly copies the physical file backup mode, the backup database can be run in the archive mode, or can run in non-archive mode.

Backup process:

1) First get all the files running in the running library.

Main backup files: Passwordfile, SPFile, Controlfile, datafile, Tempfile, logfile

2) then plan to close the database, typically closed at night when no one is accessible.

3) Copy the physical file to the specified backup path or device.

4) Copy complete, start the database immediately and make it work properly.

Backup script:

Spool/u01/app/oracle/jiaoben/bf1.sql

Select ' Ho cp ' | | name| | '/u01/app/oracle/lengbei/' from V$controlfile

UNION ALL

Select ' Ho cp ' | | name| | '/u01/app/oracle/lengbei/' from V$datafile

UNION ALL

Select ' Ho cp ' | | name| | '/u01/app/oracle/lengbei/' from V$tempfile

UNION ALL

Select ' Ho cp ' | | member| | '/u01/app/oracle/lengbei/' from V$logfile

/

Create pfile= '/u01/app/oracle/lengbei/initorcl.ora ' from SPFile;

Ho cp/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapworcl/u01/app/oracle/lengbei/

Spool off

Shutdown immediate

@/u01/app/oracle/jiaoben/bf1.sql

Startup

Rm-rf/u01/app/oracle/jiaoben/bf1.sql

Restores:

1 , non-archive mode

1) Non-archive mode, full library physical file loss in case of recovery:

A, close the database, Sqlplus can enter the Sqlplus close, otherwise kill-9 kill process

b, copy the backup file to the database physical file specific path.

C, Sqlplus/as sysdba into the database, open the database through startup.

At this point the database reverts to the time of the backup, from backup to current database transaction loss.

In addition to fully recovering to a backup point in time, a single data file loss recovery process is not supported.

2 , archive mode

1) in archive mode, all physical files are lost in case of recovery.

A, close the database, Sqlplus can enter the Sqlplus close, otherwise kill-9 kill process

b, copy the backup file to the database physical file specific path.

C, Sqlplus/as sysdba into the database, through the startup mount.

D, recover database using Backup controlfile; Auto

E, ALTER DATABASE open resetlogs;

Cold backups in archive mode can be restored by archiving the log and starting the database the first time after the restore. At the same time, the archive mode also supports non-archive cold standby recovery methods.

2) system Tablespace is lost in archive mode (can support single data file loss recovery):

A, Shutdow shut down the machine

B. Take back the backup file back to the data file location

C, Startup

D, recover datafile 1;recover tablespace system;recover database;

E, ALTER DATABASE open;

Different machine recovery: same platform, same version

1, the target library does not create an instance, the target library according to the directory structure of the source library to create a directory, copy the source Library cold standby files to the target library, according to the Source library directory structure to restore physical files.

2, the Source Library through create Pfile from SPFile; creating a parameter file and copying it with Passwordfile to the target repository $oracle_home/dbs/directory.

3, according to the Source library Listener.ora and Tnsnames.ora content in the target library to establish the file or modify its contents.

4, Sqlplus/as sysdba way into sqlplus environment, through startup pfile= ' $ORACLE _home/dbs/initorcl.ora ' way to start the database.

5, create SPFile from pfile; Creates a binary parameter file. The cold standby migration is complete.

different machine recovery: platform: rhel6.4~rhel6.5 version: Oracle 11g 11.2.0.1~oracle 11g 11.2.0.4

1, the target library does not create an instance, the target library according to the directory structure of the source library to create a directory, copy the source Library cold standby files to the target library, according to the Source library directory structure to restore physical files.

2, the Source Library through create Pfile from SPFile; creating a parameter file and copying it with Passwordfile to the target repository $oracle_home/dbs/directory.

3, according to the Source library Listener.ora and Tnsnames.ora content in the target library to establish the file or modify its contents.

4, Sqlplus/as sysdba way into sqlplus environment, through startup pfile= ' $ORACLE _home/dbs/initorcl.ora ' way to start the database.

Note that this will be an error ****************************

Ora-01092:oracle instance terminated. Disconnection forced

Ora-00704:bootstrap Process Failure

Ora-39700:database must be opened with UPGRADE option

Process id:2774

Session id:125 Serial Number:5

5. Open the database in Startup upgrade mode.

Cold backup recovery and different machine restore

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.