Archive log Basic
What is archive log:
Copy redo log files to a designated storage device after a log switch has occurred
ARCHIVE processes are present only when the database is in ARCHIVELOG mode and automatic archiving is enabled.
An archived redo log file is a copy of one of the filled members of a redo log group.
It includes the redo entries and the unique log sequence number of the identical member of the redo log group.
Database Running in noarchivelog Mode:
When you run your database in NOARCHIVELOG mode, you disable the archiving of the redo log
The
database control file indicates that filled groups are not required to be
archived
NOARCHIVELOG mode protects a database from instance failure but not from media failure
Only the most recent changes made to the database, which are stored in the online redo log groups, are available for instance recovery.
In NOARCHIVELOG mode you cannot perform
online backups
Database Running in archivelog Mode:
When you run a database in ARCHIVELOG mode, you
enable the archiving of the redo log
The database control file indicates that a group of
filled redo log files cannot be reused by LGWR until the group is archived
A filled group becomes available for archiving
immediately after a redo log switch occurs
Archive Destination Status:
Valid/Invalid:
indicates whether the disk location or service name information is specified and valid.
Enabled/Disabled:
indicates the availability state of the location and whether the database can use the destination.
Active/Inactive:
indicates
whether there was a problem accessing the destination.
Archive log Dynamic Views
V$Archived_log:-
Display the archive log information from the control file
V$Archive_dest:-
Describe the archive log destination
V$Log_history:-
Contain log file information from the control file
V$Archive_process:-
Information from the state of the various ARCH process of the instance
Select * from V$Archive_process
How to check archivelog status:-
SQL> select name,open_mode,log_mode from v$database;
NAME
OPEN_MODE
LOG_MODE
--------- -------------------- ------------
DEV READ WRITE NOARCHIVELOG
NAME
OPEN_MODE
LOG_MODE
--------- -------------------- ------------
VIS READ WRITE ARCHIVELOG
How to check archivelog size:-
SQL> select FILE TYPE, PERCENT SPACE USED from vSflash recovery area usage where FILE TYPE='ARCHIVED LOG';
OS Level:
$ ps -ef | grep -i _arc
How to enable archive log:-
shutdown
startup mount
SQL> alter database archivelog;
SQL> alter database open;
How to disable archive log:-
shutdown
startup mount
SQL> alter database noarchivelog;
SQL> alter database open;
How to find archive log location:-
SQL> archive log list
Database log
mode
Archive Mode
Automatic
archival
Enabled
Archive
destination /u01/oracle/VIS/data
Oldest online log sequence
942
Next log sequence to archive 944
Current log
sequence 944
How to delete archivelog
Go rman utility
rman target /
RMAN>List archivelog all;
archive log details and locations
RMAN>Delete archivelog all;
Deleted all archive logs
RMAN>List archivelog all;
RMAN>crosscheck archivelog all;
RMAN>List copy of archivelog until time 'SYSDATE-2';
archive log details and locations
RMAN>Delete archivelog untile time 'SYSDATE-2';
Deleted all archive logs
Rman
target /
delete
NOPROMPT archivelog all completed before 'sysdate - 1/24';
Exit
Manually clearing the space
Delete the archive log manually from mount point or reco location
Rman taregt /
CROSSCHECK ARCHIVELOG ALL;
delete noprompt expired archivelog all;
Exit.
How To Change Archive Log Destination?
Temporarily Changing the Destination Using SQL*Plus
sqlplus / as sysdba
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination
/u01/app/oracle/product/10.2.0/db_1/dbs/arch
Oldest online log sequence 9285
Next log sequence to archive 9287
Current log sequence 9287
To change the location
SQL>ARCHIVE LOG START '/u01/arch';
Once verify your changes:
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/arch
Oldest online log sequence 9285
Next log sequence to archive 9287
Current log sequence 9287
Permanently Changing the Destination Using SQL*Plus
sqlplus / as sysdba
ALTER SYSTEM SET log_archive_dest ='/u01/arch' scope=both;
To Verify your changes:
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/arch
Oldest online log sequence 9285
Next log sequence to archive 9287
Current log sequence 9287
Known Issues:
ORA-38774: cannot disable media
recovery - flashback database is enabled
SQL> alter database
noarchivelog;
alter database noarchivelog
*
ERROR at line 1:
ORA-38774: cannot disable media
recovery - flashback database is enabled
SQL> show parameter flash
NAME
TYPE
VALUE
------------------------------------
----------- ------------------------------
db_flash_cache_file
string
db_flash_cache_size
big integer 0
db_flashback_retention_target
integer 1440
SQL> show parameter reco
NAME
TYPE
VALUE
------------------------------------
----------- ------------------------------
control_file_record_keep_time
integer 50
db_recovery_file_dest
string
+RECO
db_recovery_file_dest_size
big integer 49888G
db_unrecoverable_scn_tracking
boolean TRUE
recovery_parallelism
integer 0
remote_recovery_file_dest
string
SQL>
SQL> select name,flashback_on
from v$database;
NAME
FLASHBACK_ON
--------- ------------------
TEST YES
SQL> alter database flashback
off;
Database altered.
SQL> select name,flashback_on
from v$database;
NAME
FLASHBACK_ON
--------- ------------------
TEST NO
SQL> alter database
noarchivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list
Database log
mode
No Archive Mode
Automatic
archival
Disabled
Archive
destination
USE_DB_RECOVERY_FILE_DEST
Oldest online log
sequence 84
Current log
sequence 87
SQL>
Error:
RMAN> Delete archivelog until time
'sysdate-1/24';
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=5914 device
type=DISK
RMAN-08137:
warning: archived log not deleted, needed for standby or upstream capture
process
archived log file
name=+DATA/CEBS7D/ARCHIVELOG/2021_12_29/thread_1_seq_200.2595.1092604797
thread=1 sequence=200
RMAN-08137:
warning: archived log not deleted, needed for standby or upstream capture
process
Solution:
RMAN utility and execute below command and
retest the issue
CROSSCHECK ARCHIVELOG ALL;
DELETE EXPIRED ARCHIVELOG ALL;
delete force NOPROMPT archivelog all
completed before 'sysdate - 1';
Refer:
How to Enable/Disable Archive Log Mode In 10g and
11g (Doc ID 371139.1)
How To Change Log Archive Destination While the Database Is Open When the Archive Destination Is Full (Doc ID 160446.1)
Comments
Post a Comment