tablespace error

Download Tablespace Error

If you can't read please download the document

Upload: pavan-patil

Post on 17-Nov-2015

18 views

Category:

Documents


4 download

TRANSCRIPT

Tbalespace related errorORA-01688 : unable to extend table table_name partition partition_name by 8192 in tablespace.I am trying to find the path of datafile in order to add new one in linux system,i run this query(select file_name from dba_data_files where tablespace_name = 'tablespace_name')and it shows under this path(+DATA/etl_data/etl_data_dbf), so i am trying to get this path in order to add new datafile,and i couldn't find this path in linux system.That's no surprise,because '+DATA....' indicates an ASM diskgroup. See the the ASM documentation how to deal with ASM:http://download.oracle.com/docs/cd/E11882_01/server.112/e16102/toc.htmIn general the 'ALTER ...' commands remain the same , only the filename specification is different.==============I am getting an ORA-01653 error. What is the fix fir the ORA-01653 error? ORA-01653: unable to extend table string. string by string in tablespace stringAnswer: The ORA-01653 error is caused because you need to add space to a tablespace. The Oracle docs note this on the ora-01653 error:ORA-01653: unable to extend table string. string by string in tablespace stringCause: Failed to allocate an extent of the required number of blocks for a table segment in the tablespace indicated.Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated.Oracle offer great resources on resolving ORA-01653, namely the nature of the problem as it relates to space availability: Explanation: ------------ This error does not necessarily indicate whether or not you have enough space in the tablespace, it merely indicates that Oracle could not find a large enough area of free contiguous space in which to fit the next extent. Diagnostic Steps: ----------------- 1. In order to see the free space available for a particular tablespace, you must use the view DBA_FREE_SPACE. Within this view, each record represents one fragment of space. How the view DBA_FREE_SPACE can be used to determine the space available in the database is described in Note 121259.1 Using DBA_FREE_SPACEFurthermore, we see these choices in resolving ORA-01653 (as quoted below): Manually COALESCE Adjacent Free Extents Add a DATAFILE Resize DATAFILE Enable AUTOEXTEND Defragment tablespace View temporary segments for space==============================================================What is the cause of the ORA-01652 error? ORA-01652: unable to extend temp segment by string in tablespace stringAnswer: The Oracle oerr utility note this about the ORA-01652 error: ORA-01652: unable to extend temp segment by string in tablespace string Cause: Failed to allocate an extent of the required number of blocks for a temporary segment in the tablespace indicated. Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated. First, see these important notes for fixing the ORA-1652 unable to extend error. If you have purchased the packs to use the AWR, see dba_hist_undostat tips , which can help unveil how Oracle attempted to used all available undo before aborting with the ORA-01652 error.This sill add space t the TEMP tablespace:alter tablespace tempadd tempfile'e:\oracle\app\oradata\zoom\temp02.dbf' size 1gautoextend on;You can check for held TEMP segments with this query:select srt.tablespace, srt.segfile#, srt.segblk#, srt.blocks, a.sid, a.serial#, a.username, a.osuser, a.statusfrom see code depot for full scripts v$session a, v$sort_usage srtwhere a.saddr = srt.session_addrorder by srt.tablespace, srt.segfile#, srt.segblk#, srt.blocks;MOSC has a very detailed and informative article concerning ORA-01652 and RAC. There is some troubleshooting required with ORA-01652 in RAC because there are two common causes in this area. First ORA-01652 may occur because there is simply no space available in the temp tablespace of which is being used. The second cause of ORA-01652 may have to do with the local temp segment not being able to extent space even though there is space in other instances. To trouble shoot for ORA-01652, and find out which of the above scenarios are causing ORA-01652 use this query offered by MOSC: select sum(free_blocks) from gv$sort_segment where tablespace_name = ''You will know that the first scenario is causing ORA-01652 to be thrown if the free block reads '0' because it signifies that there is no free space.If there is a good amount of space, you know that there is another cause for ORA-01652, and it is probably the second scenario. It is important to note that in a non-RAC environment, local instances are not able to extend the temp segments, so in the RAC environment, ORA-01652 has to be handled differently. If you are experiencing ORA-01652 in a non-RA environment, be aware that every SQL making use of the tablespace can fail. In RAC, more sort segment space can be used from other instances, which can help resolve ORA-01652 more easily. Try using the query below: select inst_id, tablespace_name, total_blocks, used_blocks, free_blocks from gv$sort_segment;Basically, you can then find out how much temp segment space can be used for each instance by viewing the total_blocks, and the used_blocks can reveal the space which has been used so far, and the free_blocks gives the amount of space allocated to this particular instance. This being, to resolve ORA-01652, you can check out that used_blocks = total_blocks and free_blocks = 0 will probably show for the instance, and ORA-01652 will be shown multiple times within the alert log.This basically means that free space from other instances is being requested, and typically signifies that there is instance contention. Instance contention within the temporary space can make the instance take more time to process.In sever cases, a slowdown may occur, in which you might want try one of the following work-arounds: Increase size of the temp tablespace Increase sort_area_size and/or pga_aggregate_targetHowever, remember to not use the RAC feature of DEFAULT temp space.If ORA-01652 is causing the slowdown, SMON will probably not be able to process the sort segment requests, you should try to diagnose the contention: Output from the following query periodically during the problem: select inst_id, tablespace_name, total_blocks, used_blocks, free_blocks from gv$sort_segment; Global hanganalyze and systemstate dumps=================================================================ORA-01950: no privileges on tablespace 'SYSTEM' : What error is it?Earlier I created a user :SQL>create user suhail identified by passwordSQL>User created.SQL>Grant create session,create table to suhail;SQL>Grant Succeeded.but when I login as suhail and try to create a table I get an error saying ORA-01950: no privileges on tablespace 'SYSTEM' . What error is it ? Why does it occur ?SQL> connect suhailEnter password:Connected.SQL> create table suhail_table(name char(10));create table suhail_table(name char(10))*ERROR at line 1:ORA-01950: no privileges on tablespace 'SYSTEM'I am using Oracle Database 11g Express Edition Release 11.2.0.2.0This error says that the user doesn't have quota on tablespace SYSTEM which is set as the default persistent tablespace. You can assign a user the quota like this:sql> alter user scott quota 50m on system;Here, 50m means that the user quota on the SYSTEM tablespace is 50 mebibytes. You can also set the quota to unlimited.However it is a bad practice to store user and application data in SYSTEM tablespace as it causes data fragmentation and thus degrades performance. So I would recommend you to create a new permanent tablespace:sql> create smallfile tablespace users datafile '/u01/app/oracle/oradata/ORCL/users.dbf' size 10g;And then set it as the default database permanent tablespace so that objects created by the users go into that default tablespace:sql> alter database default tablespace users;============================================================ORA-00959 tablespace test does not existuser454189 Newbieuser454189 Mar 28, 2006 10:52 PMhi all,here i hav a question to you,actaually i try to drop the tablespace 'test' before dropping i tried to take the tablespace offline. i gavesql>alter tablespace test offline;but it returnserror:ORA-00959 tablespace test does not existnow i queried "select * from v$tablespace" to check is that tablespace exist or not. there it shows the tablespace exists.actually there are no users alloted to this tablespace.so i try to create seperate user and try to allot this tablespace for that user but i cud't, again it shows same error.i hav also tested by queringSELECT tablespace_name FROM dba_tablespaces WHERE lower(tablespace_name) = 'test';-------------------------------------------------------------------------------------------------TABLESPACE_NAMEtestselect file_name from dba_data_files where lower(tablespace_name)='test';---------------------------------------------------------------------------------------------------------------FILE_NAMED:\ORACLE\ORADATA\KESD\TEST.ORAi dont know watz the wrong i did? can any one help me to solve this issue. 11309 Views Tags:Average User Rating: No ratings (0 ratings)Average User RatingNo ratings(0 ratings) 1. Re: ORA-00959 tablespace test does not exist 352719 Newbie 352719 Mar 29, 2006 12:21 AM (in response to user454189) Because you need to drop the tablespace just used the following command: drop tablespace test including contents and datafiles; Michael Like Show 0 Likes (0) Actions 2. Re: ORA-00959 tablespace test does not exist user454189 Newbie user454189 Mar 29, 2006 12:30 AM (in response to 352719) hi, i hav also used this command but still its not dropped returning same error Like Show 0 Likes (0) Actions 3. Re: ORA-00959 tablespace test does not exist Nicolas.Gasparotto Oracle ACE Nicolas.Gasparotto Mar 29, 2006 1:17 AM (in response to user454189) Hi, select file_name from dba_data_files where lower(tablespace_name)='test'; Maybe your tablespace name was create explicitly in lower case. In this case, you need to use " when you invoke this tablespace : SQL> create tablespace "test" datafile '/data/ora/H89UCBAC/u01/test.dbf' size 10M; Tablespace created. SQL> select file_name from dba_data_files where lower(tablespace_name)='test'; FILE_NAME -------------------------------------------------------------------------------- /data/ora/H89UCBAC/u01/test.dbf SQL> alter tablespace test offline; alter tablespace test offline * ERROR at line 1: ORA-00959: tablespace 'TEST' does not exist SQL> c/test/TEST 1* alter tablespace TEST offline SQL> / alter tablespace TEST offline * ERROR at line 1: ORA-00959: tablespace 'TEST' does not exist SQL> c/TEST/"test" 1* alter tablespace "test" offline SQL> / Tablespace altered. SQL> drop tablespace "test" including contents and datafiles; Tablespace dropped. SQL> Nicolas. Like Show 0 Likes (0) Actions 4. Re: ORA-00959 tablespace test does not exist 454585 Newbie 454585 Mar 29, 2006 1:16 AM (in response to user454189) Dear user454189 The complete answer to your problem is described in the thread "ORA-00959 tablespace test does not exist" you [user454189] initiated on 26-Mar-2006 22:54. I do not think there is a need to create duplicate discussion thread but OK. Given the fact, that you created the tablespace as "test" (i.e. in lowercase letters, as shown by the query result) you always have to reference the tablespace name explicitly as "test" (i.e. with double-quotes). I believe that is "watz wrong". If you created the tablespace in lower/mixed case ("Test", "test", "TeST") using double-quotes then you can expect troubles. You have to reference such a tablespace explicitely in the same way. Best practice - never create any objects in lower/mixed case by using double-quotes.hi,i was facing the same problem of tablespace doesn't exist. you might have more than one databases and they have different database names. when you will connect as sys as sysdba, you have to include the database name (@dbname). this would might be helpful for you. ==================================================================================================ORA-00959: tablespace NSN_2 does not exist... But tablespace is defined in user script for tempThis question has been Answered.tennek Newbietennek Jun 25, 2014 6:39 AMWHEN I RUN IMPDP I GET AN ERROR ABOUT "TABLESPACE DOES NOT EXIST"THIS TABLESPACE IS ACTUALLY NO LONGER PRESENT ON THE SYSTEM BUT IT IS DEFINED IN THE USER1 SCRIPTIS THERE ANYWAY I CAN ASK IT NO TO LOOK FOR THAT TEMP TABLESPACE or is there anyway i can remove the definition of NSN_2 from the user (USER1) OR should i just recreate the NSN_2 tablescape HELP NEEDED PLS... DROP USER USER1 CASCADE; CREATE USER USER1 IDENTIFIED BY DEFAULT TABLESPACE NSN_1 TEMPORARY TABLESPACE TEMP -- 2 Tablespace Quotas for USER1 ALTER USER USER1 QUOTA UNLIMITED ON NSN_1;ALTER USER USER1 QUOTA UNLIMITED ON NSN_2; ----item in contention impdp user1/password directory=dump_dir dumpfile=user2.dmp logfile=LOG.log remap_schema=USER2:USER1 remap_tablespace=NSN_4:NSN_1 Master table "USER1"."SYS_IMPORT_FULL_01" successfully loaded/unloadedStarting "USER1"."SYS_IMPORT_FULL_01": USER1/******** directory=dump_dir dumpfile=setup_02102012.dmp logfile=tries.log remap_schema=setup:USER1 remap_tablespace=NSN_4:NSN_1Processing object type SCHEMA_EXPORT/USERORA-31684: Object type USER:"USER1" already existsProcessing object type SCHEMA_EXPORT/SYSTEM_GRANTProcessing object type SCHEMA_EXPORT/ROLE_GRANTProcessing object type SCHEMA_EXPORT/DEFAULT_ROLEProcessing object type SCHEMA_EXPORT/TABLESPACE_QUOTAORA-39083: Object type TABLESPACE_QUOTA failed to create with error:ORA-00959: tablespace 'NSN_2' does not existFailing sql is:DECLARE TEMP_COUNT NUMBER; SQLSTR VARCHAR2(200); BEGIN SQLSTR := 'ALTER USER "USER1" QUOTA UNLIMITED ON "NSN_2"'; EXECUTE IMMEDIATE SQLSTR;EXCEPTION WHEN OTHERS THEN IF SQLCODE = -30041 THEN SQLSTR := 'SELECT COUNT(*) FROM USER_TABLESPACES WHERE TABLESPACE_NAME = ''NSN_2'' AND CONTENTS = ''TEMPORARY'''; EXECUTE IMMEDIATE SQLSTR INTO TEMP_COProcessing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMAProcessing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCEProcessing object type SCHEMA_EXPORT/TABLE/TABLEORA-39083: Object type TABLE:"USER1"."AVAIL_BY_OPTION_REF" failed to create with error:ORA-00959: tablespace 'NSN_2' does not existsmit_sign-OracleCorrect Answer by smit_sign-Oracle on Jun 25, 2014 10:21 PMimpdp transform=segment_attributes SmitSee the answer in context 450 Views Tags: error Content tagged with error , impdp Content tagged with impdp , ora-00959 Content tagged with ora-00959 , ora-39083 Content tagged with ora-39083 1. Re: ORA-00959: tablespace NSN_2 does not exist... But tablespace is defined in user script for temp carajandb Oracle ACE carajandb Jun 25, 2014 6:54 AM (in response to tennek) the parameter remap_tablespace should help! REMAP_TABLESPACE=source_tablespace:target_tablespace (see Oracle DatabaseUtilities11g Release 2 (11.2) page 3-35) Like Show 0 Likes (0) Actions Correct Answer 2. Re: ORA-00959: tablespace NSN_2 does not exist... But tablespace is defined in user script for temp smit_sign-Oracle Explorer smit_sign-Oracle Jun 25, 2014 10:21 PM (in response to tennek) impdp transform=segment_attributes Smit=========================================================================================================================ora 01129This question has been Answered.672625 Newbie672625 Mar 4, 2009 1:56 PMHola, I have this problemThe tables can be created correctly, but When I try to create a index, I get the error:ORA-01129 user's default or temporary tablespace does not existWhen using the statementSELECT tablespace_name from dba_tablespaces;can see the 'USERS' tablespaceTABLESPACE_NAME---------------------SYSTEMUNDOTBS1SYSAUXTEMPUSERSEXAMPLETESTSPACETESTTEMPORALAt the first time I used the USERS tablespace, then I created new tablespaces, and the problem is the same. The tablespace was create in the Enterprise manager console.And another important thing, it work fine the last week......I did not make changes in the database.ThanksOrionNetCorrect Answer by OrionNet on Mar 5, 2009 3:12 PMHello,h5. Here is your problem, we have table_name in place of schema name after create unique index and that's why you were getting default temp tablespace error.Hope this helpsCREATE UNIQUE INDEX test1.xpkstest1 ON test1.t_cliente (numero_bp ASC); Correct Answer 14. Re: ora 01129 OrionNet Guru OrionNet Mar 5, 2009 3:12 PM (in response to 672625) Hello, h5. Here is your problem, we have table_name in place of schema name after create unique index and that's why you were getting default temp tablespace error. Hope this helps CREATE UNIQUE INDEX test1.xpkstest1 ON test1.t_cliente (numero_bp ASC); Regards Edited by: OrionNet on Mar 5, 2009 4:12 PM Like Show 0 Likes (0) ===============================================================1. Re: HOw to rename a datafile with special characterVenkatB GuruVenkatB Sep 6, 2011 11:47 AM (in response to shashi)What version is your database? It's very important that you mention the version and OS when you post specific database related questions.Obviously it's a UNIX OS and you didn't set the BACKSPACE.So someone when creating the datafile, made a typo in SQLPLUS and then just used BACKSPACE key to correct it and created the file with that special characters. Whoever created it wanted to create def_arc_05.dbf but made a typo 2 instead of 5 and hit the backspace to correct it.I am not sure what your version is.In 10g and 11g, you can do ALTER TABLESPACE RENAME DATAFILE.1) Alter tablespace EXAMPLE offline normal;2) At OS Level, move the current file to a proper file3) Alter tablespace EXAMPLE rename datafile 'def_arc_02.dbf^?^?^?^?^?5.dbf' to 'def_arc_05.dbf';4) Alter tablespace EXAMPLE online;TestSQL> SELECT FILE_NAME, BYTES FROM DBA_DATA_FILES WHERE TABLESPACE_NAME = 'USERS';FILE_NAME BYTES----------------------------------------------------------------- ----------C:\ORACLE\ORADATA\ORCL\USERS01.DBF 1436549120C:\ORACLE\ORADATA\ORCL\USERS021.DBF 134217728C:\ORACLE\ORADATA\ORCL\USERS022.DBF 14994636803 rows selected.SQL> alter tablespace users offline normal;Tablespace altered.SQL> host move C:\ORACLE\ORADATA\ORCL\USERS022.DBF C:\ORACLE\ORADATA\ORCL\USERS024.dbfSQL> alter tablespace users rename datafile 'C:\ORACLE\ORADATA\ORCL\USERS022.DBF' to 'C:\ORACLE\ORADATA\ORCL\USERS024.dbf';Tablespace altered.SQL> alter tablespace users online;Tablespace altered.SQL> SELECT FILE_NAME, BYTES FROM DBA_DATA_FILES WHERE TABLESPACE_NAME = 'USERS';FILE_NAME BYTES----------------------------------------------------------------- ----------C:\ORACLE\ORADATA\ORCL\USERS01.DBF 1436549120C:\ORACLE\ORADATA\ORCL\USERS021.DBF 134217728C:\ORACLE\ORADATA\ORCL\USERS024.DBF 1499463680Another similar example in UNIX on 10.2.0.4 with SPECIAL CHARACTERS in file namesSQL> create tablespace test_restore datafile '/u01/dbfiles/ORCL/test_restore_01^H^H^H^H.dbf' size 50m; ---deliberately put in special charactersTablespace created.SQL> select file_name, file_id from dba_data_files where tablespace_name='TEST_RESTORE';FILE_NAME FILE_ID--------------------------------------------------------------------------- ----------/u01/dbfiles/ORCL/test_restor.dbf 10At OS LEVELSQL> !ls -ltr /u01/dbfiles/ORCL (hiding all other datafiles...a big list)total 10450764-rw-r----- 1 oracle oinstall 52436992 Sep 6 17:32 test_restore_01????.dbfNow let's change itSQL> alter tablespace test_restore offline normal;Tablespace altered.SQL> !mv /u01/dbfiles/ORCL/test_restore_01????.dbf /u01/dbfiles/ORCL/test_restore_01.dbfSQL> !ls -ltr /u01/dbfiles/ORCL (hiding all other datafiles...a big list)total 10450764-rw-r----- 1 oracle oinstall 52436992 Sep 6 17:32 test_restore_01.dbfSQL> alter tablespace test_restore rename datafile '/u01/dbfiles/ORCL/test_restor.dbf' to '/u01/dbfiles/ORCL/test_restore_01.dbf';alter tablespace test_restore rename datafile '/u01/dbfiles/ORCL/test_restor.dbf' to '/u01/dbfiles/ORCL/test_restore_01.dbf'*ERROR at line 1:ORA-01525: error in renaming data filesORA-01522: file '/u01/dbfiles/ORCL/test_restor.dbf' to be renamed does not existIt's not recognizing it. So I'll do it using dynamic statementSQL> Begin 2 For i in (select file_name from dba_data_files where file_id = 10) 3 Loop 4 Execute Immediate 'Alter tablespace test_restore rename datafile ' || chr(39) || i.file_name || chr(39) || ' to ' || chr(39) || '/u01/dbfiles/ORCL/test_restore_01.dbf' || chr(39) ; 5 End Loop; 6 End; 7 /PL/SQL procedure successfully completed.SQL> alter tablespace test_restore online;Tablespace altered.SQL> select file_name, file_id from dba_data_files where tablespace_name='TEST_RESTORE';FILE_NAME FILE_ID--------------------------------------------------------------------------- ----------/u01/dbfiles/ORCL/test_restore_01.dbf 10Edit : Please perform a backup of database after this structual change. This is very important=================================================================================================================