what is archive log backup in oracle


This section contains the following topics: Section C.1.1, "Specifying Archive Destinations". However, when you specify the new mode in step 5, use the following statement: When you operate your database in manual ARCHIVELOG mode, you must archive inactive groups of filled redo log files or your database operation can be temporarily suspended. The dynamic performance (V$) views, listed in "Viewing Information About the Archived Redo Log", provide all needed archive information. For convenience and efficiency, automatic archiving is usually best. The database must be mounted but not open. Use capital letters (%T, %S, and %R) to pad the file name to the left with zeroes. For example, enter: If you are archiving to a standby database, use the SERVICE keyword to specify a valid net service name from the tnsnames.ora file. When you run your database in NOARCHIVELOG mode, you disable the archiving of the redo log. Full media recovery requires rather extensive preparation before media failure actually occurs. An Export also permits selective recovery and enables you to transfer a single user's data or a specific set of tables. In this configuration archiving does not contend with other files required by the instance and can complete more quickly. It contains the following topics: Choosing Between NOARCHIVELOG and ARCHIVELOG Mode, Controlling Trace Output Generated by the Archivelog Process, Viewing Information About the Archived Redo Log, Part III, "Automated File and Storage Management" for information about creating an archived redo log that is both created and managed by the Oracle Database server, Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide for information specific to archiving in the Oracle Real Application Clusters environment. This will be your final backup of the database in NOARCHIVELOG mode and can be used if something goes wrong during the change to ARCHIVELOG mode. In case a media failure occurs, the extent of database recovery depends on whether or not you archive the redo logs and how often you back up and export the database. Figure 7-1 Redo Log File Use in ARCHIVELOG Mode. You cannot change the mode from ARCHIVELOG to NOARCHIVELOG if any datafiles need media recovery. Instance recovery is done automatically whenever an instance is started. When the instance is restarted, check the trace files generated in the dump directory by the detached processes. If media failure occurs, then it is unlikely that any of the instances are still operational. ENABLE indicates that the database can use the destination. log redo oracle archiving waits switch file checkpoint incomplete needed embarcadero Any destination declared by LOG_ARCHIVE_DUPLEX_DEST is optional if LOG_ARCHIVE_MIN_SUCCEED_DEST = 1 and mandatory if LOG_ARCHIVE_MIN_SUCCEED_DEST = 2. DEFER indicates that the location is temporarily disabled. When a redo log file fills up, a checkpoint is created. LOG_ARCHIVE_MIN_SUCCEED_DEST Values for Scenario 2, Part III, "Automated File and Storage Management", Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide, Description of "Figure 7-1 Redo Log File Use in ARCHIVELOG Mode", "Viewing Information About the Archived Redo Log", Oracle Database Backup and Recovery Advanced User's Guide, Oracle Database Net Services Administrator's Guide, "Monitoring the Database Using Trace Files and the Alert Log". Each archive destination has the following variable characteristics that determine its status: Valid/Invalid: indicates whether the disk location or service name information is specified and valid, Enabled/Disabled: indicates the availability state of the location and whether the database can use the destination, Active/Inactive: indicates whether there was a problem accessing the destination. If any MANDATORY destination fails, including a MANDATORY standby destination, Oracle Database ignores the LOG_ARCHIVE_MIN_SUCCEED_DEST parameter. In the case of the archivelog process, you can control the output that is generated to the trace file. You transmit archived logs through a network to a remote location by using Oracle Net Services. Before making any major change to a database, always back up the database to protect against any problems. The archiving of filled groups has these advantages: A database backup, together with online and archived redo log files, guarantees that you can recover all committed transactions in the event of an operating system or disk failure. If you specify SERVICE, the database translates the net service name through the tnsnames.ora file to a connect descriptor. If you are duplexing the archived logs, you can establish which destinations are mandatory or optional by using the LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST parameters. A database backup is a block-by-block copy of the database files. A database backup is a physical copy of a database. You specify the location for LOG_ARCHIVE_DEST_n using the keywords explained in the following table: If you use the LOCATION keyword, specify a valid path name for your operating system. Perform the following steps the use method 2: Specify destinations for the LOG_ARCHIVE_DEST and LOG_ARCHIVE_DUPLEX_DEST parameter (you can also specify LOG_ARCHIVE_DUPLEX_DEST dynamically using the ALTER SYSTEM statement). An error occurred creating or writing to the destination file; refer to error data. The database can reuse log files only if at least two of the OPTIONAL destinations succeed. To change the archiving mode of the database, use the ALTER DATABASE statement with the ARCHIVELOG or NOARCHIVELOG clause. This section describes how to export to and import from multiple tapes. The default value for the LOG_ARCHIVE_TRACE parameter is 0. The VALID and ENABLED states are not changed. To recover the export file generated by the EXPORT utility, use the IMPORT utility. Instance failure can be caused by loss of power, system malfunction, an operating system failure, or another hardware or software problem. At this level, the archivelog process generates appropriate alert and trace entries for error conditions. Any previous backup is no longer usable because it was taken in NOARCHIVELOG mode. The database can reuse logs only if both OPTIONAL destinations succeed. You can choose automatic or manual archiving. You can create additional logs with the ALTER DATABASE command. The database control file indicates that a group of filled redo log files cannot be reused by LGWR until the group is archived. For example, the following query displays which redo log group requires archiving: To see the current archiving mode, query the V$DATABASE view: The SQL*Plus command ARCHIVE LOG LIST displays archiving information for the connected instance.

