Thread: optimal value for undo_retention


Permlink Replies: 6 - Pages: 1 - Last Post: Aug 24, 2007 8:39 PM Last Post By: Madrid
SMH

Posts: 758
Registered: 11/15/06
optimal value for undo_retention
Posted: Jun 13, 2007 6:49 AM
Click to report abuse...   Click to reply to this thread Reply
what is the suitable value for the undo_retention parameter for 15gb undo tablespace.I quried maxquerylen from v$undostat view which shows me 26780.Right now i set undo_retention to 20 hours.Still i am facing the ORA-01555 Error(Snapshot too old error).
Undo_management=auto
DB version 9i
OS Solaris.
Thankx...
Simar

Posts: 704
Registered: 08/28/06
Re: optimal value for undo_retention
Posted: Jun 13, 2007 6:57 AM   in response to: SMH in response to: SMH
Click to report abuse...   Click to reply to this thread Reply
Hi

Oracle recomends:

OPTIMAL UNDO RETENTION = ACTUAL UNDO SIZE /(DB_BLOCK_SIZE * UNDO_BLOCK_PERSECOND)

you can get "ACTUAL UNDO SIZE" from :

SELECT SUM(a.bytes) "UNDO_SIZE"
FROM v$datafile a,
v$tablespace b,
dba_tablespaces c
WHERE c.contents = 'UNDO'
AND c.status = 'ONLINE'
AND b.name = c.tablespace_name
AND a.ts# = b.ts#

and UNDO BLOCKS PER SECOND from:

SELECT (SUM(undoblks))/ SUM ((end_time - begin_time) * 86400)
FROM v$undostat

But its always very high........set according to your resources and requirement.

Regards
user538576

Posts: 211
Registered: 10/24/06
Re: optimal value for undo_retention
Posted: Aug 23, 2007 2:53 PM   in response to: Simar in response to: Simar
Click to report abuse...   Click to reply to this thread Reply
In datawarehouse database , I know one update query runs for max 7 hours..do I have to set UNDO_RENTENTION = 7hours otherwise I get error ?
Helio Dias

Posts: 461
Registered: 06/09/04
Re: optimal value for undo_retention
Posted: Aug 23, 2007 5:42 PM   in response to: user538576 in response to: user538576
Click to report abuse...   Click to reply to this thread Reply
Probably not,

Because in DW environment you don“t have usually DML operations, so you will not have to deal with consistent view.

Regards
Helio Dias
Http://heliodias.com
Stellios

Posts: 804
Registered: 06/24/07
Re: optimal value for undo_retention
Posted: Aug 23, 2007 5:48 PM   in response to: Helio Dias in response to: Helio Dias
Click to report abuse...   Click to reply to this thread Reply
That may be so in a perfect world but you will have DML operations when performing batch operations for example which may run for hours as the poster pointed out and more likely to encounter the infamous snapshot too old.
user538576

Posts: 211
Registered: 10/24/06
Re: optimal value for undo_retention
Posted: Aug 24, 2007 8:53 AM   in response to: Stellios in response to: Stellios
Click to report abuse...   Click to reply to this thread Reply
I have one merge query runs for 5 hours on DW env. Should I have set the same hours to undo retention ?
Madrid

Posts: 7,547
Registered: 03/08/99
Re: optimal value for undo_retention
Posted: Aug 24, 2007 8:39 PM   in response to: SMH in response to: SMH
Click to report abuse...   Click to reply to this thread Reply
you can look at the undo advisor at the enterprise manager console, this will tell you what's your optimal undo retention value is. You should check the V$UNDOSTAT for snapshot too old errors frequency.

~ Madrid
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums