Saturday, August 22, 2020

Recovery From Loss Of Datafile For Which No Backup Is Available Using RMAN Utility

 

Recovery From Loss Of Datafile For Which No Backup Is Available Using RMAN Utility


SCENARIO – 10g Database Loss of datafile which has not been backed up.



CREATE NEW TABLESPACE TESTCHAITANYA


SQL> create tablespace testchaitanya datafile ‘/u02/oradata/testdb/testchaitanya.dbf’ size 25m;


Tablespace created.


TAKE A BACKUP OF THE DATABASE AT THIS POINT 


ADD DATAFILE TO TESTCHAITANYA TABLESPACE


SQL> alter tablespace testchaitanya add datafile ‘/u02/oradata/testdb/testchaitanya01.dbf’ size 25m;


Tablespace altered.


SIMULATE FAILURE BY REMOVING DATAFILES FOR TESTCHAITANYA TABLESPACE FROM DISK


Note: The tablespace TESTCHAITANYA has two datafiles, but only one has been backed up at this point in time


testdb:/u02/oradata/testdb> rm test*

testdb:/u02/oradata/testdb> sql


SQL> alter tablespace testchaitanya offline immediate;


Tablespace altered.


RESTORE DATAFILE 5; – The datafile which was backed up.


testdb:/u02/oradata/testdb> rman target / catalog rman11p/xxx@rcatp


Recovery Manager: Release 11.1.0.6.0 – Production on Thu AUG 20 09:19:28 2020


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


connected to target database: TESTDB (DBID=2358982414)

connected to recovery catalog database


RMAN> restore datafile 5;


Starting restore at 20/AUG/20

starting full resync of recovery catalog

full resync complete

Finished restore at 20/AUG/20


RMAN> restore tablespace testchaitanya;


Starting restore at 20/AUG/20

using channel ORA_SBT_TAPE_1

using channel ORA_SBT_TAPE_2

using channel ORA_DISK_1


creating datafile file number=6 name=/u02/oradata/testdb/testchaitanya01.dbf >>> In 10g, Oracle creates the missing datafile .

skipping datafile 5; already restored to file /u02/oradata/testdb/testchaitanya.dbf

Finished restore at 14/MAY/09


RECOVER TABLESPACE TEST


SQL> recover tablespace testchaitanya;

Media recovery complete.


SQL> alter tablespace testchaitanya online;


Tablespace altered.


Note: Info on Recovery From Loss Of Datafile For Which No Backup Is Available Using RMAN Utility it may differ from your environment production,testing,development and mountpoints etc


THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME OR SUBSCRIBE ME


bash_profile in Oracle RAC

 

Introduction


Bash_profile : Apart from the home directory to create and store files ,users need an environment to execute some of the tools and resources ,When a user logs in to a system the users work environment is determined by the initialization files ,these initialization files are defined by the users startup shell, The .bash_profile is a personal initialization file for configuring the user environment,the file is defined in your home directory and can be used modifying  your work environment by setting custom environment variables and terminal settings,and instruction the sytem to start up the application ,in this  we have two homes like GRID_HOME,and DB_HOME  to startup the services of the cluster application and rdbms application.



Verify Cluster services - status

#cd /u01/app/11.2.0/grid/bin

#./crsctl check cluster -all


su - oracle

vi .bash_profile


TMP=/tmp; export TMP

TMPDIR=$TMP; export TMPDIR


ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

GRID_HOME=/u01/app/11.2.0/grid; export GRID_HOME

DB_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export DB_HOME

ORACLE_HOME=$DB_HOME; export ORACLE_HOME

ORACLE_SID=prod1; export ORACLE_SID

BASE_PATH=/usr/sbin:$PATH; export BASE_PATH

PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH


LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH


:wq!


$. .bash_profile


Now... create grid_env


$vi grid_env


ORACLE_SID=+ASM2; export ORACLE_SID

ORACLE_HOME=$GRID_HOME; export ORACLE_HOME

PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH


LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH


:wq!


$vi db_env


ORACLE_SID=prod2; export ORACLE_SID

ORACLE_HOME=$DB_HOME; export ORACLE_HOME

PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH


LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH


:wq!



$chmod +x db_env

$chmod +x grid_env


To login to grid - for asm instance

$. grid_env

$echo $ORACLE_SID

$echo $ORACLE_HOME

sqlplus "/as sysasm"

sql>



To login to DB

. db_env

sqlplus '/as sysdba'



Two home

Grid home

db home


Note : Info on bash_profile it may differ in your environment production,testing,development,and directories etc



THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME OR SUBSCRIBE ME

ITIL Process

ITIL Process Introduction In this Blog i am going to explain  ITIL Process, ITIL stands for Information Technology Infrastructure Library ...