Home » RDBMS Server » Server Administration » how to reclaim space after deleting a data file (oracle 11g R2 sun solaris 10,single instance)
how to reclaim space after deleting a data file [message #463184] Wed, 30 June 2010 02:20 Go to next message
janakors
Messages: 232
Registered: September 2009
Senior Member
hello to every one

i have a tablespace with a datafile of 20g. now by mistake i delete the datafile and then try to delete the tablespace from EM but i got an error which says that data file is not present to delete

Now initially after deleting the file physically so then i check space by applying df -ah at os lvl so it didn't reclaim the space now i try to delete the tablespace from em so it gives me the above error.
this migt be due to tablespace existence.

so how can i reclaim the space.

please guide

regards
Re: how to reclaim space after deleting a data file [message #463192 is a reply to message #463184] Wed, 30 June 2010 03:00 Go to previous messageGo to next message
Michel Cadot
Messages: 68653
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
In the end, what do you want?
Get back the file? Get back the tablespace? Drop the tablespace?

Regards
Michel
Re: how to reclaim space after deleting a data file [message #463220 is a reply to message #463184] Wed, 30 June 2010 04:59 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Instead of explaining what you did, just copy and paste the session. Verbatim.
Using ASM?
Re: how to reclaim space after deleting a data file [message #463237 is a reply to message #463220] Wed, 30 June 2010 05:46 Go to previous messageGo to next message
janakors
Messages: 232
Registered: September 2009
Senior Member
thank u for reply
sir i want that 20gb back as i delete the data file so i want that space that why i deleted but on os using df -ah, it shows /u01 capacity as the data file exist so how can i reclaim that space even after deleting that data file,(i thought that might be due to the existence of it respective tablespace)

so please tell me how to drop such tablespace or any other way i can get my 20GB space back (for which i deleted that data file but didn't get it).

regards
Re: how to reclaim space after deleting a data file [message #463244 is a reply to message #463184] Wed, 30 June 2010 06:34 Go to previous messageGo to next message
mkounalis
Messages: 147
Registered: October 2009
Location: Dallas, TX
Senior Member
Can you confirm the datafile exists in your /u01 mount point? How exactly did you accidentally delete the datafile? Through an os command or through oracle? We need to know exactly what you did to help you.
Re: how to reclaim space after deleting a data file [message #463245 is a reply to message #463244] Wed, 30 June 2010 06:43 Go to previous messageGo to next message
maniatniit
Messages: 49
Registered: June 2010
Location: Mumbai
Member

Just Offline Drop the DATAFILE
Re: how to reclaim space after deleting a data file [message #463257 is a reply to message #463244] Wed, 30 June 2010 07:40 Go to previous messageGo to next message
Michel Cadot
Messages: 68653
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/ ALTER DATABASE DATAFILE ... OFFLINE DROP
2/ DROP TABLESPACE ... INCLUDING CONTENTS AND DATAFILES
3/ Restart the instance

Regards
Michel

[Updated on: Thu, 01 July 2010 02:04]

Report message to a moderator

Re: how to reclaim space after deleting a data file [message #463358 is a reply to message #463257] Wed, 30 June 2010 23:26 Go to previous messageGo to next message
janakors
Messages: 232
Registered: September 2009
Senior Member
i did the following

1.i went to ... /oradata/orcl folder

2.bash>rm -r data_01_01.dbf
bash>
3.bash>df -ah
bash> (here /u01 mount point space still shows me that no change to capacity and i it must show that space is increased as i delete the 20 gb datafile)

4. now i log on to EM and try to delete the tablespace but it give me error that respective data_01_01.dbf is not there so can't delete)


5. i want that space back how should i ?
(my suggestion is that if i can drop my tablespace so may be at os level the space would be released )


6. please guide


regards


Re: how to reclaim space after deleting a data file [message #463360 is a reply to message #463358] Wed, 30 June 2010 23:37 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>6. please guide

Oracle holds the file open & OS space is not freed until after Oracle shuts down & releases the inode it help OPEN
Re: how to reclaim space after deleting a data file [message #463361 is a reply to message #463360] Wed, 30 June 2010 23:51 Go to previous messageGo to next message
janakors
Messages: 232
Registered: September 2009
Senior Member
BlackSwan wrote on Wed, 30 June 2010 23:37
>6. please guide

Oracle holds the file open & OS space is not freed until after Oracle shuts down & releases the inode it help OPEN



do u mean that i need to shutdown and restart this instance( as i have to instances) and what exactly you mean by ---& releases the inode it help OPEN

regards
Re: how to reclaim space after deleting a data file [message #463362 is a reply to message #463361] Wed, 30 June 2010 23:55 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>do u mean that i need to shutdown and restart this instance
Yes, but this is OS behavior & has nothing to do with Oracle.
1) create 1GB text file
2) open file with vi
3) from another process/window delete file
4) OS disk space will not be returned until after vi exits & releases the inode
Re: how to reclaim space after deleting a data file [message #463385 is a reply to message #463362] Thu, 01 July 2010 02:10 Go to previous messageGo to next message
janakors
Messages: 232
Registered: September 2009
Senior Member
but sir i delete this file using oracle user directly on the OS so it should straightaway release the space and sir kindly give me something like, article or document to know about solaris behaviour specfically in my case. i think i need more knowledge about solaris os.

please suggest some book or link


regards and thank u very much for your support

janakors
Re: how to reclaim space after deleting a data file [message #463390 is a reply to message #463385] Thu, 01 July 2010 02:27 Go to previous messageGo to next message
Michel Cadot
Messages: 68653
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
but sir i delete this file using oracle user directly on the OS so it should straightaway release the space

No, because Oracle instance owns a handle on the file, the file is only released when ALL handles are closed, that is here when instance is shut downn this is why I said: "3/ Restart the instance"

Quote:
article or document to know about solaris behaviour specfically in my case. i think i need more knowledge about solaris os.

As this is the basic behaviour of ALL unix since they existed, I think you can easily find this on the web.

Regards
Michel

[Updated on: Thu, 01 July 2010 02:27]

Report message to a moderator

Re: how to reclaim space after deleting a data file [message #463575 is a reply to message #463220] Fri, 02 July 2010 01:07 Go to previous messageGo to next message
janakors
Messages: 232
Registered: September 2009
Senior Member
Mahesh Rajendran wrote on Wed, 30 June 2010 04:59
Instead of explaining what you did, just copy and paste the session. Verbatim.
Using ASM?

hello sir

can u expalin or give link that how can i copy my session and what is this "Verbatim" and how "using ASM"

please guide

regards
Re: how to reclaim space after deleting a data file [message #463579 is a reply to message #463575] Fri, 02 July 2010 01:13 Go to previous message
Michel Cadot
Messages: 68653
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
can u expalin or give link that how can i copy my session

OraFAQ Forum Guide

Quote:
what is this "Verbatim"

http://www.merriam-webster.com/dictionary/verbatim
http://en.wiktionary.org/wiki/verbatim

Quote:
how "using ASM"

http://www.oracle.com/pls/db102/print_hit_summary?search_string=asm

Regards
Michel
Previous Topic: Stumped about an ORA-01683 error
Next Topic: ORA-01033 oracle initialization or shutdown in progress
Goto Forum:
  


Current Time: Sun May 19 21:07:05 CDT 2024