Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Recovering a Oracle datafile without backup.pdf
1. Recovering a Oracle data
fi
le without backup
If a data
fi
le is damaged and no backup of that
fi
le is available, then you can still recover the
data
fi
le given the following condition:
1. All archived log
fi
les written after the creation of the original data
fi
le are available
2.The control
fi
le contains the name of the damaged
fi
le (that is, the control
fi
le is current, or is
a backup taken after the damaged data
fi
le was added to the database).
Steps to recover a data
fi
le without backup
1. Very
fi
rst step we have to do is to re-create a data
fi
le for recovery:
Create a new, empty data
fi
le to replace a damaged data
fi
le that has no corresponding backup.
For example, assume that the data
fi
le /u01/oradata/users01.dbf has been damaged, and no
backup is available. The following statement re-creates the original data
fi
le (same size) on
u02(another location):
ALTER DATABASE CREATE DATAFILE '/u01/oradata/users01.dbf' AS '/u02/users01.dbf';
This statement creates an empty
fi
le that is the same size as the lost
fi
le. The database looks at
information in the control
fi
le and the data dictionary to obtain size information. The old data
fi
le is
renamed as the new data
fi
le.
2. Perform media recovery on the empty data
fi
le.
For example, enter:
RECOVER DATAFILE '/u02/users01.dbf'
--Or use data
fi
le number
RECOVER DATAFILE 8;
All archived logs written after the original data
fi
le was created must be applied to the new, empty
version of the lost data
fi
le during recovery.
Here is a overall summary:
1.shutdown your database
2.take the database in mount state
3.alter database create data
fi
le 'old_data
fi
le_path' as 'new_data
fi
le_path';
4.once new
fi
le created do the incomplete recovery.
5. open the database with resetlogs.
Note:
If after creating new data
fi
le got error:
ERROR at line 1:
ORA-01182: cannot create database
fi
le 8 -
fi
le is in use or recovery
ORA-01110: data
fi
le 8: '/u01/oradata/users01.dbf'
To avoid error - before creating new data
fi
le, you must take the existing data
fi
le (or the
tablespace) o
ffl
ine.
2. SQL> alter database data
fi
le 8 o
ffl
ine drop;
After o
ffl
ine data
fi
le then do recover and
fi
nally online it.
********************
Restore/Recover data
fi
le from Standby without
database catalog (19c)
SQL> startup
ORACLE instance started.
Total System Global Area #### bytes
Database mounted.
ORA-01157: cannot identify/lock data
fi
le 2 - see DBWR trace
fi
le
ORA-01110: data
fi
le 3: '/u01/oradata/sysaux01.dbf'
RMAN> list backup of data
fi
le 2;
speci
fi
cation does not match any backup in the repository
As you can see on primary database we can not start db and have problem on sysaux.
And supposed that we have no backup.
Solution:
Connect to the Standby as primary connection and to the primary as auxiliary connection, and
make a backup of the data
fi
le 2.
$ rman target sys/pass@pop_stby auxiliary sys/pass@orcl_prim
RMAN>
RMAN> backup as copy data
fi
le 2 auxiliary format '/backup/sysaux01.dbf';
Connect to the primary database, catalog the backup of the data
fi
le as copy, restore and recover
the data
fi
le.
$ rman target sys/pass@pop_prim
connected to target database: pop_prim (DBID=1014132133, not open)
RMAN> catalog data
fi
lecopy '/backup/sysaux01.dbf';
RMAN> restore data
fi
le 3;
RMAN> recover data
fi
le 3;
RMAN> alter database open;
Regards,
Alireza Kamrani.