Drop datafile from tablespace

I'm new to oracle.
After I extended a tablespace I understood that it was too large.
I've been reading about how to drop a tablespace, but I don't want to drop the entire tablespace. I just want to drop the last datafile of this tablespace.
I know how to drop tablespaces in sapdba and brtools, but I don't know how I can drop one specific datafile (number 29) of the tablespace PSAPBTABD?
Please Help med.
Best regards
Harald V

Hello Harald,
see please this thread:
Re: How to drop data file?
also the section 43. <i>How can I delete a data file that was created by mistake</i>
in the SAP Note<i><b> 592393 - FAQ: Oracle</b></i>
if you have Oracle 9i databases, it is not easy to drop a datafile, but in Oracle 10g
you can drop a datafile like that:
<b><i>ALTER TABLESPACE</i></b> <<u><i>Tablespace Name</i></u>> <b><i>DROP DATAFILE</i></b> '<<u>PATH und NAME of Datafile</u>>';
for example,  you have a tablespace called PSAPC11 and you want to drop a datafile called dat.data15 of this tablespace, you can drop it like that:
e.g. <b><i>alter tablespace</i></b> <u>PSAPC11</u> <b><i>drop datafile</i></b> <u>'/oracle/C11/psapc11/dat.data15'</u>
Best regards
Baran

