(9I) DELETE DATAFILES 개념과 사용 예제

제품 : ORACLE SERVER
작성날짜 : 2002-04-01
(9I) DELETE DATAFILES 개념과 사용 예제
======================================
PURPOSE
Space Management와 관련된 Oracle 9i의 새로운 기능 중 Delete Datafiles에
대하여 알아보기로 한다.
테이블스페이스를 삭제할 때 데이터 화일이 OMF 화일이면 자동으로 삭제되지만,
그렇지 않을 경우는(Non-OMF) 예전처럼 DBA가 직접 OS 화일을 삭제해야 한다.
하지만, 9i에서는 관련 SQL 문장(DROP TABLESPACE…)에 새로운 옵션이 추가되었다.
이를 이용하면 non-OMF 화일을 자동으로 삭제할 수 있다.
이 부분이 'Delete Datafiles' 기능이다.
Explanation
<Delete Datafiles>
Non-OMF 테이블스페이스를 삭제할 때 해당 OS 화일들도 자동으로 삭제할 수 있는
옵션이 9i에 새롭게 추가되었다. 이를 이용함으로써 얻을 수 있는 잇점은 다음과
같다.
데이터베이스 운영의 단순화
다른 OS 화일을 삭제할 가능성 배제
의미 없는 화일을 즉시 제거함으로써 디스크 공간 낭비 요소 제거
아래와 같이 관련 SQL 문장에 새로운 옵션을 넣어주면 된다.
DROP TABLESPACE
SQL> DROP TABLESPACE TBS1 INCLUDING CONTENTS AND DATAFILES;
ALTER DATABASE TEMPFILE
SQL>ALTER DATABASE TEMPFILE '/disk2/oradata/tmp1.dat' DROP INCLUDING
DATAFILES;
Example
테스트 1) Non-OMF 테이블스페이스에 대한 Delete Datafiles 테스트
As SYSTEM
- Non-OMF를 이용한 테이블스페이스 생성
SQL> create tablespace nonomf_tbs datafile
'/d02/ora9i/oracle/dbs/ora9i/tbs_omf/nonomf_tbs01.dbf' size 10M;
SQL> host ls -l /d02/ora9i/oracle/dbs/ora9i/tbs_omf
total 20512
-rw-r----- 1 ora9i dba 10489856 Mar 12 17:18 nonomf_tbs01.dbf
- 해당 테이블스페이스 삭제 : 이 테이블스페이스의 모든 데이터 화일 자동 삭제
옵션 사용
SQL> drop tablespace nonomf_tbs including contents and datafiles;
SQL> host ls -l /d02/ora9i/oracle/dbs/ora9i/tbs_omf
total 0
테스트 2) Non-OMF Temporary Tablespace의 특정 화일에 대한 Delete Datafiles
As SYSTEM
- Non-OMF를 이용한 Locally Managed Temporary Tablespace 생성
SQL> create temporary tablespace nonomf_temp tempfile
'/d02/ora9i/oracle/dbs/ora9i/tbs_omf/nonomf_temp01.dbf' size 10M
extent management local;
SQL> host ls -l /d02/ora9i/oracle/dbs/ora9i/tbs_omf
total 176
-rw-r----- 1 ora9i dba 10489856 Mar 12 17:19 nonomf_temp01.dbf
- 해당 Temporary Tablespace의 특정 tempfile 삭제, Temporary Tablespace 삭제
SQL> alter database tempfile '/d02/ora9i/oracle/dbs/ora9i/tbs_omf/nonomf_temp01.dbf'
drop including datafiles;
SQL> host ls -l /d02/ora9i/oracle/dbs/ora9i/tbs_omf
total 0
SQL> drop tablespace nonomf_temp including contents and datafiles;
Reference Document
<Note:148513.1>

