Delete the datafile

Hi all,
I want to delete Datafile from my ASM instance. I gave a bad name to my data file and i want to remove it now.
SQL> select file_name,TABLESPACE_NAME,ONLINE_STATUS from dba_data_files where TABLESPACE_NAME ='USERS';
FILE_NAME TABLESPACE_NAME ONLINE_STATUS
+DATA/orcl/datafile/users2           USERS                RECOVER
Please help me to resolve this issue.
Thanks,
krish

user2281943 wrote:
Hi all,
I want to delete Datafile from my ASM instance. I gave a bad name to my data file and i want to remove it now.
SQL> select file_name,TABLESPACE_NAME,ONLINE_STATUS from dba_data_files where TABLESPACE_NAME ='USERS';
FILE_NAME TABLESPACE_NAME ONLINE_STATUS
+DATA/orcl/datafile/users2           USERS                RECOVER
You can NOT delete datafiles once they are part of the database.There is a command to drop the datafile but that works only when the file is completely empty. For your "bad name" issue of te file, all what you needed to do was to use the Rename command and to rename the file. But what appears is that the file is either offlined or is not available. Do you have archivelog mode enabled and have all the archivelogs with you? What appears is that you need to recover the said file before you can do anything else over it.
HTH
Aman....

Similar Messages

  • 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/2002

    Even 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.

  • Deleting a datafile

    In Oracle8i, how does one delete or drop a datafile? The file does not physically exist on disk. When I try to "create tablespace datafile 'foo' size 100m", it reports that it cannot process the statement because the "datafile already exists". It seems that I need to tell Oracle to delete the datafile before I can recreate it.

    The "and datafiles" is not supported in 8i. Believe it or not, I think the prescribed method of deleting datafiles is to do so at the OS prompt (gulp!). Seems strange since Oracle creates the datafile via an SQL command (create tablespace <foo> datafile <fname>).

  • 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
    abhi

    Hi 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.

  • How to defragment the datafile hwm in EBS R12 database

    Hi All,
    We are on 1204 E-biziness instance on 11gR2 database.
    We have deleted(purged some EGO data and got the huge space in dba_segments. it was around 2.5 gb after purging activity we got
    SQL> select sum(bytes/1024/1024/1024) from dba_segments;
    SUM(BYTES/1024/1024/1024)
    734.867561
    SQL>
    SQL> select sum(bytes/1024/1024/1024) from dba_data_files;
    SUM(BYTES/1024/1024/1024)
    2456.70493
    SQL>
    But in datafile the HWM is not reduced, i checked by moving the big tables, even though i am not getting the space in datafile level, i need to resize my datafile size to 1TB , take backup and clone the target which is having 1TB space.
    For example in apps_ts_tx_data we have only 243Gb segments but the datafiles size it is having 1000GB, we have to reduce the datafile size to that 300Gb, how to do it?
    =======
    SQL> select sum(bytes/1024/1024/1024) from dba_segments where tablespace_name='APPS_TS_TX_DATA';
    SUM(BYTES/1024/1024/1024)
    243.981201
    SQL> select sum(bytes/1024/1024/1024) from dba_data_files where tablespace_name='APPS_TS_TX_DATA';
    SUM(BYTES/1024/1024/1024)
    1070.2343
    SQL>
    ==========
    I thought of creating one tablespace of 300GB and move all objects into new tablespace , drop old tablespace and rename new tablespace to 'APPS_TS_TX_DATA', but we have objects like below, Pl guide me what is the best method of doing this and reduce my database size to 1TB. so that i can accomplish my task
    ====
    SQL> select DISTINCT SEGMENT_TYPE,count(*) FROM DBA_SEGMENTS where tablespace_name='APPS_TS_TX_DATA' group by SEGMENT_TYPE;
    SEGMENT_TYPE COUNT(*)
    INDEX 275
    INDEX PARTITION 509
    INDEX SUBPARTITION 96
    LOB PARTITION 8
    LOB SUBPARTITION 96
    LOBINDEX 460
    LOBSEGMENT 460
    TABLE 14615
    TABLE PARTITION 2079
    TABLE SUBPARTITION 96
    10 rows selected.
    ====
    Thanks in advance..

    Please see these docs.
    How to Reorganize INV Schema / Reclaim the High Watermark [ID 555058.1]     
    Optimizing Database disk space using Alter table shrink space/move compress [ID 1173241.1]
    Why is no space released after an ALTER TABLE ... SHRINK? [ID 820043.1]
    Various Aspects of Fragmentation [ID 186826.1]
    Thanks,
    Hussein

  • 'alter database open resetlogs' didn't reset one of the datafiles

    I've spent the last three and a half weeks recovering an oracle database (11g 64-bit linux) because of a corrupt block in an online redo log (which I thought was being written to multiple locations). I restored the files, moving some of them around in the process; recovered to the latest possible point; moved files back to their proper location; ran 'alter database open resetlogs'; and one of the datafiles (from a bigfile tablespace) didn't get reset. I checked afterward, and it was marked offline. I do not remember placing the file offline, and cannot find such a statement in my last 300 sqlplus commands, which includes commands well before I renamed this file and the commands surrounding the rename.
    Restoring/recovering the database again will take too long, and is a remarkably poor option. Even if the database had opened correctly, the affected tablespace would not have been touched in the two or three minutes the database was open. Is there any way to force oracle to reset the logs again or otherwise fix this one file to mark it with the same date? Only allowing the resetlogs option after an incomplete recovery seems a poor restriction, especially, if files can slip through like this. I'm suspecting there is someway to just fix the checkpoint values for the tablespace, but I don't know where to begin. This particular file is <5% of the database, so if I have to do some sort of backup/restore with just it, that is probably doable.

    0: 11.1.0.6.0 on SUSE Linux Enterprise Server 10 SP2
    1: rman
    backup format '/opt/oracle/backup/mydatabase_%Y-%M-%D_%s_datafiles_%p' (database);
    backup format '/opt/oracle/backup/mydatabase_%Y-%M-%D_%s_archivelogs_%p' archivelog all delete input;
    backup format '/opt/oracle/backup/mydatabase_%Y-%M-%D_%s_control_%p' current controlfile spfile;
    2:
    restore database; --not sure what datafiles were restored with this
    restore datafile X; --several files were restored individually
    recover database until scn 1137554504; -- I verified that all datafiles were on the same checkpoint after this finished. Not having placed any files offline, I didn't bother checking that.
    3:
    SQL> alter database open resetlogs;
    Database altered.
    Elapsed: 00:04:20.34
    SQL> quit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    4: Nothing in the tablespace has been touched since I ran 'alter database open resetlogs;'. It also appears that oracle placed the file offline (without me telling it to do so) and left it that way through the resetlogs, leaving the tablespace unusable during the time it was opened. The only things that would be out of date are the 'RESETLOGS_CHANGE#', the 'CHECKPOINT_CHANGE#', and associated values. It's still at the last scn before the resetlogs, and the system has been in archivelog mode the entire time. This is all information that Oracle could be tracking, and from a program logic standpoint there is no reason why Oracle cannot tie together the changes before the resetlogs, the resetlogs command and the changes after the resetlogs into a new, continuous string of changes. I assume there is some such feature in a high-caliber program because I'm actually a programmer (who would have included such advanced tracking features), and I've become a DBA out of necessity. I admit to not knowing all of the oracle DBA commands, hence me posting here before doing the work of submitting a request to metalink.
    5: I consider it a poor restriction because it doesn't always reset the logs on all files, and as far as my knowledge goes it has rendered my 3.5 week recovery process WORTHLESS. I suppose it could cause numerous errors, especially if the database wasn't cleanly shut down, but having the ability to do something equivalent to datafiles that oracle skipped the process on seems quite useful in my situation. I guess the more fundamental problem to complain about is that it would apply such changes to only some of the files, while leaving others unusable, instead of just giving me an error that some files weren't going to be reset, but I think I'm done venting my Oracle frustrations for now.
    Am I stuck with a tablespace that I cannot bring online with the database open, or is there some sort of 'alter database datafile' command (or anything else) that I know nothing of that will fix the straggling file?
    Edited by: jbo5112 on Oct 5, 2009 3:33 PM -- obfuscated some file names to secure identity.

  • WHAT IF I DELETE THE SYSTEM06.DBF FILE FROM DATABASE /U01/DB/apps_ sid / system06.dbf and how to recover it in apps

    WHAT IF I DELETE THE SYSTEM06.DBF FILE FROM DATABASE /U01/DB/apps_<sid>/ system06.dbf and how to recover it in apps

    Hi,
    First of all you must Open a ticket with oracle Support and explore the options
    You can use this note to fix it:
    RECOVERING FROM A LOST DATAFILE IN A UNDO TABLESPACE [ID 1013221.6]
    If you is Unable to Drop Undo tablespace Since Undo Segment is in Needs Recovery
    You can Upload the following trace file while opening the ticket
    SQL>Alter session set tracefile_identifier='corrupt';
    SQL>Alter system dump undo header "<new of undo segment in recover status>";
    Go to udump
    ls -lrt *corrupt*
    Upload this trace file
    Also upload the alert log fileRegards,
    Levi Pereira
    Edited by: Levi Pereira on Nov 29, 2011 1:58 PM

  • 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.

  • Automatic deleting of datafiles after DROP TABLESPACE

    Lazy junior dba question. How can i order oracle to delete files automaticly after deleting them from control file (like drop tablespace command)?
    What technology/approach should I use? Can ASM help me?
    Thnaks.

    Well, ideally after issuing
    DROP TABLESPACE <TBS_NAME> INCLUDING CONTENTS AND DATAFILES; the datafiles corresponding to that tablespace should get deleted automatically. Although, in my case, sometimes it gets deleted automatically, but sometimes it doesn't(Windows Server).
    Comments from others will be useful.
    Regards,
    Anand

  • Create a tablespace without specifying the datafile path and name

    HI,
    Is it possible to create a tablespace without specifying the datafile path and name.
    For eg : if we just specify the tablespace name and the size of the datafile, the datafile should be created in a default location with default name? Is it possible?

    user13364377 wrote:
    HI,
    Is it possible to create a tablespace without specifying the datafile path and name.
    For eg : if we just specify the tablespace name and the size of the datafile, the datafile should be created in a default location with default name? Is it possible?Using Oracle-Managed Files
    Oracle internally uses standard file system interfaces to create and delete files as needed for the following database structures:
    * Tablespaces
    * Online redo log files
    * Control files
    Through initialization parameters, you specify the file system directory to be used for a particular type of file.
    EXAMPLE:
    The following parameter settings are included in the initialization parameter file:
    DB_CREATE_FILE_DEST = '/u01/oradata/sample'
    DB_CREATE_ONLINE_LOG_DEST_1 = '/u02/oradata/sample'
    DB_CREATE_ONLINE_LOG_DEST_2 = '/u03/oradata/sample'
    The following statement is issued at the SQL prompt:
    SQL> CREATE DATABASE sample;
    SQL> CREATE TABLESPACE tbs_2 DATAFILE SIZE 400M ;
    SQL> CREATE UNDO TABLESPACE undotbs_1;
    refer the link for more information:
    http://download.oracle.com/docs/cd/B10500_01/server.920/a96521/omf.htm

  • RAC - DBCA -silent deleteDatabase not deleting underlying datafiles

    Hello All,
    I have a small question. I recently deleted a RAC database on 11GR2 (Grid Infrastructure) using the following command as the database owner (oracle)
    dbca -silent -deleteDatabase -sourcdDB mydb -sysDBAPassword mypassword -sysDBAUserName sysThe command execute properly. But I see the datafile structure is still under ASM. I'm wondering if the command should have been run as grid rather then oracle, because the documentaiton states:
    http://docs.oracle.com/cd/E11882_01/install.112/e10813/dbcacrea.htm#BABIGJAH
    "At this point, you have accomplished the following:"
    Deleted the selected database from the cluster
    Deleted high availability services that were assigned to the database
    Deleted the Oracle Net configuration for the database
    Deconfigured Database Control for that database
    Deleted the OFA directory structure for that database from the cluster
    Deleted the data files if the data files were not on raw devices
    Thanks in advance for your advise and assistance.
    Jan S.

    Check with this doc
    Removing a Node from a 10gR1 RAC Cluster [ID 269320.1]
    regards,
    Shaan

  • How to delete the members in one dimension use the maxl script

    i have question that i want to delete the members in one dimension useing the maxl script, but i do not know how to do it. can the maxl delete the members in one dimension? if can, please provide an sample script, thank you so mcuh.

    MaxL does not have commands to alter an outline directly, except the reset command which can delete all dimensions but not members selectively. The best you could do would be to run a rules file (import dimensions) using a file that contains the members you want to keepload rule for the dimension. As typical the warning is to test this first before you do it on a production database

  • I deleted a contact, but they still show up in my text options to send.  I would like to delete the contact from my texts too.

    I deleted a contact, but they still show up in my text options to send.  I would like to delete the contact from my texts too.

    No don't restore your iphone. I've done that several times &amp; it has never worked. -I still have deleted contacts in my iphone texts.  *However if you do restore it you will not lose all your data, pics, text messages etc if you backup in iCloud. It restores back to original phone. Very nice :). Anyhowwww....
    I JUST  figured it out!! :))). Remove the contact from recents.
      Start a text. You should see the deleted contact. All the way to the right of the name is a symbol. The symbol is a circle with "i" in the middle. Click that symbol then in red lettering click "remove from recents".

  • What happens if I click "delete backup" in order to delete the iCloud backups from my sisters phone off my device. Will it delete everything on her phone?

    So a while ago when I got my phone I started a new Apple ID account/ iCloud.. Then when my sister got a new iphone I gave her my id to use too. In settings-general-usage it says that my storage is almost full. I then click on manage storage and it shows my phone and my sisters phone and how many gb or whatever. Also it says "last backup failed" and other stuff that's Irrelevant. Now when I click on my sisters phone I have an option to "delete backup" MY QUESTION is if I click the delete backup button will it just delete the iCloud backup off my phone OR will it totally delete everything involving the backup off my sisters phone forever??? Please help! Thank you so much!!!!!

    Deleting a backup deletes the backup only from the iCloud storage, not anything on the iPhone.
    The iPhone's iCloud backup will be updated at some point - automatically when the iPhone is connected to an available wi-fi network while connected to a power source unless the iCloud backup is turned off on the iPhone.

  • We use our Iphones with the icloud to set up scheduling of jobs. Multiple phones share the same icloud for this purpose. We recently had a change in leadership. How do I completely delete the icloud account? Or do I just create a new one/forget old 1

    Multiple phones share one Icloud account. We use it to schedule jobs and crew leaders read the cloud to get the information of the job that needs to be done. However, we recently had a change of leadership and we think this person might have logged into or put our cloud on his phone to sabotage our business. I changed the password but that didn't fix the situation. I could put a job on the cloud with an old phone that was logged in with the old password and everyone with the new password would still see the job. I have since created a whole new cloud account which seems to have eliminated the "future" issue of sabotage however I would like to completely eliminate that old account...any advise?

    Everyone needs to go to Settings (or System Preferences)>iCloud and click 'Delete account' or 'Sign out' as applicable (it's the same thing). Then they can sign into the new account you have created and proceed from there. You can't actually delete the old account from the server but you can just ignore it.

Maybe you are looking for

  • Vendor payment with bank charges

    hai, I want to make a payment to Vendor with bank charges. Like for ex. Vendor Bill amount is Rs.1000.00, i want to issue a cheque for Rs.980.00 and Bank charges Rs.20.00 so total amount Rs.1000.00 to be adjusted against bill. How do achieve this? go

  • How to center 6 divs in a container div - horizontally

    I'm trying to build a Fluid Grid website with DW CC. For now I have a problem which I can't solve. I have six links in a nav bar. Every link has different block sizes, so I arranged that with CSS. Now I like to have those divs, which are in a contain

  • Camera raw file not found

    I have adobe photoshop cs6 on mac os 10.6.8. I recently tried to upgrade my camera raw plugin and now when going to about plugin camera raw it pops a window open saying could not complete camera raw command file not found. Please help for i have no i

  • Problems with Photomerge in CS4

    I'm using Photoshop on Vista 32. When I try to do a photomerge either from PS or Bridge, it does its stuff, then closes everything immediately. Reboots / changed options make no difference. Any ideas?

  • Need opinion : Tiger Server running on PowerMac G4 (AGP Graphic)?

    Dear Gurus, I have a spare PowerMac G4 (AGP Graphic) with 2GB RAM, and a spare copy of 10.4 Server. Is it reasonable to install Tiger Server into this PowerMac? The computer will serve as a file server for about 20+ user (mostly documents, no video o