Ora 01691 ошибка как исправить

I get the below error when I try to insert data in the database.

ORA-01691: unable to extend lob segment XXXXXX by 8192 in tablespace USERS

I’m using an Oracle database (express 12c version). Googling the error I found that it means that there no more space in the tablespace and you need to increase the dimension of your datafile or the number of datafile you are using. I have 5 datafile of 30 GB and one of them is empty so I don’t understand what the problem is.

Edit

SYSTEM      793,19      800     99,15   32768   2,42

SYSAUX      2203,56     2320    94,98   32768   6,72

UNDOTBS1    48,13       23345   0,21    32768   0,15

USERS       153534,5    30720   499,79  30720   499,79

USERS       153534,5    30720   499,79  30720   499,79

USERS       153534,5    30720   499,79  30720   499,79

USERS       153534,5    30720   499,79  30720   499,79

USERS       153534,5    30720   499,79  30720   499,79

I get the below error when I try to insert data in the database.

ORA-01691: unable to extend lob segment XXXXXX by 8192 in tablespace USERS

I’m using an Oracle database (express 12c version). Googling the error I found that it means that there no more space in the tablespace and you need to increase the dimension of your datafile or the number of datafile you are using. I have 5 datafile of 30 GB and one of them is empty so I don’t understand what the problem is.

Edit

SYSTEM      793,19      800     99,15   32768   2,42

SYSAUX      2203,56     2320    94,98   32768   6,72

UNDOTBS1    48,13       23345   0,21    32768   0,15

USERS       153534,5    30720   499,79  30720   499,79

USERS       153534,5    30720   499,79  30720   499,79

USERS       153534,5    30720   499,79  30720   499,79

USERS       153534,5    30720   499,79  30720   499,79

USERS       153534,5    30720   499,79  30720   499,79

Описание фона: веб-сервер пользователя внезапно появляется данные, которые не могут быть написаны, и журнал проверки см. В разделе, что проблема выглядит следующим образом:

ORA-01691: лоб сегментUSERS.SYS_LOB0000087483C00004$$Невозможно расширить 8192 (в пользователей табличного пространства).в результате чегоДанные не могут быть написаны.

Обработка аварийной аварийной аварийной обработки: Запрос информации, связанной с ошибкой, ответ недостаточен, а файл данных добавляется. Используйте этот метод для успешного решения его. После запроса автоматическое расширение было установлено.

Позже я вдруг подумал, что это будет ограничение по размеру файла, поэтому используйте ключевые слова: Одиночный запрос Ограничение Ограничения Ограничение Техническая документация, результаты находят следующие:

Когда табличное пространство Maxsize Unlimited:

В системе Linux в случае размера блока 8k максимальный размер файла данных составляет 32 ГБ.

Когда размер пространства таблицы установлен (Maxsize 4096m):

Значение размера данных предварительно установлено.

3. Решение:

A. Когда размер файла данных имеет значение настройки (MAXSIZE 4096M): увеличить размер файла данных, максимум не превышает 32G.

alter database datafile 'Путь файла' autoextend on next 100m maxsize 10240M;

B. Когда пространство таблицы Maxsize Unlimited: вы можете добавить только файл данных.

alter tablespace xxx add datafile 'Путь файла данных 'Размер 1000 м Autoextend на следующий 100 м Maxsize Unlimited

В случае размера блока данных Data Oralce по умолчанию один файл до 32G; файл данных может достигать корпуса 32T в 8K, используя большой файл.

Размер блока по умолчанию не может быть изменен, если вам нужно изменить базу данных;

Это зависит от этого задачи решения: 1, добавьте файлы данных. 2, используйте большие файлы. 3, измените размер блока данных.

Вот подробное решение:

Окружающая среда: Linux.системаИнструмент: PL / SQL разработчик

Шаг 1: Просмотр имени и файла табличного пространства:

select tablespace_name, file_id, file_name,

round(bytes/(1024*1024),0) total_space

from dba_data_files

order by tablespace_name

Шаг 2: Увеличьте желаемое табличное пространство:

Изменение базы данных DataFile «Табличное пространство» Расположение «Изменение размера нового размера»

Например:

alter database datafile ‘oracleoradataanita_2008.dbf’ resize 4000m

Для оракулабаза данныхТабличное пространство, в дополнение к ручному увеличению, увеличьте файл данных или тому подобное, чтобы расширить размер табличного пространства.

Метод 1: Добавить номер файла данных

Изменить имя таблицы табличного пространства
Добавить файл данных «Новый файл файла данных» Размер файла данных

Например:

alter tablespace ESPS_2008
     add datafile ‘oracleoradataanita_2010.dbf’ size 1000m

Способ 2: Установить табличное пространство автоматического расширения

Изменение базы данных DataFile «Файл данных»
AUTOVEXTENC на следующий автоматический расширенный размер Maxsize максимальный размер расширения

Например:

alter database datafile ‘oracleoradataanita_2008.dbf’

      autoextend on next 100m maxsize 10000m

Метод 3: Использование таблицы запросов:

select a.tablespace_name,a.bytes/1024/1024 «sum MB»,

(a.bytes-b.bytes)/1024/1024 «used MB»,b.bytes/1024/1024 «free MB»,

