Wednesday, October 17, 2007

Changing Database Modes

By default Oracle database runs in no archive log mode. This means that Oracle will not make any off line copies of online redo logs. Therefore it is highly recommended that you must change it to archive log mode; so that there may be no loss of log information. Now here is a point that archiving is done in two ways i.e. Manual and Automatic. Manual archiving can be a burden on a DBA and it takes too much time. And in some cases it also brings database to its knees. When you turn the database to archive log mode than ARCH process does the automatic archiving. Now the only question remains to be answered is how to change the database mode. Here are the simple steps.

  1. First of all shut down the Instance.
  2. Than go into the init.ora file and change the following parameters.

Log_archive_start=true

Log_archive_dest=’c: \oracle\oradata\dbase\archive’

  1. Mount the Instance.
  2. Than give the command;

SQL>alter database archivelog;

SQL>archive log list;

  1. The second command will tell you the information about the database that whether it is in archive or noarchive log mode.
  2. Finally open the database with the command.

SQL>alter database open;

After completing all these steps you will see that the mode of your database is changed. If you want to change it back to noarchive log mode then first change the parameter Log_archive_start to false and give the command:

SQL>alter database noarchivelog;

Remember that your database should be in mount state when applying these commands. Also you can check the status again by giving the command:

SQL>archive log list.

Now if you are using Oracle 10g then it is a lot easier. All you got to do is to shutdown the database first and then bring it to mount state and give the command:

SQL>alter database archivelog;

As for as the two parameters are concerned the first one is deprecated and second defaults to the flash recovery area.

No comments:

Post a Comment