In our scenario, we have a rather small archive destination, which we will fill and see how the alternate will be used.
SQL> SELECT DEST_NAME,STATUS,DESTINATION
FROM V$ARCHIVE_DEST
WHERE DESTINATION IS NOT NULL;
DEST_NAME STATUS DESTINATION
----------------------------------------------
LOG_ARCHIVE_DEST_1 VALID /oratest/archives
According to Oracle Note 369120.1, LOG_ARCHIVE_DEST_1 must have the NOREOPEN attribute set, for this to work. So:
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='LOCATION=/optim2/oratest/TESTDB/arch' SCOPE=BOTH; System altered. SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=/oratest/archives NOREOPEN ALTERNATE=LOG_ARCHIVE_DEST_2' SCOPE=BOTH; System altered. SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ALTERNATE SCOPE=BOTH; ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ALTERNATE SCOPE=BOTH * ERROR at line 1: ORA-02097: parameter cannot be modified because specified value is invalid ORA-16028: new LOG_ARCHIVE_DEST_STATE_2 causes less destinations than LOG_ARCHIVE_MIN_SUCCEED_DEST requires SQL> SELECT DEST_NAME,STATUS,DESTINATION FROM V$ARCHIVE_DEST WHERE DESTINATION IS NOT NULL; DEST_NAME STATUS DESTINATION ------------------------------------------------------------ LOG_ARCHIVE_DEST_1 ALTERNATE /oratest/archives LOG_ARCHIVE_DEST_2 ALTERNATE /optim2/oratest/TESTDB/arch SQL> show parameter LOG_ARCHIVE_DEST_STATE_1 NAME TYPE VALUE ------------------------ ------ ------ log_archive_dest_state_1 string ENABLE
I cannot understand why I get this error. I haven't changed LOG_ARCHIVE_DEST_1's state to ALTERNATE and the parameter shows its state is ENABLE not ALTERNATE.
I connect from another terminal and execute the same query:
SQL> SELECT DEST_NAME,STATUS,DESTINATION
FROM V$ARCHIVE_DEST
WHERE DESTINATION IS NOT NULL;
DEST_NAME STATUS DESTINATION
------------------------------------------------------------
LOG_ARCHIVE_DEST_1 VALID /oratest/archives
LOG_ARCHIVE_DEST_2 ALTERNATE /optim2/oratest/TESTDB/arch
!?!?!? I don't know why those query's results are different. If anyone has the time to test this case or know why this is happening, please, inform me.
The database version is 11.2.0.3.
Anyway, now we have an alternate destination and we will fill the default log destination.
This is the part from the alert log, where the default archive log destination fills and all new archive logs are placed in the alternate destination:
Thread 1 advanced to log sequence 144 (LGWR switch) Current log# 3 seq# 144 mem# 0: /optim2/oratest/TESTDB/redo/redo03.log Tue Jul 17 12:21:10 2012 ARC3: Error 19502 Closing archive log file '/oratest/archives/1_143_787911367.arc' ARCH: Archival stopped, error occurred. Will continue retrying ORACLE Instance TESTDB - Archival Error
LOG_ARCHIVE_DEST_1 filled
ORA-16038: log 2 sequence# 143 cannot be archived ORA-19502: write error on file "", block number (block size=) ORA-00312: online log 2 thread 1: '/optim2/oratest/TESTDB/redo/redo02.log' Archived Log entry 139 added for thread 1 sequence 143 ID 0x9941a747 dest 2: Archiver process freed from errors. No longer stopped
LOG_ARCHIVE_DEST_2 starts being used.
The default destination is DISABLED and the ALTERNATE has become VALID:
SQL> SELECT DEST_NAME,STATUS,DESTINATION
FROM V$ARCHIVE_DEST
WHERE DESTINATION IS NOT NULL;
DEST_NAME STATUS DESTINATION
----------------------------------------------------------
LOG_ARCHIVE_DEST_1 DISABLED /oratest/archives
LOG_ARCHIVE_DEST_2 VALID /optim2/oratest/TESTDB/arch
SQL> show parameter LOG_ARCHIVE_DEST_STATE
NAME TYPE VALUE
------------------------ ------ -------
log_archive_dest_state_1 string ENABLE
log_archive_dest_state_2 string ALTERNATE
We backup and delete the archive logs using RMAN to free all space from the destinations.
The destinations' status will not change. All new archive logs will be placed in LOG_ARCHIVE_DEST_2.
So, to go back to previous state, we have to reconfigure the destinations:
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_1=ENABLE SCOPE=BOTH;
System altered.
SQL> SELECT DEST_NAME,STATUS,DESTINATION
FROM V$ARCHIVE_DEST
WHERE DESTINATION IS NOT NULL;
DEST_NAME STATUS DESTINATION
--------------------------------------------------------
LOG_ARCHIVE_DEST_1 VALID /oratest/archives
LOG_ARCHIVE_DEST_2 VALID /optim2/oratest/TESTDB/arch
In this state, archive logs will be written in BOTH destinations, so:
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ALTERNATE SCOPE=BOTH;
System altered.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=/oratest/archives NOREOPEN ALTERNATE=LOG_ARCHIVE_DEST_2' SCOPE=BOTH;
System altered.
SQL> SELECT DEST_NAME,STATUS,DESTINATION
FROM V$ARCHIVE_DEST
WHERE DESTINATION IS NOT NULL;
DEST_NAME STATUS DESTINATION
----------------------------------------------------------
LOG_ARCHIVE_DEST_1 ALTERNATE /oratest/archives
LOG_ARCHIVE_DEST_2 ALTERNATE /optim2/oratest/TESTDB/arch
AGAIN, V$ARCHIVE_DEST output is not correct. We can't have 2 alternate and no valid destination.
From the second session:
SELECT DEST_NAME,STATUS,DESTINATION
FROM V$ARCHIVE_DEST
WHERE DESTINATION IS NOT NULL;
DEST_NAME STATUS DESTINATION
-----------------------------------------------------------
LOG_ARCHIVE_DEST_1 VALID /oratest/archives
LOG_ARCHIVE_DEST_2 ALTERNATE /optim2/oratest/TESTDB/arch
This is the correct configuration. Now, new archive logs will be placed in LOG_ARCHIVE_DEST_1 and not in LOG_ARCHIVE_DEST_2.
23/07/12: I opened an SR for this incident and filed Bug 14360414.
25/09/12: Oracle closed my SR, since bug's impact is not high, but kept bug open with status 11 - Code Bug (Response/Resolution).
No comments:
Post a Comment