Similar Messages

  • Drop one datafile from Tablespace

    Hi,
    I have 9i Database on Linux. I want to drop one datafile from tablespace. I have tried to drop datafile through following command but it gave no effect.
    alter database datafile <datafile name> offline drop;
    What should i have to do for dropping datafile?
    Do the needful
    Thankx in advance.

    Hi
    since you dont specify the database version or if you have it setup as archivelog or noarchivelog mode, i paste the drop specs for dropping a datafile, from SQL Reference manual of 9i
    DROP If the database is in NOARCHIVELOG mode, you must specify the DROP
    clause to take a datafile offline. However, the DROP clause does not remove the
    datafile from the database. To do that, you must drop the tablespace in which the
    datafile resides. Until you do so, the datafile remains in the data dictionary with the
    status RECOVER or OFFLINE.
    If the database is in ARCHIVELOG mode, Oracle ignores the DROP keyword.
    Regards
    Message was edited by:
    pcambra

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

  • Drop datafile from a offline tablespace

    We are running oracle 9.2 on windows.
    Out of the 3 datafiles in a non-system tablespace A, one datafile A-DF1 was accidently droped from the file system by our DBA.
    The other two datafiles were brought online by using the ALTER DATABASE RECOVER command by bringning the database in mount phase.
    Now we want to remove that datafile A-DF1 from the tablespace and bring that tablespace online.
    The database is not in archive mode and no cold backup was present.
    The solution that we want to try is:
    1-drop the tablespace A without dropping the datafiles
    2-create a new tablespace and reuse those datafiles
    3-assign this new tablespace to the affected user
    Would this work? Do you have any other safe solution for this problem?
    thanks
    Imran

    Hi..
    Your solution is a wrong solution.
    1. I guess, that the tablespace A won't be a empty tablespace.As, the objects are present in the tablespace you can't drop the tablespace without dropping its contents.You will have to use *DROP TABLESPACE <tbs_name> INCLUDING CONTENTS; -- This will drop all the contents.
    2. Do, you have a export backup, or any kind of backup.As the database is in no archivelog mode, you won't be able to do complete recovery.
    3. Take the datafile A-DF1 OFFLINE and keep the tablespace online. -- alter database datafile 'datafile_name' offline;
    If you don't have any kind of backup, the data is LOST.
    Anand

  • Need to drop datafile from my undo tablespace

    I have a undo tablespace and it has 2 datafiles. i would like to drop one datafile.
    befor i am droping this datafile i am going to bring this file to offline and i got this message: ORA--01145 offline immediate disallowed unless media recovery enable.
    can someone tell me how i can safly do it without any problem.
    Thanks

    An undo tablespace can be dropped like any other tablespace, but not until all transactions within the tablespace are complete. First, specify a new undo tablespace as in the previous example. To see if the tablespace has any pending transactions, run the following query:
    SQL> select rn.name, rs.status
    2 from v$rollname rn, v$rollstat rs
    3 where rn.name in
    4 (select segment_name from dba_segments
    5 where tablespace_name = 'UNDOTBS')
    6 and rn.usn = rs.usn
    7 ;

  • Drop a datafile from physical standby's control file

    Hi,
    I am trying to create a physical standby database for my production...
    1) I have taken cold backup of my primary database on 18-Nov-2013...
    2) I added a datafile on 19-nov-2013 ( 'O:\ORADATA\SFMS\SFMS_DATA4.DBF' )
    3) Standby control file was generated on 20-ov-2013 (today) after shutting down and then mounting the primary database...
    When i try to recover the newly setup standby using archive files, i am getting the following error (datafile added on 19th Nov is missing)
    SQL> recover standby database;
    ORA-00283: recovery session canceled due to errors
    ORA-01110: data file 39: 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    ORA-01157: cannot identify/lock data file 39 - see DBWR trace file
    ORA-01110: data file 39: 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    How to overcome this situation...
    Can i delete the entry for the newly added datafile from the backup control file ?
    When i tried to delete datafile using "alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF';", it is showing that database should be  open..
    SQL> alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    ERROR at line 1:
    ORA-01109: database not open
    SQL> show parameter STANDBY_FILE_MANAGEMENT
    NAME                                 TYPE        VALUE
    standby_file_management              string      AUTO
    SQL> alter system set STANDBY_FILE_MANAGEMENT=manual;
    System altered.
    SQL> show parameter STANDBY_FILE_MANAGEMENT
    NAME                                 TYPE        VALUE
    standby_file_management              string      MANUAL
    SQL> alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    ERROR at line 1:
    ORA-01109: database not open
    Regards,
    Jibu

    Jibu wrote:
    Hi,
    I am trying to create a physical standby database for my production...
    1) I have taken cold backup of my primary database on 18-Nov-2013...
    2) I added a datafile on 19-nov-2013 ( 'O:\ORADATA\SFMS\SFMS_DATA4.DBF' )
    3) Standby control file was generated on 20-ov-2013 (today) after shutting down and then mounting the primary database..
    Hi,
    What is your version?
    If you added new datafile or created new tablespace, take backup again for restore new created standby database.
    If your standby  database running well, DG configuration success, then this datafile will create on standby side, too.
    Set STANDBY_FILE_MANAGEMENT=AUTO best practice.
    When i try to recover the newly setup standby using archive files, i am getting the following error (datafile added on 19th Nov is missing)
    SQL> recover standby database;
    ORA-00283: recovery session canceled due to errors
    ORA-01110: data file 39: 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    ORA-01157: cannot identify/lock data file 39 - see DBWR trace file
    ORA-01110: data file 39: 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    How to overcome this situation...
    Can i delete the entry for the newly added datafile from the backup control file ?
    Not need any delete datafile from standby side, you must recreate standby database, or you can  take RMAN backup and restore to standby  side again.
    When i tried to delete datafile using "alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF';", it is showing that database should be  open..
    SQL> alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    ERROR at line 1:
    ORA-01109: database not open
    SQL> show parameter STANDBY_FILE_MANAGEMENT
    NAME                                 TYPE        VALUE
    standby_file_management              string      AUTO
    SQL> alter system set STANDBY_FILE_MANAGEMENT=manual;
    System altered.
    SQL> show parameter STANDBY_FILE_MANAGEMENT
    NAME                                 TYPE        VALUE
    standby_file_management              string      MANUAL
    SQL> alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    ERROR at line 1:
    ORA-01109: database not open
    It is not logical, Physical  standby must be bit-for-bit same with Primary  database.
    Regards
    Mahir M. Quluzade

  • Droping a datafile from a tablespace

    I want to drop a datafile from a tablespace by using the query
    SQL> alter tablespace TS1 drop datafile 'OS path\df1';
    This query drops the datafile. But physically the datafile is present in the OS path. how to delete the datafile completely from the disk.

    Version:-
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL>
    Although it's dropped on database level, I can't delete.If dropped data file from ORACLE, it deletes from OS level too. By any other processes being locked like antivirus and so on?
    SQL> select file_name from dba_data_files where tablespace_name='USERS';
    FILE_NAME
    C:\ORACLE\ORADATA\ORCL\USERS01.DBF
    C:\ORACLE\ORADATA\ORCL\USERS02.DBF
    SQL> alter tablespace users add datafile 'c:\oracle\oradata\orcl\users03.dbf' size 10m;
    Tablespace altered.
    SQL> host
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    C:\Users\bn2676>cd c:\Oracle\oradata\orcl
    c:\Oracle\oradata\orcl>dir users*
    Volume in drive C is System
    Volume Serial Number is 1853-3E21
    Directory of c:\Oracle\oradata\orcl
    02/15/2012  11:25 PM         5,251,072 USERS01.DBF
    02/16/2012  09:04 PM        10,493,952 USERS02.DBF
    02/16/2012  09:05 PM        10,493,952 USERS03.DBF
                   3 File(s)     26,238,976 bytes
                   0 Dir(s)  177,196,707,840 bytes free
    c:\Oracle\oradata\orcl>exit
    SQL> alter tablespace users drop datafile 'c:\oracle\oradata\orcl\users03.dbf';
    Tablespace altered.
    SQL> select file_name from dba_data_files where tablespace_name='USERS';
    FILE_NAME
    C:\ORACLE\ORADATA\ORCL\USERS01.DBF
    C:\ORACLE\ORADATA\ORCL\USERS02.DBF
    SQL> host
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    C:\Users\bn2676>cd c:\Oracle\oradata\orcl\
    c:\Oracle\oradata\orcl>dir user*
    Volume in drive C is System
    Volume Serial Number is 1853-3E21
    Directory of c:\Oracle\oradata\orcl
    02/15/2012  11:25 PM         5,251,072 USERS01.DBF
    02/16/2012  09:04 PM        10,493,952 USERS02.DBF
                   2 File(s)     15,745,024 bytes
                   0 Dir(s)  177,207,398,400 bytes free
    c:\Oracle\oradata\orcl>

  • Question about ALTER TABLESPACE add/drop datafile

    Good afternoon,
    As an exercise, I created a tablespace STORETABS and added a datafile to it using the command:
    SQL> alter tablespace storetabs add datafile 'e:/storetabs3.dbf' size 50M;This step succeeded. A new file was created in the root of e: as expected.
    Following that command, I issued:
    SQL> alter tablespace storetabs drop datafile 'e:/storetabs3.dbf';
    Tablespace altered.The command succeeded. However, the file *'e:/storetabs3.dbf'* was not removed. After re-reading the documentation found at http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_3002.htm, I get the impression that removing the O/S file itself is something that always needs to be done manually.
    The question: Am I correct that there is no option to cause the "alter tablespace <tablespace> drop datafile <datafilename>" to delete the O/S file ? In other words, must the O/S file always be manually deleted as a separate step ?
    Thank you for your help,
    John.

    I believe in windows directory paths used backslash and not forward slash.
    You can argue why oracle does not give error, either while creating or while dropping ;)
    SQL> select * from v$version ;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> select tablespace_name, file_name from dba_data_files ;
    TABLESPACE_NAME
    FILE_NAME
    USERS
    /u01/app/oracle/oradata/orcl/users01.dbf
    UNDOTBS1
    /u01/app/oracle/oradata/orcl/undotbs01.dbf
    SYSAUX
    /u01/app/oracle/oradata/orcl/sysaux01.dbf
    SYSTEM
    /u01/app/oracle/oradata/orcl/system01.dbf
    EXAMPLE
    /u01/app/oracle/oradata/orcl/example01.dbf
    SCOTT_TBS
    /home/oracle/scott_f1.dat
    6 rows selected.
    SQL> !ls -l scott_f1.dat   
    -rw-r----- 1 oracle oinstall 276832256 Sep 11 21:15 scott_f1.dat
    SQL> alter tablespace scott_tbs add datafile '/home/oracle/scott_f2.dat' size 10M ;
    Tablespace altered.
    SQL> !ls -l scott_*.dat
    -rw-r----- 1 oracle oinstall 276832256 Sep 11 21:15 scott_f1.dat
    -rw-r----- 1 oracle oinstall  10493952 Sep 11 21:18 scott_f2.dat
    SQL> alter tablespace scott_tbs drop datafile '/home/oracle/scott_f2.dat' ;
    Tablespace altered.
    SQL> !ls -l scott*.dat
    -rw-r----- 1 oracle oinstall 276832256 Sep 11 21:15 scott_f1.dat

  • Can I Drop a datafile from UNDOTBS

    Hi!!!!
    I want to drop a datafile from UNDOTBS . can I Drop it.
    If yes then how to drop ? what is the effect of it on database?
    If anybody knows the the answer then Pls reply..

    You can do this provided test it before doing it in production
    Steps.
    1. Create a new Undo tablespace
    2. Shutdown the database
    3. Change the parameter UNDO_TABLESPACE to the newly created undo tablespace
    4. Start the database
    5. Do whatever you want with the old undo tablespace.

  • How to move a specific tablespace datafile from one directory to another

    Database: 10.2.0.1
    OS : Generic
    Problem Description : How to move a specific tablespace datafile from one directory to another considering that the database is on Oracle Dataguard setup
    ** Oracle is working on this issue, but in parallel is opening the topic to the Community so that Community members can add their perspective, experience or knowledge. This will further enhance all knowledge bases including My Oracle Support and My Oracle Support Communities **
    Edited by: ram_orcl on 16-Aug-2010 21:21

    Dear ram_orcl,
    Please follow the procedures here;
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14239/manage_ps.htm#i1034172
    8.3.4 Renaming a Datafile in the Primary Database
    When you rename one or more datafiles in the primary database, the change is not propagated to the standby database. Therefore, if you want to rename the same datafiles on the standby database, you must manually make the equivalent modifications on the standby database because the modifications are not performed automatically, even if the STANDBY_FILE_MANAGEMENT initialization parameter is set to AUTO.
    The following steps describe how to rename a datafile in the primary database and manually propagate the changes to the standby database.
       1.
          To rename the datafile in the primary database, take the tablespace offline:
          SQL> ALTER TABLESPACE tbs_4 OFFLINE;
       2.
          Exit from the SQL prompt and issue an operating system command, such as the following UNIX mv command, to rename the datafile on the primary system:
          % mv /disk1/oracle/oradata/payroll/tbs_4.dbf
          /disk1/oracle/oradata/payroll/tbs_x.dbf
       3.
          Rename the datafile in the primary database and bring the tablespace back online:
          SQL> ALTER TABLESPACE tbs_4 RENAME DATAFILE      2> '/disk1/oracle/oradata/payroll/tbs_4.dbf'
            3>  TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
          SQL> ALTER TABLESPACE tbs_4 ONLINE;
       4.
          Connect to the standby database, query the V$ARCHIVED_LOG view to verify all of the archived redo log files are applied, and then stop Redo Apply:
          SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
          SEQUENCE# APP
          8 YES
          9 YES
          10 YES
          11 YES
          4 rows selected.
          SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
       5.
          Shut down the standby database:
          SQL> SHUTDOWN;
       6.
          Rename the datafile at the standby site using an operating system command, such as the UNIX mv command:
          % mv /disk1/oracle/oradata/payroll/tbs_4.dbf /disk1/oracle/oradata/payroll/tbs_x.dbf
       7.
          Start and mount the standby database:
          SQL> STARTUP MOUNT;
       8.
          Rename the datafile in the standby control file. Note that the STANDBY_FILE_MANAGEMENT initialization parameter must be set to MANUAL.
          SQL> ALTER DATABASE RENAME FILE '/disk1/oracle/oradata/payroll/tbs_4.dbf'
            2> TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
       9.
          On the standby database, restart Redo Apply:
          SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
            2> DISCONNECT FROM SESSION;
    If you do not rename the corresponding datafile at the standby system, and then try to refresh the standby database control file, the standby database will attempt to use the renamed datafile, but it will not find it. Consequently, you will see error messages similar to the following in the alert log:
    ORA-00283: recovery session canceled due to errors
    ORA-01157: cannot identify/lock datafile 4 - see DBWR trace file
    ORA-01110: datafile 4: '/Disk1/oracle/oradata/payroll/tbs_x.dbf'Hope That Helps.
    Ogan

  • Cannot drop old undo tablespace. Cause: active rollback segment

    dear all.
    db: oracle 10.2.0.1
    os: rhel as version 5 64 bits.
    This is a testing database. And my database is online and open. But i can free the external usb disk that contains my ols undotbs.
    I want to drop old undo tablespace but this is not possible.
    1.- In order to open my database i had my datafile( '/mnt/hdext/back_plelds/undotbs02.dbf') offline drop, and then i can to open my database.
    2.- When i try to delete my old undo tablespace im getting this error:
    SQL> drop tablespace undotbs1 including contents and datafiles;
    drop tablespace undotbs1 including contents and datafiles
    ERROR at line 1:
    ORA-01548: active rollback segment '_SYSSMU1$' found, terminate dropping
    tablespace
    3.- My default undo_tablespace is another that i was created before step 1.
    SQL> sho parameter undo_ta
    NAME TYPE VALUE
    undo_tablespace string UNDOTMP
    SQL>
    Well i search in metalink ORA-01548 code error and in 18947.1 doc whows me that the solution is:
    Action: Shut down instances that use the active rollback segments in the
    tablespace and then drop the tablespace.
    4.- I try to shutdown but im getting:
    SQL> shutdown immediate;
    ORA-00376: file 10 cannot be read at this time
    ORA-01110: data file 10: '/mnt/hdext/back_plelds/undotbs02.dbf'
    SQL>
    This /mnt/hdext is an external USB disk and i have all permissions. I exported tables without any problem and i can read all files.
    i search un metalink again ora codes (ORA-00376 ORA-01110) and the doc id: 427801.1 shows in the solution:
    Drop the old undo tablespace instead of making it offline.
    but when i try to drop the tablespace it shows the error describe in the step 2.
    Facts:
    - my tablespace UNDOTBS1 is ONLINE. I put in offline and this is not the solution.
    - This is the status of my rollback segments:
    SQL> select segment_name, status from dba_rollback_segs where
    2 tablespace_name='UNDOTBS1';
    SEGMENT_NAME STATUS
    _SYSSMU1$                      NEEDS RECOVERY
    _SYSSMU2$                      NEEDS RECOVERY
    _SYSSMU3$                      NEEDS RECOVERY
    _SYSSMU4$                      NEEDS RECOVERY
    _SYSSMU5$                      NEEDS RECOVERY
    _SYSSMU6$                      NEEDS RECOVERY
    _SYSSMU7$                      NEEDS RECOVERY
    _SYSSMU8$                      NEEDS RECOVERY
    _SYSSMU9$                      NEEDS RECOVERY
    _SYSSMU10$                     NEEDS RECOVERY
    _SYSSMU11$                     OFFLINE
    SEGMENT_NAME STATUS
    _SYSSMU12$                     OFFLINE
    12 rows selected.
    SQL>
    - I have the note (Unable to drop und tablespace In this article describe the problem but this is not the same. The difference is that i cannot drop the rollback segment that describe in step 2.
    SQL> drop rollback segment "_SYSSMU1$";
    drop rollback segment "_SYSSMU1$"
    ERROR at line 1:
    ORA-30025: DROP segment '_SYSSMU1$' (in undo tablespace) not allowed
    in metalink the doc id: 173696.1 shows the solution:
    Action:     Check the undo segment name and reissue statement if necessary.
    i cannot drop the rollback_segment
    What can i do ???
    thanks a lot.

    in step 4 did you try with shutdown abort?
    If its still does not work then create another new table space with new file and then swtich to that tablespace http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/undo.htm#sthref1504Khurram

  • Recovering a datafile from backup in different server

    Hi All,
    I usually take hot backup of datafiles to different server like this because i dont have enough space in same server. I
    SQL> alter tablespace XXXX begin backup;
    host scp /bu1/oradaTA/XXXXX/XXXXX [email protected]:/db1dw/oradata/backup/dec2010/XXXX
    alter tablespace OPS end backup;
    If i want to recover the datafile can i normally do the offline drop of that datafile and copy the datafile from backup which is in differnet server thorugh scp and make the datafile online??? and the database is in archivelog mode but i dont care abt the log files. i just need to recover the datafile as it was from last backup.
    or do we need to use any recover datafile commands?? if need to use any recover datafile command from where it will recover the datafile??
    i dont have any scripts for backup or recovery , i just take manual scp of the datafiles.
    Help plzz, thanks in advance.....

    SQL> alter tablespace XXXX begin backup;
    host scp /bu1/oradaTA/XXXXX/XXXXX [email protected]:/db1dw/oradata/backup/dec2010/XXXX
    alter tablespace OPS end backup;What is the version you are using? is it 9i if not you can peform backup at database level instead of tablespace level.
    If i want to recover the datafile can i normally do the offline drop of that datafile and copy the datafile from backup which is in differnet server thorugh scp and make the datafile online??? and the database is in archivelog mode but i dont care abt the log files. i just need to recover the datafile as it was from last backup.Why offline drop to recover? Are you sure what are you doing?
    or do we need to use any recover datafile commands?? if need to use any recover datafile command from where it will recover the datafile??1) alter system switch logfile;
    2) select max(sequence#) from v$archived_log;
    For Ex:
    Sequence -- 100
    3) alter database begin backup;
    4) copy all the datafiles to another server(bcoz you not have space in same server)
    5) alter database end backup;
    6) select max(sequence#) from v$archived_log;
    For Ex:
    Sequence -- 110
    Then copy these generated 10 archives to new server also.

  • Dropping datafiles

    Can I drop datafiles individually, or do I need to drop the entire tablespace? The ALTER TABLESPACE command doesn't appear to have a drop datafile clause. I've dropped enough objects in the tablespace to reduce the amount of space used to 1%, but there are still a dozen objects including tables and indexes. There are also references to and from these objects to objects in other tablespaces.
    Kevin Tyson

    ALTER DATABASE dbname
    DATAFILE filename OFFLINE DROP;
    Does not actually drop datafiles. It only takes them offline if the database is in noarchivelog mode.
    However, that section in the SQL reference goes on to say...
    "However, the DROP clause does not remove the datafile from the database. To do that, you must drop the tablespace in which the datafile resides. "
    Which answers my question.

  • Drop datafiles

    HI,
    Oracle 10.2.0.4 SUSe 10 Archivelog mode
    The datafile mount point is 100% used. So I had to shutdown the DB and mount it. I want to make some space in the mount space and delete unwanted datafiles from the database. Since now i am in mount stage how can i delete the datafiles from the DB. And make space on the server.
    Please suggest

    hi,
    post
    select file_name,tablespace_name,user_bytes/10024/1024,bytes/1024/1024,maxbytes/1024/1024 from dba_data_files;check for any used datafiles, if you really you dont want you can go ahead to dellete,
    drop tablespace tbs1 including contents and datafiles;Thanks

  • After offline drop datafile, v$datafile.status='RECOVER'

    OS version:
    [oracle@base ~]$ uname -a
    Linux base.no.sohu.com 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux
    DB version:
    SQL> select version from v$instance;
    VERSION
    9.2.0.1.0Here is my steps,
    SQL>alter database datafile '/usr/oradata/bill/soq05.dbf' offline;
    Database altered.
    SQL>alter database datafile '/usr/oradata/bill/soq05.dbf' offline drop;
    Database altered.Cause there is nothing errors generated, I thought the commands executed sucessfully. But it's not.
    SQL> SELECT NAME,STATUS FROM v$datafile WHERE NAME='/usr/oradata/bill/soq05.dbf';
    NAME                                     STATUS
    /usr/oradata/bill/soq05.dbf              RECOVER
    SQL> SELECT FILE#, STATUS, ERROR, RECOVER, TABLESPACE_NAME, NAME 
      2  FROM   V$DATAFILE_HEADER 
      3  WHERE  RECOVER = 'YES'  OR     (RECOVER IS NULL AND ERROR IS NOT NULL);
         FILE# STATUS  ERROR                RECOVER              TABLESPACE_NAME                NAME
            18 OFFLINE                      YES                  SOQ                            /usr/oradata/bill/soq05.dbf
    [oracle@base ~]$ ll /usr/oradata/bill/soq05.dbf
    -rw-r-----  1 oracle oinstall 1073750016 Aug 28 17:39 /usr/oradata/bill/soq05.dbfThe datafile haven't been droped successfully and its status changed to 'RECOVER'. Also, I can't online it now.
    What should I do to make this datafile droped or at least make it online/offline? What I am worry is the database will be failed to restart because of this 'RECOVER' datafile.
    Thanks very much!
    Satine

    Hey Werner,
    Thanks very much for your help.
    The reason I tried to drop the datafile is after I add the datafile to tablespace, I found the datafile failed to be created on the standby side because the parameter "db_file_name_convert"'s value were incorrect. When I created the datafile on primary side, the value of "db_file_name_convert" was,
    SQL> select name,value from v$parameter where name='db_file_name_convert';
    NAME                           VALUE
    db_file_name_convert           /home/oracle/bill/oradata/bill, /U02/bill/oradata/billIt should be VALUE='/usr/oradata/bill','/U02/bill/oradata/bill'. For now the datafile's status on standby side is,
    SQL> SELECT name,status FROM V$DATAFILE where file#=18;
    NAME                                               STATUS
    /U02/bill/product/9.2.0.1/dbs/UNNAMED00018         RECOVERIf the datafile on primary side could been recovered successfully, is there a way to make the datafile on standby side also correct?
    Thanks
    Satine

Maybe you are looking for

  • Smartview 11.1.2.1.0/Excel 2010

    I am using Smartview version 11.1.2.1.0 and am having issues trying to access Essbase in Excel 2010. If I try to access member selections from my Smartview menu Excel 2010 just freezes. If I try to just type in the member selections and refresh I wil

  • Does the Mac pro DVD player play Blu-ray discs?

    I suspect the answer is no, because the only DVD's that don't work in my player are blu-ray. But if someone can confirm this for me that would be great. If I need to download software to make my DVD player Blu-ray please direct me to the right site.

  • Authorization check to perform a process in a Ztransaction

    we have a custom program where in I need to check the authorization. The program generates a report and in the o/p screen we have a push button to process a selected line item. I would like to know how do I limit this 'Process' option only to certain

  • Translate iBook to Japanese/Japanese font not rendering

    Hi, I'm currently working on an iBook that is to be translated into Spanish, Italian, and Japanese. Whereas Spanish and Italian will not be an issue, I am trying to figure out how to display Japanese characters in iBA and am having trouble. I noticed

  • Screen stuck zoomed in a little bit all the time.

    There seems to be no catalyst for this situation as far as an update or anything, but my iPhone 3GS just started zooming in a little bit on the screen bringing the apps to the very edge of the screen and blocking off the options in apps like iPod and