Pages

Monday, April 2, 2012

Managing Archived Redo Logs


Managing Archived Redo Logs
Oracle allows you to save filled groups of online redo log files, known as archived redo logs, to one or more offline destinations. Archiving is the processes of turning online redo logs into archived redo logs. The background process ARCn automates archiving operations. You can use archived logs to:
-->Recover a database
-->Update a standby database
-->Gain information about the history of a database via the LogMiner utility

Choosing Between NOARCHIVELOG and ARCHIVELOG Mode

Running a Database in NOARCHIVELOG Mode

When you run your database in NOARCHIVELOG mode, you disable the archiving of the online redo log. The database's control file indicates that filled groups are not required to be archived. Therefore, when a filled group becomes inactive after a log switch, the group is available for reuse by LGWR.
The choice of whether to enable the archiving of filled groups of online redo log files depends on the availability and reliability requirements of the application running on the database. If you cannot afford to lose any data in your database in the event of a disk failure, use ARCHIVELOG mode. Note that the archiving of filled online redo log files can require you to perform extra administrative operations.

Running a Database in ARCHIVELOG Mode

When you run a database in ARCHIVELOG mode, you enable the archiving of the online redo log. The database control file indicates that a group of filled online redo log files cannot be used by LGWR until the group is archived. A filled group is immediately available for archiving after a redo log switch occurs.
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.
  • You can use a backup taken while the database is open and in normal system use if you keep an archived log.
  • You can keep a standby database current with its original database by continually applying the original's archived redo logs to the standby.

Enabling  Archive log

By default when creating database, database is in no archive mode to enable database archive mode, first we have to startup the database in mount state , in mount state only we can enable the archive mode
sql> shutdown
sql> startup mount
sql> alter database archivelog;
sql> alter database open;
to check whether the database is in archive log or not
sql>archive log list;
To Set the Destination for Archived Redo Logs Using LOG_ARCHIVE_DEST

Sql> shutdown immediate
Edit the parameter file
$ vi initTEST.ora
LOG_ARCHIVE_DEST = ‘/Oracle/product/10.2.0/db_1/admin/TEST/arch’

LOG_ARCHIVE_FORMAT = arch_%t_%s.arc

No comments:

Post a Comment