Why recover after control file restore

When we have not lost any data files but just restored the control file, why is recover command required. What does it really do for control file ?
Does it really reads the redo logs ? I was under impression , it synchronises from the scn in datafiles . Is it correct ?
Edited by: user11159529 on May 6, 2011 1:51 PM

Thanks all for your respone.
The confusion i have from 11Gr2 admin exam which has following options
When you have lost no data files and you recover the backup control file, why is recover command required ?
1)To roll forward changes to the control file byresynchronizing from the data files.
2) To roll forward changes to the control file by applying redo from from the redo logs
Notes say ANSWER 2 is correct answer
To me it made more sense to have option 1 as correct answer. But Oracle notes say OPTION 2 is correct.
I have having trouble following why 2 and not 1 is the correct answer.
Thanks

Similar Messages

  • Control file restore without backup

    I installed oracle 10g
    Backed it up with rman ... backup database
    Now I lost the control file
    With out auto backup of control file ..how can i restore my control file and get it in sync with my database file

    Hi,
    As you stated as the below things
    I installed oracle 10g
    Backed it up with rman ... backup database Does the backup is taken is of full backup, then you can restore the controlfile. Basic thing, when ever the System.dbf is backup implicity the control file backup is done, don't forget, then is no need to set autobackup on looking into this case.
    try to restore as from backup, sa I stated above, your issue will be solved, remember if any strucutal changes are carried out after your backup, then those can not be recovered based on backup controlfile (like addition of new datafiles)
    - Pavan Kumar N
    Oracle 9i/10g - OCP
    http://oracleinternals.blogspot.com/

  • Control file lost and datafile addeed restore/recovery with no data loss

    Here i have tried to the following
    created new table called t2 and made sure data went to a specific tablespace...
    took a level 0 backup
    removed the control file
    added couple of datafile to above tablespace and then inserted more data
    then went out to restore control file and the database...but datafile still could not be opened ?? what did i do wrong here....
    SQL> @datafile
    -- list of datafile
    Tablespace File Typ Tablespac File Stat    Used MB    Free MB    FILE_MB    MAXMB Datafile_name                     FILE_ID AUT
    UNDOTBS1   Datafile ONLINE    AVAILABLE         16         84        100    1,024 /data/trgt/undotbs01.dbf                3 YES
    USERS      Datafile ONLINE    AVAILABLE       1153        895       2048    3,072 /data3/trgt/user02.dbf                  5 YES
    CNT_TST    Datafile ONLINE    AVAILABLE          1          9         10        0 /data3/trgt/cnt_tst01.dbf               7 NO
    SYSAUX     Datafile ONLINE    AVAILABLE        626         35        660   32,768 /data/trgt/sysaux01.dbf                 2 YES
    USERS      Datafile ONLINE    AVAILABLE       2031         17       2048    2,048 /data3/trgt/move/users01.dbf            4 YES
    SYSTEM     Datafile ONLINE    AVAILABLE        712         58        770   32,768 /data/trgt/system01.dbf                 1 YES
    USERS      Datafile ONLINE    AVAILABLE         65         35        100   32,768 /data3/trgt/users03.dbf                 6 YES
    7 rows selected.
    -- new table is created called t2 and its going into TS called cnt_tst
    SQL> CREATE TABLE TEST.T2
      C1  DATE,
      C2  NUMBER,
      C3  NUMBER,
      C4  VARCHAR2(300 BYTE)
    TABLESPACE cnt_tst;  2    3    4    5    6    7    8
    Table created.
    -- data inserted
    SQL> INSERT INTO
      test.T2
    SELECT
    FROM
      (SELECT
        SYSDATE,
        ROWNUM C2,
        DECODE(MOD(ROWNUM,100),99,99,1) C3,
        RPAD('A',300,'A') C4
      FROM
        DUAL
      CONNECT BY
        LEVEL <= 10000)
    ;   2    3    4    5    6    7    8    9   10   11   12   13   14   15
    10000 rows created.
    SQL> commit;
    Commit complete.
    -- to check of cnt_tst has any free space or not, as we can see its full
    SQL> @datafile
    Tablespace File Typ Tablespac File Stat    Used MB    Free MB    FILE_MB    MAXMB Datafile_name                     FILE_ID AUT
    UNDOTBS1   Datafile ONLINE    AVAILABLE         16         84        100    1,024 /data/trgt/undotbs01.dbf                3 YES
    USERS      Datafile ONLINE    AVAILABLE       1153        895       2048    3,072 /data3/trgt/user02.dbf                  5 YES
    SYSAUX     Datafile ONLINE    AVAILABLE        626         35        660   32,768 /data/trgt/sysaux01.dbf                 2 YES
    USERS      Datafile ONLINE    AVAILABLE       2031         17       2048    2,048 /data3/trgt/move/users01.dbf            4 YES
    SYSTEM     Datafile ONLINE    AVAILABLE        712         58        770   32,768 /data/trgt/system01.dbf                 1 YES
    USERS      Datafile ONLINE    AVAILABLE         65         35        100   32,768 /data3/trgt/users03.dbf                 6 YES
    CNT_TST    Datafile ONLINE    AVAILABLE         10          0         10        0 /data3/trgt/cnt_tst01.dbf               7 NO
    7 rows selected.
    SQL> select count(*) from test.t2;
      COUNT(*)
         10000
    1 row selected.
    -- to get a count and max on date
    SQL> select max(c1) from test.t2;
    MAX(C1)
    29-feb-12 13:47:52
    1 row selected.
    SQL> -- AT THIS POINT A LEVEL 0 BACKUP IS TAKEN (using backup database plus archivelog)
    SQL> -- now control files are removed
    SQL> select name from v$controlfile;
    NAME
    /ctrl/trgt/control01.ctl
    /ctrl/trgt/control02.ctl
    2 rows selected.
    SQL>
    SQL> ! rm /ctrl/trgt/control01.ctl
    SQL> ! rm /ctrl/trgt/control02.ctl
    SQL> ! ls -ltr /ctrl/trgt/
    ls: /ctrl/trgt/: No such file or directory
    SQL>
    -- new datafile is added to CNT_TST TABLESPACE and new data is added as well
    SQL> ALTER TABLESPACE CNT_TST ADD DATAFILE '/data3/trgt/CNT_TST02.dbf' SIZE 100M AUTOEXTEND OFF;
    Tablespace altered.
    SQL> ALTER SYSTEM CHECKPOINT;
    System altered.
    SQL> alter system switch logfile;
    System altered.
    SQL> /
    System altered.
    SQL> /
    System altered.
    SQL> ALTER TABLESPACE CNT_TST ADD DATAFILE '/data3/trgt/CNT_TST03.dbf' SIZE 100M AUTOEXTEND OFF;
    Tablespace altered.
    SQL>  INSERT INTO
      test.T2
    SELECT
    FROM
      (SELECT
        SYSDATE,
        ROWNUM C2,
        DECODE(MOD(ROWNUM,100),99,99,1) C3,
        RPAD('A',300,'A') C4
      FROM
        DUAL
      CONNECT BY
        LEVEL <= 10000)
    ;   2    3    4    5    6    7    8    9   10   11   12   13   14   15
    10000 rows created.
    SQL> /
    10000 rows created.
    SQL> commit;
    Commit complete.
    SQL> INSERT INTO
      test.T2
    SELECT
    FROM
      (SELECT
        SYSDATE,
        ROWNUM C2,
        DECODE(MOD(ROWNUM,100),99,99,1) C3,
        RPAD('A',300,'A') C4
      FROM
        DUAL
      CONNECT BY
        LEVEL <= 40000)
    ;  2    3    4    5    6    7    8    9   10   11   12   13   14   15
    40000 rows created.
    SQL> commit;
    Commit complete.
    SQL> @datafile
    -- to make sure new datafile has been registered with the DB
    Tablespace File Typ Tablespac File Stat    Used MB    Free MB    FILE_MB    MAXMB Datafile_name                     FILE_ID AUT
    CNT_TST    Datafile ONLINE    AVAILABLE          9         91        100        0 /data3/trgt/CNT_TST03.dbf               9 NO
    UNDOTBS1   Datafile ONLINE    AVAILABLE         16         84        100    1,024 /data/trgt/undotbs01.dbf                3 YES
    USERS      Datafile ONLINE    AVAILABLE       1153        895       2048    3,072 /data3/trgt/user02.dbf                  5 YES
    CNT_TST    Datafile ONLINE    AVAILABLE          9         91        100        0 /data3/trgt/CNT_TST02.dbf               8 NO
    SYSAUX     Datafile ONLINE    AVAILABLE        626         35        660   32,768 /data/trgt/sysaux01.dbf                 2 YES
    USERS      Datafile ONLINE    AVAILABLE       2031         17       2048    2,048 /data3/trgt/move/users01.dbf            4 YES
    SYSTEM     Datafile ONLINE    AVAILABLE        712         58        770   32,768 /data/trgt/system01.dbf                 1 YES
    USERS      Datafile ONLINE    AVAILABLE         65         35        100   32,768 /data3/trgt/users03.dbf                 6 YES
    CNT_TST    Datafile ONLINE    AVAILABLE         10          0         10        0 /data3/trgt/cnt_tst01.dbf               7 NO
    9 rows selected.
    -- now the count and max ... note count before backup was 10000 and max(c1) was diff
    SQL> select count(*) from test.t2;
      COUNT(*)
         70000
    1 row selected.
    SQL> select max(c1) from test.t2;
    MAX(C1)
    29-feb-12 13:58:25
    1 row selected.
    SQL> -- now restore starts
    SQL> shutdown abort;
    ORACLE instance shut down.
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@berry trgt]$ rman
    Recovery Manager: Release 11.2.0.1.0 - Production on Wed Feb 29 14:01:48 2012
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    RMAN>  connect catalog rman/pass@rcat
    connected to recovery catalog database
    RMAN>  connect target /
    connected to target database (not started)
    RMAN> startup nomount;
    Oracle instance started
    Total System Global Area     188313600 bytes
    Fixed Size                     1335388 bytes
    Variable Size                125833124 bytes
    Database Buffers              58720256 bytes
    Redo Buffers                   2424832 bytes
    RMAN> restore controlfile from autobackup;
    Starting restore at 29-FEB-12 14:02:37
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=20 device type=DISK
    recovery area destination: /backup/trgt/flash_recovery_area
    database name (or database unique name) used for search: TRGT
    channel ORA_DISK_1: no AUTOBACKUPS found in the recovery area
    channel ORA_DISK_1: looking for AUTOBACKUP on day: 20120229
    channel ORA_DISK_1: AUTOBACKUP found: /backup/trgt/backup/cont_c-3405317011-20120229-09
    channel ORA_DISK_1: restoring control file from AUTOBACKUP /backup/trgt/backup/cont_c-3405317011-20120229-09
    channel ORA_DISK_1: control file restore from AUTOBACKUP complete
    output file name=/ctrl/trgt/control01.ctl
    output file name=/ctrl/trgt/control02.ctl
    Finished restore at 29-FEB-12 14:02:39
    RMAN> alter database mount;
    database mounted
    released channel: ORA_DISK_1
    RMAN> recover database;
    Starting recover at 29-FEB-12 14:02:55
    Starting implicit crosscheck backup at 29-FEB-12 14:02:55
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=20 device type=DISK
    Crosschecked 96 objects
    Finished implicit crosscheck backup at 29-FEB-12 14:02:57
    Starting implicit crosscheck copy at 29-FEB-12 14:02:57
    using channel ORA_DISK_1
    Finished implicit crosscheck copy at 29-FEB-12 14:02:57
    searching for all files in the recovery area
    cataloging files...
    no files cataloged
    using channel ORA_DISK_1
    starting media recovery
    archived log for thread 1 with sequence 13 is already on disk as file /redo_archive/trgt/online/redo01.log
    archived log for thread 1 with sequence 14 is already on disk as file /redo_archive/trgt/online/redo02.log
    archived log for thread 1 with sequence 15 is already on disk as file /redo_archive/trgt/online/redo03.log
    archived log file name=/redo_archive/trgt/archive/1_10_776523284.dbf thread=1 sequence=10
    archived log file name=/redo_archive/trgt/archive/1_10_776523284.dbf thread=1 sequence=10
    archived log file name=/redo_archive/trgt/archive/1_11_776523284.dbf thread=1 sequence=11
    archived log file name=/redo_archive/trgt/archive/1_12_776523284.dbf thread=1 sequence=12
    archived log file name=/redo_archive/trgt/online/redo01.log thread=1 sequence=13
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of recover command at 02/29/2012 14:02:59
    ORA-01422: exact fetch returns more than requested number of rows
    RMAN-20505: create datafile during recovery
    RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/redo_archive/trgt/online/redo01.log'
    ORA-00283: recovery session canceled due to errors
    ORA-01244: unnamed datafile(s) added to control file by media recovery
    ORA-01110: data file 9: '/data3/trgt/CNT_TST03.dbf'
    RMAN> -- wnet to session 2 and renamed datafile from unammed-- wnet to session 2 and renamed datafile for unammed file
    SQL> select name from v$datafile;
    NAME
    /data/trgt/system01.dbf
    /data/trgt/sysaux01.dbf
    /data/trgt/undotbs01.dbf
    /data3/trgt/move/users01.dbf
    /data3/trgt/user02.dbf
    /data3/trgt/users03.dbf
    /data3/trgt/cnt_tst01.dbf
    /oracle/app/product/11.2.0/dbhome_1/dbs/UNNAMED00008
    /oracle/app/product/11.2.0/dbhome_1/dbs/UNNAMED00009
    9 rows selected.
    SQL> alter database create datafile '/oracle/app/product/11.2.0/dbhome_1/dbs/UNNAMED00008' as '/data3/trgt/CNT_TST02.dbf';
    Database altered.
    SQL> alter database create datafile '/oracle/app/product/11.2.0/dbhome_1/dbs/UNNAMED00009' as '/data3/trgt/CNT_TST03.dbf';
    Database altered.
    SQL>  select name from v$datafile;
    NAME
    /data/trgt/system01.dbf
    /data/trgt/sysaux01.dbf
    /data/trgt/undotbs01.dbf
    /data3/trgt/move/users01.dbf
    /data3/trgt/user02.dbf
    /data3/trgt/users03.dbf
    /data3/trgt/cnt_tst01.dbf
    /data3/trgt/CNT_TST02.dbf
    /data3/trgt/CNT_TST03.dbf
    9 rows selected.after above was done, went back to session 1 and tried recovered the DB
    RMAN> recover database;
    Starting recover at 29-FEB-12 14:06:16
    using channel ORA_DISK_1
    starting media recovery
    archived log for thread 1 with sequence 13 is already on disk as file /redo_archive/trgt/online/redo01.log
    archived log for thread 1 with sequence 14 is already on disk as file /redo_archive/trgt/online/redo02.log
    archived log for thread 1 with sequence 15 is already on disk as file /redo_archive/trgt/online/redo03.log
    archived log file name=/redo_archive/trgt/online/redo01.log thread=1 sequence=13
    archived log file name=/redo_archive/trgt/online/redo02.log thread=1 sequence=14
    archived log file name=/redo_archive/trgt/online/redo03.log thread=1 sequence=15
    media recovery complete, elapsed time: 00:00:00
    Finished recover at 29-FEB-12 14:06:17
    RMAN> alter database open resetlogs;
    database opened
    new incarnation of database registered in recovery catalog
    starting full resync of recovery catalog
    full resync complete
    starting full resync of recovery catalog
    full resync complete
    RMAN> exit
    Recovery Manager complete.
    [oracle@berry trgt]$
    [oracle@berry trgt]$
    [oracle@berry trgt]$ sq
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 29 14:07:18 2012
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> alter session set NLS_DATE_FORMAT="dd-mon-yy hh24:mi:ss:
      2
    SQL>
    SQL> alter session set NLS_DATE_FORMAT="dd-mon-yy hh24:mi:ss";
    Session altered.
    SQL> select count(*) from test.t2;
    select count(*) from test.t2
    ERROR at line 1:
    ORA-00376: file 8 cannot be read at this time
    ORA-01110: data file 8: '/data3/trgt/CNT_TST02.dbf'
    SQL> select max(c1) from test.t2;
    select max(c1) from test.t2
    ERROR at line 1:
    ORA-00376: file 8 cannot be read at this time
    ORA-01110: data file 8: '/data3/trgt/CNT_TST02.dbf'
    SQL> alter database datafile 8 online;
    alter database datafile 8 online
    ERROR at line 1:
    ORA-01190: control file or data file 8 is from before the last RESETLOGS
    ORA-01110: data file 8: '/data3/trgt/CNT_TST02.dbf'
    {code}
    so what did i do wrong in my recovery that i could not get my data?? how can i avoid this?? and restore my DB?
    Edited by: user8363520 on Feb 29, 2012 12:24 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    user8363520 wrote:
    Here i have tried to the following
    created new table called t2 and made sure data went to a specific tablespace...
    took a level 0 backup
    removed the control file
    added couple of datafile to above tablespace and then inserted more data
    then went out to restore control file and the database...but datafile still could not be opened ?? what did i do wrong here....
    SQL> @datafile
    -- list of datafile
    Tablespace File Typ Tablespac File Stat    Used MB    Free MB    FILE_MB    MAXMB Datafile_name                     FILE_ID AUT
    UNDOTBS1   Datafile ONLINE    AVAILABLE         16         84        100    1,024 /data/trgt/undotbs01.dbf ;               3 YES
    USERS      Datafile ONLINE    AVAILABLE       1153        895       2048    3,072 /data3/trgt/user02.dbf ;                 5 YES
    CNT_TST    Datafile ONLINE    AVAILABLE          1          9         10        0 /data3/trgt/cnt_tst01.dbf ;              7 NO
    SYSAUX     Datafile ONLINE    AVAILABLE        626         35        660   32,768 /data/trgt/sysaux01.dbf ;                2 YES
    USERS      Datafile ONLINE    AVAILABLE       2031         17       2048    2,048 /data3/trgt/move/users01.dbf ;           4 YES
    SYSTEM     Datafile ONLINE    AVAILABLE        712         58        770   32,768 /data/trgt/system01.dbf ;                1 YES
    USERS      Datafile ONLINE    AVAILABLE         65         35        100   32,768 /data3/trgt/users03.dbf ;                6 YES
    7 rows selected.
    -- new table is created called t2 and its going into TS called cnt_tst
    SQL> CREATE TABLE TEST.T2
    C1  DATE,
    C2  NUMBER,
    C3  NUMBER,
    C4  VARCHAR2(300 BYTE)
    TABLESPACE cnt_tst;  2    3    4    5    6    7    8
    Table created.
    -- data inserted
    SQL> INSERT INTO
    test.T2
    SELECT
    FROM
    (SELECT
    SYSDATE,
    ROWNUM C2,
    DECODE(MOD(ROWNUM,100),99,99,1) C3,
    RPAD('A',300,'A') C4
    FROM
    DUAL
    CONNECT BY
    LEVEL <= 10000)
    ;   2    3    4    5    6    7    8    9   10   11   12   13   14   15
    10000 rows created.
    SQL> commit;
    Commit complete.
    -- to check of cnt_tst has any free space or not, as we can see its full
    SQL> @datafile
    Tablespace File Typ Tablespac File Stat    Used MB    Free MB    FILE_MB    MAXMB Datafile_name                     FILE_ID AUT
    UNDOTBS1   Datafile ONLINE    AVAILABLE         16         84        100    1,024 /data/trgt/undotbs01.dbf ;               3 YES
    USERS      Datafile ONLINE    AVAILABLE       1153        895       2048    3,072 /data3/trgt/user02.dbf ;                 5 YES
    SYSAUX     Datafile ONLINE    AVAILABLE        626         35        660   32,768 /data/trgt/sysaux01.dbf ;                2 YES
    USERS      Datafile ONLINE    AVAILABLE       2031         17       2048    2,048 /data3/trgt/move/users01.dbf ;           4 YES
    SYSTEM     Datafile ONLINE    AVAILABLE        712         58        770   32,768 /data/trgt/system01.dbf ;                1 YES
    USERS      Datafile ONLINE    AVAILABLE         65         35        100   32,768 /data3/trgt/users03.dbf ;                6 YES
    CNT_TST    Datafile ONLINE    AVAILABLE         10          0         10        0 /data3/trgt/cnt_tst01.dbf ;              7 NO
    7 rows selected.
    SQL> select count(*) from test.t2;
    COUNT(*)
    10000
    1 row selected.
    -- to get a count and max on date
    SQL> select max(c1) from test.t2;
    MAX(C1)
    29-feb-12 13:47:52
    1 row selected.
    SQL> -- AT THIS POINT A LEVEL 0 BACKUP IS TAKEN (using backup database plus archivelog)
    SQL> -- now control files are removed
    SQL> select name from v$controlfile;
    NAME
    /ctrl/trgt/control01.ctl
    /ctrl/trgt/control02.ctl
    2 rows selected.
    SQL>
    SQL> ! rm /ctrl/trgt/control01.ctl
    SQL> ! rm /ctrl/trgt/control02.ctl
    SQL> ! ls -ltr /ctrl/trgt/
    ls: /ctrl/trgt/: No such file or directory
    SQL>
    -- new datafile is added to CNT_TST TABLESPACE and new data is added as well
    SQL> ALTER TABLESPACE CNT_TST ADD DATAFILE '/data3/trgt/CNT_TST02.dbf' SIZE 100M AUTOEXTEND OFF;
    Tablespace altered.
    SQL> ALTER SYSTEM CHECKPOINT;
    System altered. Upto this i was clear, but now i cann't understand when you actually dropped the control file from you database(in running stat) how can you perform "alter system checkpoint" and other "alter tablespace.." command? Once controlfile is inaccessible, oracle database is not suppose to function.

  • Cannot recover control file in Oracle10g

    Dear friends ,
    I have to delete my three control files for testing purpose in ORacle 10g .Before Deleting , I take a backup with control file and spfile using following way :
    script :
    run
    allocate channel t1 type disk;
    backup format 'df_%t_%s_%p'
    (database);}
    AND OUTPUT of RMAN ,
    RMAN> show all;
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'C:\TEMP\ctrl_file%F';
    Now when I run the restore script then it shows follwing error :
    RMAN> set DBID=1178861114;
    executing command: SET DBID
    RMAN> restore controlfile from autobackup db_recovery_file_dest='C:\TEMP\CTRL_FILEC-1178861114-20080413-00';
    Starting restore at 13-APR-08
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=158 devtype=DISK
    recovery area destination: C:\TEMP\CTRL_FILEC-1178861114-20080413-00
    database name (or database unique name) used for search: ORCL
    channel ORA_DISK_1: no autobackups found in the recovery area
    channel ORA_DISK_1: looking for autobackup on day: 20080413
    channel ORA_DISK_1: looking for autobackup on day: 20080412
    channel ORA_DISK_1: looking for autobackup on day: 20080411
    channel ORA_DISK_1: looking for autobackup on day: 20080410
    channel ORA_DISK_1: looking for autobackup on day: 20080409
    channel ORA_DISK_1: looking for autobackup on day: 20080408
    channel ORA_DISK_1: looking for autobackup on day: 20080407
    channel ORA_DISK_1: no autobackup in 7 days found
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 04/13/2008 10:35:34
    RMAN-06172: no autobackup found or specified handle is not a valid copy or piece
    I dont know why my control files are not backed up ? can anybody plz help me ?

    I can't say why what you did didn't work but I can say that using RMAN is not the best way to recover lost control files.
    Lets assume you have three control files located on three different drives. It is impossible to accidentally delete all three so the best solution to losing one is to shutdown the database and copy an existing one to the location where a file has gone missing and rename it to the name of the deleted file.
    Failing that you should always have a script created using:
    BACKUP CONTROLFILE TO TRACE;I would only use the control files backed up by RMAN to create an auxiliary database such as a standby or for testing.

  • Datafiles and control file corrupted

    I have oracle 9i installed on windows 2003 server. A couple of days before our windows crashed and the system administrator took the backup of all files and reinstalled windows. After reinstallation of windows I restored the files backed up by system administrator and tried to start the database. I got the following error:
    ORA-00227: corrupt block detected in controlfile: (block 1, # blocks 1)
    ORA-00202: controlfile: 'D:\ORACLE\ORADATA\ORCL\CONTROL03.CTL'
    All the multiplexed copies of control files are also corrupted. We do not have the backup since last few days and the database is in noarchivelog mode. Simple restoration to the old backup would be a great loss. Kindly help me to recover the control file and datafiles.

    All the multiplexed copies of control files are also corrupted. We do not have the backup since last few days and the database is in noarchivelog mode. Simple restoration to the old backup would be a great loss. Kindly help me to recover the control file and datafiles.You could try to re-create the control files assuming the database itself was closed properly.
    However you should only do this if you know what you are doing.
    In any case you should backup the database in its current state in case things getting worse by trying to recover. CHECK this backup twice!
    In any case: Open a support ticket at Oracle. You will most probably need their help.
    In addition to that - it look quite bad for your data. You should prepare for data loss (just to be sure; i dont want to scare you)....
    Ronny Egner
    My Blog: http://blog.ronnyegner-consulting.de

  • ORA-00210: cannot open the specified control file

    Hi all,
    Initially we faced the following error:
    ORA-00214: control file '+DBDG/dws/controlfile/current.256.638648487' version
    75647 inconsistent with file '+FLASHDG/dws/controlfile/current.256.638648489'
    version 75645
    Then the following action:
    RMAN> restore controlfile from autobackup;
    Starting restore at 05-DEC-07
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=997 devtype=DISK
    recovery area destination: +flashdg
    database name (or database unique name) used for search: DWS
    channel ORA_DISK_1: autobackup found in the recovery area
    channel ORA_DISK_1: autobackup found: +flashdg/DWS/AUTOBACKUP/2007_12_04/s_640476511.697.640476513
    channel ORA_DISK_1: control file restore from autobackup complete
    output filename=+DBDG/dws/controlfile/current.256.638648487
    output filename=+FLASHDG/dws/controlfile/current.256.638648489
    Finished restore at 05-DEC-07
    RMAN> recover database;
    Starting recover at 05-DEC-07
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of recover command at 12/05/2007 15:16:10
    ORA-00210: cannot open the specified control file
    RMAN>
    Any idea why this is happening?
    Regards,
    Soma Sekhar Karri

    Something which you should have looked up prior to posting
    00210, 00000, "cannot open the specified controlfile"
    // *Cause:  Cannot open the controlfile.
    // *Action: Check to make sure the controlfile exists and is not locked by
    // some other program.
    Sybrand Bakker
    Senior Oracle DBA

  • In case of a DB crash what happens to the status of the Control File

    When a DB is crashed will the Control file that exists in the OS also get corrupted, What happens to the Data Files , how to recover the Control files and Data Files , the DB in case there isn't any Backup media or any Dump available on the DB.

    The only one way to recover a database is to be in archivelog mode.
    And if I said about recover stricto sensu, that's because even in noarchivelog mode we need to use the command recover until cancel before an open with resetlogs option, even if we haven't any redo/archive logs. That fake a recover, this is what we say a mimic recover. Which is not a recover stricto sensu like it can be the case with archivelog mode.
    Nicolas.

  • A question about restoring from cold backup(control file backup not clear)

    Hi,
    I had another question about restoring the cold backup. My database is in noarchivelog mode and after taking a consistent cold backup, all I need to do is to restore the backup right? -Why I got this question is because: when I backup my control file to trace, I see statements like this:-----
    -- Commands to re-create incarnation table
    -- Below log names MUST be changed to existing filenames on
    -- disk. Any one log file from each branch can be used to
    -- re-create incarnation records.
    -- ALTER DATABASE REGISTER LOGFILE '/uo1/app1/arch1_1_647102958.dbf';
    -- Recovery is required if any of the datafiles are restored backups,
    -- or if the last shutdown was not normal or immediate.
    RECOVER DATABASE
    -- Database can now be opened normally.
    ALTER DATABASE OPEN;
    My database is in noarchivelog mode now so don't know why these statements (of register the logfile) is there in the backup of control file? so when I restore the cold backup of this database, it will still work correct? (there is no logfile I have only CRD files in cold backup -no archive log files.)
    thanks
    Nirav

    Thanks for your inputs! It is most useful to me.
    Regards
    Nirav

  • Restore control file and openresetlogs

    hi
    When I restore controlfile from autobackup
    and than restore database and recover database;
    I can only open the database with openresetlogs option.
    why?

    1-)
    Does all datafiles and control files have scn or
    checkpoint scn?
    and Does all redolog groups have same scn?
    what is SCN?
    Any changes i.e DML in a database is assigned a system change number (SCN) ,SCN is assigned for changes that is why its called system change number.Both SCN and changes are written to redo log files.
    SQL> select current_scn from v$database
      2  /
    CURRENT_SCN
         756124
    SQL> /
    CURRENT_SCN
         756125
    SQL> /
    CURRENT_SCN
         756136
    SQL> /
    CURRENT_SCN
         756138
    SQL> /
    CURRENT_SCN
         756140
    SQL> /
    CURRENT_SCN
         756394
    SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup mount
    ORACLE instance started.
    Total System Global Area  171966464 bytes
    Fixed Size                   787988 bytes
    Variable Size             145488364 bytes
    Database Buffers           25165824 bytes
    Redo Buffers                 524288 bytes
    Database mounted.
    SQL>  select current_scn from v$database
      2   /
    CURRENT_SCN
              0
    SQL> /
    CURRENT_SCN
              0
    SQL> /
    CURRENT_SCN
              0
    SQL> /
    CURRENT_SCN
              0
    SQL> When yours database in mount state no activity either from user ends ,background process or foreground process no scn is going to assigned.
    whats the use of SCN why it is inremented?
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/consist.htm#CNCPT221
    2-)
    Does checkpoint scn changes every checkpoint(log switch,etc....).not every second.
    checkpoint scn changes after every logswitch cause after log switch an event occur for chekpoint ,this event starts writing dirty buffer from database buffer cache to datafile for which redo log file contains data.After flusing alls dirty buffer from database buffer to datafile an SCN is assigned (system change number assigned) this chekpoint is also a change thats why it is also assigned SCN which is checkpoint SCN,CKPT process gives the database a timestamp/SCN by incrementing a number in controlfile header and broadcast that same SCN to alls datafiles.
    CKPT can occur for the number of reason one for is log switch when yours redo log filled , you can also manually trigger checkpoint by issuing alter system command or you may set parameters like log_checkpoint_timeout etc.
    3-)
    What about scn?? Does it the one that I see from
    select current_scn from v$database? which changes every one second?
    Check first question reply.
    Khurram

  • Lost all Control files (Want to Recover)

    Hi
    I have a database in archive log mode and we take a rman hot backup everyday. We are not using the recovery catalog. I lost all the control files
    few days ago. I have a control file to trace and that was generated 20 days ago. This is our test database. I want to recover it. I don't know if we have
    done any physical changes or not after the creation of this text file to create a control file. Database is still up and running.
    Any help will be appreciated?
    Thanks in Advance

    If the control is restored from the rman backup lets say it is 3 days old, then how to update the same control file with the current database statistics.
    --Luckys.                                                                                                                                                                                                                                                                                                                                           

  • RECREATE DATABASE Using CONTROL File After SUSPEND Database

    Hello All,
    Does someone can tell me if he does achieve recreating a database using "Backup Control File" after putting database in "suspend" mode?
    The procedure looks like this :
    1 - Alter DATABASE Suspend
    2 - A Snapshot of the filesystem where the oracle datafile are located
    3 - Copy of those files to another file systeme
    4 - Startup setting a new database name
    Does someone as do it successfully ?
    Thanks for your answer

    Carlos,
    I tried to do it without putting the tablespaces in backup mode and it didn't work for me. At that time adding the backup mode wasn't a big deal for me, so I didn't investigate the problem thoroughly.
    Logically thinking you sould be able to do:
    1. suspend database
    the SCNs recored in datafiles headers could be incosistent at this point
    2. make a snapshot
    3. mount the backup database
    4. run recover until cancel using backup controlfile - I don't think you can avoid this step in case if you have inconsistent SCNs in the datafiles headers - you'll need to synchronize them
    5. open resetlogs.
    the suspend database should eliminate the possibility of inconsistent data within a block during the backup.
    Just out of curiosity - why don't you want to put the tablespace in the backup mode?
    Mike

  • Lost control file, how to recover them

    Hi All,
    I have Oracle 11G running on RHEL 5.2 server and unexpectedly I can't start database after a server reboot. I have executed the following commands,
    sqlplus /as sysdba
    SQL> startup
    ORA-01078: failure in processing system parameters
    LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/db_1/dbs/inittestdb.ora'
    SQL>
    and then
    SQL> startup pfile='/u01/app/oracle/admin/testdb/pfile/init.ora.1024201018143'
    ORACLE instance started.
    Total System Global Area 1269366784 bytes
    Fixed Size          2212976 bytes
    Variable Size          754977680 bytes
    Database Buffers     503316480 bytes
    Redo Buffers          8859648 bytes
    ORA-00205: error in identifying control file, check alert log for more info
    Here are the alert log messages,
    ORA-00210: cannot open the specified control file
    ORA-00202: control file: '/u01/app/oracle/oradata/testdb/control02.ctl'
    ORA-27037: unable to obtain file status
    Linux-x86_64 Error: 2: No such file or directory
    Additional information: 3
    ORA-00210: cannot open the specified control file
    ORA-00202: control file: '/u01/app/oracle/oradata/testdb/control01.ctl'
    ORA-27037: unable to obtain file status
    Linux-x86_64 Error: 2: No such file or directory
    Additional information: 3
    ORA-205 signalled during: ALTER DATABASE MOUNT...
    [oracle@trace]$ ls -l /u01/app/oracle/oradata/testdb
    total 0
    There are are no control files in the directory and I couldn't find them on the disk. Unfortunately, I do not have backups for dbs (this is a staging server). Is there any way we can recover those files or fix the problem ?
    Could someone please help us on this?
    Thanks

    Mahesh Menon wrote:
    [oracle@trace]$ ls -l /u01/app/oracle/oradata/testdb
    total 0
    He is not having any files in that location... not only control files, but the datafiles too.. in that case how is it possible ??? thats why I mentioned like that...
    And yes, if the datafiles and redos are located in another location then we can recreate the controlfile.
    But since it is a test system, I dont think there will be files in another location...
    Please take it that I am not arguing with the GURUS and EXPERTS here..Well thought-out arguments are appreciated!
    Perhaps the answer is to ls -l /u01/app/oracle/oradata
    Maybe it's TESTDB or some for some other reason testdb really isn't the sid.
    If it's a staging environment, where do things come from? If the data files are found on the staging server, but no controlfiles, perhaps alter database backup controlfile to trace on the source server might give something to work with.

  • Database restore without temp, undo and control files.

    Hi All,
    You might found this question silly but I don't know so asking this question here.
    I have cold back up of the database. Now, I want create clone of that database, but I have some different paths for the DBFs so I will create new control file after restoring the database.
    Now, I know that I don't need control files and tempfiles to be restored. I have 10 undo files in backup but on the new clone database I don't need all 10. I want only 5. So can I do the restoration without undo , temp and control file and later on add undo and temp?? and if yes then tell me that can I add them at mount level??
    This is my first restore, Please guide me its very urgent

    Nitin Joshi wrote:
    f the COLD Backup does not include the Online Redo Logs, an ALTER DATABASE OPEN RESETLOGS is requireed >>to create these Online Redo Logs. Unfortunately, an OPEN RESETLOGS can only be done after an Incomplete >>Recovery or when using a Backup Control file.
    Therefore, we do a RECOVER with a CANCEL to simulate an Incomplete Recovery.Completely agree with you Hemant. And the links you've provided,i've gone through many times. Excellent description.
    I just wanted to know in above(OP's) scenario if he has complete cold backup(includes online redo logs), does he really need open reset logs or any recovery?
    Regards!no , if you have cold backup with online redo log files then i don't think so you need to open database in resetlogs.Resetlog is always after incomplete recovery or recovery using backup controlfile or you dont have redo logs.
    I am completely agree with you that with given scenario for the cold backup undo tablespace would not be part of recovery and you can
    -offline drop undo tablespace file
    -create another one undo tablespace and its undo datafile
    -point spfile to that newly undo tablespace
    I think Aman is saying in the context of restore and recover online database where undo tablespace create a vital role in database recovery, the undo blocks roll back the effects of uncommitted transactions previously applied by the rolling forward phase.
    Khurram

  • RMAN-06067: RECOVER DATABASE required with a backup or created control file

    Hi,
    Oracle version :10.2.04
    I recovered control files
    RMAN> restore controlfile to '/oracle/ora10gr4/dbs/nis.ctl';
    Starting restore at 21-AUG-12
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: restoring control file
    output filename=/oracle/ora10gr4/dbs/nis.ctl
    channel ORA_DISK_1: reading from backup piece /data_idx1/ORAMIG/OMIGTEST/cfc-260103938-20120821-03
    channel ORA_DISK_1: restored backup piece 1
    piece handle=/data_idx1/ORAMIG/OMIGTEST/cfc-260103938-20120821-03 tag=TAG20120821T152259
    channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
    Finished restore at 21-AUG-12after this i got the below error when i tried to open DB.
    SQL> alter database open resetlogs;
    alter database open resetlogs
    ERROR at line 1:
    ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1:
    '/data_idx1/ORAMIG/OMIGTEST/DATA_FILES/system_1_OMIGTEST.dbf'So i tried the following.
    RMAN> restore datafile '/data_idx1/ORAMIG/OMIGTEST/DATA_FILES/system_1_OMIGTEST.dbf';
    Starting restore at 21-AUG-12
    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 /data_idx1/ORAMIG/OMIGTEST/DATA_FILES/system_1_OMIGTEST.dbf
    channel ORA_DISK_1: reading from backup piece /data_idx1/ORAMIG/OMIGTEST29_1_791910787
    channel ORA_DISK_1: restored backup piece 1
    piece handle=/data_idx1/ORAMIG/OMIGTEST29_1_791910787 tag=TAG20120821T151306
    channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
    Finished restore at 21-AUG-12
    RMAN> recover  datafile '/data_idx1/ORAMIG/OMIGTEST/DATA_FILES/system_1_OMIGTEST.dbf';
    Starting recover at 21-AUG-12
    using channel ORA_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of recover command at 08/21/2012 16:21:45
    RMAN-06067: RECOVER DATABASE required with a backup or created control fileCan anyone pls help me with this error?
    Thanks

    Hi,
    Try this command after restore control file.
    RMAN>  restore database;
    RMAN> recover database;
    RMAN> alter database open resetlogs;Paste here result, if you are get error.
    Regards
    Mahir M. Quluzade
    www.mahir-quluzade.com

  • Error while restore control file

    Hi,
    SQL> startup
    ORACLE instance started.
    Total System Global Area  289406976 bytes
    Fixed Size                  1248576 bytes
    Variable Size             130024128 bytes
    Database Buffers          150994944 bytes
    Redo Buffers                7139328 bytes
    ORA-00205: error in identifying control file, check alert log for more info
    SQL> shutdown immediate
    ORA-01507: database not mounted
    ORACLE instance shut down.
    SQL> startup pfile='C:\oracle\init.ora';
    ORACLE instance started.
    Total System Global Area  289406976 bytes
    Fixed Size                  1248576 bytes
    Variable Size              92275392 bytes
    Database Buffers          188743680 bytes
    Redo Buffers                7139328 bytes
    Database mounted.
    Database opened.rman
    C:\Documents and Settings\Siva Saravana Kumar>rman
    Recovery Manager: Release 10.2.0.1.0 - Production on Mon May 13 17:29:40 2013
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    RMAN> connect target sys@mani
    target database Password:
    connected to target database: MANI (DBID=946337126)
    RMAN> restore controlfile from autobackup;
    Starting restore at 13-MAY-13
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=141 devtype=DISK
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 05/13/2013 17:30:05
    RMAN-06496: must use the TO clause when the database is mounted or open
    RMAN>i don't understand why am getting this error ? i used pfile for startup database .. Pls Help

    924575 wrote:
    Shahrokh wrote:
    Connect to RMAN like this. in command line
    c:> set oracle_sid=your_dbname
    C:> RMAN target /
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    C:\Documents and Settings\Siva Saravana Kumar>rman
    Recovery Manager: Release 10.2.0.1.0 - Production on Mon May 13 18:12:15 2013
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    RMAN> connect target sys@mani
    target database Password:
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    ORA-12514: TNS:listener does not currently know of service requested in connect
    descriptor
    RMAN> exit
    Recovery Manager complete.
    C:\Documents and Settings\Siva Saravana Kumar>set oracle_sid=mani
    C:\Documents and Settings\Siva Saravana Kumar>rman target /
    Recovery Manager: Release 10.2.0.1.0 - Production on Mon May 13 18:20:40 2013
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00554: initialization of internal recovery manager package failed
    RMAN-04005: error from target database:
    ORA-01031: insufficient privileges
    C:\Documents and Settings\Siva Saravana Kumar>
    Your OS user is not a member of the ora_dba group.

Maybe you are looking for