Three methods of Oracle database backup and recovery Oracle database has three standard backup methods: Export/Import (EXP/IMP), hot backup, and cold backup. Exporting spare parts is a logical backup, while cold backup and hot backup are physical backup. 1. Export/Import (Export/Import) data can be extracted from the database using Export, and the extracted data can be sent back to the Oracle database using Import. 1. Simple Export data (Export) and Import data (Import) Oracle support three types of output: (1) and table (T), Export the data of the specified table. (2) user mode (U mode), which exports all objects and data of the specified user. (3) Full database mode (Full mode). All objects in the databases are exported. The data Import process is the inverse process of data Export (Export). The data files are imported into the database and the database data is exported to the data file respectively. 2. incremental export/import incremental export is a common data backup method. It can only be implemented for the entire database and must be exported as a SYSTEM. During this export, the system does not require any answers. The default export file name is export. dmp. If you do not want your output file to be named export. dmp, you must specify the file name to use in the command line. Incremental export includes three types: (1) and "full" incremental Export (Complete), that is, backup of three databases, such as exp system/manager inctype = complete file = 040731.dmp (2) incremental export the data changed after the last backup, for example, exp system/manager inctype = incremental file = 040731.dmp (3) and "accumulative" incremental export the accumulative export mode is to export the changed information in the database after the last "full" export. For example, the exp system/manager inctype = cumulative file = 040731.dmp database administrator can schedule a backup schedule and export data in three different ways. For example, you can make the following arrangements for database sealing tasks: Monday: Full backup (A) Tuesday: Incremental Export (B) Wednesday: Incremental Export (C) Thursday: Incremental Export (D) Friday: accumulative Export (E) Saturday: Incremental Export (F) Sunday: Incremental Export (G) if the database is accidentally damaged on Sunday, the database administrator can follow these steps to reply to the database: step 1: run the create database Command to regenerate the DATABASE structure. Step 2: CREATE an additional rollback that is large enough. Step 3: complete incremental import A: imp system/manager inctype = RESTOREFULL = y FILE = A Step 4: Accumulative incremental import E: imp system/manager inctype = RESTOREFULL = y file = E Step 5: import the latest incremental F: imp system/manager inctype = RESTOREFULL = y file = F 2. Cold backup cold backup occurs when the database is shut down normally, A complete database will be provided when it is disabled normally. This article describes how to copy key files to another location during cold backup. The fastest and safest way to back up Oracle information during cold backup. Advantages of cold backup: 1. It is a very fast backup method (only copying files) 2. It is easy to archive (simple copy) 3. easy recovery to a certain point in time (just copy the file back) 4. It can be combined with the archiving method to restore the database in the "best state. 5. Low maintenance and high security. However, cold backup also has the following limitations: 1. When used independently, only the "recovery at a certain time point" can be provided. 2. During the whole backup process, the database must be backed up instead of other work. That is to say, in the cold backup process, the database must be closed. 3. If the disk space is limited, it can only be copied to tape and other external storage devices, and the speed will be very slow. 4. data cannot be restored by table or by user. If possible (mainly for efficiency), back up the information to the disk, start the database (allowing the user to work), and copy the backup information to the tape, the database can also work ). Files that must be copied in cold backup include: 1. All data files; 2. All control files; 3. All online redo log files; 4. Init. ora file (optional) It is worth noting that cold backup must be performed when the database is closed. When the database is open, the execution of database file system backup is invalid. The following is a complete example of cold backup. (1) Close the database sqlplus/nolog SQL>; connect/as sysdba SQL>; shutdown normal; (2) use the Copy command to back up all the time files, redo log files, control files, initialization parameter files {$ PageTitle = SQL>; cp ;;}( 3) Restart Oracle Database SQL>; startup 3. Hot Backup is a database backup method that uses archivelog mode when the database is running. Therefore, if you have a cold backup file last night and a hot backup file today, you can use this data to restore more information when a problem occurs. Hot Backup requires that the database be operated in Archivelog mode and requires a large amount of archive space. Once the database is running in the archivelog state, you can back up the database. The Hot Backup command file consists of three parts: 1. The data file backs up a tablespace and a tablespace. (1) set tablespace to backup state (2) backup tablespace data file (3) Restore tablespace to normal state 2. back up the archive log file (1) temporarily stop the archiving process (2) files under the log in the archive rede log target directory (3) restart the archive process (4) back up the archived redo log file 3. the advantages of using the alter database bachup controlfile command to back up the control file Hot Backup are: 1. it can be backed up at the tablespace or database file level, and the backup time is short. 2. The database is still available during Backup. 3. It can be restored in seconds (to a specific point in time ). 4. Almost all database entities can be restored. 5. Recovery is fast. In most cases, apsaradb recovers when it is still working. Hot Backup is insufficient: 1. no error is allowed. Otherwise, the result is serious. 2. if the Hot Backup fails, the result cannot be used for restoration at a time point. because it is difficult to maintain, you must be careful not to "end with failure ".