Datafile deletion
hai
how to check how much amount of space in a tablespace is assigned to the database user.i queried dba_ts_quotas and queried users and size columns to findout the space assigned for a user in a tablespace but the size is displayed as 0 in the size column
please say me how to find out the space assigned for a user in a specific tablespace
also say me whether it is possible to delete on of the 2 datafiles in a specific tablespace.if possible plesa say me how to do that
Regards
amberson
"You can not delete a datafile from a tablespace."
Really ?
SQL> alter tablespace users add datafile;
Tablespace altered.
SQL> select file_id from dba_data_files where file_name like '%users%';
FILE_ID
4
7
SQL> select count(*) from dba_extents where file_id = 7;
COUNT(*)
0
SQL> alter tablespace users drop datafile 7;
Tablespace altered.
SQL> select file_id from dba_data_files where file_name like '%users%';
FILE_ID
4
Similar Messages
-
Help! datafile deleted on oracle 9i under redhat linux
Please help me, i delete a datafile from a test tablespace and i don't know
how to fix it on 9i, in 8i is very documented but 9i is a real pain, here
is the error when 'dbstart'ing the db:
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> Connected to an idle instance.
SQL> ORACLE instance started.
Total System Global Area 353440004 bytes
Fixed Size 450820 bytes
Variable Size 167772160 bytes
Database Buffers 184549376 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 28 - see DBWR trace file
ORA-01110: data file 28: '/oradata/alumnos/tablespaces/test2.dbf'
Thank you in advance,
Otto SolaresCan you perform a Tablespace Point In Time Recovery on the specific tablespace?
-
How to recover to keep tablespaces working after datafile deleted on OS
hi,
given situation like this :
1. OS HPUX 11i
2. Oracle 9.2 or 10g
3. tablespace AAA have a datafile AAA.dbf
4. AAA.dbf has been deleted by a guy on OS by accident
5. it's a production database , i have other copy of product running elsewhere
6. we can forget about the data on this tablespace , just wanna make sure new data will still be inserted
I know there is a magic way involving file descritpor to recovery the file on OS if it was still opened by the process
seems it only works on linux or solaris , since HPUX don't have /proc
here is what i had done ,
1. offline drop the tablespace
2. export tablespace AAA from other DB without data but everything else
3. import them into DB without AAA now
only problem seems application couldn't insert into the tables ,Object priveledge not granted
i'd checked the export file , those object grant SQL are right there , i just don't know why import hasn't worked
so my question is
if it were you ,
1.do you have any better idea of how to recover
2.if you any dirty and fast way of recovery File on HP box , appreciate that too
3.can you image why import doesn't seems getting priveledge imported ? my DB version 9.2.0.4
many thanks
br/rickythanks , aman ,lenord and you all
looks like i'm the sinful :)
to clear it up ... it's not me who did it , one of our guys , same thing ,hum ~~
he deleted the backup , cause it's full and auto backup is not ongoing , and he's trying to make things right
he deleted the datafile , cause i told him to rename the file to another space , coz vgdb is full , screw up that too ..
yeah , it'a real production database ~~ , so ,if anybody learn somethings on this , credit on me , :)
the version is 9.2.0.4 , but gonna move to 10g soonor or later , so put it there , to see if in 10g , we can do better ..
tablespace created like five years ago , so , apply all archive since would be crazy ~
this database have 500 Tablespaces , and thoudsands of tables , and the one lost is a important one ,
but data in it , we can bear loss
what i do , is offline drop the tablespace , and import the tablespace without data from other production DB ...
only it didn't work out so well with object grant , and application still not inserting ...
why i post it here , is i wanna learn better ways in this kind of situations ...
i thought my way is not good enough
anway , i'll look at all your suggestions
thanks
br/ricky
Edited by: zs_hzh on Sep 15, 2008 10:12 PM -
Undo Datafile deleted, How to startup database?
Hi
I was getting that message when startup database
SQL> startup
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218292 bytes
Variable Size 83888396 bytes
Database Buffers 75497472 bytes
Redo Buffers 7168000 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: '/u01/app/oracle/oradata/impl2pk/undotbs02.dbf'
Later on got to know that a datafile was deleted.
Anybody help me how to start database now?
Thankshttp://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5669213349582Khurram
-
hi
by mistake i have deleted one datafile.. is there any way to bring up the db
actually i have created a perfstat tablespace with 1 datafile named perfstat.dbf in two database
latter on that tablespaces was not required so i was tried to drop the tablespace
so i started with the 1st database and drop the tablespace using
drop tablespace <tsname> including contents and datafiles
by mistake i have open the another database folder where all the datafile is located...i found that perfstat datafile is not deleted so i have deleted it using os command rm ( so by mistake i have fired drop tablespace command in 1st database and physicaly deleted the file from another database)
the problem is we dont have backup and our database is in no archivelog mode
currently db is running but whenever we will restart db it will give us error about this file and db wont up
so is there any workaround for this..... plz its urgent.hi alok
r u sure this will work because.. datafile is not there it is deleted.. currently db is running and if i m trying to offline tablespace it is giving me this error
SQL> alter tablespace perfstat offline;
alter tablespace perfstat offline
ERROR at line 1:
ORA-01116: error in opening database file 6
ORA-01110: data file 6: '/td_oradata/oradata/p012band/perfstat.dbf'
ORA-27041: unable to open file
HPUX-ia64 Error: 2: No such file or directory
Additional information: 3
if i m trying to offline datafile it is giving me this error
SQL> alter database datafile '/td_oradata/oradata/p012band/perfstat.dbf' offline;
alter database datafile '/td_oradata/oradata/p012band/perfstat.dbf' offline
ERROR at line 1:
ORA-01145: offline immediate disallowed unless media recovery enabled
r u sure that after shutdown the database in mount mode i can offline tablespace
please reply -
Hello,
after changing undo tablespace to new smaller one and dropping the old one the space was not released.
I found that:
oracle@ora1:~> lsof | grep deleted
oracle 24861 oracle 18u REG 199,65533 4377812992 10 /oradata/ckpt/system/undotbs01.dbf (deleted)
oracle@ora1:~> ps aux | grep 24861
oracle 24861 0.0 2.3 5769704 189132 ? Ss May12 0:00 ora_q000_CKPT
the question is: Why the file is still opened by the process and how to release it? Is it possible to shutdown and startup db without problem? I worry that db will miss the file during startup and will not start.
Thanks
TVthe removel was not performed by os command
I created new tbs by
create undo tablespace ...
Changed default undo tbs
alter system set UNDO_TABLESPACE=UNDOTBS2;
dropped the old
drop tablespace UNDOTBS1 including contents and datafiles;
all commands were successful
show parameter undo_t
NAME TYPE VALUE
undo_tablespace string UNDOTBS2 -
Datafile Deleted but Data Accessible
Hi
My database is in archive log mode, 10.2.0.2.
I took a hot RMAN backup and then created a tablespace with one datafile and created a user having this new tablespace as a default tablespace. Created two tables for this user.
Then I deleted the datafile of this tablespace using OS command but the data is the datafile is still accessible. Isn't it strange? I thought the database will crash or will at least not access the data on this datafile.
Can someone please tell me how this data is being accessed?
Also if I do shutdown immediate I get the following:
SQL> shutdown immediate;
ORA-01116: error in opening database file 9
ORA-01110: data file 9: '/oracle/oradata/gptest/surrey.dbf'
ORA-27041: unable to open file
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 3
Thanks in AdvanceHi
My database is in archive log mode, 10.2.0.2.
I took a hot RMAN backup and then created a
tablespace with one datafile and created a user
having this new tablespace as a default tablespace.
Created two tables for this user.
Then I deleted the datafile of this tablespace using
OS command but the data is the datafile is still
accessible. Isn't it strange? I thought the database
will crash or will at least not access the data on
this datafile.
Can someone please tell me how this data is being
accessed?
how did you access the data? i think it takes some time to register in the control file that a daatfile has been deleted then latre if u query from that tablepsace will result in error.you can access once the deletion info is registered in controlfile.
correct me if i am wrong
Also if I do shutdown immediate I get the following:
SQL> shutdown immediate;
ORA-01116: error in opening database file 9
ORA-01110: data file 9:
'/oracle/oradata/gptest/surrey.dbf'
ORA-27041: unable to open file
IBM AIX RISC System/6000 Error: 2: No such file or
directory
Additional information: 3
Thanks in Advance
the above surrey.dbf is the one you have deleted now you need to restore and recover the datafile inturn the database.
cheers
maran -
Undo Datafile Deletion(Drop)
Hi
I m working in oracle 11G in Lunix. I have created two datafiles for undo tablespace. Due to space crunch, i need to drop a lesser sized datafile from undo tablespace. Is there any way to drop it?
ThanksAs mentioned earlier, it can not be dropped once added, but there is a workaround which can be useful in your case..
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:515222144417 -
10g flashback database limitations
When are you not able to Flashback Database?
· Media failure, corruption or datafile deletion.
· The control file has been restored or recreated
· A tablespace has been dropped
· A data file has been shrunk
· A RESETLOGS operation is required.
If you dropped a schema and want it back, you can use flashback database to get it back. But if you dropped both schema and tablespace, it is not possible to get the schema back with flashback database.
Is there any other scenarios to use flashback database?
jzcI am trying to evaluate the benefit to turn on this feature. Please drop few lines of your opinion to help me.
-
How to drop tablespace ?
HI
Several hours ago I shutdown Oracle, and later wrongly remove a mearly testing tablespace (called TS). NOW I CANNOT STARTUP ORACLE.
I used the method below:
SQL > sqlplus / as sysdba;
SQL > startup mount;
SQL > ALET TABLESPACE TS OFFLINE;
then system show's : ORA-01109 database not open
you see, How can I run "srartup open" successfully while not reload ORACLE system to OperaintSystem?
scottHi,
Above steps are correct.
In case you need to recovery db, try simple steps.
startup mount;
Restore datafile <deleted datafile no>;
Recover datafile <deleted datafile no>;
SQL 'Alter database open;'
Regards,
Satishbabu Gunukula
http://oracleracexpert.blogspot.com -
Data files removed during language import
Hi,
While running a language import on ECC 6.0, someone removed the data files from the /usr/sap/trans/data directory.
We are facing 2 problems now :
1. the language that must be imported is now locked in SMLT (no lock exists in SM12 as described in help)
2. we can't find how to recreate the datafile from the .PAT file located on the install DVD. (some people have told me they did it before, but can't find back how)
Can someone please help ?
Tx in advance
Patrice.What I know is,
If the datafiles deleted we can't add manually. better to install. before that taka a backup of existing one.
regards
ganesh -
Why the query of the object still can work after the datafile has been deleted?
Dear friends:
Recently, I deleted a datafile from OS but don't touch the correspondent tablespace in OEM(actually the datafile name still exists in OEM after I deleted it from OS). I found out I still can create objects such as table and query it in this tablespace using sqlplus though the physical datafile has already been deleted.(What I done is I created new objects using an account whose default tablespace is that one which I deleted the datafile from it.). Will these new objects use another datafile instead the original one deleted? I will appriciate if you can point out the reason for me. Thanks for your help!
John
07/26/2002Even though you delete a datafile physically from OS, entries about the datafile still exists in Data Dictionary. So long as these entries are there in data dictionary, Oracle will consider that these file exists unless there is a specific command which referes to deleted files.
Further, you are trying to create table in a tablespace whose datafile is deleted. If that was the only datafile for that tablespace then you should get an error. If the table is getting created, there must be some other datafile for that tablespace, in which your table is getting created. This is all when your database is already in running stage. If you shutdown and restart the database, it won't start next time because of missing datafile.
Hope this solves your query. -
Delete a datafile in 11gR2 ASM
Here is the current datafiles of the database 11gR2, 11.2.0.1 on the ASM file system.
SQL> select FILE_NAME,TABLESPACE_NAME from dba_data_files;
FILE_NAME TABLESPACE_NAME
+DATA01/heat/datafile/testtbs.274.807968419 TESTTBS
+DATA01/heat/datafile/testtbs.266.807968493 TESTTBS
+DATA01/heat/datafile/testtbs.258.807968511 TESTTBS
1/ Use RMAN to backup the whole db onto the disk
2/ In RMAN, check the backup: List backup; See all the backup including the above data files;
3/ Run this cmd to drop 1 datafile, In SQL> ALTER TABLESPACE TESTTBS drop datafile '+DATA01/heat/datafile/testtbs.258.807968511';
4/ Verify it, whether that data file deleted, yes it was deleted.
SQL> select FILE_NAME,TABLESPACE_NAME from dba_data_files;
FILE_NAME TABLESPACE_NAME
+DATA01/heat/datafile/testtbs.274.807968419 TESTTBS
+DATA01/heat/datafile/testtbs.266.807968493 TESTTBS
5/ In RMAN, check the backup again: List backup; It's not there in the backup. Why's that ?????????????????????
BS Key Type LV Size Device Type Elapsed Time Completion Time
6 Full 935.09M DISK 00:01:15 21-FEB-2013 11:43:44
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20130221T114228
Piece Name: +FRA01/heat/backupset/2013_02_21/nnndf0_tag20130221t114228_0.344.807968549
List of Datafiles in backup set 6
File LV Type Ckp SCN Ckp Time Name
1 Full 999944 21-FEB-2013 11:42:29 +DATA01/heat/datafile/system.256.807898985
2 Full 999944 21-FEB-2013 11:42:29 +DATA01/heat/datafile/sysaux.261.807898985
3 Full 999944 21-FEB-2013 11:42:29 +DATA01/heat/datafile/undotbs1.260.807898985
4 Full 999944 21-FEB-2013 11:42:29 +DATA01/heat/datafile/users.268.807898985
5 Full 999944 21-FEB-2013 11:42:29 +DATA01/heat/datafile/testtbs.274.807968419
6 Full 999944 21-FEB-2013 11:42:29 +DATA01/heat/datafile/testtbs.266.807968493
7 Full 999944 21-FEB-2013 11:42:29
6/ Try restore the deleted data file, it's not available in the backup ????? I do not understand this ? Really appreciate someone could explain this ?????When you drop a datafile, the database instance updates controlfiles, redologs and SCN numbers. The datafile you have in your backup will no longer match the the rest of the database environment, so it cannot be restored without restoring the complete database prior to the time the datafile was dropped. Similarly you cannot mount or restore the datafile of a different database. The database does not maintain recovery information for a datafile that does not exist. If you loose the datafile, e.g. delete it from the filesystem, you can restore the datafile and recover the information using the existing controlfile and redologs. That is all normal and is not influenced by ASM.
-
Deleted archive files during the datafile offline period
Dear Gurus
I want to report a mishap that happened in one of our system.
I made one of the data files x01.dbf offline(the only datafile for that tablespace say X )
Now unfortunately i deleted the archives during the period the datafile was offline ..
Now it is not letting me do any operation like any ddl operation ..
How can I restore the database back to normal .
Thanks in advance
abhiHi again,
Dear GuruOh la, I'm not a guru, just an old oracle newwbie!
I did not understand what was that 7 error game :)Lesson learned: do not try to translate obscure French stuff :-)
About your problem, if this does not work, you have only one possibility: drop it. If the drop fails you'll have to bounce the database in order to do that.
If you have to "recover" from the tablespace loss, you'll have to do some TSPITR (Tablespace Point In Time Recovery).
HTH,
Yoann. -
Dear Friends ,
I m using Oracle 10g . suddenly , I have to delete one of my datafile(USERS01.DBF) in absent mind.
My database is in NOARCHIVE LOG mode and I have no export or cold backup . When I start my
database then it shows the following error :
SQL> startup
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1296284 bytes
Variable Size 188745828 bytes
Database Buffers 88080384 bytes
Redo Buffers 7090176 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\RND\USERS01.DBF'
I m running recover command and it also shows the following error :
SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-01110: data file 4: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\RND\USERS01.DBF'
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\RND\USERS01.DBF'
SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-01110: data file 4: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\RND\USERS01.DBF'
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\RND\USERS01.DBF'
In this moment , Is there any way to recover my datafile ? plz help .. ..Vijay,
Of course you can open your database after creating a new datafile of same. Data of that particular datafile is ever lost.
I guess you mean "ater database create datafile" command right?I don't think that also will work here because that too needs archivelog files to make that new file consistent with rest of the databsae.
Please see here,
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/recoscen003.htm#BRADV224
As OP is in noarchivelog mode, so I don't think he has this option available.
Aman....
Maybe you are looking for
-
Hi, I have one workflow log for ivoice. It is in error stste in one step. I have restaterd the main workflow using swpr . Still the workflow is in error. User wants to complete the workflow in any case. But if I use SWIA then it says that error workf
-
How to get dispaly value of radio button
hi i have situation where i what to get display value of radio button,for example i store value A in db but i display Active in my radio button how can i do that my radio button is <af:selectOneRadio id="sor3" layout="horizontal"
-
How to save the web page content? help!
i'm doing 'saveAs' button in order to save all the web content. I'm using ole automation. Can help me to check how to modify my code in order to run 'saveAs' function'? I'm stucked at the code shown below as i would like to insert the web content ins
-
ITunes 4.9 and Australian Music Store
Hi, I have been unable to access the Australian music store because I only have iTunes v. 4. If I upgrade to v. 4.9 (which comes with the Nano I will be purchasing) will I be able to connect and download from the Australian store? Also will I have an
-
Choose from list in the system
Hi I want to create the Choose from list in the System form (Employee Master Data) in the edit box. what is the coding for this ? can anyone help me ... Regards Bhuvana Edited by: bhuvana eshwari on Aug 7, 2008 8:23 AM