oracle archive log

to check setting about archive log

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sqlplus /nolog
conn /as sysdba

SQL>archive log list
SQL>show parameter archive

sql>select * from v$archive_processes;
sql>select log_mode from v$database;
sql>select archiver from v$instance

sql>select group#,members,sequence#,archived,status,first_change#,to_char(first_time, 'yyyy-mm-dd hh24:mi:ss') first_change_time from v$log;
sql>select name,sequence#,archived,status,first_change#, to_char(first_time, 'yyyy-mm-dd hh24:mi:ss') first_change_time from v$archived_log;

SQL>select * from V$BACKUP_REDOLOG;
SQL>select * from V$archive_dest;

to clean archive log

1
2
rman target / (rman target sys/sys@dbname more than one instance)
RMAN>list archivelog all;

method 1:
RMAN>delete archivelog until time 'sysdate-1';

method 2:

1
2
3
4
mv arch_1_1234.arc /tmp
RMAN>crosscheck archivelog all;
RMAN>list expired archivelog all;
RMAN>delete expired archivelog all;

Reference

http://www.cumt.org/blog/585
http://www.cnblogs.com/woody-wu/archive/2009/08/23/1552372.html