The Oracle database has three standard backup methods, namely:
1. Export / Import (Exp / IMP) 2. Hot Spare 3. Cold Backup
(Note Export spare parts is a logical backup, cold backup and hot backups are physical backups)
1. Export / Import (Export / Import) Use export to extract data from the database, using imported data back to the Oracle database.
1. Simple Export Data (Export) and Import Data (import) Oracle supports the output of three modes: (1) Table mode (T method), export data for the specified table. (2) User mode (U mode), export all objects and data of the specified user. (3) The full warehouse (FULL mode), export all objects in the database. The process of data import (import) is the inverse process of the data export, which imports the data file into the database and exports the database data to the data file. 2. Incremental Export / Import Incremental Export is a commonly used data backup method, which can only be implemented throughout the database, and must be exportable as system. When performing such export, the system does not request an answer any questions. Export file name defaults to export.dmp, if you do not want your own output file to be named Export.dmp, you must point out the file name you want to use in the command line. Incremental exports include three types: (1) "complete" incremental export (Complete), Export data changed after backup on the last backup, such as: exp system file = 040731.dmp (3) "Cumulative" increment Export Cumulative export method is to export from the last "complete" export database Changeable information. For example: Exp System / Manager IncTy = Cumulative File = 040731.dmp database administrator can schedule a backup schedule that is reasonably and efficiently completed by three different ways to export data. For example, the sealing task of the database can be arranged as follows: Monday: Fully Backup (a) Tuesday: Increment Export (B) Wednesday: Increment Export (C) Thursday: Increment Export (D) Friday: Cumulative Export (E) Saturday: Increment Export (F) Sunday: Increment Export (G) If the database is accidental damage, the database administrator can reply to the database: Step: First step: Use the command CREATE DATABASE to regenerate the database structure; Step 2: Create a big enough rollback.
Step 3: Full incremental import A: IMP system / manager incy = rest system / manager incy = restore full = y File = a Step 4: Accumulated incremental Import E: IMP System / Manager IncTy = Restore Full = Y File = E Step 5: Recent incremental import F: IMP system / manager incy = rest system / y file = f Sec 2 A key file is copied to another position when a cold backup is in a cold backup. For backup Oracle information, the fastest and secure method when cold backup. The advantages of cold backup are: 1. It is a very fast backup method (only copy file) 2, easy to archive (simple copy) 3, easy to return to a point in time (just copy the file back) 4 , In combination with the archive method, do the recovery of the database "best state". 5, low maintenance, high security. However, the cold backup also has the following deficiencies: 1. When used alone, only the recovery of "at a certain point in time" is available. 2. In the full process of the backup, the database must be prepared and cannot do other jobs. That is, during the cold backup process, the database must be closed. 3. If the disk space is limited, only the other external storage devices such as tape can be copied, and the speed will be very slow. 4, can not be restored in the form or by user. If possible (mainly efficient), the information should be backed up to the disk, then start the database (can operate) and copy the backup information to the tape (copy, the database can work). Documents that must be copied in the cold backup include: 1, all data files 2, all control files 3, all online redo log files 4, init.ora file (optional) is worth noting to make the cold backup must be performed in the database shutdown When the database is in an open state, the execution database file system backup is invalid. The following is a complete example of a cold backup. (1) Close the database SQLPLUS / NOLOG SQL> Connect / as Sysdba SQL> Shutdown Normal; (2) Back up all of the time files, redo log files, control files, initialize the parameter file SQL> CP (3) Restart Oracle database
SQL> Startup
Third, hot spare
Thermal backup is a method of backing up the database with the ArchiveLog Mode mode with the database operation. So, if you have a cold backup yesterday and today's hot backup documents, you can use this information to restore more information when there is a problem. The hot backup requires the database to operate in the ArchiveLog mode and require a lot of file space. Once the database is running in ArchiveLog, you can make a backup. The command file of the hot spare is consisting of three parts:
1. Data file a table space backup of a table space.
(1) Set the table space to back up status
(2) Data file of backup table space
(3) The reply table space is normal 2. Backup archive log file
(1) Temporary stop archiving process
(2) Log under the file in the Archive Rede Log Target Directory
(3) Restart the Archive process
(4) Backup archived redo log file
3. The advantages of backing up the control file hot backup with the Alter Database Bachup ControlFile command are:
1. You can back up in a table space or database file level, and the backup time is short.
2. The database can still be used when backed up.
3. Can reach second level recovery (restored to a point in time).
4. Restore almost all database entities
5. Recovery is fast, and in most cases, the database is still restored.
The lack of hot spare is:
1. Can't go wrong, otherwise the consequence is serious
2. If the hot backup is unsuccessful, the result is not available for time point recovery.
3. Because it is difficult to maintain, it is necessary to carefully and do not allow "failure to end".