When the database is running in ARCHIVELOG mode, the log writer process (LGWR) cannot reuse and hence overwrite a redo log group until it has been archived. To back up a closed database, complete the following: Shut down all instances by using the SHUTDOWN NORMAL command. (See the discussion of this topic in "Monitoring the Database Using Trace Files and the Alert Log".) Track archivelog destination parameter modifications. All locks on Oracle Database 11g resources are released. To recover from instance failure, simply restart the failed instance to restore it to the working state that existed immediately before it failed. If you use NOARCHIVELOG mode, then you must shut down Oracle Database 11g before backing up the database. Typically, you will need a logical copy of the database when a user has dropped a table and you want to restore only that table. In this command, replace request_number with the request number you noted in Step 2. A filled group becomes available for archiving immediately after a redo log switch occurs. See Oracle Database Backup and Recovery Advanced User's Guide for more information about this method of recovery. To archive redo log files for the current instance manually, use the ARCHIVE LOG command. You cannot recover transactions subsequent to that backup. These procedures are discussed in the sections that follow: Specifying the Minimum Number of Successful Destinations. The following topics are contained in this section: You can choose whether to archive redo logs to a single destination or multiplex them. Start a new instance and mount, but do not open, the database. Provide the full specification if the location is other than the current device and directory. Specify the destination with either the LOG_ARCHIVE_DEST_n or LOG_ARCHIVE_DEST parameters. The RFS process, which is required when archiving to a remote destination, is responsible for the following tasks: Consuming network I/O from the ARCn process, Creating file names on the standby database by using the STANDBY_ARCHIVE_DEST parameter, Populating the log files at the remote site, Updating the standby database control file (which Recovery Manager can then use for recovery). If you cannot afford to lose any data in your database in the event of a disk failure, use ARCHIVELOG mode. To specify a disk file as the archive destination, use the following conventions: You must specify a full file name or valid file name format using the variables. This chapter describes how to archive redo data. Recovery procedures should ensure that no transactions are lost and that no data is written incorrectly. Oracle Database then translates the service name, through the tnsnames.ora file, to a connect descriptor. If you decide to import from an export file as part of media recovery, then you must re-create the database using the SQL*Plus utility before importing the export file. Whenever the database archives a redo log, it archives it to every destination specified by either set of parameters. The other two types of failure, statement failure and process failure, result in automatic recovery. This section describes the procedures for recovering data if media, software, or system fails. To archive the first redo log, enter the following command: Replace log_sequence_number with the number of the log file you want to be archived. Repeat this procedure as many times as required. To change the archiving mode, you must be connected to the database with administrator privileges (AS SYSDBA). Ensure that the database is mounted but not open. To import from multiple tapes, the import tape label must be the same as the one for first export tape. For example, if three ARCn processes are archiving to two standby databases, then Oracle Database establishes six RFS connections. An archived redo log file is a copy of one of the filled members of a redo log group. A value of 0 is the same as turning off the REOPEN attribute; ARCn will not attempt to archive after a failure. The following statement archives all unarchived log files: When you use manual archiving mode, you cannot specify any standby databases in the archiving destinations. To restart an instance after it has failed, perform the following steps: Shut down the instance with the SHUTDOWN command. Frequent writes can speed recovery because there will be less data in the logs to reapply to the database. Multi-reel export files are possible only for HP OpenVMS tapes. ALTERNATE indicates that the destination is an alternate. Image backups do not provide this flexibility. The two modes of transmitting archived logs to their destination are normal archiving transmission and standby transmission mode. You can operate your database in standby archiving mode, which automatically updates a standby database with archived redo logs from the original database. This process is only possible if the database is running in ARCHIVELOG mode. Indicate a remote archival by specifying a Oracle Net service name as an attribute of the destination. The characteristics determining a locations status that appear in the view are shown in Table 7-1. Follow the instructions in Oracle Database Administrator's Guide to back up both open and closed databases. The archiving of filled redo log files can require you to perform extra administrative operations. Should a_log1 become corrupted, then ARCn can still archive the identical b_log1. The user manually and temporarily disabled the destination.

