To drop a tablespace(with contents) in Offline mode
A test tablespace in the prod (24x7) was not required and to before dropping it I put it in the offline mode (with immediate option) to prevent further access.
The tablespace is not empty and presently in the offline mode.
Can I drop this tablespace ?
How?
I dont want to perform any recovery. Please suggest?
Thanks
Yes, you can :
SQL> create tablespace test datafile '/u01/ora92/oradata/ora9/test.dbf' size 10M;
Tablespace created.
SQL> create table test01(a number) tablespace test;
Table created.
SQL> alter tablespace test offline;
Tablespace altered.
SQL> drop tablespace test including contents and datafiles;
Tablespace dropped.
SQL>You can even do it with the tablespace online :
SQL> create tablespace test datafile '/u01/ora92/oradata/ora9/test.dbf' size 10M;
Tablespace created.
SQL> create table test01(a number) tablespace test;
Table created.
SQL> drop tablespace test including contents and datafiles;
Tablespace dropped.
SQL>
Similar Messages
-
Cannot drop undo tablespace with Active extents but no active sessions
Hi all,
I am running on 10gr2 oracle database in a Linux 32 bit environment.
I have a corrupted undo datafile. I've been able to recover the datafile but still the alert logs is still showing that it is corrupted.
Now what I'm trying to do is to drop the old undo tablespace like the one discussed here Change undo tablespace in Oracle - Switch Oracle's Undo tablespace.
My problem is I have an Active extent but no active session corresponding to it:
SYS@ccasdb AS SYSDBA > SELECT a.name,b.status
FROM v$rollname a,v$rollstat b
WHERE a.usn = b.usn
AND a.name IN (
SELECT segment_name
FROM dba_segments
WHERE tablespace_name = 'UNDOTBS1'
); 2 3 4 5 6 7 8
NAME STATUS
_SYSSMU18$ PENDING OFFLINE
SYS@ccasdb AS SYSDBA > SELECT a.name,b.status , d.username , d.sid , d.serial#
2 FROM v$rollname a,v$rollstat b, v$transaction c , v$session d
3 WHERE a.usn = b.usn
4 AND a.usn = c.xidusn
5 AND c.ses_addr = d.saddr
6 AND a.name IN (
7 SELECT segment_name
8 FROM dba_segments
9 WHERE tablespace_name = 'UNDOTBS1'
10 );
no rows selected
but still cannot drop the undotablespace.
SYS@ccasdb AS SYSDBA > drop tablespace UNDOTBS1 including contents and datafiles;
drop tablespace UNDOTBS1 including contents and datafiles
ERROR at line 1:
ORA-30013: undo tablespace 'UNDOTBS1' is currently in use
Regards,
TimYes i was able to recover the datafile but the alert_log kept on prompting that it is still corrupted. The datafile's status is online.
I want to kill the session/s contributing to the PENDING OFFLINE status of the rollback segment so I can already drop the undotablespace and so
that the alert log will stop prompting for that corrupted datafile in that UNDOTABLESPACE.
Can i Just alter the tablespace's datafiles to offline drop then just drop it. Then I drop the tablespace? -
Fastest and easiest way to drop a tablespace with LOB Segments
When I try to drop a tablespace I get a message that I can't cause it still contains LOB Segments. I searched to see what objects like tables or indexes are in that tablespace and there are none.
Any one run into this? Any way to get around this issue?Sorry,
Version = 10.2.0.4
OS = Win2003 32bit
Command used = DROP TABLESPACE IWORKS_LARGE_TABLES INCLUDING CONTENTS AND DATAFILES;
Error Message = ORA-22868: table with LOBs contains segments in different tablespaces
Objects currently in this tablespace:
SQL> select s.segment_name, s.segment_type
2 from dba_segments s
3 where tablespace_name = 'IWORKS_LARGE_TABLES'
4 ;
SEGMENT_NAME SEGMENT_TYPE
SYS_IL0000060885C00008$$ LOBINDEX
SYS_LOB0000060885C00008$$ LOBSEGMENT
SYS_IL0000060918C00048$$ LOBINDEX
SYS_LOB0000060918C00048$$ LOBSEGMENTI basically want to drop the whole tablespace but these objects are not allowing me to. -
Drop Undo Tablespace taking more than 1 hr
Hi,
To give you background, I had given an "insert into .. select" command which was inserting 3 millions of rows of rowidth approx 5000 bytes. The window on which it was given, was closed by mistake.
After sometime when I checked the size of undo_tablespace, it was 5.5GB. I decided to create a new one and drop the old undo_tbsp.
I have successfully created new undo tablespace and changed the same in spfile also.
now when i am dropping the old undo tablespace, its taking long time. its almost an hour, but the tablespace has not been dropped yet.
I have given following command
drop tablespace undotbs_01 including contents;
Any idea, why is it taking so much time, and how long should I wait?
If someone can give me any other idea on how can I drop the tablespace, that will be great.
Regards,
Archana.To give you background, I had given an "insert into .. select" command which was inserting 3 millions of rows of rowidth approx 5000 bytes. The window on which it was given, was closed by mistake.This could be the cause.
I wonder the killed/closed session doesn't hangup with a latch or lock.
Since the old undo tbs had active transaction, it might have to pending offline status. If so, you can drop it.
Jaffar -
Drop Normal Tablespace Taking several hours
Hi,
In my 1TB database there is one tablespace size (38.5 GB / used 4 GB) which we used for objects backup purpose and i am trying to drop this tablespace using every option like bring tablespace offline and drop with DROP TABLESPACE TBS_NAME INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS
but Drop Tablespace Taking several hours (24 + hrs)
I tried with drop objects from the tablespace but that is also taking lot of time to drop and then i tried to drop empty tablespace and again it is taking several hours.
Database version :- 10.2.0.3 and 10.2.0.4
Operation System Version :- Solaris 5.10
ERP 11.5.10
Please suggest what could be the problem.So, till now you have done these steps,
1) dropped all database objects from that tablespace. Checked if any objects are there in this tablespace and there were none
2) take tbs offline
3) drop tablespace
4) While drop tablespace command is hanging, monitored segments in the tbs from another session. Segments were reducing very slowly
Out of first 3 steps, which step took longer? drop tablespace ?
Logically, when you are able to drop objects, then there should be no issue of locks or anything like that.
Dictionary updates should not take 24 hours!!!
What else is going on, on the disk/file-system where this tbs is housed?
Do you have all locally managed tablespaces? -
Hi Everybody,
Here there are some steps that leaded me into a dead end, where I would like and greatly appreciate some help.
1. We have a tablespace FONC, dictionary managed, 136Gb spliced in 11 datafiles
FONC1 to FONC11.
2. There it is a huge table in this tblsp, T1, 70GB, having BLOBs.
3. Some other tables are in it also.
My plan is to move all objects in this tblsp in a 2 new tblsp, one for the
BLOBS, one for the rest. And to drop this tablespace at the end.
I do not have enough disk space in order to have both tablespaces present in the
same time.
What I did.
0. ArchiveLog off.
1. Export the T1 table, the huge one (splitting the export in 24 files, placed
in all free spaces I found).
2. alter table move tablespace for the other tables.
3. start the Drop table T1.
4. after 6 hours, I stopped the drop, being short in time.
5. start drop tablespace FONC.
6. after another 5 hours, I cancelled this drop also.
7. tblsp FONC contains nothing else but a 67GB temporary segment.
8. took the tblsp FONC offline.
9. shutdown db abort.
10. delete datafiles FONC1 to FONC11.
11. startup db - no errors except a message in SMON Log - timeout waiting for a
tablespace management resource.
12. Create new tablespace.
13. Import table T1.
14. Archivelog ON - error ORA-265 - instance needs recovery.
15. Shutdown Abort.
16. Startup Open.
17. Shutdown Immediate.
18. startup mount.
19. ALter database datafile fonc1...11 offline drop.
20. Recover database - everything ok.
21. Alter ... ARCHIVELOG - same error.
22. Other trials - same results ...
No indications in any oracle log that SMON did an instance recovery, or other
error message.
Finally, the DB is operational, but ARCHIVELOG is OFF.
My problem is how to get rid of the FONC tablespace without loosing another xxxx
hours. A normal DROP tablsp including contents did not finished after 24 hours.
I need a way just to invalidate the temporary segment in the FONC tblsp, to get
rid of it, to be able to get rid of the tblsp FONC also. I guess that the
missing datafiles impede the instance recovery. An solution to be done when the
DB is online and in use is of course the most desirable one ...
using DBMS_SPACE_ADMIN can be more helpfull ?
Manually edit the controlfiles ?
Using RMAN ?
Thanks in advance, I appreciate what you are doing,
DanNo I did not tried with Nologging.
On the other hand, what I see that takes long are the updates on the tables fet$ and uet$. More than that, a system session is issuing all the time blocking locks on this tables, that makes the drop to take so much time. Releasing 67GB in extents is quite challenging ...
So I need a way to lead only to delete on the fet$ and uet$ tables, and, a way to avoid the blocking locks. I thought that using DBMS_SPACE_ADMIN and invalidating the temporary segment first can be a solution.
The real problem here is that I can not do try-and-see, I can not stop the exploitation of the DB so I was hoping that somebody went through the same experience and has a working solution.
Thanks,
Dan -
DROP EXAMPLE tablespace Error : Plz help me
Hi all,
I try to drop the EXAMPLE tablespace but I get this error :
alter tablespace example offline;
DROP TABLESPACE example INCLUDING CONTENTS AND DATAFILES ;
ORA-29857 : domain indexes and / or secondary objects exist in the tablespace
I'm using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 on Linux server.
Please tell me :
-The utility of this tablespace?
-how to do to drop this tablespace?
ThanksThose users are simple demo users, they are created by default on 9i and on 10g R1 and R2 those are created if at db creation time you check the demo account check box or if you choose the easy install mode with default database.
Those accounts should not be present in a production environment, and in case they are, they should remain 'lockded and expired'. So by dropping those users nothing happens, you may rebuild those accounts whenever you want by running the scripts located at the ORACLE_HOME/demo, if they are not present, you must install them from the companion disk (10g).
~ Madrid -
Why I got error ORA-02429 when I tried to drop a tablespace?
I use the following command to drop the tablespace:
drop tablespace users including contents and datafiles;The error message is below:
Error report:
SQL Error: ORA-00604: error occurred at recursive SQL level 1
ORA-02429: cannot drop index used for enforcement of unique/primary key
00604. 00000 - "error occurred at recursive SQL level %s"
*Cause: An error occurred while processing a recursive SQL statement
(a statement applying to internal dictionary tables).
*Action: If the situation described in the next error on the stack
can be corrected, do so; otherwise contact Oracle Support.However, I have removed all the tables and indexes in this tablespace.
Nothing found when I issued the following enquiries.
select index_name from user_indexes where TABLESPACE_NAME = 'USERS';
select table_name from user_tables where TABLESPACE_NAME = 'USERS';Is there anything I missed?
Thanks in advance.999274 wrote:
Could you please let me know how to purge recyclebin ?It's bad form to hijack someone else's thread for your own questions.
As for your question
=================================================
Learning how to look things up in the documentation is time well spent investing in your career. To that end, you should drop everything else you are doing and do the following:
Go to [url tahiti.oracle.com]tahiti.oracle.com.
Locate the link for your Oracle product and version, and click on it.
You are now at the entire documentation set for your selected Oracle product and version.
<b><i><u>BOOKMARK THAT LOCATION</u></i></b>
Spend a few minutes just getting familiar with what is available here. Take special note of the "books" and "search" tabs. Under the "books" tab (for 10.x) or the "Master Book List" link (for 11.x) you will find the complete documentation library.
Spend a few minutes just getting familiar with what <b><i><u>kind</u></i></b> of documentation is available there by simply browsing the titles under the "Books" tab.
Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what <b><i><u>kind</u></i></b> of information is available there.
Do the same with the SQL Reference Manual.
Do the same with the Utilities manual.
You don't have to read the above in depth. They are <b><i><u>reference</b></i></u> manuals. Just get familiar with <b><i><u>what</b></i></u> is there to <b><i><u>be</b></i></u> referenced. Ninety percent of the questions asked on this forum can be answered in less than 5 minutes by simply searching one of the above manuals.
Then set yourself a plan to dig deeper.
- Read a chapter a day from the Concepts Manual.
- Take a look in your alert log. One of the first things listed at startup is the initialization parms with non-default values. Read up on each one of them (listed in your alert log) in the Reference Manual.
- Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files. Go to the Network Administrators manual and read up on everything you see in those files.
- When you have finished reading the Concepts Manual, do it again.
Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
================================= -
Drop a tablespace and datafile when database is mounted
I tried to import data in my oracle 11g. It failed midway. I presumed that i did not size the redolog properly. Now my database cannot go beyound the mounted mode.
ORA-01157: cannot identify/lock data file 7 – see DBWR trace file
ORA-01110: data file 7: ‘ /data1/owprojects/xxxxx.dbf ‘
Its a new oracle installation and i do not need the corrupt datafile.
I cant take the tablespace offline neither can i drop the tablespace including its contents.
Do i drop from the Linux OS. If yes which other file to i edit to remove the pointer to this tablespace.
Thanks and Best Regards
JTry:
alter database datafile 7 offline for drop;Example:
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1071333376 bytes
Fixed Size 1388352 bytes
Variable Size 658505920 bytes
Database Buffers 406847488 bytes
Redo Buffers 4591616 bytes
Database mounted.
SQL>
SQL> alter database open;
alter database open
ERROR at line 1:
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: 'C:\TEMP\TEST01.DBF'
SQL> alter database datafile 5 offline for drop;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 396
Next log sequence to archive 397
Current log sequence 397
SQL> alter tablespace test drop datafile 5;
alter tablespace test drop datafile 5
ERROR at line 1:
ORA-03261: the tablespace TEST has only one file
SQL> drop tablespace test;
Tablespace dropped.
SQL>Please read http://docs.oracle.com/cd/E11882_01/server.112/e25494/dfiles004.htm#ADMIN11428.
Edited by: P. Forstmann on 19 mars 2012 18:53 -
Hey Folks,
I really need some help here.
I'm trying to drop/recreate the undo tablespace (currently 25gig) Oracle 9i
When I try to drop the undo tablespace 'UNDOTBS1' I get the following error:
âORA-01548: active rollback segment '_SYSSMU1$' found, terminate dropping tablespaceâ
Here's what I have tried so far:
- Bounced the DB several times hoping to get rid of the reference to the active rollback segment. No luck.
- Created a new undo table space
- Tried 'Alter system set undo_tablespace=new_one' (noticed that 10 new rollback segs were created '_SYSMU11$..SYSMU20$' pointing to the new undo tablespace)
- I then performed an offline drop of the undo tablespace data file. After the offline drop, the system rollback segs SYSMU01$..SYSMU10$ went offline as would be expected.
- Even with the new undo tablespace, all other application tablespaces still use the old undo which due to the offline drop, no inserts, deletes, etc. will work.
After all the above, I still get the same error when trying to drop the undo tablespace.
Any ideas? Ideally I would like to be able to drop the undo tablespace and recreate it, but at this point I'd be happy to bring back the undo tablespace datafile so we can at least use the database again.
Thanks in advance!!
ColinSQL> show parameters undo
undo_retention integer
10800
undo_suppress_errors boolean
FALSE
undo_tablespace string
UNDOTBS03
r.- The undo tablespace which the database is looking for is this one ( UNDOTBS03 )
What is strange about the lines above is that I have
all those params above commented out in my
\pfile\init.ora file (and have bounced the db).
Iâm not sure why they are still showing up.
r.- Perhaps your instance is started with the spfile instead of the init file
Here's what we did after the UNDOTBS1 tablespace
caused the disk to run out of space during a large
import (from now on we are going to use commit = y):
1. Created a new undo tablespace UNDOTBS03 - got
errors so instead we to created it as a temp
tablespace UNDOTBS03 which worked. r.- Yes, but that tablespace was created as a UNDO TABLESPACE ?
2. Tried to drop UNDOTBS1 got the following error
msg:
ORA-01548: active rollback segment '_SYSSMU1$' found,
terminate dropping tablespacer.- Of course, the database did not allow to drop it beacause there were pending transactions
3. SQL> alter system set undo_tablespace =
'UNDOTBS03' scope = both. Tried dropping UNDOTBS1.
Same error as in #2 above.r.- There were still pending transactions with the older undo tablespace
4. We then offline dropped the datafile associated
with UNDOTBS1 hoping that would then allow us to drop
UNDOTBS1. Same error as #2.r.- That was the worst you did. You can not drop a tablespace so...
5. Then tried creating a undo tablespace again:
Create UNDO tablespace undo_temp
datafile 'D:\oracle\oradata\usbperf\undo_temp.DBF'
size 25m autoextend on;
Error on line 0
Create UNDO Tablespace undo_temp
datafile 'D:\oracle\oradata\usbperf\undo_temp.
ORA-00604: error occurred at recursive SQL level 1
ORA-00376: file 2 cannot be read at this time
ORA-01110: data file 2:
'D:\ORACLE\ORADATA\USBPERF\UNDOTBS01.DBF'
So thatâs where we are. I'm guessing that the
original undo tablespace corrupted when it tried to
extend and ran of disk space?
Thanks again for the help.
Colin ok I can guide to solve this but you have to do what I am going to tell you step by step. Is this a production database ?
Joel Pérez
http://www.oracle.com/technology/experts -
Drop Temporary Tablespace!
Hi All,
I have tried dropping my old temporary tablespace TEMP after making new TEMP2 as default.
All the users (checked in dba_users) are using TEMP2 as default temporary tablespace.
Now, issue is when I am trying to take TEMP offline and dropping it some of the users are not able to open the forms.
Please suggest, is it necessary that I must do this activity after taking a proper downtime or I can do it in business hours.
Thanks,
AnchorageIt's done now!!!
Actually issue was
You cannot drop a tablespace if it contains any rollback segments holding active transactions.*
Try to check whether any one using the temp segments or not on query "v$sort_usage"*
If it returns the rows, the sessions are using the temp tablespace. Once the Sessions Closes then the the command execution will be completed, else you and go head and kill the session with respect to session Id.*
Which was been explained to me by Pavan in General Database Forum!
I have killed the active session and it was success!
Anchorage -
Drop rollback tablespace after using UNDO
I have switched to using UNDO instead of using rollback segments. The UNDO works fine, and I have sucessfully dropped all rollback segments. Now I try to drop rollback tablespace. Can I simplely issue drop tablespace command to drop it? the reason I hesitate to simply drop it is that before I do drop, I placed the rollback tablespace offline. And there are errors during transaction since some tables somehow still checking on this tablespace. Can I simplely drop rollback tablespace, and Oracle would clean this internally, and everything would be finr?
thanks for your input.Hi,
This is the steps to migration from rollback tablespace to undo tablespace (from 8i to 9i migration by manual upgrade) :
SQL>alter system set undo_management=auto scope=spfile;
SQL>create UNDO tablespace UNDOTBS datafile d:\database\mydb\system\undotbs01.dbf size 500M;
SQL>alter system set undo_tablespace= UNDOTBS scope=spfile;
SQL>shutdown immediate
SQL>startup
SQL>select SEGMENT_NAME,TABLESPACE_NAME,STATUS from dba_rollback_segs; --Verirify creation and usage UNDO tablespace
SQL>drop tablespace rbs including contents and datafiles;
SQL>create pfile=d:\database\mydb\system\pfile\init.ora from spfile;No need to drop old rollback segment.
Nicolas. -
Hi all,
I'm working with an 11.2.0.1 RAC. I need resize the temp tablespace. In order to do it, I've created a new temp tablespace with the correct size and I've configure it as default tablespace for database. After it, I try to drop the old temp tablespace but when I launch the drop sentence, it never finish.
I've take a look and I can see some inactive sessions are using the old temp tablespace.
How can I drop it? Any ideas?
Best Regards,
dbajug>
I'm not getting errors if I try to drop the tablespace. I execute this estatement:
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP1;
DROP TABLESPACE TEMP INCLUDING CONTENTS AND DATAFILES;
But it never ends. No error appears. After 20 minutes, I cancel the execution with a Ctrl+C.
>
Because there are sessions which still use space in old temporary tablespace .I don't think this sessions which already used old space in old temporary tablespace) can automaticly change from old t new .hence you have to choose one of the above ways
Edited by: Radrigez on 04.07.2011 5:56 -
DB 10.2.0.4
AIX 5.2
PROD
I am trying to drop temp tablespace as below command. It is running since nine hours I am not understand why it is taking too much time. FYI I have created a new temp and assigned to default temporary tablespace. Even I connected with new session and run “drop tablespace temp” it is also running since one hour. Suggest me.
DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;
Thanksuser11969485 wrote:
FYI Holder session is "oracle@devdb (SMON)"
Edited by: user11969485 on Jan 7, 2012 12:49 AMYes, Looks like you hitting a BUG.
Check this note Bug 3833893: SMON GETS "TT ENQUEUE" OF TEMP IF DATEFILE OF TEMP DOESN'T EXIST
It saying to drop files from mount status. Lets try :)
Keep Close the Threads, So it meaningful as those answered.
user11969485 Newbie
Handle: user11969485
Status Level: Newbie (10)
Registered: Oct 27, 2009
Total Posts: 302
Total Questions: 66 (57 unresolved)
Edited by: CKPT on Jan 7, 2012 2:36 PM -
Hi ,
After a tablespace drop solely .... what is happening with its included segments....., i mean where would they belong to.... to SYSTEM tablespace...?????
NOTE: I use Oracle10g on Windows XP platform......
Thanks , a lot
SimonHi ,
The following portion of document is from an Oracle documentation :
"To drop a tablespace, use the DROP TABLESPACE statement. The following statement drops the users tablespace, including the segments in the tablespace:
DROP TABLESPACE users INCLUDING CONTENTS;
If the tablespace is empty (does not contain any tables, views, or other structures), you do not need to specify the INCLUDING CONTENTS clause. Use the CASCADE CONSTRAINTS clause to drop all referential integrity constraints from tables outside the tablespace that refer to primary and unique keys of tables inside the tablespace.
To delete the datafiles associated with a tablespace at the same time that the tablespace is dropped, use the INCLUDING CONTENTS AND DATAFILES clause. The following statement drops the users tablespace and its associated datafiles:
DROP TABLESPACE users INCLUDING CONTENTS AND DATAFILES;
"So , from the above , i understand that :
1) if i specify DROP TABLESPACE USERS.... then the tablespace db object is dropped only.... not datafiles , not segments......So , my question is where these segments belong to ....afterwards????
2) if i specify DROP TABLESPACE users INCLUDING CONTENTS ... then the tablespace db object is dropped as well as the segments included in it.....Not the datafiles....
3) if i specify DROP TABLESPACE users INCLUDING CONTENTS AND DATAFILES... then the tablespace db object is dropped , the segments and datafiles ,as well ....
Are the above considerations correct...?????
Many thanks ,
Simon
Message was edited by:
sgalaxy
Maybe you are looking for
-
I subscribe to numerous podcasts. When I refresh my subscribed to Podcast Window, there is a download reference in the left sidebar when clicked opens a download window. I use this download window to organize the manner into which playlist the podcas
-
How can I stop iTunes from changing tags in Widows 8?
So, this is not new to Windows 8, I've also had this problem for years with Windows 7 also. However it seems to have gotten worse with Windows 8. I've been hoping Apple would fix this but it has been an ongoing nagging problem with iTunes for as long
-
Hi There, I had a lot of issues upgrading from CS4 (Adobe Application Manager crashing, installer not opnening etc) but managed to get the installer to run by using the Adobe Creative Suite Cleaner Tool to remove all traces of CS4. However, when the
-
Helo Everyone I tried to upgrade my Blackberry Bold 9900 device software from version 7.0.0 to version 7.1.0 but having difficulties. I tried using the Blackberry Desktop Manager but there was no version 7.1.0 listed among the available updates. Even
-
IMac Retina 27" TDM with newly released MacBook Air
If I upgrade my Macbook Air to the newly released ( March, 2015 ), can I do target display mode with my iMac retina 27" ?