Remove datafile from database

Hello all,
I have a database 11.1.0.7 where I wanted to remove a datafile. The database is in archivelog.
The first thing that I did was to make sure that no data was in the datafile. - OK
Then, since I only wanted to remove 1 week later, I put the datafile offline - OK
On the day (one week after putting it offline) that I was going to remove/drop the datafile from the tablespace I got an ORA- saying to put the datafile online before dropping.
And here is my problem! The database says that the datafile needs recover :(
Questions:
1- If the datafile was offline, why does it need recover?
2- Do you thing that the database will ask for all archivelogs until now to recover this datafile ?
3- If I dont want to apply all archivelogs, can I simply remove the datafile by recreating the controlfile without this datafile?
Thank you.

Questions:
1- If the datafile was offline, why does it need recover?The SCN must be alligned with the DB
2- Do you thing that the database will ask for all archivelogs until now to recover this datafile ?I never tried that with missing archived logs so I cannot say it. Just try and you will see.
3- If I dont want to apply all archivelogs, can I simply remove the datafile by recreating the controlfile without this datafile?The problem is that this datafile is registered in the dictionary. You cannot do it.
Probably you got this exception:
ORA-03264: cannot drop offline datafile of locally managed tablespace
Cause: Trying to drop offline datafile in lmts
Action: Try to drop file after making it onlinehttp://download.oracle.com/docs/cd/B28359_01/server.111/b28310/dfiles006.htm#ADMIN11435
Restrictions for Dropping Datafiles
The following are restrictions for dropping datafiles and tempfiles:
- The database must be open.
- If a datafile is not empty, it cannot be dropped.
- If you must remove a datafile that is not empty and that cannot be made empty by dropping schema objects, you must drop the tablespace that contains the datafile.
- You cannot drop the first or only datafile in a tablespace.
- This means that DROP DATAFILE cannot be used with a bigfile tablespace.
- You cannot drop datafiles in a read-only tablespace.
- You cannot drop datafiles in the SYSTEM tablespace.
- If a datafile in a locally managed tablespace is offline, it cannot be dropped.

Similar Messages

  • Remove OID from database

    Hello,
    I am trying to install a new infrastructure instance without deleting the database. I need to delete or unregister the current internet directory from the metadata repository so that a new one can be installed. Does anyone know the steps to remove OID from a database cleanly so that it can be installed again to the same db? Any info would be greatly appreciated.
    Thanks
    Jordan

    Benny, use netmgr to do this. see Adding or Modifying Entries in the Directory Server http://download-west.oracle.com/docs/cd/B19306_01/network.102/b14212/config_concepts.htm#i487299
    regards,
    --Olaf                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Remove images from database...

    I prefer to import images by reference to Lr, that is, keep the original files where they are. On occasion a mistake happens and an image is fully imported into the database. If I remember what these images are it is easy to remove them from the database and re-import them by reference. However, if one does not remember the imported images, how can one identify them? Is there a flag or something that identifies images that were imported fully into the database?

    Antonio, you are using the word "import" differently than LR does. To LR, import means that it should show the file and be responsible for managing the file. The RAW file stays where it is and is not affected by this. Don't make the mistake of assuming that because you can see the raw image on the hard drive, that LR has not imported it. It either leaves them where you put them or it moves them to a new directory structure, depending on the Import options you choose - but either way, the raw file still exists on the hard disk and is still accessible to external tools. This is by design.
    LR then generates preview images for import files, and updates them as you work with the image in the Develop module. It *can* use a JPEG preview if such exists as an initial preview image, but that is solely a matter of convenience. The key point is that previews are LR's way of showing you the file, since it can't show you a RAW file directly.
    But the previews are not really considered to be what LR imported; they are instead the byproduct of the fact that the original RAW image was imported.

  • Removing workstations from database

    I have auto removal of unused worksataions setup on several servers.
    I
    noticed that some of the workstation objects that were manually
    deleted
    from NDS still show up in an inventory scan. Shouldn't the scheduled
    removal get rid of those from the database even if they've already
    been
    manually removed from NDS?
    Thanks,
    Jeff

    > [email protected],
    >
    > > Got it working. Thanks anyway.
    >
    > What was the fix? <G>
    >
    Jared, in my message I wrote that I was using the STARTSER
    NSLOOKUPFORDB
    command and getting an error message. I was typing it in at the
    server
    console just as I had written it in my message. The actual command is
    STARTSER NDSLOOKUPFORDB. I was missing the first "D" in
    ndslookupfordb...human error.
    jg

  • Best Practice for Removing Zeroes from Database

    Does anyone have some clever bits of code or best practices for evaluating a database and instances of zeroes? I'm working on cleaning up our rules file and am thinking the best way to start would be to write some code to look for zeroes and write them to a log file. This would at least indicate if there was even a problem with zeroes (which there may or may not be).
    Any suggestions out there / utilities / code samples?
    Thanks.

    We accomplished this using data extracts from a subset of scenarios/years/entities/accounts to ensure that all of our potential rules could be checked to ensure they were not writting zero's. This worked pretty well for our purposes, a text editor called EmEditor allows for VB macros in it pretty easily and we could write a quick macro to check for strings ending in "; 0." You may also want to review your check box of calculated in your extract and see if the zeros are a result of calculations. A rule output could work pretty well, although it would take some defining as you would have to write it out in a sub and make sure that you capture the data of all subroutines if your zero's are rule driven or actual inputs. May want to review some if you have very small insignificant values getting written, seen items that have one value 13 places to the right of the decimal that were not really signficant.
    JTF

  • How to separate datafiles from database software files on different disks

    Hi,
    i had 6 drives which i configured as RAID and now i have three RAID 1 logical volumes as LV0, LV1, LV2
    i used LV0 for installing LINUX enterprise version 4 operating system.
    now i want to install the oracle software and database 10.2.0
    i want to install the oracle software on LV0 along with OS files
    oracle database datafiles in LV1 and
    oracle database index files in LV2.
    how can i separate the files in different locations while installing oracle software and database files.
    Can someone help me please.
    Thanks,
    Philip.

    The Installation Guide is your friend. Specifically Appendix C of the Oracle® Database Installation Guide - 10g Release 2 (10.2) for Linux x86 discussed this in detail.
    http://download-west.oracle.com/docs/cd/B19306_01/install.102/b15660/app_ofa.htm#sthref1036

  • Updating with XML datafiles from Database or Applications Server

    Our Environment: One database server running 10g with multiple application servers.
    My Question: Am I correct in saying that if you want to update a database with XML files using a bfilename and a directory object, that the physical data files must always reside on the Database server?
    Thanks and kind regards
    Adrian

    Thank you very much for the reply.
    Our systems all operate under Unix and I was wondering whether you or anyone else knows if anyone has successfully tried to use 'soft links' to span the file systems to other machines.
    There's obviously a performance downside, but what we are trying to accomplish is leaving all 'data files' on our individual application servers.
    Thanks again
    Adrian

  • WCF Data services remove miliseconds from DateTime when expand

    I get some strange behavior, when using WCF Data Services 5.6. In my case, I have table, with 1 column set with Concurrency=Fixed, and this column hold date time field from database, updated each time when row is edited. In case I just retrieve entity -
    this column has correct value with milliseconds. But if I do mapping - milliseconds are removed.
    Here is a issue at glance :
    ====================================================================
    void Main()
    var b = from p in TABLE1 where p.ID == 100 select p;
    b.Dump();
    Request in this case is : Data.svc/TABLE1(100M) And data returned from service is :
    <d:COL1 m:type="Edm.DateTime">2015-02-16T12:13:52.972</d:COL1>
    ====================================================================
    As you can see , here time is returned with milliseconds - .972 In other case :
    void Main()
    var tmp = from p in TABLE1 where p.ID == 100 select
    new TABLE1()
    ID=p.ID,
    COL1=p.COL1
    var a1 = tmp.ToList();
    a1.Dump();
    Request in this case is : Data.svc/TABLE1(100M)?$select=ID,COL1
    <d:COL1 m:type="Edm.DateTime">2015-02-16T12:13:52</d:COL1>
    ====================================================================
    Time is returned without milliseconds.
    Does anybody have same problem? May be its a bug in the WCF Data services or in the model?

    Ok, seems like I found an answer to this, or at least way to avoid the problem.
    First I traced generated SQL from framework, and I see that in first case, im getting SQL
         SELECT ID, COL1 FROM TABLE1
    and in second case, I got
         SELECT ID, CAST( COL1 AS DATETIME) FROM TABLE1
    which cause the problem.
    Then I tried to update EF to version 6, WCF Data services to version 5.6.3,
    Oracle ODP to latest one, tried to use Oracle managed driver... no any success.
    Then I played little bit with table definition, and I saw that my col1 with type TIMESTAMP in database and DateTime in the model was defined as NOT NULL.
    If I remove this from database definition, I got right value with milliseconds.
    So , may be this is a bug in Oracle driver, but probably this is a bug in the WCF Data Services. At least I found a way to use concurrency in my case with this solution.

  • DROP DATAFILE FROM A TABLESPACE

    What is the difference between "ALTER TABLESPACE DROP DATAFILE ..." and "ALTER DATABASE DATAFILE ... OFFLINE DROP"?
    I read the Oracle document before, it tolds me that the "ALTER DATABASE DATAFILE ... OFFLINE DROP" is not really drop data file. But, does the "ALTER TABLESPACE DROP DATAFILE ..." really drop data file?

    "ALTER DATABASE DATAFILE ... OFFLINE DROP"
    will take datafile offline to drop it later. In this case your control file will need to be recreated to de-link the datafile from database.
    From 10g onwards you can ALTER TABLESPACE DROP DATAFILE... but in this case datafile should not contain any data in it.

  • How to import the datafiles from one database to another

    Hi,
    I have got some datafiles from the existing database(Consider it as Database A), but it has been removed as of now.
    I am having the datafiles and control files of it.
    I have freshly installed one oracle Database(database B), I am planning to load those datafiles in the newly installed
    database.
    Is it possible, if so wat is the procedure.
    Both the databses are Oracle 11g.
    Help me out of this.
    Thanks.
    Regards
    Gatha

    Hi,
    As you said that you have data files and Control files, then using import quite no possbile, but you need to do it manually (as it exits in the Source System in same path).
    Initially, you copy these files from the Source System to Destination System that is
    Data Files and Control Files
    Next, you will get the DBID from the controlfile backup is you have Example :-
    CTL_SP_BAK_C-1507972899-20070228-00, then " 1507972899" is the DBID,
    Try to use the RMAN for this
    example :-
    Open the rman
    set dbid 1507972899
    then you need to build the initilizaition file to start an instance based on the Configuration
    or Copy the spfile from the back from source system if exits.
    Startup the DB in mount mode.
    You might get the error
    ORA-01078: failure in processing system parameters
    Now restore spfile from 'backup path' where you have copied files
    startup force nomount
    Now the instance is started
    connect to DB as sysdba
    check the control file parameter values and online redo Log files paths (Log_Archive_dest)
    Restore the old control file from backup, since the new instance must the know where the files are located
    restore controlfile from 'backup path'
    then shutdown the DB
    start in mount mode
    restore the DB - restore database
    Note: Recovery is dependent on the available archived (and online) redo logs.
    Final step will be Alter database open resetlogs;
    - Pavan Kumar N

  • Removing record from secondary database

    Could soembody please explain - if I'm removing entry from secondary database using a cursor, will that entry be removed from primary database as well, or I need to remove it explicitly?

    looks like it does, as stated in javadocs, so nevermind ;)

  • Create database using datafiles from cold backup

    hi,
    I've been given a bunch of datafiles from a cold backup.
    I have created my own database using the same DB_NAME as the original.
    I now want to be able to attach these datafiles to my database. How do I go about? Do I need to start the database in mount mode so that the control file is open, then start adding these datafiles to the tablespace, and then open the database?
    Any help would be appreciated.
    Thank you.

    OracleGuy777 wrote:
    hi,
    I've been given a bunch of datafiles from a cold backup.
    I have created my own database using the same DB_NAME as the original.
    I now want to be able to attach these datafiles to my database. How do I go about? Do I need to start the database in mount mode so that the control file is open, then start adding these datafiles to the tablespace, and then open the database?
    Any help would be appreciated.
    Thank you.Hi,That is not possible.You actually have two different databases,however db_name is same but every db_name are same databases is not same.These has own DBID in same environment.(Their controlfile and datafile information exactly is different).There is similar way is transportable tablespace feature.You can use this feature to transport tablespace between databases.For more information see below link.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/tspaces.htm#i1007169

  • SharePoint 2007 - the best practice to detached/remove a content database from a web app without any Farm impact

    Best
    practice to remove content databases from SharePoint 2007 without any Farm
    impact <o:p></o:p>

    Hi  ,
    For removing a content database from a Web application, you can take steps as below:
    1.On the Manage Content Databases page, click the content database that you want to remove.
    2.On the Manage Content Database Settings page, in the Remove Content Database section, select the Remove content database check box.
    If any sites are currently using this database, a message box appears. Click OK to indicate that you want to proceed with the removal.
    3.Click OK.
    Reference:
    http://technet.microsoft.com/en-us/library/cc262440(v=office.12).aspx
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Can i use one datafile from different database to my database ?

    hi,
    i copied one datafile from development server to my database ? how can i use this datafile
    can i re-create controlfile , please suggest?
    Edited by: 819136 on Jan 12, 2011 2:45 AM

    I have create the controlfile please find the below details
    SQL> startup nomount
    ORACLE instance started.
    Total System Global Area 612368384 bytes
    Fixed Size 1298160 bytes
    Variable Size 255852816 bytes
    Database Buffers 348127232 bytes
    Redo Buffers 7090176 bytes
    SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS ARCHIVELOG
    2 MAXLOGFILES 5
    3 MAXLOGMEMBERS 3
    4 MAXDATAFILES 14
    5 MAXINSTANCES 1
    6 MAXLOGHISTORY 226
    7 LOGFILE
    8 GROUP 1 'E:\ORACLE\ORADATA\ORCL\REDO01.LOG' SIZE 100M,
    9 GROUP 2 'E:\ORACLE\ORADATA\ORCL\REDO02.LOG' SIZE 100M,
    10 GROUP 3 'E:\ORACLE\ORADATA\ORCL\REDO03.LOG' SIZE 100M
    11 DATAFILE
    12 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF',
    13 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF',
    14 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF',
    15 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF',
    16 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF',
    17 *'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEST01.DBF'*
    18 CHARACTER SET WE8MSWIN1252;
    CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS ARCHIVELOG
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01159: file is not from same database as previous files - wrong database id
    ORA-01110: data file 43: 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEST01.DBF'
    SQL>
    SQL> ALTER DATABASE OPEN RESETLOGS;
    ALTER DATABASE OPEN RESETLOGS
    ERROR at line 1:
    ORA-01507: database not mounted

  • Remove decommissioned SQL database from SCOM

    Hi,
    In SCOM 2007 R2, we have few SQL databases which have been decommissioned & removed but, they are still in Healthy state in SCOM.
    How can I remove these entries from SCOM? I want to remove only the databases.
    TIA.

    Try this  -
    1) Log in to those SQL servers
    2) Stop System center management(SCOM health) service.
    3) Rename Health Service State folder located at "c:\programfiles\system center operations manager\agent\Health Service State:.
    4) Restart System center management(SCOM health) service.
    5) Wait for few minutes so that discoveries can run again and then check in the SCOM console. Those Databases should go away now.
    Please let me know if this did not help or if this is not what you are looking for.
    Thanks, S K Agrawal

Maybe you are looking for