ORA-01658: unable to create INITIAL extent for segment in tablespace TS_DATA - oracle

When i tried to create a table in my User_DB schema i am getting an error as ORA-01658: unable to create INITIAL extent for segment in tablespace TS_DATA. I run the following query to get all the TABLESPACE_NAME:
SELECT * FROM DBA_DATA_FILES;
But i really dont know which tablespace i am using and how to extend the tablespace to solve this issue.

As the error message indicates, you're using the TS_DATA tablespace. You can extend it by either enlarging one of the existing data files:
ALTER DATABASE
DATAFILE 'C:\ORACLEXE\APP\ORACLE\ORADATA\XE\TS_DATA.DBF'
RESIZE 3000M;
Or by adding a second datafile to the tablespace:
ALTER TABLESPACE ts_data
ADD DATAFILE 'C:\ORACLEXE\APP\ORACLE\ORADATA\XE\TS_DATA2.DBF'
SIZE 1000M;
Or just allow the datafile to auto extend:
ALTER DATABASE
DATAFILE 'C:\ORACLEXE\APP\ORACLE\ORADATA\XE\TS_DATA2.DBF'
AUTOEXTEND ON
MAXSIZE UNLIMITED; -- Or some reasonable cap

To check existing table spaces data file and size by following sql
select a.file_id,b.file_name,b.autoextensible,b.bytes/1024/1024,sum(a.bytes)/1024/1024
from dba_extents a , dba_data_files b
where a.file_id=b.file_id
group by a.file_id,b.file_name,autoextensible,b.bytes/1024/1024
Then run following sql, it would to make auto extend data file size.
ALTER DATABASE
DATAFILE '/u01/app/oracle/oradata/XE/TS_DATA.dbf'
AUTOEXTEND ON
MAXSIZE UNLIMITED;

Related

unable to extend temp segment by 128 in tablespace TEMP for clob

I am working on a project in which I am working on database where in java program I need to read the clob data from datafile and then creating clob object and setting clob data in the object and insert row. I am doing batch insert with 10000 rows. But after reading some (32) rows, I am getting following error:-
java.io.IOException: ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
at oracle.jdbc.driver.OracleClobOutputStream.flushBuffer(OracleClobOutputStream.java:293)
at oracle.jdbc.driver.OracleClobOutputStream.write(OracleClobOutputStream.java:191)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1793)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
I searched this error online and found some solutions on site. I have executed the following queries then:-
select value from v$parameter where name = 'db_block_size';
select bytes/1024/1024 as mb_size,
maxbytes/1024/1024 as maxsize_set, x.*
from dba_data_files x;
alter tablespace system add datafile 'C:\APP\ADMIN\ORADATA\VIDUSHIEXTRACT\DATAFILE\O2_MF_USERS_FLHMH039_.DBF' size 5024m autoextend on maxsize unlimited;
FYI: In my db the above type of data files are multiple.
But after all this also I got the same error after 32 rows(I have 1028 rows total in my table, in which each clob column data has approx 4MB data). So please can anyone tell me what should I do now, in order to resolve this issue?
you extended the SYSTEM tablespace by adding a datafile, but you need to extent the TEMP tablespace (as suggested by the error)

Oracle IMPDP fail - unable to create INITIAL extent for segment in tablespace

I'm trying to import a database dump into our local Oracle 11.2g using the IMPDP functionality, but am getting the following error:
ORA-39171: Job is experiencing a resumable wait.
ORA-01658: unable to create INITIAL extent for segment in tablespace {TABLESPACE}
All of the answers/solutions I have seen for this, tell you to ALTER the tablespace with the following command:
ALTER DATABASE DATAFILE 'C:\APP\ADMIN\ORADATA\ORCL\TABLESPACE.DBF' AUTOEXTEND ON MAXSIZE UNLIMITED;
I have done this, but am still getting the same error. Any other suggestions as to what could be wrong?
The error: `unable to create INITIAL extent for segment in tablespace {TABLESPACE}'
Check your disk space to have enough space to create an extent of the table
Well it looks like recreating the TABLESPACE using this has worked - CREATE BIGFILE TABLESPACE

ora-1653 unable to extend table

I am trying to import an Oracle Schema to a new BBDD:
impdp ******/****** schemas=SCHEMA dumpfile=SCHEMA_2016-09-16_%u.dpdmp
But I get this error:
ORA-39171: Job is experiencing a resumable wait.
ORA-01653: unable to extend table SCHEMA.ELEMENTS by 8192 in tablespace SCHEMA_DAT1
My TABLESPACE and DATAFILES are in "AUTOEXTEND ON" mode:
create tablespace SCHEMA_DAT1 datafile '/ora01/app/oracle/oradata/fgh/DATAFILES/SCHEMA_DAT1.dbf' SIZE 4096M AUTOEXTEND ON;
alter database datafile '/ora01/app/oracle/oradata/fgh/DATAFILES/SCHEMA_DAT1.dbf' autoextend on maxsize unlimited;
The error is very strange and i can't find a solution.
I need a lot more DataFiles because the limit is 32GB per file. Thanks.

Table space dropped but dbf file still exist

we have dropped a tablespace by command drop tablespace T1 assuming that the datafile will also be dropped. Later we created the same tablespace T1 with different datafile.
Now the problem is that datafile is holding 14GB of diskspace. Is there any way to recover that space from the datafile. Please suggest.
Thanks in advance.
take a look here
https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_9004.htm
you needed to drop the datafile at the same time as dropping the tablespace
DROP TABLESPACE tablespace INCLUDING CONTENTS AND DATAFILES CASCADE CONTRAINTS;
if you check DBA_DATA_FILES, if your old datafile is not listed you will be ok to remove it from the OS

ORA-01652 - Query doen't work with hibernate but it works fine in SQL client

I execute a SQL query with hibernate and the application give the error:
ORA-01652: unable to extend temp segment
The TABLE SPACE has 4 GB.
The strange thing is that the query from the application yesterday was working fine, and today it doen't work.
I have not made any changes either in the database or application.
The oracle version is Oracle 11g
You are running short on space in temp tablespace , use this query t check how much space you have in your temp tablespace
SQL> select file_name,SUM(bytes)/1024/1024 "Current_size_mb", sum(maxbytes)/1024/1024 "max_size_mb" from dba_temp_files group by file_name;
FILE_NAME Current_size_mb max_size_mb
---------------------------------------------------------------------- --------------- -----------
C:\AKS\AKDB\ORADATA\RESEARCH\TEMP01.DBF 20 32767.9844
Adding a new tempfile to temp tablespace
SQL> alter tablespace temp add tempfile 'C:\AKS\AKDB\ORADATA\RESEARCH\TEMP02.DBF' size 100m autoextend on maxsize 1g;
Temporary tablespace called TEMP which is used internally by database for operations like distinct, joins,etc to fetch large amount of data.
So, after increasing the size of TEMP tablespace the issue can be resolved.
Follow this link : How to shrink temp tablespace in oracle?

Resources