When database is in archive log mode. Oracle instance would make another copy of the log. The purpose for the archive log mode is to increase the availably. Noarchivelog mode is similar to ‘truncate log at check point” in Sybase or “Simple recovery mode” in MSSQL .Archivelog mode is similar to “Full recovery mode” in MSSQL.
In the archive mode, the database can be backup while it is open.
The database can be online database restore from full backup + online log + archive log ( in the open status) as long as SYSTEM table space and current undo table space are intact.
How to check the current mode for the database?
select log_mode from v$database;
archive log list
How to enable the archive mode?
Before we enable the archive mode, we need to make sure below 3 parameters are properly set.
log_archive_format
Format for the archive log file.
show parameter log_archive_format
log_archive_max_processes
Number of the Arch process working on archiving.
show parameter log_archive_max_processes
log_archive_dest
Define the location of the archive file store. It can be the directory path or use db_recovery_file_dest to store in the flash recovery area.
show parameter log_archive_dest
Below demo, set the archive file to directory path and flash recovery area
alter system set log_archive_dest_1='LOCATION=/home/oracle/app/oracle/oradata/orcl/archive/';
alter system set log_archive_dest_2='LOCATION=db_recovery_file_dest';
Update ( 2013/2/4): db_recovery_file_dest can not be used with log_archive_dest but can be used with log_archive_dest_n. If we try to set the log_archive_dest using flash back recovery area, we would get the ORA-16018: cannot use LOG_ARCHIVE_DEST with LOG_ARCHIVE_DEST_n or
DB_RECOVERY_FILE_DEST error.
The archive mode ONLY can be changed when database is not open.
select status from v$instance;
select log_mode from v$database;
shutdown immediate
startup mount
select status from v$instance;
select log_mode from v$database;
alter database archivelog;
select log_mode from v$database;
alter database open;
After enable the archive mode, we need to take the full database backup as the original backup under non archive mode can not be used.
Archive current log file
Below command archive the current online log ( sequence 602)
alter system archive log current;
How to disable the archive mode?
Only can change the database from archive mode to no archive mode when database is not open ( mount ).
select log_mode from v$database;
shutdown immediate
startup mount
alter database noarchivelog;
select log_mode from v$database;
alter database open;
Since we switch the mode, the original database backup is no longer valid. We need to take the new database dump just in case.
shutdown immediate
exit
rman target /
startup mount
backup database;
alter database open;
exit;
That is very helpful for increasing my knowledge in this field
ReplyDeleteseo Niemcy
OMEGA has been a world leader fake watchesin advanced watch design since 1848. replica omega planet ocean watches Over the years, replica omega railmaster watches the brand has been widely celebrated for their durability and precision. OMEGA has served as the official timekeepers of the Olympic Games for nearly a century. They also created the official watch of the space program and first watch to land on the moon. Buying an OMEGA watch is an excellent way to invest in a piece of history.
ReplyDelete