Oracle Database Backup and Recovery

xiaoxiao2021-03-06  84

The Oracle database has three standard backup methods, which are exported / imported (Exp / IMP), hot backup, and cold backups, respectively. Export spare parts is a logical backup, a cold backup and a hot backup is a physical backup. 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 three modes of output: (1), a table mode (T method), export the data of the specified table. (2), user mode (U mode), export all objects and data of the specified user. (3), the full storage method (Full mode), 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) is backup three databases, such as: exp system / manager incy = completion file = 040731.dmp (2), "incremental" Incremental exporting data changed after the last backup, such as exp system file = 040731.dmp (3), "cumulative" incremental export cumulative export method is to export from the last "complete" export Information that changes in the database. 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) Turn off 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 parameter files SQL> CP (3) Restart Oracle Database SQL> Startup Third, the hot backup hot backup is a method of backing up the database with the ArchiveLog Mode mode in the case of 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.

转载请注明原文地址:https://www.9cbs.com/read-121864.html

New Post(0)