1. query the list of log files used:
Select * from v $ log;
2. query the log files of the Group in use:
Select * from v $ logfile;
3. Force log switching:
Alter system switch logfile;
4. query historical logs:
Select * from v $ log_history;
5. Log archiving mode:
Select dbid, name, created, log_mode from v $ database;
6. query the archived log information:
Select recid, stamp, thread #, sequence #, name from v $ archived_log;
7. add and delete a log file group
Alter database add logfile group 1 ('/home1/Oracle/oradata/ora8i/log1a. log'), '/home2/oracle/oradata/ora8i/log1b. log') size 100 M;
Alter database drop logfile group 1;
8. add and delete log members
Alter database add logfile member '/home1/oracle/oradata/ora8i/log1a. log 'to group 1,'/home1/oracle/oradata/ora8i/log2a. log' to group 2;
Alter database drop logfile member '/home1/oracle/oradata/ora8i/log1a. log ';
9. Move log files
Alter database rename file '/home1/oracle/oradata/ora8i/log1a. log' to'/home2/oracle/oradata/ora8i/log1a. log ';
Before executing this command, make sure that the log file has been physically moved to the new directory.
10. Clear log files
Alter database clear logfile '/home1/oracle/oradata/ora8i/log1a. log ';
This command is used when you cannot use the delete group or group member command to delete logs.
8. view the space occupied by archived logs:
SELECT space_limit/1024/1024/1024 AS "Quota_G", space_used/1024/1024 AS "Used_M", space_used/space_limit * 100 "Used _ %", space_reclaimable AS reclaimable, number_of_files AS files FROM v $ recovery_file_dest;
9. Modify the size of the archive log Space
Alter system set DB_RECOVERY_FILE_DEST_SIZE = 40g;
10. view the archived log list
RMAN> list archivelog all;
Delete archived logs
RMAN> delete archivelog until time 'sysdate-1 ';
Dual-host can also be used
Delete obsolete;
Crosscheck archivelog all;
Delete expired archivelog all;
11. Use list expired to check whether there is any invalid archive log, and verify that there is no invalid archive log:
RMAN> list expired archivelog all;