全部博文(710)
分类: Oracle
2011-05-08 21:48:10
8)configuring the database archiving mode(b8_1)
noarchivelog(b8_2)
archivelog(b8_3)
a) changing the archiving mode
sys>shutdown immediate
sys>startup mount
sys>alter database archivelog;(ALTER DATABASE ARCHIVELOG MANUAL;)(10g)
sys>alter database open;
(full database backup)
log_archive_start=true|false(9i)
select name,ISDEPRECATED from v$parameter where name like '%log_archive_star%';(10g)
b) Specifying Multiple ARCn Processes
log_archive_max_processes (max ARCn process number)
sys> ALTER SYSTEM SET LOG_ARCHIVE_MAX_PROCESSES=3;
sys>select name,paddr from v$bgprocess where paddr<>'00';
c)Specifying the Archive Log Destination
log_archive_dest_n (archive log destination)(n=1..10)
log_archive_dest_1='location=/u01/app/oracle/arch'
log_archive_dest_2='service=standby_db1'
sys>alter system set log_archive_dest_1='location=/u01/app/oracle/arch';
sys>alter system set log_archive_dest_2='location=USE_DB_RECOVERY_FILE_DEST';
MANDATORY: implies that archiving to this destination must complete successfully
before an online redo log file can be overwritten.
reopen or reopen=600:whether archiving to a destination must be re-attempted in case of failure
sys>alter system set log_archive_dest_1='location=/u02/app/oracle/arch MANDATORY';
sys>alter system set log_archive_dest_1='location=/u02/app/oracle/arch MANDATORY reopen';
sys>alter system set log_archive_dest_1='location=/u02/app/oracle/arch MANDATORY reopen=600';
OPTIONAL: implies that an online redo log file can be reused even if it has not been successfully archived to this destination.
This is the default.
sys>alter system set log_archive_dest_1='location=/u02/app/oracle/arch OPTIONAL';
flash recovery area
The Flash Recovery Area provides a centralized location for
control file backups, archived redo logs, flashback logs, and database backups.
The Flash Recovery Area can be defined as a directory, file system, or ASM disk group.
A single Flash Recovery Area can be shared by more than one database
USE_DB_RECOVERY_FILE_DEST=/u01/app/oracle/flash_recovery_area
d)Specifying the Minimum Number of Successful Archive Locations
log_archive_min_succeed_dest
The number of destinations that need to be archived successfully before an online redo log file can be used is determined
based on the following settings:
The number of destinations defined as MANDATORY.
The value of the LOG_ARCHIVE_MIN_SUCCEED_DEST parameter.
The value specifies a lower bound on the number of local destinations that need to be archived.
If this number is less than the number of mandatory local destinations,
it has no effect on the archiving behavior.
If this number exceeds the number of mandatory local destinations,
the number of local destinations archived must be at least equal to this value before an online redo log file can be reused.
LOG_ARCHIVE_MIN_SUCCEED_DEST = 2
e)Controlling Archiving to a Destination
An archival destination can be disabled by using the dynamic initialization parameter LOG_ARCHIVE_DEST_STATE_n
LOG_ARCHIVE_DEST_STATE_2 = DEFER
Archiving to a destination can be enabled again
LOG_ARCHIVE_DEST_STATE_2 = ENABLE
f)log_archive_format
alter system set log_archive_format='%s_%a_%t_%r.arc' scope=spfile;
%s (log sequence)(*)
%S (length )
%t (log thread) (*)
%T
%a (active id)
%d (db id)
%r (resetlogs id) (*)
%R (select resetlogs_id from V$DATABASE_INCARNATION);
alter system archive log start
alter system archive log stop;
alter system archive log current
g)see archivelog
SYS>archive log list;
SYS>select DBID,NAME,LOG_MODE from v$database;
v$archived_log
v$archive_dest
v$log_history
v$archive_processes