Backup/restore Oracle database 10g


Purpose:

The first time I have tried to restore Oracle database to a certain point it wasn’t easy like Microsoft SQL server, I wanted to patch the database with ERP system patch then restore to point before I applied the patch in case of something happened. I did recover oracle database however it restored everything after the point I want recover, finally I realized I have to perform point in time recovery.

  1. Perform full backup using rman command line

 Log on to Oracle database server using a user member ora_dba local group
 In command prompt:
C:\>rman target sys/DbPassword@Oracledbname  

Recovery Manager: Release 10.2.0.3.0 – Production on Fri Apr 18 17:27:51 2008  

Copyright (c) 1982, 2005, Oracle.  All rights reserved. 

connected to target database: Oracledbname (DBID=425570525) 

RMAN> RUN {
  ALLOCATE CHANNEL disk1 DEVICE TYPE DISK
  FORMAT ‘\\local or shared disk\oracle_bkp\18042008/%U’;
  BACKUP DATABASE } 

  1. Restore the database to point of time 

    1. Shutdown the database

      Log on to Oracle database server using a user member ora_dba local group In command prompt:

      Microsoft Windows [Version 5.2.3790]

      (C) Copyright 1985-2003 Microsoft Corp.

      C:\>Sqlplus sys/DbPassword@Oracledbname as sysdba

      SQL*Plus: Release 10.2.0.3.0 – Production on Fri Apr 18 17:45:07 2008

      Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

      Connected to: 

      Oracle Database 10g Release 10.2.0.3.0 – 64bit Production

      SQL> shutdown immediate

    2. Restore to Point of time

      Log on to Oracle database server using a user member ora_dba local group  In command prompt:

      C:\>rman target sys/DbPassword@Oracledbname
      Recovery Manager: Release 10.2.0.3.0 – Production on Fri Apr 18 17:27:51 2008
      Copyright (c) 1982, 2005, Oracle.  All rights reserved.
      connected to target database: LINPROD (DBID=425570525)
      RMAN>startup force mount;
      RMAN> RUN {set until time “to_date(’18-04-08 15:35:00′, ‘dd-mm-yy hh24:mi:ss’)”;restore database;recover database;} 

    1. Start the database

Log on to Oracle database server using a user member ora_dba local group

In command prompt:

Microsoft Windows [Version 5.2.3790]

(C) Copyright 1985-2003 Microsoft Corp.

C:\>Sqlplus sys/DbPassword@Oracledbname as sysdba

SQL>startup

 

Advertisements

About Tarek

I have been working in IT for years and I thought it might be good to share my experience using real life scenarios.
This entry was posted in Oracle Database and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s