Oracle Database Recovery

Download Free PDF

Situation 1

  1. No Database Backup
  2. No Control file Backup
  3. No Control file
  4. Some Data files Corrupted

Create PFile

export ORACLE_SID=test5

vi /u01/app/oracle/product/19.0.0/dbhome_1/dbs/inittest5.ora

*.audit_file_dest='/u01/app/oracle/admin/test5/adump'

*.audit_trail='db'

*.compatible='19.0.0'

*.control_files='/data/test5/control1.ctl'

*.db_block_size=8192

*.db_name='test5'

*.diagnostic_dest='/u01/app/oracle'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=test5XDB)'

*.log_archive_dest_1='location=/data/test5/archive'

*.memory_target=1049m

*.open_cursors=300

*.processes=320

*.remote_login_passwordfile='EXCLUSIVE'

*.undo_tablespace='UNDOTBS1'

Create Directories

mkdir –p /u01/app/oracle/admin/test5/adump

mkdir /data/test5

mkdir /data/test5/archive

Control File Scripts

CREATE CONTROLFILE

SET DATABASE test5

LOGFILE

GROUP 1 '/data/test5/redo01_01.log' size 5M,

GROUP 2 '/data/test5/redo02_01.log' size 5M

RESETLOGS

DATAFILE '/data/test5/o1_mf_sysaux_mmw00w5g_.dbf' reuse,

'/data/test5/o1_mf_system_mmvzxlgr_.dbf' reuse,

'/data/test5/o1_mf_undotbs1_mmw029hf_.dbf' reuse,

'/data/test5/o1_mf_users_mmw02bq6_.dbf' reuse,

'/data/test5/tbs2.dbf'  reuse

MAXLOGFILES 50

MAXLOGMEMBERS 3

MAXLOGHISTORY 400

MAXDATAFILES 200

MAXINSTANCES 1

ARCHIVELOG;

Alter database mount;

select name from v$datafile;

select name from v$controlfile;

Alter database open resetlogs;

select table_name,tablespace_name from dba_tables where owner='TEST';