To import from multiple tapes, run the following commands: At this point, the import starts and you are prompted to enter the import file name as follows: The import proceeds to the end of the reel. Archived redo logs are integral to maintaining a standby database, which is an exact replica of a database. There is usually no need specify this initialization parameter or to change its default value, because the database starts additional archiver processes (ARCn) as needed to ensure that the automatic processing of filled redo log files does not fall behind. You can display information about the archived redo logs using the following sources: Several dynamic performance views contain useful information about archived redo logs, as summarized in the following table.

Standby transmission involves transmitting files through a network to either a local or remote standby database. If the following warning message is displayed during the backup procedure, then ignore it and continue with the backup: To back up an open database, complete the following tasks: Run SQL*Plus, and enter the following command: Specify the name of the tablespace that you want to back up. You can diagnose instance failure by checking if one or more of the detached processes have terminated, or if work in the instance seems to be suspended. Track detailed archivelog destination activity. All references to LOG_ARCHIVE_DEST must be accompanied by LOG_ARCHIVE_FORMAT and the statements modified as required.

If you do not specify the REOPEN keyword, ARCn will never reopen a destination following an error. Displays information about the state of the various archive processes for an instance. The LOG_ARCHIVE_MIN_SUCCEED_DEST value cannot be greater than the number of destinations, nor can it be greater than the number of MANDATORY destinations plus the number of OPTIONAL local destinations. All locations must be local. This section describes the issues you must consider when choosing to run your database in NOARCHIVELOG or ARCHIVELOG mode, and contains these topics: The choice of whether to enable the archiving of filled groups of redo log files depends on the availability and reliability requirements of the application running on the database. You can usually work around this limitation of the ANSI format by using user-level or table-level exports. The user has properly initialized the destination, which is available for archiving. The service name must have an associated database SID, so that the database correctly updates the log history of the control file for the standby database. In this scenario, you archive to three local destinations, each of which you declare as OPTIONAL. If you want to archive only to a single destination, you specify that destination in the LOG_ARCHIVE_DEST initialization parameter. The database control file indicates that filled groups are not required to be archived. You must respond to these prompts as required. You set the initial archiving mode as part of database creation in the CREATE DATABASE statement. To back up database files, use the HP OpenVMS BACKUP utility. The REOPEN attempt either succeeds or fails. Use the LOG_ARCHIVE_DEST_n parameter (where n is an integer from 1 to 10) to specify from one to ten different destinations for archival. Scripting on this page enhances content navigation, but does not change the content in any way. You can see the relationship between the LOG_ARCHIVE_DEST_n and LOG_ARCHIVE_MIN_SUCCEED_DEST parameters most easily through sample scenarios. For example: Changes initiated in this manner will take effect at the start of the next archiving operation. Normal transmission involves transmitting files to a local disk. However, you must still restart the failed instance. There are additional keywords that can be specified with this initialization parameter that are not discussed in this book. A backup of an open database is also known as an online or hot backup. To export files to tape for transferring to another HP OpenVMS system, run the following commands: Several prompts are displayed at this point. Restart the instance with the STARTUP command. If you do not specify the archive destination, then the destination is derived from the INIT.ORA parameter LOG_ARCHIVE_DEST. The following steps switch the database archiving mode from NOARCHIVELOG to ARCHIVELOG: An open database must first be closed and any associated instances shut down before you can switch the database archiving mode. The identical resetlogs ID indicates that the files are all from the same database incarnation: To specify a maximum of two locations, use the LOG_ARCHIVE_DEST parameter to specify a primary archive destination and the LOG_ARCHIVE_DUPLEX_DEST to specify an optional secondary archive destination. Sometimes archive destinations can fail, causing problems when you operate in automatic archiving mode. A media failure occurs when a nonrecoverable error occurs during a read or write transaction involving one or more of the database files. When using the REOPEN keyword, note the following: ARCn reopens a destination only when starting an archive operation from the beginning of the log file, never during a current operation. You cannot use REOPEN to specify the number of attempts ARCn should make to reconnect and transfer archived logs. Recovering an Oracle Database 11g database is the process of restoring normal Oracle Database 11g operations when they are interrupted by operating system error, hardware failure, or process termination. A backup of a closed database is also known as an offline or cold backup. If you are operating your standby database in managed recovery mode, you can keep your standby database synchronized with your source database by automatically applying transmitted archive logs. Refer to Oracle Database Utilities for further information. Changing the database archiving mode updates the control file. Each checkpoint guarantees that information in the redo log file is written to the database. Edit the initialization parameter file to include the initialization parameters that specify the destinations for the archive log files (see "Specifying Archive Destinations"). If you are prepared for media failure properly, then you can recover both the system tablespace data files and the non-system tablespace data files. When you specify a value for LOG_ARCHIVE_MIN_SUCCEED_DEST=n, Oracle Database will treat at least one local destination as MANDATORY, because the minimum value for LOG_ARCHIVE_MIN_SUCCEED_DEST is 1.