Description:-

Backup your databases and use the restore and recover features to restore a database to the same or another system or to recover database files.It is important to create a backup recovery strategy to protect the databases in Oracle Database from data loss due to a physical problem with a disk that causes a failure of a read from or write to a disk file that is required to run the database.How to restore the backup that. Let’s see the below example.

Step1:Copy of Pfile,datafile,redo file and Controlfile to Manualdb location and using to startup create database.

SQL> startup mount

ORACLE instance started.

Total System Global Area  524288000 bytes

Fixed Size     8622624 bytes

Variable Size   377490912 bytes

Database Buffers   134217728 bytes

Redo Buffers     3956736 bytes

Database mounted.

Step2:Mounted the Database and check the controlfile location.

SQL> show parameter control_file

NAME      TYPE  VALUE

———————————— ———– ——————————

control_file_record_keep_time      integer  7

control_files      string  /u01/manualdb/files/control/co

ntrol02bk.ctl

Step3:To Create the Controlfile using with Trace file.

SQL> recover database using BACKUP CONTROLFILE;

ORA-00283: recovery session canceled due to errors

ORA-01110: data file 1: ‘/u01/manualdb/files/data/system01.dbf’

ORA-01157: cannot identify/lock data file 1 – see DBWR trace file

ORA-01110: data file 1: ‘/u01/manualdb/files/data/system01.dbf’

SQL> alter database backup controlfile to trace  as ‘/u01/app/oracle/diag/rdbms/inba/inba/trace/ctl.sql’;

Database altered.

SQL> shutdown immediate;

ORA-01109: database not open

Database dismounted.

ORACLE instance shut down.

SQL>

SQL> startup nomount;

ORACLE instance started.

Total System Global Area  524288000 bytes

Fixed Size     8622624 bytes

Variable Size   377490912 bytes

Database Buffers   134217728 bytes

Redo Buffers     3956736 bytes

SQL> CREATE CONTROLFILE REUSE DATABASE "MANUALDB" NORESETLOGS  ARCHIVELOG

    MAXLOGFILES 5

    MAXLOGMEMBERS 5

    MAXDATAFILES 100

    MAXINSTANCES 1

    MAXLOGHISTORY 292

LOGFILE

  GROUP 1 '/u01/manualdb/files/redo/redo01.log'  SIZE 100M BLOCKSIZE 512,

  GROUP 2 '/u01/manualdb/files/redo/redo02.log'  SIZE 100M BLOCKSIZE 512,

  GROUP 3 '/u01/manualdb/files/redo/redo03.log'  SIZE 100M BLOCKSIZE 512

-- STANDBY LOGFILE

DATAFILE

  '/u01/manualdb/files/data/system01.dbf',

  '/u01/manualdb/files/data/sysaux01.dbf',

  '/u01/manualdb/files/data/undotbs01.dbf',

  '/u01/manualdb/files/data/users01.dbf',

  '/u01/manualdb/files/data/system02.dbf',

  '/u01/app/oracle/product/12.2.0.1/db_1/dbs/tbs1.dbf',

  '/u01/app/oracle/product/12.2.0.1/db_1/dbs/tbs2.dbf',

  '/u01/manualdb/files/data/tbs3.dbf',

  '/u01/app/oracle/product/12.2.0.1/db_1/dbs/test03.dbf'

CHARACTER SET US7ASCII

;  2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19   20   21   22   23  

Control file created.

Step4:Recover datafile and redologfile using controlfile:

SQL>  recover database using backup controlfile;

ORA-00279: change 7391600 generated at 10/25/2020 09:22:44 needed for thread 1

ORA-00289: suggestion :

/u01/app/oracle/product/12.2.0.1/db_1/dbs/arch1_1_1027674850.dbf

ORA-00280: change 7391600 for thread 1 is in sequence #1

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

/u01/manualdb/files/redo/redo01.log

Log applied.

Media recovery complete.

SQL>

SQL> alter database open resetlogs;

Database altered.

SQL> select name,open_mode from v$database;

NAME   OPEN_MODE

——— ——————–

MANUALDB  READ WRITE

 

 

Recent Posts

Start typing and press Enter to search