Master Note: Undo space usage rate (Doc ID 1578639.1)

Master Note: High Undo Space Usage (Doc ID 1578639.1)

APPLIES TO:

Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Information in this document applies to any platform.

PURPOSE

This troubleshooting guide is to identify high undo usage and correct them. This also lists various known issues on high undo usage and their workarounds.

This troubleshooting guide is designed to identify high usage undo and correct. Also lists related to high utilization undo a variety of known problems and their solutions.

This also explains the method for Sizing Undo Tablespace appropriately.

It also illustrates a method of appropriately adjusting the size of the undo tablespace.

TROUBLESHOOTING STEPS

Sizing Undo Tablespace   resize undo tablespace

Sizing the undo tablespace plays vital role in most of the undo issues.  You can either use Auto-extensible tablespace or use undo advisor to determine the size of the fixed size undo tablespace

Resizing undo undo table space in most issues plays a vital role. You can use the automatic extension table space, you can also use the undo advisor to determine the size of fixed-size undo tablespace.

When the undo tablespace is auto-extensible, Oracle automatically increases the size of the tablespace when more space is needed. By combining automatic extension of the undo tablespace with automatically tuned undo retention, you can ensure that long-running queries succeed by guaranteeing the undo for such queries.

When the undo table space is automatically extended when more space is needed, Oracle will automatically increase the size of table space. By automatically extended undo table space combined with the automatic adjustment of undo retention can to ensure the success of long-running inquiry by ensuring undo such a query

If using Fixed size Undo tablespace, use Undo Advisor to size the tablespace. The Undo Advisor helps you analyze various scenarios to determine an appropriate undo tablespace size for different values of maximum undo retention.

If you are using fixed-size undo tablespace, use the undo advisor to adjust the size of table space. undo advisor can help you analyze various options, undo that maximum retention of different values ​​to determine the appropriate size undo tablespace

Note:
Always allow 10 to 20% extra space in your undo tablespace to provide for some fluctuation in your workload    

Always set aside 10% to 20% additional space in the undo table space, in order to reduce the workload of change in    

With AUM in place, UNDO size can be controlled with the undo_retention parameter and the size of the UNDO tablespace, and the setting for these are determined by the level of DML activity in the database

AUM in the case of using, and size parameters may be used undo_retention UNDO tablespace UNDO to control the size of these settings depending on the level of activity in the database DML

Refer: How To Size UNDO Tablespace For Automatic Undo Management (Doc ID 262066.1)

Determining Space Requirement: determining space requirements

V$UNDOSTAT displays a histogram of statistical data to show how well the system is working. The available  include undo space consumption, transaction concurrency, and length of queries executed in the instance. You can use this view to estimate the amount of undo space required for the current workload. Oracle uses this view to tune undo usage in the system. This view is available in both automatic undo management mode and manual undo management mode.

V $ UNDOSTAT display a histogram of statistical data to show the health of the system. The available undo space consumption, and the length of concurrent transaction execution of queries in the examples. You can use this view to estimate the amount of undo space required for the current workload. This view is adjusted using Oracle undo system usage. In view of the automatic mode and the manual undo management undo management mode are available

Shrink Undo Datafiles   shrink undo data files

Refer the document  How to Shrink the datafile of Undo Tablespace (Doc ID 268870.1)

Troubleshooting High Space Usage   solve space usage high in the case

Check the freespace avialable in the undo tablespace   : Check undo table space available free space

SELECT SUM(BYTES) FROM DBA_FREE_SPACE WHERE TABLESPACE_NAME='&UNDOTBS';

The high space usage can be mainly because   : high space utilization may be mainly due to

a. A huge transaction that requires more   space huge transaction needs more space

b. Lots of Unexpired extents (the   extents that are required for undo retention) many outstanding extents (Use the undo preserve extent required)

c. Expired extents not being re-   used (mostly due to some bugs) expired extents can not be reused (mainly due to some error)

d. Other reported bugs.   Error Other reports

To proceed with the analysis, we need  to know the status of the undo extents:  To conduct the analysis, we need to know the status undo range

select sum(bytes /(1024*1024)) from dba_undo_extents where status='EXPIRED';
select sum(bytes /(1024*1024)) from dba_undo_extents where status='ACTIVE';
select sum(bytes /(1024*1024)) from dba_undo_extents where status='UNEXPIRED';

DBA_UNDO_EXTENTS describes the extents comprising the segments in all undo tablespaces in the database.  This view shows the status and size of each extent in the undo tablespace.

DBA_UNDO_EXTENTS described composition range segment database undo all of the table space. This view shows the status and size of the undo table space of each expansion region

To tune SQL queries or to check on runaway queries, use the value of the SQLID column provided in the long query or in the V$UNDOSTAT or WRH$_UNDOSTAT views to retrieve SQL text and other details on the SQL from V$SQL view.

To adjust the SQL query or check runaway query, use long queries or V $ SQLID value of $ _UNDOSTAT view column provided UNDOSTAT or WRH, in order to retrieve additional details about SQL and SQL text from V $ SQL view

