When is resetlogs option used in alter database

Hi
Could anybody explain when
alter database open resetlogs
statement is used?
Thanks in advance

[incomplete recovery or recovery with a backup control file|http://download.oracle.com/docs/cd/B10501_01/server.920/a96572/performingreco.htm]

Similar Messages

  • What is the use of 'ALTER DATABASE CLOSE'?

    Hello Everybody,
    SQL*Plus: Release 10.1.0.2.0 - Production on Ma Aug 15 21:28:30 2005
    Copyright © 1982, 2004, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> conn / as sysdba
    Connected.
    SQL> startup force
    ORACLE instance started.
    Total System Global Area 171966464 bytes
    Fixed Size 787988 bytes
    Variable Size 145750508 bytes
    Database Buffers 25165824 bytes
    Redo Buffers 262144 bytes
    Database mounted.
    Database opened.
    SQL> select status from v$instance;
    STATUS
    OPEN
    SQL> alter database close;
    Database altered.
    SQL> select status from v$instance;
    STATUS
    MOUNTED
    SQL> alter database open;
    alter database open
    ERROR at line 1:
    ORA-16196: database has been previously opened and closed
    If i have to shutdown the instance and database then
    WHAT IS THE USE OF 'ALTER DATABASE CLOSE' ?
    I need explanation. Why should i shutdown?
    Dont give me this answer.
    ORA-16196: database has been previously opened and closed
    Cause: The instance has already opened and closed the database, which is allowed only once in its lifetime.
    Action: Shut down the instance.

    If you read the documentation you will see that there is no ALTER DATABASE CLOSE command.
    This is an undocumented Oracle command, which we are not supposed to use. Consequently we are not allowed to complain about the way that it works. Instead we're supposed to use SHUTDOWN IMMEDIATE.
    Cheers, APC

  • What is the Use of  "Alter database activate standby database"

    Hi ,
    I appreciate your time.
    I just wanted to know what is the use of "Alter database activate standby database" command when doing the failover. How different it will act in failover process. Can we use this command in SwitchOver.
    Thanks in advance.

    Hi Uwe Hesse,
    Wonderfull... good info....
    So my understanding is that the use of "ACTIVATE PHYSICAL STANDBY DATABASE" is conditional and depends on the redo log gap and the Database status(Able to mount or not).
    Condition 1: If the Db is in Mount state and Redo log gap is successfully filled.
    1) Flush any unsent redo from the primary database to the target standby database.
    SQL> ALTER SYSTEM FLUSH REDO TO target_db_name;
    Note: If the above Statement Completes successfully without any errors.
    2) Stop Redo Apply.
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
    3) Finish applying all received redo data.
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
    4) Verify that the target standby database is ready to become a primary database.
    SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
    5) Switch the physical standby database to the primary role.
    SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN;
    Condition 2: If the DB is not able Mount and Redo Gap can't be filled.
    Important Note: If the the above command in STEP3 gives error, some received redo data was not applied. Try to resolve the cause of the error and re-issue the statement before proceeding.
    If the error condition cannot be resolved, a failover can still be performed (with some data loss) by issuing the following SQL statement on the target standby database:
    SQL> ALTER DATABASE ACTIVATE PHYSICAL STANDBY DATABASE;
    Thanks in advance.

  • Generate or Preview XML when Extending Reader Options using Adobe LiveCycle Designer

    Hi,
    I am trying to view the generated xml when reader options are extended. However, when I try to open the reader extended PDF in LiveCycle Designer, it says you will lose reader options. Is there any other way in which I can compare the generated XML before and after extending reader options?
    I am having issues processing PDF after extending reader options as the generated xml is generating the following error.
    "XmlException was unhandled by user code, Data at the root level is invalid. Line1, position1"

    May be you can try this way to get the XML before and after the Reader extensions.
    1) Place a Text field with multi line allowed.
    2) Place a button on the form with the following in click event.
          TextField1.rawValue = xfa.data.saveXML("pretty");
    3) Open the form in either Reader/ Acrobat and click on the Button. Save the XML data in a file that was assigned to the TextField.
    4) Reader extend the form.
    5) Repeat the step 3 again to capture the XML from the form after Reader Extensions.
    This way you can get the XML from the form before and after.
    Thanks
    Srini

  • Alter database OR alter system?? what is the logic?

    Hi,
    this is just a general question not related to any particular issue. I seem to be missing the logic behind when we need to use the "alter system ... " statements and when we need to use the "alter database ..." statements. Is there a logic I can use to guess ? Or we only need to remember them (or look up for them)?
    Let's take an example.
    alter database archivelog; & alter system checkpoint;
    OR
    alter database add logfile; & alter system set undo_retention=800;
    If you have a key that can be generally applied please let me know as I am not able to find it. Thank you,
    enrico

    I am not sure if there is a general rule but this is what I use:
    alter database is about modifying the database architecture, like data files, archived log files etc.
    alter system is about modifying the instance. so, you are modifying the way oracle runs. Remember that all parameters should be done with alter system (like undo_retention)
    hope this will help you.

  • What if "ALTER DATABASE OPEN" WORKS WHEN DB IS INCONSISTENT???

    Hello Everyone,
    I heard from couple of friends that in the case of recovery , oracle database opens despite the fact that some of the data files are inconsistent.
    Is this really true? If it is, then i think its a bug with specific Oracle patch or release.
    Is there anyone who has experienced a similar situation in the past? Please share.
    Thanks.
    sapguy

    Appreciate your response. I ran into a situation where we are not sure of what time choose to choose recovery (point in time) and ended up recovering file by file and its been 100 files .. .none of those files helped with "Media recovery complete" message . This is database refresh from production backup.
    Then when i am trying to issue ALTER DATABASE OPEN RESETLOGS  one of main guy says do not issue OPEN command as it may corrupt the database.
    I came across one of friend who ran into similar situation and he was able open the database , but LATER database started issuing ora 600 due to corrupted files or whatever which never happened.   Forgive me .. if my text is confusing.
    Thanks.

  • Cannot alter database open

    I go the error message when I open databse.
    SQL> alter database open resetlogs;
    alter database open resetlogs
    ERROR at line 1:
    ORA-01190: controlfile or data file 1 is from before the last RESETLOGS
    ORA-01110: data file 1: '/u01/oracle/uatdata/system01.dbf'
    Then I issue the following command:
    SQL> recover datafile 1;
    ORA-00283: recovery session canceled due to errors
    ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
    what went wrong?
    FAN

    Here are the following information:
    RMAN> list backup of controlfile
    2> ;
    using target database controlfile instead of recovery catalog
    List of Backup Sets
    ===================
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    402 Full 6M DISK 00:00:00 08-OCT-08
    BP Key: 402 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081008-00
    Controlfile Included: Ckp SCN: 2023488262 Ckp time: 08-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    412 Full 6M DISK 00:00:01 09-OCT-08
    BP Key: 412 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081009-00
    Controlfile Included: Ckp SCN: 2024136961 Ckp time: 09-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    422 Full 6M DISK 00:00:00 11-OCT-08
    BP Key: 422 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081011-00
    Controlfile Included: Ckp SCN: 2025471910 Ckp time: 11-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    425 Full 6M DISK 00:00:01 11-OCT-08
    BP Key: 425 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081011-01
    Controlfile Included: Ckp SCN: 2025471911 Ckp time: 11-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    435 Full 6M DISK 00:00:00 12-OCT-08
    BP Key: 435 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081012-00
    Controlfile Included: Ckp SCN: 2026183392 Ckp time: 12-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    436 Full 6M DISK 00:00:00 12-OCT-08
    BP Key: 436 Status: AVAILABLE Tag: TAG20081012T111913
    Piece Name: /u02/db/backup/RMAN/backup_UAT_667912753_460_1_ecjsv2hh_1_1.bck
    Controlfile Included: Ckp SCN: 2026183392 Ckp time: 12-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    438 Full 6M DISK 00:00:00 12-OCT-08
    BP Key: 438 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081012-01
    Controlfile Included: Ckp SCN: 2026183393 Ckp time: 12-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    448 Full 6M DISK 00:00:00 12-OCT-08
    BP Key: 448 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081012-02
    Controlfile Included: Ckp SCN: 2026451642 Ckp time: 12-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    449 Full 6M DISK 00:00:00 12-OCT-08
    BP Key: 449 Status: AVAILABLE Tag: TAG20081012T202618
    Piece Name: /u02/db/backup/RMAN/backup_UAT_667945578_473_1_epjt02ja_1_1.bck
    Controlfile Included: Ckp SCN: 2026451642 Ckp time: 12-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    451 Full 6M DISK 00:00:01 12-OCT-08
    BP Key: 451 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081012-03
    Controlfile Included: Ckp SCN: 2026451643 Ckp time: 12-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    461 Full 6M DISK 00:00:04 13-OCT-08
    BP Key: 461 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081013-00
    Controlfile Included: Ckp SCN: 2026889745 Ckp time: 13-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    464 Full 6M DISK 00:00:00 13-OCT-08
    BP Key: 464 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081013-01
    Controlfile Included: Ckp SCN: 2026889749 Ckp time: 13-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    474 Full 6M DISK 00:00:00 14-OCT-08
    BP Key: 474 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081014-00
    Controlfile Included: Ckp SCN: 2027589079 Ckp time: 14-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    477 Full 6M DISK 00:00:01 14-OCT-08
    BP Key: 477 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081014-01
    Controlfile Included: Ckp SCN: 2027589080 Ckp time: 14-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    487 Full 6M DISK 00:00:01 15-OCT-08
    BP Key: 487 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081015-00
    Controlfile Included: Ckp SCN: 2028248959 Ckp time: 15-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    488 Full 6M DISK 00:00:00 15-OCT-08
    BP Key: 488 Status: AVAILABLE Tag: TAG20081015T111406
    Piece Name: /u02/db/backup/RMAN/backup_UAT_668171647_512_1_g0jt6vbv_1_1.bck
    Controlfile Included: Ckp SCN: 2028248959 Ckp time: 15-OCT-08
    BS Key Type LV Size Device Type Elapsed Time Completion Time
    490 Full 6M DISK 00:00:00 15-OCT-08
    BP Key: 490 Status: AVAILABLE Tag:
    Piece Name: /u02/oracle/uat/uatdb/9.2.0/dbs/c-1357907388-20081015-01
    Controlfile Included: Ckp SCN: 2028248960 Ckp time: 15-OCT-08
    FAN

  • How to use the backup database to create report or update testing

    Hi,
    I have a fully backup of production database in the last month, and I have using Oracle 8.1.7. I want to known how can I use
    this backup to generate a new instance so that I can reproduct some report from the last month data or doing some update testing
    from the backup database with the both production instance and last month instance is opened at the same time. I have tried to
    create a new instance by using the oradim and startup the new sid with mount option and then use the alter database function
    to change the datafile name to the new directory. After this i also create the local service name and change to listerner. I can
    startup the new instance but when i start the production database. I got the error that I can open the database with exclusive.
    I do this in Oracle 7.3.4 and it works. But how can i setting it in Oracle 8.1.7. Anyone can help me and many thanks.

    Hi,
    Create the Second instance thro' Database Configuration Assistant, and Replace with Back up files.Now you can run two instances at parallel.

  • Alter database character set

    i'm trying to change the character set of my oracle 8.1.6 database from USANSCII to UTF8,using the alter database command.
    ALTER DATABASE CHARACTER SET UTF8;
    But the error being thrown is "New charset needs to be a superset of the old charset.
    Can i migrate from ANSCI TO UTF8 on Oracle 8i?

    What do you get when you query your database using the following SQL statement?
    SQL> SELECT * FROM V$NLS_PARAMETERS
      2  WHERE PARAMETER LIKE '%CHARACTERSET';
    PARAMETER                                                        VALUE
    NLS_CHARACTERSET                                                 WE8ISO8859P15
    NLS_NCHAR_CHARACTERSET                                           AL16UTF16

  • Diff btw "recover datafile file#" & "alter database recover datafile file#"

    What is the difference between
    "recover datafile file#"
    "alter database recover datafile file#"
    Thanks
    Naveen

    I don't mean to be rude, but the statement that "There is no difference in both the commands" is facile in the extreme. Sounds like more off-the-cuff instant advice than the considered thoughts of someone who's actually bothered to try both commands out.
    The "alter database recover..." command is a disaster waiting to happen and should never be used by anyone who actually wants to achieve a successful database recovery. It has the effect of suppressing most of the interactive dialogue you get when you submit the shorter "recover..." command, and indeed causes spurious errors to be displayed because the non-interactive recovery process gets it wrong.
    For example, here's me recovering my database using the "alter database" syntax:
    SQL> alter database open;
    alter database open
    ERROR at line 1:
    ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
    ORA-01110: data file 4: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\WIN10\USERS01.DBF'
    SQL> alter database recover datafile 4;
    alter database recover datafile 4
    ERROR at line 1:
    ORA-00279: change 642359 generated at 07/04/2008 09:03:18 needed for thread 1
    ORA-00289: suggestion :
    C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\WIN10\ARCHIVELOG\2008_07_04\O1_MF_1_9_%U_.ARC
    ORA-00280: change 642359 for thread 1 is in sequence #9Note the slightly alarming report of an 'error at line 1'. What's difficult to convey in mere text, however, is that at the end of that output, the thing just sits there, and you've no idea what on Earth is happening on the database. The text tells you it's making a suggestion, but there's no indication of how you accept the suggestion, of what's happening when you do accept it or where anything is up to.
    I've interrupted one of those once (fortunately only in a training room) and lost the entire database as a result (because a half-complete, interrupted recovery is worse than no recovery at all).
    Compare that with the plain "recover..." syntax example:
    SQL> recover datafile 4;
    ORA-00279: change 642359 generated at 07/04/2008 09:03:18 needed for thread 1
    ORA-00289: suggestion :
    C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\WIN10\ARCHIVELOG\2008_07_04\O1_MF_1_9_%U_.ARC
    ORA-00280: change 642359 for thread 1 is in sequence #9
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    ORA-00279: change 642571 generated at 07/04/2008 09:06:26 needed for thread 1
    ORA-00289: suggestion :
    C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\WIN10\ARCHIVELOG\2008_07_04\O1_MF_1_10_%U_.ARC
    ORA-00280: change 642571 for thread 1 is in sequence #10
    ORA-00278: log file
    'C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\WIN10\ARCHIVELOG\2008_07_04\O1_MF_1_9_46TPVL2G_.ARC' no longer needed for this recovery
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    ORA-00279: change 642576 generated at 07/04/2008 09:06:32 needed for thread 1
    ORA-00289: suggestion :
    C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\WIN10\ARCHIVELOG\2008_07_04\O1_MF_1_12_%U_.ARC
    ORA-00280: change 642576 for thread 1 is in sequence #12
    ORA-00278: log file
    'C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\WIN10\ARCHIVELOG\2008_07_04\O1_MF_1_11_46TPVRMK_.ARC' no longer needed for this recovery
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    Log applied.
    Media recovery complete.There are no weird error messages reported here. The suggestion is accompanied by a prompt that tells you how to accept it. Every time a new log is required, a new prompt is given. You can cleanly cancel at any time by typing 'cancel'. You are kept informed throughout and are in charge throughout.
    Anyone that uses "alter database" syntax during a recovery is, therefore, either brave or foolhardy. In either case, there is a very profound difference between the two.
    Your parting shot that 'alter database' is a SQL command and 'recover' can be an RMAN command misses the point by a wide mile, too. RMAN can issue pretty much any piece of SQL you like, so long as you wrap it in the SQL command:
    RMAN> sql 'alter database recover datafile 4';
    using target database control file instead of recovery catalog
    sql statement: alter database recover datafile 4
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of sql command on default channel at 07/04/2008 09:23:16
    ORA-00279: change  generated at  needed for thread
    RMAN-11003: failure during parse/execution of SQL statement: alter database recover datafile 4
    ORA-00279: change 642359 generated at 07/04/2008 09:03:18 needed for thread 1
    ORA-00289: suggestion : C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\WIN10\ARCHIVELOG\2008_07_04\O1_MF_1_9_%U_.ARC
    ORA-00280: change 642359 for thread 1 is in sequence #9We don't get much further in RMAN with this dodgy form of the recovery command than we did in SQL*Plus, it's true -but that's just because it's a silly command to use in the first place, wherever you thought to use it. The distinction you seek to draw between 'SQL commands' and 'RMAN commands' is false in this case, in other words.

  • Drop or alter database link question...

    I have a database that uses a dblink to connect to a remote database to use a sequence for id's. The remote database is a 12 node rac cluster and when the database link was initially created the admin that created it only specified one of the nodes in the rac cluster in the comnnection description for the database link.
    We want to change the link to include both rac nodes but we have a bunch of synonyms that point to the database link and I do not want to invalidate the synonyms.
    If I alter the dblink as opposed to drop and recreate then will the synonyms become unusable or invaildated?
    Thanks.

    First, you cannot change the connection information for a database link using the ALTER DATABASE LINK statement. You'll need to drop and recreate the database link to do so. From the documentation
    You cannot use this statement to change the connection or authentication user associated with the database link. To change user, you must re-create the database link.Second, are you saying that the TNS entry was specified explicitly in the CREATE DATABASE LINK statement rather than specifying a TNS alias (i.e. an entry in a tnsnames.ora file)? Normally, you'd specify a TNS alias when you create the database link in which case you could simply modify that alias rather than changing the database link.
    Third, synonyms do not become unusable or invalid just because the underlying object does not exist
    SQL> create synonym invalid_synonym
      2    for not_a_user.not_a_table@not_a_link;
    Synonym created.
    SQL> select status from dba_objects where object_name = 'INVALID_SYNONYM';
    STATUS
    VALIDYou'll get an error if you try to use the synonym, of course, but it won't be invalid. As long as you fix the database link before someone tries to use the synonym, there is no issue.
    Justin

  • Oracle 11gR2 alter database open hangs for a long time

    Hi,
    We are cloning oracle apps database with RAC to non-RAC. We did the ORACLE_HOME clone and then duplicated the database with rman.
    It completed successfully.
    While trying to bounce the database, the db startup option hangs at "alter database open" for a long time
    There are no errors in the alert log file. It just waits at "alter database open"
    Please help and thanks in advance.
    Regards
    Sasikala

    These are the lines in the trace file
    Instance name: stdby
    Redo thread mounted by this instance: 0 <none>
    Oracle process number: 9
    Unix process pid: 434204, image: oracle@developmentDR (MMAN)
    *** 2011-01-31 09:32:40.713
    *** SESSION ID:(208.1) 2011-01-31 09:32:40.713
    *** CLIENT ID:() 2011-01-31 09:32:40.713
    *** SERVICE NAME:() 2011-01-31 09:32:40.713
    *** MODULE NAME:() 2011-01-31 09:32:40.713
    *** ACTION NAME:() 2011-01-31 09:32:40.713
    def_comp: comp id 7 bp state 4
    And I din try opening the db with resetlogs. Do you want me to do that?
    thanks

  • Alter system and Alter database

    Hi all,
    Can U please tell me the difference between alter system and alter database.
    Thanks in advance...

    From SQL Reference
    Use the ALTER SYSTEM statement to dynamically alter your Oracle Database instance. The settings stay in effect as long as the database is mounted.
    Use the ALTER DATABASE statement to modify, maintain, or recover an existing database.
    instance => the processes using the database files
    database =>database files

  • ORA-01589 must use RESETLOGS option for database open

    I am running 10.1.0 and the database went down and I have been trying to get it started again. I have worked through several errors but stuck on this one.
    When trying to run startup I get this error ORA-01589 must use RESETLOGS or NORESETLOGS option for database open.
    Thanks,
    Tim

    please try below steps:--
    SQL> select * from v$logfile;
    GROUP# STATUS TYPE MEMBER IS_
    4 ONLINE /restore-11/POS/posebu-db/corppos-data02/oradata/EBUPOSPR/redo4_01.log NO
    4 ONLINE /restore-11/POS/posebu-db/corppos-data01/oradata/EBUPOSPR/redo4_02.log NO
    3 ONLINE /restore-11/POS/posebu-db/corppos-data02/oradata/EBUPOSPR/redo3_01.log NO
    3 ONLINE /restore-11/POS/posebu-db/corppos-data01/oradata/EBUPOSPR/redo3_02.log NO
    2 ONLINE /restore-11/POS/posebu-db/corppos-index01/oradata/EBUPOSPR/redo2_01.log NO
    2 ONLINE /restore-11/POS/posebu-db/corppos-data02/oradata/EBUPOSPR/redo02_02.log NO
    1 ONLINE /restore-11/POS/posebu-db/corppos-data01/oradata/EBUPOSPR/redo1_01.log NO
    1 ONLINE /restore-11/POS/posebu-db/corppos-index01/oradata/EBUPOSPR/redo1_02.log NO
    8 rows selected.
    SQL> select * from v$log;
    GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM
    1 1 0 1073741824 2 YES UNUSED 0
    4 1 1 1073741824 2 NO CURRENT 7.6915E+12 21-SEP-11
    3 1 0 1073741824 2 YES UNUSED 0
    2 1 0 1073741824 2 YES UNUSED 0
    SQL> recover database until cancel using backup controlfile;
    ORA-00279: change 7691479663660 generated at 09/21/2011 05:10:48 needed for thread 1
    ORA-00289: suggestion : /restore-11/POS/posebu-db/corppos-archive01/EBUPOSPR/1_1_762412057.arc
    ORA-00280: change 7691479663660 for thread 1 is in sequence #1
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    /restore-11/POS/posebu-db/corppos-data02/oradata/EBUPOSPR/redo4_01.log
    Log applied.
    Media recovery complete.
    SQL> select hxfil file_id, fhtnm tablespace_name from x$kcvfh;
    FILE_ID TABLESPACE_NAME
    1 SYSTEM
    2 UNDOTBS
    3 SYSAUX
    4 USERS
    SQL> select file#, checkpoint_change#, checkpoint_time, error from v$datafile_header;
    FILE# CHECKPOINT_CHANGE# CHECKPOIN ERROR
    1 7.6915E+12 21-SEP-11
    2 7.6915E+12 21-SEP-11
    3 7.6915E+12 21-SEP-11
    4 7.6915E+12 21-SEP-11
    SQL> col CHECKPOINT_CHANGE# for 9999999999999
    SQL> l
    1* select file#, checkpoint_change#, checkpoint_time, error from v$datafile_header
    SQL> /
    FILE# CHECKPOINT_CHANGE# CHECKPOIN ERROR
    1 7691479663749 21-SEP-11
    2 7691479663749 21-SEP-11
    3 7691479663749 21-SEP-11
    4 7691479663749 21-SEP-11
    SQL> select hxfil file_id, fhscn scn, fhthr thread, fhrba_seq sequence, fhsta status from x$kcvfh;
    FILE_ID SCN THREAD SEQUENCE STATUS
    1 7691479663749 1 1 8192
    2 7691479663749 1 1 0
    3 7691479663749 1 1 0
    4 7691479663749 1 1 0
    24 rows selected.
    SQL> select * from v$recover_file;
    no rows selected
    SQL> alter database open resetlogs;
    Database altered.
    +++++++++++++++++++++++++++++++++++++++++++++++++
    Best regards
    Shishir Tekade.

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

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

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

Maybe you are looking for