Home » RDBMS Server » Backup & Recovery » Why Do Redo Log Remain Active Even After alter system archive log current (11.2.0.4, SLES SP3 )
Why Do Redo Log Remain Active Even After alter system archive log current [message #647469] |
Fri, 29 January 2016 00:08 |
|
juniordbanewbie
Messages: 250 Registered: April 2014
|
Senior Member |
|
|
Dear all,
this is what I have done,
SYS@ORCL>SELECT log.group#, logfile.member, log.status, log.archived FROM sys.v_$logfile logfile JOIN sys.v_$log log ON logfile.group#=log.group# ORDER BY log.group#, logfile.member;
GROUP# MEMBER STATUS ARC
---------- ------------------------------------------ -------- ---
1 /u02/app/oracle2/oradata/ORCL/redo01.log INACTIVE YES
2 /u02/app/oracle2/oradata/ORCL/redo02.log INACTIVE YES
3 /u02/app/oracle2/oradata/ORCL/redo03.log CURRENT NO
4 /u02/app/oracle2/oradata/ORCL/redo04_1.log UNUSED YES
4 /u02/app/oracle2/oradata/ORCL/redo04_2.log UNUSED YES
5 /u02/app/oracle2/oradata/ORCL/redo05_1.log UNUSED YES
5 /u02/app/oracle2/oradata/ORCL/redo05_2.log UNUSED YES
6 /u02/app/oracle2/oradata/ORCL/redo06_1.log UNUSED YES
6 /u02/app/oracle2/oradata/ORCL/redo06_2.log UNUSED YES
9 rows selected.
SYS@ORCL>
SYS@ORCL>ALTER SYSTEM ARCHIVE LOG CURRENT;
System altered.
SYS@ORCL>
SYS@ORCL>SELECT log.group#, logfile.member, log.status, log.archived FROM sys.v_$logfile logfile JOIN sys.v_$log log ON logfile.group#=log.group# ORDER BY log.group#, logfile.member;
GROUP# MEMBER STATUS ARC
---------- ------------------------------------------ -------- ---
1 /u02/app/oracle2/oradata/ORCL/redo01.log INACTIVE YES
2 /u02/app/oracle2/oradata/ORCL/redo02.log INACTIVE YES
3 /u02/app/oracle2/oradata/ORCL/redo03.log ACTIVE YES
4 /u02/app/oracle2/oradata/ORCL/redo04_1.log CURRENT NO
4 /u02/app/oracle2/oradata/ORCL/redo04_2.log CURRENT NO
5 /u02/app/oracle2/oradata/ORCL/redo05_1.log UNUSED YES
5 /u02/app/oracle2/oradata/ORCL/redo05_2.log UNUSED YES
6 /u02/app/oracle2/oradata/ORCL/redo06_1.log UNUSED YES
6 /u02/app/oracle2/oradata/ORCL/redo06_2.log UNUSED YES
9 rows selected.
SYS@ORCL>
SYS@ORCL>ALTER DATABASE DROP LOGFILE GROUP 1;
Database altered.
SYS@ORCL>
SYS@ORCL>ALTER DATABASE DROP LOGFILE GROUP 2;
Database altered.
SYS@ORCL>
SYS@ORCL>ALTER DATABASE DROP LOGFILE GROUP 3;
ALTER DATABASE DROP LOGFILE GROUP 3
*
ERROR at line 1:
ORA-01624: log 3 needed for crash recovery of instance ORCL (thread 1)
ORA-00312: online log 3 thread 1: '/u02/app/oracle2/oradata/ORCL/redo03.log'
My question is why do redo log group 3 remains active even after I do a alter system archive log current?
thanks in advance!
|
|
|
|
Re: Why Do Redo Log Remain Active Even After alter system archive log current [message #647474 is a reply to message #647473] |
Fri, 29 January 2016 01:19 |
|
juniordbanewbie
Messages: 250 Registered: April 2014
|
Senior Member |
|
|
what should be done initally?
SYS@ORCL>SELECT log.group#, logfile.member, log.status, log.archived FROM sys.v_$logfile logfile JOIN sys.v_$log log ON logfile.group#=log.group# ORDER BY log.group#, logfile.member;
GROUP# MEMBER STATUS ARC
---------- ------------------------------------------ -------- ---
1 /u02/app/oracle2/oradata/ORCL/redo01.log INACTIVE YES
2 /u02/app/oracle2/oradata/ORCL/redo02.log INACTIVE YES
3 /u02/app/oracle2/oradata/ORCL/redo03.log CURRENT NO
4 /u02/app/oracle2/oradata/ORCL/redo04_1.log UNUSED YES
4 /u02/app/oracle2/oradata/ORCL/redo04_2.log UNUSED YES
5 /u02/app/oracle2/oradata/ORCL/redo05_1.log UNUSED YES
5 /u02/app/oracle2/oradata/ORCL/redo05_2.log UNUSED YES
6 /u02/app/oracle2/oradata/ORCL/redo06_1.log UNUSED YES
6 /u02/app/oracle2/oradata/ORCL/redo06_2.log UNUSED YES
are you saying
ALTER SYSTEM archive log current;
SYS@ORCL>SELECT log.group#, logfile.member, log.status, log.archived FROM sys.v_$logfile logfile JOIN sys.v_$log log ON logfile.group#=log.group# ORDER BY log.group#, logfile.member;
GROUP# MEMBER STATUS ARC
---------- ------------------------------------------ -------- ---
1 /u02/app/oracle2/oradata/ORCL/redo01.log INACTIVE YES
2 /u02/app/oracle2/oradata/ORCL/redo02.log INACTIVE YES
3 /u02/app/oracle2/oradata/ORCL/redo03.log CURRENT NO
4 /u02/app/oracle2/oradata/ORCL/redo04_1.log UNUSED YES
4 /u02/app/oracle2/oradata/ORCL/redo04_2.log UNUSED YES
5 /u02/app/oracle2/oradata/ORCL/redo05_1.log UNUSED YES
5 /u02/app/oracle2/oradata/ORCL/redo05_2.log UNUSED YES
6 /u02/app/oracle2/oradata/ORCL/redo06_1.log UNUSED YES
6 /u02/app/oracle2/oradata/ORCL/redo06_2.log UNUSED YES
9 rows selected.
SYS@ORCL>
SYS@ORCL>ALTER SYSTEM ARCHIVE LOG CURRENT;
System altered.
SYS@ORCL>
SYS@ORCL>SELECT log.group#, logfile.member, log.status, log.archived FROM sys.v_$logfile logfile JOIN sys.v_$log log ON logfile.group#=log.group# ORDER BY log.group#, logfile.member;
GROUP# MEMBER STATUS ARC
---------- ------------------------------------------ -------- ---
1 /u02/app/oracle2/oradata/ORCL/redo01.log INACTIVE YES
2 /u02/app/oracle2/oradata/ORCL/redo02.log INACTIVE YES
3 /u02/app/oracle2/oradata/ORCL/redo03.log ACTIVE YES
4 /u02/app/oracle2/oradata/ORCL/redo04_1.log CURRENT NO
4 /u02/app/oracle2/oradata/ORCL/redo04_2.log CURRENT NO
5 /u02/app/oracle2/oradata/ORCL/redo05_1.log UNUSED YES
5 /u02/app/oracle2/oradata/ORCL/redo05_2.log UNUSED YES
6 /u02/app/oracle2/oradata/ORCL/redo06_1.log UNUSED YES
6 /u02/app/oracle2/oradata/ORCL/redo06_2.log UNUSED YES
ALTER SYSTEM checkpoint;
right or wrong? now I can't really simulate because redo log group 3 is already inactive.
thank a lot!
|
|
|
|
|
Re: Why Do Redo Log Remain Active Even After alter system archive log current [message #647481 is a reply to message #647469] |
Fri, 29 January 2016 06:39 |
|
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
Just as an aside, I notice that your groups 1,2 and 3 are not multiplexed, while the rest are. Makes me wonder about the purpose of this exercise.
Are you trying to get rid of the non-multiplexed groups after having added 3 new multiplexed groups?
If so, that wasn't necessary, as you could have simply added a second member to each of the original groups.
If, on the other hand, you were also increasing the size of your redo groups by adding new, larger ones, then you are on the right track. Once created, the size of a redo cannot be changed, so the only way to effect a change is to add new groups with the new size, then delete the old.
|
|
|
|
|
|
|
Re: Why Do Redo Log Remain Active Even After alter system archive log current [message #647522 is a reply to message #647518] |
Sun, 31 January 2016 05:19 |
John Watson
Messages: 8962 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
juniordbanewbie wrote on Sun, 31 January 2016 09:56Dear Ed, the purpose of this exercise is to test this on a test system before doing it on production. production has multiplexed redo logs. currently production is switching 9 times in an peak hour, since oracle recommendation is log switch every 20 minutes, it means 3 times in an hour. so I got to increase the redo log size by 3 times in actual production.
As MC says,
Quote:Forget about this Oracle recommendation which I think dates back to Oracle 7. because, as I said,
Quote:Many people think that a log switch forces a full checkpoint. It doesn't any more, as you have proved. Not since release 8
You need to think about why that recommendation was made, not just blindly follow (and worry) about it.
|
|
|
Re: Why Do Redo Log Remain Active Even After alter system archive log current [message #647543 is a reply to message #647521] |
Mon, 01 February 2016 22:25 |
|
juniordbanewbie
Messages: 250 Registered: April 2014
|
Senior Member |
|
|
I confirm that we need to do the following before we can drop the redo logs,
ALTER SYSTEM ARCHIVE LOG CURRENT;
ALTER SYSTEM CHECKPOINT;
If I'm looking at this factor
- wait events related to switch logs
when is it problembatic?
PERFSTAT@ORCL>
PERFSTAT@ORCL>--log file switch (private strand flush incomplete)
PERFSTAT@ORCL>--12345678901234567890123456789012345678901234567890
PERFSTAT@ORCL>
PERFSTAT@ORCL>SET LINESIZE 112
PERFSTAT@ORCL>
PERFSTAT@ORCL>column event format a50
PERFSTAT@ORCL>column sum_total_waited_micro format 09999999999999
PERFSTAT@ORCL>column sum_total_waits format 0999999999
PERFSTAT@ORCL>column avg_time_waited_micro format 0999999.9999
PERFSTAT@ORCL>
PERFSTAT@ORCL>
PERFSTAT@ORCL>SELECT event, sum(time_waited_micro) sum_total_waited_micro, sum(total_waits) sum_total_waits
2 , round(sum(time_waited_micro)/sum(total_waits),4) avg_time_waited_micro
3 FROM STATS$SYSTEM_EVENT WHERE event IN
4 ('log file sync',
5 'log buffer space',
6 'log file switch (archiving needed)',
7 'log file switch (checkpoint incomplete)',
8 'log file switch (private strand flush incomplete)',
9 'log file switch completion',
10 'switch logfile command'
11 )
12 GROUP BY event
13 ORDER BY round(sum(time_waited_micro)/sum(total_waits),4) DESC;
EVENT SUM_TOTAL_WAITED_MICRO SUM_TOTAL_WAITS AVG_TIME_WAITED_MICRO
-------------------------------------------------- ---------------------- --------------- ---------------------
log file switch completion 00004978075902 0000007547 0659609.8982
switch logfile command 00001155864483 0000004338 0266451.0104
log file switch (checkpoint incomplete) 00000486932855 0000002485 0195948.8350
log buffer space 00000210578167 0000001825 0115385.2970
log file switch (private strand flush incomplete) 00000142563916 0000006615 0021551.6124
log file sync 02079561458560 0183151033 0011354.3529
is there any magical figure that I should look for?
when should we increase redo log size or increase redo log group or both?
from https://docs.oracle.com/cd/E11882_01/server.112/e10803/config_db.htm#HABPT4823
it does not tell us whether to increase redo log size or increase number of redo log group or both to achieve a peak redo rate x 20 minutes
thanks
|
|
|
|
|
Re: Why Do Redo Log Remain Active Even After alter system archive log current [message #647548 is a reply to message #647543] |
Tue, 02 February 2016 00:48 |
|
Michel Cadot
Messages: 68728 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote:is there any magical figure that I should look for?
No there is not, it depends only on your opinion like to answer the question "from how much weight a person is too fat?".
As I said, it depends on the global picture of your site.
By the way, telling you waited for X seconds without telling since when the mesure is taken is useless. It is not the same thing to have waited 10 seconds in the last minute or 10 seconds in the last day.
[Updated on: Tue, 02 February 2016 00:49] Report message to a moderator
|
|
|
Re: Why Do Redo Log Remain Active Even After alter system archive log current [message #647550 is a reply to message #647548] |
Tue, 02 February 2016 01:20 |
|
juniordbanewbie
Messages: 250 Registered: April 2014
|
Senior Member |
|
|
are you saying that I should tune my query to include when the snapshot is taken like the following?
SELECT to_char(snapshot.snap_time, 'YYYY-MM-DD HH24:MI:SS') ,event, sum(time_waited_micro), sum(total_waits), round(sum(time_waited_micro)/sum(total_waits),4)
FROM STATS$SYSTEM_EVENT se JOIn stats$snapshot snapshot
ON se.SNAP_ID = snapshot.snap_id
WHERE se.event IN
('log file sync',
'log buffer space',
'log file switch (archiving needed)',
'log file switch (checkpoint incomplete)',
'log file switch (private strand flush incomplete)',
'log file switch completion',
'switch logfile command'
) and snapshot.snap_time<SYSDATE and snapshot.SNAP_TIME>=SYSDATE-5/24/60
GROUP BY to_char(snap_time, 'YYYY-MM-DD HH24:MI:SS') ,event
ORDER BY round(sum(time_waited_micro)/sum(total_waits),4) DESC;
thanks
|
|
|
|
|
Re: Why Do Redo Log Remain Active Even After alter system archive log current [message #647566 is a reply to message #647543] |
Tue, 02 February 2016 06:25 |
|
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
juniordbanewbie wrote on Mon, 01 February 2016 22:25
If I'm looking at this factor
- wait events related to switch logs
when is it problembatic?
When the end users complain.
Quote:
is there any magical figure that I should look for?
when should we increase redo log size or increase redo log group or both?
thanks
You appear to have contracted a serious case of Compulsive Tuning Disorder.
Here's the steps I take to deal with "too many log switches", in the absence of any other problematic evidence:
1) Get a fresh cup of coffee
2) Go flirt with the secretary
3) Ask a co-worker what he thinks of the outcome of last week's game.
4) Check OraFAQ and OTN forums for any interesting threads.
|
|
|
Goto Forum:
Current Time: Sun Dec 22 02:03:49 CST 2024
|