Oracle RMAN 11g Backup and Recovery by Robert Freeman

Oracle RMAN 11g Backup and Recovery by Robert Freeman

Author:Robert Freeman [Freeman, Robert]
Language: eng
Format: epub
Publisher: McGraw-Hill Osborne Media
Published: 2010-04-22T07:00:00+00:00


296 Part II: Setup Principles and Practices

If the logfile you are trying to clear has not been archived, you may get the following error: SQL> alter database clear logfile group 1;

alter database clear logfile group 1

*

ERROR at line 1:

ORA-00350: log 1 of instance orcl (thread 1) needs to be archived

ORA-00312: online log 1 thread 1: '/oracle01/oradata/dance/redo01.log'

Of course, since the logfile is not there, it cannot be archived. In this case, we use the alter database clear unarchived logfile command to clear the unarchived log file and rebuild the log file in its current location, as seen here:

SQL> alter database clear unarchived logfile '/oracle01/oradata/dance/redo01.log'; You will need to back up your database in this case, since an archived redo log will have been lost.

In some cases, the database will not crash, but will freeze. If this occurs, open another SQL*Plus session and connect to the database. Then issue the alter database checkpoint command followed by either the alter database clear logfile or the alter database clear unarchived logfile command, depending on the type of recovery required. After you issue these commands, the database should operate as usual.

Loss of an Active but Not Current Online Redo Log Group

If you suffer the loss of an active online redo log group, you will need to use the alter database clear unarchived logfile command as shown in the previous section. This is because the active online redo log will not have been archived, and you need to indicate to Oracle that this is okay.

This command will rebuild the online redo log and allow Oracle to proceed with normal operations.

You should always back up the database after this operation.

Loss of the Current Online Redo Log Group

If you want to have a bad day, losing the current online redo log group probably would do it for you. If you have lost the current online redo log group, you probably will experience some loss of data. When you lose the current online redo log group, you can expect that the database will shut down, and not in the normal, pleasant kind of way that you would like.

If you are lucky and the database has not yet shut down, you should immediately attempt to reduce the overall loss of data by checkpointing the database using the alter system checkpoint command, and then shut down the database afterward as soon as practical. The alter system checkpoint command forces the database to write any dirty blocks from the database buffer cache to the database datafiles.

You may be able to open the database without any recovery being required. To try to restart the database:

1. Issue the startup mount command.

2. Issue the alter database clear unarchived logfile command for the redo log group that was lost. Examples of this command can be seen in earlier sections of this chapter.

3. Issue the alter database open command.

If the database opens successfully, you are in luck and a celebration is warranted.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.