Case 1. Active transaction consuming space (Undo   extents are marked Active) 1. active transaction consumes space (Use the undo range marked as active)

If there is a huge transaction then high space usage is expected. You can verify the same using the above output, where the Undo extents will be mostly 'Active'.

If the transaction is large enough, it will require a lot of space to use. You can use the output above to verify the same results, which will undo the scope of most "active."

Case 2. High Space Usage by Committed transactions   (Undo extents are marked Unexpired) Case 2: High space utilization has been submitted to the transaction (undo range marked as not expired)

In this case, the Undo blocks for the committed transactions are kept to honour the undo retention time. This is controlled either by a high Undo_Retention parameter set or by the high value for tuned_undoretention.

In this case, we will remain committed transactions "undo" block to honor undo retention time. This is controlled by a higher value or higher parameter set tuned_undoretention of Undo_Retention

select max(maxquerylen),max(tuned_undoretention) from v$undostat;

 In case of non autoextensible Undo tablespace, the tuned_undoretention is calculated in such a way that we try to provide the maximum retention utilizing the space available. Hence, the Undo blocks are retained for a longer time and this inturn makes the Undo tablespace to appear as if its full. The tuned undoretention will be adjusted when there is a space requirement.

In the case of non-automatic extensible Undo tablespace, tuned_undoretention of calculation is that we tried to use the available space to provide maximum retention. Therefore, undo block retained longer, which in turn looks like the undo table space is full. Unreserved time after time-space requirements will be adjusted to adjust

Refer: Full UNDO Tablespace In 10gR2 and above (Doc ID 413732.1)

When undo tablespace is using NON-AUTOEXTEND datafiles,V$UNDOSTAT.TUNED_UNDORETENTION may be calculated too high preventing undo block from being expired and reused.

When undo tablespace being used NON-AUTOEXTEND data file, V $ UNDOSTAT.TUNED_UNDORETENTION possible to calculate too high, causing expiration and reuse block undo

Refer: Automatic Tuning of Undo_retention Causes Space Problems (Doc ID 420525.1)    

Case 3: Lots of Expired blocks   Case 3: large quantities of obsolete blocks

The Expired blocks will be reused and hence this should be counted as 'availabe' space in the Undo segment.

Expired block will be reused, so the undo segments should be counted as "available" Space

Known Issues

a) If there is a heavy workload before shutdown then there may have been a lot of undo produced in a short space of time giving a low tuned retention. If DB is then shutdown and restarted the in-memory information starts afresh, but there can be a lot of blocks in undo segments from before the shutdown which are not expired , and will not now expire for a long time as they fall inside the new higher tuned_undoretention period.

a) If you shut down a lot of work before, it may undo a large amount in a very short period of time, resulting in a lower retention rate after adjustment. If you then close and restart the database, the information in memory will start again, but from the previous close, the undo segment may be many blocks does not expire, and because they belong to a new memory, so now for a long time not to higher stage tuned_undo retention period.

BUG: 9681444  - TUNED_UNDORETENTION CAN BE TOO HIGH BOUNCE an AFTER DB IF HIGH WORKLOAD the BEFORE
Fixed in 12.1

Workaround: Setting _highthreshold_undoretention


This helps them limit the tuned undo retention to any particular value. @alter system set  "_highthreshold_undoretention" =  10800;  (set to 10800 seconds if undo_retention value is less than 3 hours. Otherwise go with max  of (undo_retention, 10800 seconds))

This helps them to undo retention limit will be adjusted to any particular value. @alter system set "_highthreshold_undoretention" = 10800 ; ( undo_retention if the value is less than 3 hours, otherwise it is set to 10800 seconds, the maximum value is (undo_retention, 10,800 seconds).)

the In The above 12g Parameter Will BE SET by default   in 12g, set these parameters default

the Refer: the Undo Remains Unexpired the When the Using Non-autoextensible the Datafiles the For of the the Undo the Tablespace ( Doc ID 1112431.1 )    

B) High Use the undo Usage Seen When Import by the impdp IS DONE to the Table wHERE the index IS Created.  It Seems to consume UNDO with the split of the index.When import is done without creating the index, the consumption of UNDO is a little.

b) When creating an index into the table by impdp, you will see higher undo usage. It seems to use the index to split consumed UNDO. Upon completion of import in the case of the index is not created, UNDO consumption is very small

impdp maintenance index during import as default, 

By default, impdp maintaining an index during import to the default values, create tables and indexes if you have not used direct_path

But, if there is no index who enforce constraint, and specify access_method=direct_path at impdp command line, we can use direct path method to import. 

However, if there is no constraint index performed, and specify access_method = direct_path impdp on the command line, you can use the direct path method for introducing

Workaround: load data by direct path by disabling primary key constraint (using ALTER TABLE ... MODIFY CONSTRAINT ... DISABLE NOVALIDATE) and using access_method = direct_path .

Solution: by disabling the primary key constraint (using the ALTER TABLE ... MODIFY CONSTRAINT ... DISABLE NOVALIDATE) using access_method = direct_path to load data through a direct path.

