data backup
Whether it is, the database's backup is a backup of the three files of Data File / Control File / Redo File. 1, EXP / IMP backup mode 2, offline backup 3, online backup mode (ONLINE BACKUP) 4, Standy's operating mode
1, the backup mode of EXP / IMP (1) The command mode can be performed in an Online environment.
(2) OEM mode is exported by exporting backup wizards.
2, offline backup mode (OFFLINE BACKUP) Copy the relevant file. (1) Turn off the database; (2) Copy file, DataFile / Control File / Redo Log File; (3) Open the database.
3, online backup conditions: (1) The database cannot be turned off; (2) The database must be in archive mode, that is, the redo log file is filled, saving the full Redo log file on disk;
Let the data are in Archive Mode: (1) Set Archive Mode; set the following parameters in the inIitorcl.ora file: # 启 a 处理 处理 处理 处理 log_archive_start = true # Set the storage place for Archive log file log_archive_Dest = / Home / ORADATA / ORCL / Archive # Sets the file name log_archive_format = -s% .arc (2) mount status to open the database; startup mount pfile = initorcl.ora; ALTABASE ARCHIVELOG; ALTER DATABASE OPEN;
Online backup method of one (1) set tablespace to backup mode; alter tablespace tablespace_name begin backup; (2) copy the relevant data table copy sourcefile destfile (3) restore tablespace to normal alter tablespace tablespace_name end backup; (4) backup control filealter Database Backup ControlFile To 'Control.BK' (5) Copy Redo Log File
4, Standy's Runtime This mode is the main source backup mode. Method: (1) Preparing the backup method of the primary database (2) The main database is as follows: a, full offline backupb, online backup, backup database Control FileAlTabase Backup Standby ControlFile As 'filename' (3) Determine the main machine is in ArchiveLog Mode Operation methods are shown in 3. (4) Copy the Backup DataFiles / Control File from the primary machine to the backup host. The copied documents are as follows: a, control fileb, backup datafiles; c, archived redo logsd, online filese, initialization file (5) Set the mainization parameters of the primary machine to set the backup host's Initialization Parameters? ? ? ? ? May differ from (5). (7) Open the backup host database A. Open the database in the Nomount state, then ALTER starts Standby machine Start Nomount Pfile = INITSTANDBY.ORA; Alter Database Mount Standby Database; b, Standby Mode is started under Startup, indicating that the backup machine is already able to accept Primary The archive redo log of the database, the method available with FTP or ORACLE is automatically obtained by Oracle. (8) Start the backup database ALTER DATABASE Recover Managed Standby Database; Data Recovery
1. Recovery of offline backup (will lose data) (1) Determine the database shutdown (2) copy related backup files to related locations (3) Start database 2, Archive Mode recovery (1 Complete recoverya, shut down the database; shutdown; b, open the database startup mount; c, perform database recovery set autorecovery on; Recover Database; D. After completing Recovery, open the database ALTER DATABASE OPEN; (2) For a single file or Data table Recovery; A, let the tableSpace offline IMMEDIATE; B, replacing the damage file C with a good backup file, determine the Archive log file to be restored to D, start Recovery; Recover TableSpace Appdata; Recover DataFile 'user01.dbf'; E, after completion, Alter makes TableSpace online ALTER TABLESPACE AppData Online;
(3) Incomplete Recovery If the transaction log file is corrupt, you should pay attention to the log sequence number recorded by the DataFiles and Control File is not completely recovered. The mount phase is to be set to 1, so that the database can be opened.
Use Cancel to a certain point in time A, mount opens the database startup mount; b, restore the Recover Database Until Cancel; C, after completion, open the database (Open Mode), reset the setting of Control File and DataFiles Log Sequence Number settings to 1 ALTER DATABASE OPEN RESETLOGS;