7 Replies Latest reply: Mar 15, 2013 12:35 PM by EdStevens RSS

    Error in Restoring the database time

    979508
      Hello.

      I am trying to restore the database time to reflect one minute before a batch job. The batch job ran at 11:40:24. When trying to restore the database using the following, I get the error message listed below.


      RMAN> run {
      2> set UNTIL TIME = '2013-03-14 11:39:24';
      3> RESTORE DATABASE;
      4> RECOVER DATABASE;
      5> ALTER DATABASE OPEN RESETLOGS;
      6> }

      Error message:

      executing command: SET until clause

      Starting restore at 14-MAR-13
      RMAN-00571: ===========================================
      RMAN-00569: ==========ERROR MESSAGE STACK FOLLOWING =========
      RMAN-00571: ===========================================
      RMAN-03002: failure of restore command at 03/14/2013 13:33:31
      ORA-01861: literal does not match format string

      Can someone assist me in resolving this error message? I would greatly appreciate the help.
        • 1. Re: Error in Restoring the database time
          mseberg
          Try the following format :

          sql 'alter session set NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"';
          set until time "to_date('21-19-2012 00:00:00','DD-MM-YYYY HH24:MI:SS')";

          When you speak of me, speak well.

          Best Regards

          mseberg
          • 2. Re: Error in Restoring the database time
            979508
            First and foremost, sorry for the late response. I tried your suggestion and got the following error message:


            executing command: SET until clause

            Starting restore at 14-MAR-13
            RMAN-00571: ===========================================
            RMAN-00569: ==========ERROR MESSAGE STACK FOLLOWING =========
            RMAN-00571: ===========================================
            RMAN-03002: failure of restore command at 03/14/2013 19:38:52
            ORA-00907: missing right parenthesis

            Regards
            • 3. Re: Error in Restoring the database time
              saratpvv
              you can try like this..
              Example :

              RMAN> RUN
              {
              SQL "ALTER SESSION

              SET NLS_DATE_FORMAT=''DD-MON-YYYY HH24:MI:SS''";
              SET UNTIL TIME '15-MAR-2013 01:04:22';
              RESTORE DATABASE;
              RECOVER DATABASE;
              }
              • 4. Re: Error in Restoring the database time
                vlethakula
                rman
                {
                SET UNTIL TIME "to_date('12-11-2012 23:59:00','MM-DD-YYYY HH24:MI:SS')";
                rest of commands
                }
                • 5. Re: Error in Restoring the database time
                  EdStevens
                  976505 wrote:
                  First and foremost, sorry for the late response. I tried your suggestion and got the following error message:


                  executing command: SET until clause

                  Starting restore at 14-MAR-13
                  RMAN-00571: ===========================================
                  RMAN-00569: ==========ERROR MESSAGE STACK FOLLOWING =========
                  RMAN-00571: ===========================================
                  RMAN-03002: failure of restore command at 03/14/2013 19:38:52
                  ORA-00907: missing right parenthesis

                  Regards
                  then your command had a missing right parenthesis. Unfortunately, you decided we didn't need to see the command to help you find it ....
                  • 6. Re: Error in Restoring the database time
                    979508
                    In my initial my post I showed everything. However after some additional research I was able to resolve my problem.

                    1. Reset the NLS…date from c:/ as follows:
                    SET NLS_DATE_FORMAT=yyyy-mm-dd hh24:mi:ss
                    SET NLS_LANG=american_america.we8iso8859p15

                    2. Shutdown database & Startup mount

                    3. Logged in to RMAN as target / nocatalog


                    What I found is, when I initially set the NLS date I used quotation marks. However after setting the NLS without the quotation marks, I was able to run the command with no errors.

                    I greatly appreciate your help.
                    • 7. Re: Error in Restoring the database time
                      EdStevens
                      976505 wrote:
                      In my initial my post I showed everything.
                      No.

                      In your initial post you showed "everything" relating to
                      RMAN-03002: failure of restore command at 03/14/2013 13:33:31
                      You did not show whatever changes you made that caused your next error, the one to which I was responding
                      ORA-00907: missing right parenthesis
                      The error changed because the conditions changed. We only knew the conditions for the first error.



                      However after some additional research I was able to resolve my problem.

                      1. Reset the NLS…date from c:/ as follows:
                      SET NLS_DATE_FORMAT=yyyy-mm-dd hh24:mi:ss
                      SET NLS_LANG=american_america.we8iso8859p15

                      2. Shutdown database & Startup mount

                      3. Logged in to RMAN as target / nocatalog


                      What I found is, when I initially set the NLS date I used quotation marks. However after setting the NLS without the quotation marks, I was able to run the command with no errors.

                      I greatly appreciate your help.