Similar Messages

  • Checking delete datafile's log from oracle i.e. deleted from root user.

    Can any body help me finding the log for checking any trace for datafiles that are deleted from root user in hp-ux server ( and the sys log has alredy been modified by root user ).
    So is there is any way to check through database or server level to check the trace of deleted datafiles files log.

    user13390258 wrote:
    Thanks, In our project we are using finace 7 application and as it does't support hot backup so we are doing cold backup of database. Through HP RSM software. And we do not have RMAN backup also. Actually i am not geeting proof to show that file has been deleted from ROOT user.I don't know what a "finace 7" application is, but your assertion that it doesn't support a hot backup makes no sense. A backup of the database, and how it is accomplished, should be of no concern to the app.
    As for your statement "we don not have RMAN backup also" ... well, it looks like now you are seeing the cost of that decision. One would hope that once you get through this crisis you would take it upon yourself to institute proper database backups, because - as the dBA - your first and most important job is to insure the security of the database. I never depend on any backup scheme anyone else claims to have in place. If they want to do something they claim will backup the database, fine. But I know that when the excrement hits the ventilation system, it's MY butt on the line to recover the database, so I am d*** well going to be taking rman backups.

  • Delete datafile

    Hi,
    In my database, when i drop any tablespace by using following command, tablespace can be deleted by datafiles are in oradata directory and when i tried to delete manually os does not give permission to remove datafiles and os gives the error that these files are in used.
    Please help me to drop datafiles.
    Thank in advance.
    Anand.

    If you want to get rid of the datafiles, use the
    statement:DROP TABLESPACE
    tablespace_name
    INCLUDING CONTENTS AND DATAFILE;
    Depends on the database version you are using -the
    AND DATAFILES option was only introduced in 10g.
    Windows seems to be worse for this than unix. For
    some reason oracle on unix seems a lot better at
    tidying up after itself when you drop a
    tablespace...
    cheers,
    MarkThis is incorrect. "Add datafiles" exists in 9i. I
    have found that is doesn't function properly in 9i.
    Everytime I have used it, it doesn't delete the
    files. When I tried to delete them, it tells me
    they were in use, and I had to wait for a restart to
    clear the files.ok fine - I amend my statement to ADD DATAFILES exists in 9i but didn't work until 10g. ok? ;-)
    Personally I wouldn't use OEM for this kind of activity but that's personal preference...

  • Deleting datafiles

    while issuing the drop tablespace command with including contents and datafile ,the datafile is not physicallly deleted from the os

    The command will remove the tablespace, the datafile, and the tablespace's contents from the data dictionary. All of the objects that where contained in that tablespace are permanently removed. One point to keep in mind is that Oracle will not drop the physical datafile after the DROP TABLESPACE command.
    Sravan

  • DELETE DATAFILE (database) FROM ASM not using dbca

    Hi All
    I have RAC(2 node) on Windows 2003 EE, Oracle 10g R2
    How i can delete file from my asm instance?
    For example, i create database manualy then i want delete this database? how i can delete file from asm? dbca dont see this instance.
    a long time ago, i have also TEST db, i delete this db using dbca but in ASM (EM console) i still see this db, there are no file but i see "word" TEST how i can delete that?
    thanks in advice

    http://www.oracle.com/technology/products/database/asm/pdf/asm_10gr2_bestpractices%2009-07.pdf
    page 26
    SELECT concat('+'||gname, sys_connect_by_path(aname, '/')) full_alias_path FROM
    (SELECT g.name gname, a.parent_index pindex, a.name aname,
    a.reference_index rindex FROM v$asm_alias a, v$asm_diskgroup g
    WHERE a.group_number = g.group_number)
    START WITH (mod(pindex, power(2, 24))) = 0
    CONNECT BY PRIOR rindex = pindex;
    :)

  • How to delete datafiles in oracle 10gR2

    Hi,
    we have tablespace with 70 datafiles. we have truncate some large files.
    Now the problem is that all 70 files have less data then 15G, while every datafile size is 60 G.
    I want to move all the data in to some data files, so that i can remove all the others datafiles.
    Tables are partitioned.
    Due to space issue i can not move tables to other tablesapce.

    user3240461 wrote:
    Hi,
    we have tablespace with 70 datafiles. we have truncate some large files.
    Now the problem is that all 70 files have less data then 15G, while every datafile size is 60 G.
    I want to move all the data in to some data files, so that i can remove all the others datafiles.
    Tables are partitioned.
    Due to space issue i can not move tables to other tablesapce.You can not remove datafiles.
    You can however resize them, using e.g.:
    ALTER DATABASE DATAFILE <your full path file> RESIZE 20G;For this to work, all data must be in de first 20Gb of the datafile, which might need some data shuffling upfront.
    Success

  • HOW TO DELETE datafiles of the droped database in asm disgroup

    Hi,
    I have a issue with ASM diskgroup.
    I have dropped the database without droping the asm files in diskgroup hopw could i remove those files
    Please help me on this its very very help fulll..

    DBA  wrote:
    Hi,
    I have a issue with ASM diskgroup.
    I have dropped the database without droping the asm files in diskgroup hopw could i remove those files
    Please help me on this its very very help fulll..You can remove the files manually using rm command.
    use asmcmd.
    http://download.oracle.com/docs/cd/E14072_01/server.112/e10500/asm_util003.htm#BABDIIJH
    http://www.dba-oracle.com/t_asmcmd.htm
    Regards
    Rajesh

  • Dropping a Datafile and Deleting its References

    Using sqlplus how do I delete datafiles and any references to them?
    At the moment I start the database in mount mode and use:
    ALTER DATABASE DATAFILE 'O:\BCS\test.ora' OFFLINE DROP;
    Which drops the datafile, but when I try to open the database it fails because it is still referencing the datafile.
    How do I delete this reference?
    Any thoughts or suggestions are greatly appreciated.
    Regards
    Toby

    I usually use the following sql to see what is in a tablespace before I drop it with
    "drop tablespace users including contents and datafiles;"
    column meg format 999999999
    column tablespace_name format a20
    set wrap off
    set lines 120
    set heading on
    set pages 50
    select round(sum(a.bytes)/1024/1024) meg,
    count(*) extents,a.tablespace_name,a.segment_type,a.owner||'.'||a.segment_name
    from dba_extents a
    where a.tablespace_name=upper('&1')
    group by a.tablespace_name,a.segment_type,a.owner||'.'||a.segment_name
    order by round(sum(a.bytes)/1024/1024)
    I also map the contents of datafiles with the following you can get the file_id from v$datafile or dba_data_files:
    column owner format a30
    column object format a30
    set lines 120
    set wrap off
    set trunc off
    set pages 50
    set feedback on
    column file_id format 999
    select     /*+ Rule */     'free space' owner     /*"owner" of free space*/
    ,          ' ' object          /*blank object name*/
    ,          file_id                    /*file id for the extent header*/
    ,          block_id               /*block id for the extent header*/
    ,          blocks                    /*length of the extent, in blocks*/
    from          dba_free_space
    where          file_id=&1
    union
    select     /*+ Rule */ substr(owner,1,20)||' '||substr(segment_type,1,9) /*owner name (first 20 chars)*/
    ,          substr(segment_name,1,32)||'.'||partition_name     /*segment name*/
    ,          file_id                    /*file id for the extent header*/
    ,          block_id               /*block id for the extent header*/
    ,          blocks                    /*length of the extent, in blocks*/
    from           dba_extents
    where          file_id=&1
    order by     3,4
    And datafiles can be dropped in 10g if they are empty:
    alter tablespace users drop datafile '/oracle/oradata/users01.dbf';
    Good luck

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

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

  • Accidently, My datafile is deleted................Help required!!!!!!

    my database is in non-archiving mode
    accidently my datafile is deleted,
    that particular datafile is very important to me
    What can i do to recover that datafile, as i have not taken the previous backup of that datafile;
    Plz help me,
    Thanks in advance/..............

    Oh! Dear,
    Please check the following link and hope you got some answers from here -
    http://www.google.co.in/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&channel=s&hl=en&q=how+to+recover+deleted+datafile+in+oracle&meta=&btnG=Google+Search
    Regards.
    Satyaki De.

  • 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

  • Can we use online redo log to recover lost datafile in NOARCHIVE mode?

    I am working on OCA exam and confued about these 2 sample questions. (similar questions with totally different answer)
    Please give me hint about the different between these 2 questions.
    ** If the database is in NOARCHIVELOG mode, and one of the datafile for tablespace USERS is lost, what kind of recovery is possible? (answer: B)
    A. All transactions except those in the USERS tablespace are recoverable up to the loss of the datafile.
    B. Recovery is possible only up to the point in time of the last full database backup.
    C. The USERS tablespace is recoverable from the online redo log file as long as none of the redo log files have been reused since the last backup.
    D. Tablespace point in time recovery is available as long as a full backup of the USERS tablespace exists.
    ** The database of your company is running in the NOARCHIVELOG mode. You perform a complete backup of the database every night. On Monday morning, you lose the USER1.dbf file belonging to the USERS tablespace. Your database has four redo log groups, and there have been two log switches since Sunday night's backup.
    Which is true (answer: B)
    A. The database cannot be recovered.
    B. The database can be recovered up to the last commit.
    C. The database can be recovered only up to the last completed backup.
    D. The database can be recovered by performing an incomplete recovery.
    E. The database can be recovered by restoring only the USER!.dbf datafile from the most recent backup.

    I think Gaurav is correct, you can recover to the last commit even in NOARCHIVELOG, as long as all the changes in the redo logs have not been overwritten. So answer should be B for question 2.
    Here is my test:
    SQL> select log_mode from v$database;
    LOG_MODE
    NOARCHIVELOG
    SQL> select tablespace_name, file_name from dba_data_files;
    TABLESPACE_NAME
    FILE_NAME
    USERS
    C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA101RC\USERS01.DBF
    SYSAUX
    C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA101RC\SYSAUX01.DBF
    UNDOTBS1
    C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA101RC\UNDOTBS01.DBF
    SYSTEM
    C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA101RC\SYSTEM01.DBF
    DATA
    C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA101RC\DATA01.DBF
    SQL> create table names
    2 ( name varchar(16))
    3 tablespace users;
    Table created.
    so this segment 'names' is created in the datafile users01.
    At this point I shut down and mount the DB, then:
    RMAN> backup database;
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:29
    Finished backup at 06-OCT-07
    SQL>alter database open
    SQL> insert into names values ('pippo');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    At this point I delete datafile users01 and restart:
    SQL> startup
    ORACLE instance started.
    Total System Global Area 167772160 bytes
    Fixed Size 1247900 bytes
    Variable Size 67110244 bytes
    Database Buffers 96468992 bytes
    Redo Buffers 2945024 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\ORA101RC\USERS01.DBF'
    restoring the backup taken before inserting the value 'pippo' in table names:
    RMAN> restore database;
    Starting restore at 06-OCT-07
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    restoring datafile 00001 to C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA101RC\SYSTEM01.D
    BF
    restoring datafile 00002 to C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA101RC\UNDOTBS01.
    DBF
    restoring datafile 00003 to C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA101RC\SYSAUX01.D
    BF
    restoring datafile 00004 to C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA101RC\USERS01.DB
    F
    restoring datafile 00005 to C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA101RC\DATA01.DBF
    channel ORA_DISK_1: reading from backup piece C:\ORACLE\PRODUCT\10.2.0\DB_1\DATA
    BASE\0AITR52K_1_1
    channel ORA_DISK_1: restored backup piece 1
    piece handle=C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\0AITR52K_1_1 tag=TAG20071006
    T181337
    channel ORA_DISK_1: restore complete, elapsed time: 00:02:07
    Finished restore at 06-OCT-07
    RMAN> recover database;
    Starting recover at 06-OCT-07
    using channel ORA_DISK_1
    starting media recovery
    media recovery complete, elapsed time: 00:00:05
    Finished recover at 06-OCT-07
    SQL> alter database open;
    Database altered.
    SQL> select * from names;
    NAME
    pippo
    SQL>
    enrico

  • Problem in creating Datafile

    Hi all,
    I am doing some kind of testing in my test maching and I faced the following situation.
    I have a good control file and all the archives starting from the 1st scn. Now I brought down the instance and physically deleted a datafile and tried bringing up the db. This time it couldnt open the db as a file is missing, so I created the datafile and gave the recover database command and things opened up fine. No I backed up the ctrl file to trace and brought down the instance. Now I deleted my controlfile and recreated it successfully by using the script that I got from trace and tried the datafile drop and recreate trick as before, but in this case I couldn't create the datafile. Can anybody explain me why is this behaviour?

    KRIS wrote:
    Version is 11.2.0.1.0
    OS is Red Hat Enterprise Linux Server release 5.5
    As told earlier I tried to create the deleted datafile and this is the error I got.
    13:20:44 SQL> alter database create datafile 4 as '/oracle/abhi/data/users.dbf'; alter database create datafile 4 as '/oracle/abhi/data/users.dbf'
    ERROR at line 1:
    ORA-01178: file 4 created before last CREATE CONTROLFILE, cannot recreate
    ORA-01110: data file 4: '/oracle/abhi/data/users.dbf'
    I can understand the error, but I want to understand what happens internally under such circumstances and why such a datafile recovery is not allowed in oracleonly you can re-create datafile without backup in archivelog mode, the datafile creation should be less than the control file creation time.
    if you re-create the control file then you cannot use the command "alter database create datafile" .
    you can use only for the datafiles created after control file creation time.
    check:-
    SQL> select creation_time,name from v$datafile;
    CREATION_ NAME
    17-APR-07 D:\ORACLE\PRODUCT\10.2.0\ORADATA\DEMODB\SYSTEM01.DBF
    17-APR-07 D:\ORACLE\PRODUCT\10.2.0\ORADATA\DEMODB\UNDOTBS01.DBF
    17-APR-07 D:\ORACLE\PRODUCT\10.2.0\ORADATA\DEMODB\SYSAUX01.DBF
    17-APR-07 D:\ORACLE\PRODUCT\10.2.0\ORADATA\DEMODB\USERS01.DBF
    27-JUL-11 D:\ORACLE\PRODUCT\10.2.0\ORADATA\DEMODB\EXAMPLE01.DBF
    27-JUL-11 D:\ORACLE\PRODUCT\10.2.0\ORADATA\DEMODB\USER02.DBF
    6 rows selected.
    6 rows selected.
    SQL> select controlfile_created from v$database;
    CONTROLFI
    27-JUL-11

  • Error while recovering datafile using rman

    Hi Friends,
    I was trying to recover the deleted datafile 5 , but getting the following error... ( oracle 10g , database archive log mode )
    RMAN> startup
    database is already started
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of startup command at 02/28/2012 10:54:30
    ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
    ORA-01110: data file 5: 'F:\ORACLE\ORADATA\DEMO\DEM01.DBF'
    RMAN> restore datafile 5;
    Starting restore at 28-FEB-12
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=156 devtype=DISK
    released channel: ORA_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 02/28/2012 10:54:49
    ORA-19554: error allocating device, device type: SBT_TAPE, device name:
    ORA-27211: Failed to load Media Management Library
    RMAN>
    Whats the way out...

    RMAN> show all;
    RMAN configuration parameters are:
    CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
    CONFIGURE BACKUP OPTIMIZATION ON;
    CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # defa
    ult
    CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
    CONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
    CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 100 M;
    CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' MAXPIECESIZE 100 M;
    CONFIGURE MAXSETSIZE TO UNLIMITED; # default
    CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
    CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
    CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'G:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\S
    NCFDEMO.ORA'; # default

Maybe you are looking for