Let’s have look on the steps we use for “RMAN Particular Datafile Backup”
Check the datafile
SQL> select file_id,tablespace_name,file_name from dba_data_files; FILE_ID TABLESPACE_NAME FILE_NAME ---------------------------------------------------------------------------------------- 4 USERS D:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA01\USERS01.DBF 3 SYSAUX D:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA01\SYSAUX01.DBF 2 UNDOTBS1 D:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA01\UNDOTBS01.DBF 1 SYSTEM D:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA01\SYSTEM01.DBF 6 CHEC D:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA01\CHECK01.DBF 5 TEST D:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA01\TEST02.DBF 6 rows selected
Create a dummy table and insert some records.
SQL> create table dummy(name varchar(100)) tablespace users; Table created. SQL> insert into test values('**** INSERT BEFORE BACKUP ****'); 1 row created. SQL> commit; Commit complete.
Backup datafile
RMAN> backup datafile 4;
Now insert some records
SQL> insert into test values('**** INSERT AFTER BACKUP ****'); 1 row created. SQL> commit; Commit complete.
Now, shutdown the database and remove the datafile
RMAN> shutdown immediate; database closed database dismounted Oracle instance shut down
Try to start the database
SQL> startup; ORACLE instance started. Total System Global Area 167772160 bytes Fixed Size 1247876 bytes Variable Size 83887484 bytes Database Buffers 75497472 bytes Redo Buffers 7139328 bytes Database mounted. ORA-01157: cannot identify/lock data file 4 - see DBWR trace file ORA-01110: data file 4: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\USERS01.DBF'
We need to recover the datafile and open the datafile
RMAN> restore datafile 4; RMAN> recover datafile 4; SQL> alter database open; Database altered.
Today’s thought
Small aim is a crime; have great aim. By ApJ Abdul Kalam
Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/
Joel Perez’s LinkedIn: Joel Perez’s Profile
LinkedIn Group: Oracle Cloud DBAAS
Facebook Page: OracleHelp