- after loading data, enable primary key constraint (using ALTER TABLE ... MODIFY CONSTRAINT ... ENABLE VALIDATE)

- 加载数据后,启用主键约束(使用ALTER TABLE ... MODIFY CONSTRAINT ... ENABLE VALIDATE)

Refer: Error ORA-30036 DataPump Import (IMPDP) Exhausts Undo Tablespace (Doc ID 727894.1)    

c) Active Undo segments without actual transactions  没有实际的活动undo段交易

Issue 1: There exist active undo segments without actual transaction presence. 95-98% of undo space is consuming by ACTIVE undo segments, and consumed space continues to increase despite the absence of transactions)

Question 1: there is no active undo segments exist in the actual transaction. Activities undo segment takes up 95-98% of undo space, although there is no transaction, but the space consumption is still increasing)

It is caused by the fact that the active undo had touched flashback enabled tables but there was no active flashback data archiver (FBDA) process to handle the archiving of those transactions.

This is due to the activity undo has touched enabled Flashback feature table, but there are no active Flashback Data Archiver (FBDA) process to handle these transactions archive

The instance parameter "_disable_flashback_archiver" is set , so the FBDA processs was not starting . This must be reset and the instance must be restarted.

Examples of parameters "_disable_flashback_archiver" has been set, so FBDA process is not started. It must be reset, and must be restarted Examples

Refer : Undo Continuously Growing And Not Releasing Active Segments (Doc ID 1476614.1)

Issue 2:

In 11.2.0.3

A rapidly growing number of active undo extents may be seen in a non-RAC (or former RAC) environment if Flashback Archive is being used.

If you are using flashback archive, then in non-RAC (or former RAC) environment can be seen in the rapid increase in the number of active undo range

Its due to Bug 16196536 Many active undo extents with a lot of flash with a flashback Archive caused by errors 16,196,536 back to undo a range of activities archiving
If the amount of active undo segments is growing very rapidly AND select * from SYS_FBA_BARRIERSCN shows more than one instance (INST_ID) in a non-RAC environment, then you have likely hit this issue.

If the number of active growth undo segment very quickly, and in select * from SYS_FBA_BARRIERSCN is displayed multiple instances (INST_ID) in a non-RAC environment, you are likely to encounter this problem.

Try the following workaround:  Try the following solutions

a)  backup the current record in sys_fba_barrierscn table
    SQL> create table csdba.sys_fba_barrierscn as select * from sys_fba_barrierscn;
    
b) Deleting information in the sys.sys_fba_barrierscn table where inst_id = 1
    SQL>   alter system set "_fbda_debug_mode"=8;
    SQL>   delete from sys.sys_fba_barrierscn where inst_id = 1;
    SQL>   commit;
    SQL>   alter system set "_fbda_debug_mode"=0;
 
c) flush the shared pool to make sure the memory is clean
    SQL>   alter system flush shared_pool;

Refer :Bug 14164829: ACTIVE UNDO GROWING NO ACTIVE TRANSACTION CAN BE FOUND

This issue is fixed in 11.2.0.4 and above  . This problem has been fixed in 11.2.0.4 and later releases

Diagnostic Information Required While Raising a Service Request   diagnostic information needed to request services

Provide the following information while raising a Service Request with Oracle Support 

Provide the following information when holding a service request by Oracle Support

1. Provide the outputs of the following queries : providing an output of the following query

Status of the undo blocks:  state block undo

 col segment_name format a30 head "Segment Name"
 col "ACT BYTES" format 999,999,999,999 head "Active Bytes"
 col "UNEXP BYTES" format 999,999,999,999 head "Unexpired Bytes"
 col "EXP BYTES" format 999,999,999,999 head "Expired Bytes"
 
 select segment_name, nvl(sum(act),0) "ACT BYTES",
    nvl(sum(unexp),0) "UNEXP BYTES",
    nvl(sum(exp),0) "EXP BYTES"
    from (select segment_name, nvl(sum(bytes),0) act,00 unexp, 00 exp
    from dba_undo_extents where status='ACTIVE' group by segment_name
    union
    select segment_name, 00 act, nvl(sum(bytes),0) unexp, 00 exp
    from dba_undo_extents where status='UNEXPIRED' group by segment_name
    union
   select segment_name, 00 act, 00 unexp, nvl(sum(bytes),0) exp
   from dba_undo_extents where status='EXPIRED' group by segment_name)
   group by segment_name
   order by 1
   /

 Free space available within the Undo tablespace:   space available undo tablespace

SELECT SUM(BYTES) FROM DBA_FREE_SPACE WHERE TABLESPACE_NAME='&UNDOTBS';

SELECT autoextensible FROM dba_data_files WHERE tablespace_name='&UNDOTBS';

Undo Retention and the tuned_undoretention  undo保留和tuned_undoretention

Show parameter Undo

Select max(maxquerylen),max(tuned_undoretention) from v$undostat;

REFERENCES

NOTE:16196536.8 - Bug 16196536 - Many active undo extents with flashback Archive

Guess you like

Origin www.cnblogs.com/zylong-sys/p/11965195.html