Re: RMAN in Windows: Issues With Point-In-Time Recovery

From: John Hurley <hurleyjohnb_at_yahoo.com>
Date: Thu, 16 Sep 2010 15:57:03 -0700 (PDT)
Message-ID: <33214ab6-2782-4db5-9952-7e4ac1122be8_at_k9g2000vbo.googlegroups.com>



On Sep 16, 5:54 pm, "if_inves..._at_yahoo.com" <basis_consult..._at_hotmail.com> wrote:
> Hi,
>
> I would appreeciate ideas regarding the following; I am
> new to RMAN (Having used SAP backup tools until now).
>
> I am running 10g on Win2003. I have an RMAN script that backups the
> database and controlfiles. However, when
> I try a restore, I cannot recover to a point-in-time recovery taken
> soon after the backup (Point-in-time recoveries an hour or two
> afterwards are fine). It is a small database (5GB or so; It is on a VM
> system and I have a snapshot so I can recover that way, but I am
> testing RMAN)
>
> For example, I run the RMAN scipt at 4:20PM. It finishes
> about 4:26PM. The log indicates no problems. At 4:30PM I make a change
> in the database (Add a table).
>
> I then break the database (Rename a datafile, etc.) and
> run a point-in-time recovery script to 4:29PM. The RMAN log indicates
> that the database recovered.
>
> However, when I login to SQLPLUS and try to open the database,
> I am forced to issue the statement "Recover Database". The
> database recovers, I can open it, but my 4:30PM change
> is present.
>
> I am not sure why the RMAN recovery was insufficient, or why
> the database is rolled to 4:30PM+, not 4:29PM (Likely due
> to the SQL "recover database" command, I think).
>
> These are not the most elegent RMAN scripts, but they are
> as follows:
>
> The backup script (I don't think that I need to swich logfile a few
> times, but I wanted all archive changes saved)
> ***************************************************************
> spool log to <logfile>;
> configure retention policy to none;
> RUN
> {
>   CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '\\<drive>\<share>\admin
> \RMAN%d_1%U';
>   BACKUP as compressed backupset database;
>   SQL "alter system switch logfile";
>   SQL "alter system switch logfile";
>   SQL "alter system switch logfile";
>   SQL "alter system switch logfile";
>   backup as compressed backupset archivelog from sequence 327;   (The
> archive sequence numbers are a lot higher  than
> 327)}
>
> exit;
> spool off;
>
> ***************************************************************************
> Recovery script:
>
> Spool log to <recovery log_file>;
> connect target;
> startup mount;
> RUN
>  {
>   configure CHANNEL DEVICE TYPE DISK FORMAT '\\<drive>\<share>\admin
> \RMANCSA_11TLO24F6_1_1';
>   restore DATABASE;
>   configure channel device type disk format '\\<Drive>\\<share>\admin
> \RMANCSA_11VLO2535_1_1';
>   restore archivelog from sequence 327;
>   set until time "to_date('2010 sep 16 16:29','yyyy mon dd hh24:mi')";
>   recover database;
>  }
> exit;
> spool off;
>
> Thanks,
> QZ

I would recommend learning how to do this recovery first using sqlplus and make sure you know exactly what you are doing in that environment and why.

Then move onto doing it using rman commands if you must.

Personally I use rman for the restores but do all my recover commands using sqlplus but I am just a grouchy old dba. Received on Thu Sep 16 2010 - 17:57:03 CDT

Original text of this message