Saturday, June 7, 2008

Archive Mode

ARCHIVE MODE MANAGEMENT

To change the log_mode of the database from noarchive to archive log_mode

First find out whether database is in which mode : two ways

SQL>archive log list;

Or

SQL>select log_mode from V$database;

If not in archive mode

SQL>shu immediate;

Edit the init.ora parameter file of the database and add or change atleast 4 parameters

1] Enable Archive

2] Archive Destination

3] Archive Format

4] Archive Maximum Processes

i.e.

log_archive_start=true

log_archive_dest_1=”e:\oracle\backup\db2\archive1\ MANDATORY”

log_archive_dest_2=”f:\oracle\backup\db2\archive2\ OPTIONAL”

log_archive_format= arch_%s.arc ( # %s stands for log sequence number )

log_archive_max_processes=2

After editing the parameter file

SQL>startup mount pfile=’d:\oracle\oradata\ora92\database\init.ora’;

Confirm the log_mode now

SQL>archive log list; or SQL>select log_mode from v$database;

List the parameters log_archive_dest, log_archive_start, & log_archive_format:

SQL>show parameter log_archive;

Or

SQL>select name, value from v$parameter where name like ‘log_archive_dest%’;

Now switch the database to archive log ( database should be in archive log mode )

SQL>alter database archivelog;

And to put into other mode alter database noarchivelog ofcourse after changing the parameters in the parameter file.

Now confirm again with archive log list command and finally

SQL>alter database open;

1 comment:

Samira K. said...

Hi Amjadali,
Nice one and as usual detail one...
Regards
Samira K.