round (((a.bytes-b.bytes)/a.bytes)*100,2) «used%» from

(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a,

(select tablespace_name,sum(bytes) bytes,max (bytes) largest from dba_free_space group by tablespace_name)b

where a.tablespace_name=b.tablespace_name

order by ((a.bytes-b.bytes)/a.bytes) desc;

 

Autoextensible datafiles still have a size limit.

select file_id, bytes, maxbytes from dba_data_files where tablespace_name = 'XYZ';

Maxbytes is the maximum size of the datafile, it can not grow beyond that. If bytes = maxbytes, you have two options:

1) increase the maximum size (maxbytes) as (15 is the file_id from above query), for example to 10G:

alter database datafile 15 autoextend on maxsize 20G;

Datafiles have a hard limit for the maximum size, it is 2^22 * block_size for smallfile tablespaces, and 2^32 * block_size for bigfile tablespaces.

If you use a tablespace with 8K block size, then the maximum size of your datafile is 32 GB. If your datafile is already at that size, you can not increase it any further, there comes option number two:

2) add a new datafile to the tablespace, for example:

alter tablespace xyz add datafile '/path/to/datafiles/xyz02.dbf' size 100M autoextend on next 100M maxsize unlimited;

May 4, 2021

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 )

 1,641 views last month,  2 views today

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

I’m getting this error:

ORA-1691: unable to extend lobsegment ABC.SYS_LOB0014859757C00018$$ by 1280 in tablespace              ABC

The tablespace is build like the folowing:

CREATE TABLESPACE "ABC" DATAFILE 
  '/ora/db/user/abc1.db' SIZE 4194304000,
  '/ora/db/user/abc2.db' SIZE 4194304000,
  '/ora/db/user/abc3.db' SIZE 4194304000,
  '/ora/db/user/abc4.db' SIZE 4194304000
  LOGGING ONLINE PERMANENT BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL UNIFORM SIZE 10485760 SEGMENT SPACE MANAGEMENT AUTO

How can I extend the tablespace? Do I need to restart db after extending?

Mureinik's user avatar

Mureinik

295k52 gold badges303 silver badges346 bronze badges

asked May 5, 2015 at 15:45

user897237's user avatar

You can extend a tablespace by adding an additional datafile to it or by extending an existing one. Since you currently seem to have a convention of uniformly sized files, I’d just add another one:

ALTER TABLESPACE "ABC" ADD DATAFILE '/ora/db/user/abc5.db' SIZE 4194304000;

This can be done with the database and tablespace online, and there’s no need to restart anything.

answered May 5, 2015 at 15:51

Mureinik's user avatar

MureinikMureinik

295k52 gold badges303 silver badges346 bronze badges

4

Autoextensible datafiles still have a size limit.

select file_id, bytes, maxbytes from dba_data_files where tablespace_name = 'XYZ';

Maxbytes is the maximum size of the datafile, it can not grow beyond that. If bytes = maxbytes, you have two options:

1) increase the maximum size (maxbytes) as (15 is the file_id from above query), for example to 10G:

alter database datafile 15 autoextend on maxsize 20G;

Datafiles have a hard limit for the maximum size, it is 2^22 * block_size for smallfile tablespaces, and 2^32 * block_size for bigfile tablespaces.

If you use a tablespace with 8K block size, then the maximum size of your datafile is 32 GB. If your datafile is already at that size, you can not increase it any further, there comes option number two:

2) add a new datafile to the tablespace, for example:

alter tablespace xyz add datafile '/path/to/datafiles/xyz02.dbf' size 100M autoextend on next 100M maxsize unlimited;

May 4, 2021

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 )

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

I’m getting this error:

ORA-1691: unable to extend lobsegment ABC.SYS_LOB0014859757C00018$$ by 1280 in tablespace              ABC

The tablespace is build like the folowing:

CREATE TABLESPACE "ABC" DATAFILE 
  '/ora/db/user/abc1.db' SIZE 4194304000,
  '/ora/db/user/abc2.db' SIZE 4194304000,
  '/ora/db/user/abc3.db' SIZE 4194304000,
  '/ora/db/user/abc4.db' SIZE 4194304000
  LOGGING ONLINE PERMANENT BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL UNIFORM SIZE 10485760 SEGMENT SPACE MANAGEMENT AUTO

How can I extend the tablespace? Do I need to restart db after extending?

Mureinik's user avatar

Mureinik

298k52 gold badges307 silver badges351 bronze badges

asked May 5, 2015 at 15:45

user897237's user avatar

You can extend a tablespace by adding an additional datafile to it or by extending an existing one. Since you currently seem to have a convention of uniformly sized files, I’d just add another one:

ALTER TABLESPACE "ABC" ADD DATAFILE '/ora/db/user/abc5.db' SIZE 4194304000;

This can be done with the database and tablespace online, and there’s no need to restart anything.

answered May 5, 2015 at 15:51

Mureinik's user avatar

MureinikMureinik

298k52 gold badges307 silver badges351 bronze badges

4

Понравилась статья? Поделить с друзьями:
  • Ora 01461 ошибка
  • Osstatus ошибка 99999
  • Osstatus ошибка 5342
  • Ora 01438 ошибка
  • Ora 01430 ошибка