I got ” ORA-01691 unable to extend LOB segment ” error in Oracle database.
ORA-01691 unable to extend LOB segment
Details of error are as follows.
ORA-01691: unable to extend lob segment %s.%s by %s in tablespace %s Cause: Failed to allocate an extent of the required number of blocks for LOB segment in the tablespace indicated. Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated.
ORA-55917: Table flush I/O failed for log ID: 1 bucket ID: 0 ORA-01691: unable to extend lob segment AUDSYS.SYS_LOB0000091239C00014$$ by 128 in tablespace SYSAUX ORA-02002: error while writing to audit trail ORA-55917: Table flush I/O failed for log ID: 1 bucket ID: 0 ORA-01691: unable to extend lob segment AUDSYS.SYS_LOB0000091239C00014$$ by 128 in tablespace SYSAUX
unable to extend lob segment
This ORA-01691 errors are related with the Failed to allocate an extent of the required number of blocks for LOB segment in the tablespace indicated.
To solve this error, Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated.
Add a datafile to the SYSAUX tablespace as below to have more space on the SYSAUX tablespace . If this solution does not work, then the database has to be rebuilt.
1. First we would have to check in the diskgroup how much free space is available to add datafile.
SQL> SELECT name, free_mb, total_mb, free_mb/total_mb*100 as percentage FROM v$asm_diskgroup;
2. Then we would have to find out that diskgroup name which is mapped to SYSAUX tablespace for adding datafile.
SQL> select tablespace_name,file_name from dba_data_files where tablespace_name='SYSAUX';
You should see an output similar to the below output –
TABLESPACE FILE_NAME ---------- -------------------------------------------------------------------------- SYSAUX +DATA/test/datafile/sysaux.264.960435911
Here the diskgroup is +DATA which is mapped to SYSAUX tablespace.
3. Add the datafile in DATA diskgroup.
SQL> alter tablespace SYSAUX add datafile'+DATA' size 10G autoextend on next 1024M;
If you use File system, then add datafile as follows.
alter tablespace SYSAUX add datafile '/oradata/datafile/SYSAUX02.dbf' size 1G autoextend on next 1024M;
4. Check the datafile is added for Sysaux Tablespace with 10G size.
SQL> select tablespace_name,file_name,bytes/1024/1024/1024 from dba_data_files;
After this, we need to purge the audit data as the SYSAUX is extended now.
Purge the audit records periodically which will eventually prevent the LOB segment from growing to a large size, the space inside the LOB segment will be re-used.
Review your audit configurations and Unset unwanted audit settings.
To disable the Unified Audit policies that are enabled by default , run the below :
noaudit policy ORA_SECURECONFIG;
noaudit policy ORA_LOGON_FAILURES;
Do you want to learn Oracle Database for Beginners, then read the following articles.
Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )