Oracle cold backup
1. Cold backups occur in the case where the database has been properly closed, and it will be provided to us a complete database when properly turned off. Cold backup is a way of copying key files to an additional location. For backup Oracle information, cold backup is the fastest and safest way. It is worth noting that the cold backup must be completed in the case where the database is closed. When the database is open, the execution database file system backup is invalid.
2. The documents required for cold backups include the following:
l All data files
l All control files
l All online redo log files
l init
3, step of cold backup
l Turn off the instance for backups (Instance)
l Back up the entire database to a directory
l Start database
4. Database recovery with cold backup
If the database is running in the non-archive log mode, copy the backup file back to the original directory. Non-archive log mode The database can only be restored to the state of the backup time.
If the database is running in archive log mode, copy the data file back to the original directory (not including online redolog files), then select the corresponding redo log file to recover, you can restore all the operations after the cold backup, that is It is said that it can restore the state before the system crash.
5, cold backup example
l Example 1. Cold backup and recovery in the Windows environment In this example, database instance names wh, all data files, all control files and all online redo log files are in folder D: / Oracle / ORA92 / WH, backup The recovery operation is as follows:
1. Enter SQL * Plus to log in to the database as SYSDBA
SQL> SYS / ORACLE @ WH AS SYSDBA
2, turn off the database SQL> Shutdown Immediate
3, copy D: / Oracle / Ora92 / WH to the target backup directory E: / BacakuPora / White
Database cooling backup is complete. The following is changed in the database:
4, start the database
SQL> Startup5, delete data
SQL> Delete * from wh.test
The database recovery is performed at this time.
6, SQL> Shutdown Immediate;
7, copy target backup catalog E: / Bacakupora / WH to D: / Oracle / ORA92 / WH
The database is completed. By querying, you can find that the database is restored to the state of the backup time, and all the operations performed after the backup is invalid.
l Example II, cold backup and recovery in the Linux environment
In this example, the database instance name URPDB, all data files are stored in the / ORADATA / URPDB directory, all control files and all online redo log files are in the folder OPT / ORA9 / ORADATA / URPDB, and the backup recovery operations are as follows:
1, SYS / ORACLE @ URPDB As Sysdba Enter SQL * Plus; 2, SQL> Shutdown Immediate (consistency all data files on time point) 3, copy / oradata / uRPDB and OPT / ORA9 / ORADATA / URPDB All files to the new backup directory. Suppose proceeds: 4, SQL> Startup 5, SQL> Create Table Test (C1 Number (5), C2 VARCHARC (10)); 6, SQL> INSERT INTO TEXT VALUES (1, 'A'); 7, SQL > commit;