How to Restore Archive logs from a backup set in oracle
How Does oracle capture archived logs from the backup set?
In Dalian Hospital, the database is archived. However, after archiving, rman uses crontab to automatically archive the logs and delete the archived log files on the system. After the RealSync program stops for a period of time, archive logs must be applied to solve the log loss problem.
The problem is: the metadata about backup in the control file in the database has been lost, but the backup set exists. At this time, we began to call an internal non-public function package of oracle: dbms_backup_restore to extract archived logs from the backup set to the specified system directory. To meet our needs. The statement is as follows:
declaredevtype varchar2(256);done boolean;begindevtype:=sys.dbms_backup_restore.deviceAllocate(type=>'',ident=>'t2');sys.dbms_backup_restore.restoreSetArchivedLog(destination=>'/archivelog02');sys.dbms_backup_restore.restoreArchivedLog(thread=>2,sequence=>51500);sys.dbms_backup_restore.restoreBackupPiece(done=>done,handle=>'/backup/zlhis/rman/AL_ZLHIS_20141030_862336902_23768_1',params=>null);sys.dbms_backup_restore.deviceDeallocate;end;
Note: destination => '/archivelog02 specifies the location where the archived logs are stored. thread indicates the thread Number of rac, sequence is the serial number of the archive log to be restored. handle indicates the absolute path of the Backup set. After modification, run the SQL plus command window.
Oracle recovery problems, including backup and archiving logs
The control file (that is,. CTL) and data file (. DBF) are both in the same version. After installation, copy the file to overwrite it.
Then copy the two ORA files of TNS and LISTENER.
If your new installation path is the same as before, you can use it.
If they are different, make sure that SQLPLUS can be mounted after several services are enabled, and then:
Shutdown
Startup mount
After the database is loaded:
Alter database rename file 'data file path and file name in the old installation location 'to 'data file path and file name in the new installation location ';
Use the preceding command to change the path of all data files (all files under the oradata directory.
---------------------------------------------------------------------
If you have a DMP file
Imp userid = USER/123 FILE = dmp file name;
Archive logs in oracle differ from database backup
Archiving logs redo the backup of logs, and redo logs record all the changes to the data (DML, DDL, or structural changes made to the data by the Administrator). You can recover the data, you can also restore other files.
Database Backup can be divided into many types, such as common exp and rman. The Archiving status of rman backup must be enabled, that is, rman backup and archiving logs are closely related, rman backup can back up control files, data files, redo log files, and other files, comprehensive.
Exp logical backup backs up data in data files.
The difference is that exp can only restore database data, archive logs can restore data and other files (using rman backup ).
Archive logs must be used together with rman backups and cannot be used separately for comparison with Database backups. This makes no sense.
Hope to help you!