You are on page 1of 106

Ask Questions

At the end of the interview you will usually be given a chance to ask any questi
ons. When asked if they have any questions, most candidates answer, No. Wrong answ
er! It is extremely important to ask questions, not only do they allow the inter
viewee to acquire more information but they also demonstrate your interest in th
e position and company.
The best questions come from listening to what is asked during the interview and
asking for additional information
Closing
When the Interview is Complete Insure you thank the manager for his time. In mos
t cases the manager will advise you as to when he will make his decision. If he
does not define that fact, it is perfectly acceptable to ask. Let the interviewe
r know that you think you would be a good fit for his or her team and look forwa
rd to hearing from him soon.
ORACLE ARCHITECTURE
Tell me about yourself? Your role as a DBA? Your Day to Day activities?
What is difference between oracle SID and Oracle service name?
Oracle SID is the unique name that uniquely identifies your instance/database wh
ere as the service name is the TNS alias can be same or different as SID.
What are the steps to install oracle on Linux system? List two kernel parameter
that effect oracle installation?
Initially set up disks and kernel parameters, then create oracle user and DBA gr
oup, and finally run installer to start the installation process. The SHMMAX & S
HMMNI two kernel parameter required to set before installation process.
What are bind variables?
With bind variable in SQL, oracle can cache queries in a single time in the SQL
cache area. This avoids a hard parse each time, which saves on various locking a
nd latching resource we use to check object existence and so on.
What is the difference between data block/extent/segment?
A data block is the smallest unit of logical storage for a database object. As o
bjects grow they take chunks of additional storage that are composed of contiguo
us data blocks. These groupings of contiguous data blocks are called extents. Al
l the extents that an object takes when grouped together are considered the segm
ent of the database object.
What is the difference between PGA and UGA?
When you are running dedicated server then process information stored inside the
process global area (PGA) and when you are using shared server then the process
information stored inside user global area (UGA).
What is SGA? Define structure of shared pool component of SGA?
The system global area is a group of shared memory area that is dedicated to ora
cle instance. All oracle process uses the SGA to hold information. The SGA is us
ed to store incoming data and internal control information that is needed by the
database. You can control the SGA memory by setting the parameter db_cache_size
, shared_pool_size and log_buffer.
Shared pool portion contain three major area:
Library cache (parse SQL statement, cursor information and execution plan),
data dictionary cache (contain cache, user account information, privilege user i
nformation, segments and extent information,data buffer cache for parallel execu
tion message and control structure.
What is the difference between SMON and PMON processes?
SMON (System Monitor) performs recovery after instance failure, monitor temporar
y segments and extents; clean temp segment, coalesce free space. It is mandatory
process of DB and starts by default.
Oracle's PMON (Process Monitor) :
The process monitor database process.
This process is in charge to perform process recovery when a user process fails
(also when killed). It then cleans up the cache and frees resources that the pro
cess used.
PMON checks dispatchers and server processes and restarts them if they have fail
ed.
Service registration
Service registration is a feature which allows an Oracle Server to register itse
lf with a listener. That means that the Oracle Service needs not be configured i
n the listener.ora configuration file.
During service registration, PMON provides the listener with
Names of the database services provided by the database
Name of the instance associated with the servie and its current and maximum load
Service handlers (dispatchers and dedicated servers)
However, if there is no listener at startup, PMON can obviously not register tho
se information. Therefore, PMON tries then periodically to register with the lis
tener, which might take up to 60 seconds.
It is possible to force this registration with alter system register.
What is a system change number (SCN)?
SCN is a value that is incremented whenever a dirty read occurs.
SCN is incremented whenever a deadlock occurs.
SCN is a value that keeps track of explicit locks.
SCN is a value that is incremented whenever database changes are made.
What is the main purpose of CHECKPOINT in oracle database? How do you automaticall
y force the oracle to perform a checkpoint?
A checkpoint is a database event, which synchronize the database blocks in memor
y with the datafiles on disk. It has two main purposes: To establish a data cons
istency and enable faster database Recovery.
The following are the parameter that will be used by DBA to adjust time or inter
val of how frequently its checkpoint should occur in database.
LOG_CHECKPOINT_TIMEOUT = 3600; # Every one hour
LOG_CHECKPOINT_INTERVAL = 1000; # number of OS blocks.
What happens when we fire SQL statement in Oracle?
First it will check the syntax and semantics in library cache, after that it wil
l create execution plan.
If already data is in buffer cache it will directly return to the client.
If not it will fetch the data from datafiles and write to the database buffer ca
che after that it will send server and finally server send to the client.
What is the use of large pool, which case you need to set the large pool?
You need to set large pool if you are using: MTS (Multi thread server) and RMAN
Backups. Large pool prevents RMAN & MTS from competing with other sub system for
the same memory. RMAN uses the large pool for backup & restore when you set the
DBWR_IO_SLAVES or BACKUP_TAPE_IO_SLAVES parameters to simulate asynchronous I/O
. If neither of these parameters is enabled, then Oracle allocates backup buffer
s from local process memory rather than shared memory. Then there is no use of l
arge pool.
What does database do during the mounting process?
While mounting the database oracle reads the data from controlfile which is used
for verifying physical database files during sanity check. Background processes
are started before mounting the database only.
What are logfile states?
CURRENT state means that redo records are currently being written to that group. I
t will be until a log switch occurs. At a time there can be only one redo group
current.
If a redo group containing redo s of a dirty buffer that redo group is said to be A
CTIVE state. As we know log file keep changes made to the data blocks then data b
locks are modified in buffer cache (dirty blocks). These dirty blocks must be wr
itten to the disk (RAM to permanent media).
And when a redolog group contains no redo records belonging to a dirty buffer it
is in an INACTIVE state. These inactive redolog can be overwritten.
One more state UNUSED initially when you create new redo log group its log file is
empty on that time it is unused. Later it can be any of the above mentioned sta
te.
What is log switch?
The point at which oracle ends writing to one online redo log file and begins wr
iting to another is called a log switch. Sometimes you can force the log switch.
ALTER SYSTEM SWITCH LOGFILE;
How to check Oracle database version?
SQL> Select * from v$version;
Explain Oracle Architecture?
Oracle Instance:
a means to access an Oracle database,always opens one and only one database and
consists of memory structures and background process.
Oracle server:
a DBMS that provides an open, comprehensive, integrated approach to information
management,Consists of an Instance and a database.
Oracle database:
a collection of data that is treated as a unit,Consists of Datafiles, Control fi
les, Redo log files. (optional param file, passwd file, archived log)
Instance memory Structures:
System Global Area (SGA):
Allocated at instance startup, and is a fundamental component of an Oracle Insta
nce.
SGA Memory structures:
Includes Shared Pool, Database Buffer Cache, Redo Log Buffer among others.
Shared Pool :
Consists of two key performance-related memory structures Library Cache and Data
Dictionary Cache.
Library Cache:
Stores information about the most recently used SQL and PL/SQL statements and en
ables the sharing of commonly used statements.
Data Dictionary Cache :
Stores collection of the most recently used definitions in the database Includes
db files, tables, indexes, columns etc. Improves perf. During the parse phase,
the server process looks at the data dictionary for information to resolve objec
t names and validate access.
Database Buffer Cache:
Stores copies of data blocks that have been retrieved from the datafiles. Everyt
hing done here.
Redo Log Buffer :
Records all changes made to the database data blocks, Primary purpose is recover
y. Redo entries contain information to reconstruct or redo changes.
User process:
Started at the time a database User requests connection to the Oracle server. re
quests interaction with the Oracle server, does not interact directly with the O
racle server.
Server process:
Connects to the Oracle Instance and is Started when a user establishes a session
.
fulfills calls generated and returns results.
Each server process has its own nonshared PGA when the process is started.
Server Process Parses and run SQL statements issued through the application, Rea
ds necessary data blocks from datafiles on disk into the shared database buffers
of the SGA, if the blocks are not already present in the SGA and Return results
in such a way that the application can process the information.
In some situations when the application and Oracle Database operate on the same
computer, it is possible to combine the user process and corresponding server pr
ocess into a single process to reduce system overhead.
Program Global Area (PGA):
Memory area used by a single Oracle server process.
Allocated when the server process is started, deallocated when the process is te
rminated and used by only one process.
Used to process SQL statements and to hold logon and other session information.
Background processes:
Started when an Oracle Instance is started.
Background Processes Maintains and enforces relationships between physical and m
emory structures
There are two types of database processes:
1. Mandatory background processes
2. Optional background processes
Mandatory background processes:
DBWn, PMON, CKPT, LGWR, SMON
Optional background processes:
ARCn, LMDn, RECO, CJQ0, LMON, Snnn, Dnnn, Pnnn, LCKn, QMNn
DBWn writes when:
Checkpoint occurs
Dirty buffers reach threshold
There are no free buffers
Timeout occurs
RAC ping request is made
Tablespace OFFLINE
Tablespace READ ONLY
Table DROP or TRUNCATE
Tablespace BEGIN BACKUP
Log Writer (LGWR) writes:
At commit
When 1/3rd full
When there is 1 MB of redo
Every 3 seconds
Before DBWn writes
System Monitor (SMON) Responsibilities:
Instance recovery
Rolls forward changes in redo logs
Opens database for user access
Rolls back uncommitted transactions
Coalesces free space
Deallocates temporary segments.
Process Monitor (PMON) Cleans up after failed processes by:
Rolling back the transaction
Releasing locks
Releasing other resources
Restarting dead dispatchers
Checkpoint (CKPT) Responsible for:
Signaling DBWn at checkpoints
Updating datafile headers with checkpoint information
Updating control files with checkpoint information
Archiver (ARCn)
Optional background process
Automatically archives online redo logs when ARCHIVELOG mode is set
Preserves the record of all changes made to the database
Why do you run orainstRoot and ROOT.SH once you finalize the Installation?
orainstRoot.sh needs to be run to change the Permissions and groupname to 770 an
d to dba.
Root.sh (ORACLE_HOME) location needs to be run to create a ORATAB in /etc/oratab
or /opt/var/oratab in Solaris and to copy dbhome, oraenv and coraenv to /usr/lo
cal/bin.
orainstRoot.sh
[root@oracle11g ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory to 770.
Changing groupname of /u01/app/oraInventory to dba.
The execution of the script is complete
root.sh
[root@oracle11g ~]# /u01/app/oracle/product/11.1.0/db_1/root.sh
Running Oracle 11g root.sh script
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.1.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin
Copying oraenv to /usr/local/bin
Copying coraenv to /usr/local/bin
Creating /etc/oratab file
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
For Oracle installation on unix/linux, we will be prompted to run a script root.s
h from the oracle inventory directory.this script needs to run the first time onl
y when any oracle product is installed on the server.
It creates the additional directories and sets appropriate ownership and permiss
ions on files for root user.
Oracle Database 11g New Feature for DBAs?
1) Automatic Diagnostic Repository [ADR]
2) Database Replay
3) Automatic Memory Tuning
4) Case sensitive password
5) Virtual columns and indexes
6) Interval Partition and System Partition
7) The Result Cache
8) ADDM RAC Enhancements
9) SQL Plan Management and SQL Plan Baselines
10) SQL Access Advisor & Partition Advisor
11) SQL Query Repair Advisor
12) SQL Performance Analyzer (SPA) New
13) DBMS_STATS Enhancements
14) The Result Cache
15) Total Recall (Flashback Data Archive)
Note: The above are only top new features, there are other features as well intr
oduced in 11g which will be included subsequently
What is the Difference Between Local Inventory and Global Inventory?
What is oraInventory ?
oraInventory is repository (directory) which store/records oracle software produ
cts & their oracle_homes location on a machine. This Inventory now a days in XML
format and called as XML Inventory where as in past it used to be in binary for
mat & called as binary Inventory.
There are basically two kind of inventories,
One is Local Inventory (also called as Oracle Home Inventory) and other is Globa
l Inventory (also called as Central Inventory).
What is Global Inventory ?
Global Inventory holds information about Oracle Products on a Machine. These pro
ducts can be various oracle components like database, oracle application server,
collaboration suite, soa suite, forms & reports or discoverer server . This glo
bal Inventory location will be determined by file oraInst.loc in /etc (on Linux)
or /var/opt/oracle (solaris). If you want to see list of oracle products on mac
hine check for file inventory.xml under ContentsXML in oraInventory Please note
if you have multiple global Inventory on machine check all oraInventory director
ies)
You will see entry like
HOME NAME= ORA10g_HOME LOC= /u01/oracle/10.2.0/db TYPE= O IDX= 1?/
What is Local Inventory ?
Inventory inside each Oracle Home is called as local Inventory or oracle_home In
ventory. This Inventory holds information to that oracle_home only.
What is Oracle Home Inventory?
Oracle home inventory or local inventory is present inside each Oracle home. It
only contains information relevant to a particular Oracle home. This file is loc
ated in the following location:
$ORACLE_HOME/inventory
It contains the following files and folders:
Components File
Home Properties File
Other Folders
Can I have multiple Global Inventory on a machine ?
Quite common questions is that can you have multiple global Inventory and answer
is YES you can have multiple global Inventory but if your upgrading or applying
patch then change Inventory Pointer oraInst.loc to respective location. If you
are following single global Inventory and if you wish to uninstall any software
then remove it from Global Inventory as well.
What to do if my Global Inventory is corrupted ?
No need to worry if your global Inventory is corrupted, you can recreate global
Inventory on machine using Universal Installer and attach already Installed orac
le home by option
-attachHome
./runInstaller -silent -attachHome -invPtrLoc $location_to_oraInst.loc
ORACLE_HOME= Oracle_Home_Location ORACLE_HOME_NAME= Oracle_Home_Name
CLUSTER_NODES= {}
What is RESULT Cache?
11G Backgroung Processes?
The following process are added in 11g as new background processes.
1 dbrm DB resource manager
2 dia0 Diagnosability process
3 fbda Flashback data archiver process
4 vktm Virtual Timekeeper
5 w000 Space Management Co-ordination process
6 smc0 Space Manager process
NOTE : The above six are mandatory processes.
But 11g has 56 new processes added which can be queried using
If any one of these 6 mandatory background processes is killed/not running, the
instance will be aborted ?
Background processes are started automatically when the instance is started.
Mandatory background processes are DBWn, LGWR, CKPT, SMON, PMON, and RECO. All o
ther processes are optional, will be invoked if that particular feature is activ
ated.
If any one of these 6 mandatory background processes is killed/not running, the
instance will be aborted.
Any issues related to backgroud processes should be monitored and analyzed from
the trace files generated and the alert log.
What is SGA_TARGET and SGA_MAX_SIZE ?
SGA_MAX_SIZE is the largest amount of memory that will be available for the SGA
in the instance and it will be allocated from memory. You do not have to use it
all, but it will be potentially wasted if you set it too high and don t use it. It
is not a dynamic parameter. Basically it gives you room for the Oracle instance
to grow.
SGA_TARGET is actual memory in use by the current SGA. This parameter is dynamic
and can be increased up to the value of SGA_MAX_SIZE.
SGA_MAX_SIZE and SGA_TARGET both are the parameter are used to change the SGA SI
ZE.
SGA_MAX_SIZE sets the maximum value for sga_target.
SGA_TAGET is 10G feature used to change the sga size dynamically .it specifies t
he total amount of SGA memory available to an instance.
this feature is called Automatic Shared Memory Management. With ASMM, the parame
ters java_pool_size, shared_pool_size, large_pool_size and db_cache_size are aff
ected.
SGA_MAX_SIZE & SGA_TARGET
http://maxwellmiranda.wordpress.com/2009/09/17/sga_max_size-sga_targe/
SGA_MAX_SIZE sets the overall amount of memory the SGA can consume but is not dy
namic.
The SGA_MAX_SIZE parameter is the max allowable size to resize the SGA Memory ar
ea parameters. If the SGA_TARGET is set to some value then the Automatic Shared
Memory Management (ASMM) is enabled, the SGA_TARGET value can be adjusted up to
the SGA_MAX_SIZE parameter, not more than SGA_MAX_SIZE parameter value.
I.e. If SGA_MAX_SIZE=4GB and SGA_TARGET=2GB, later period of time, if you want y
ou can resize your SGA_TARGET parameter to the value of SGA_MAX_SIZE i.e. 4GB, y
ou can t resize the SGA_TARGET value to more than 4GB.
It is significant that SGA_TARGET includes the entire memory for the SGA, in con
trast to earlier releases in which memory for the internal and fixed SGA was add
ed to the sum of the configured SGA memory parameters. Thus, SGA_TARGET gives yo
u precise control over the size of the shared memory region allocated by the dat
abase. If SGA_TARGET is set to a value greater than SGA_MAX_SIZE at startup, the
n the latter is bumped up to accommodate SGA_TARGET
Do not dynamically set or unset the SGA_TARGET parameter. This should be set onl
y at startup.
SGA_TARGET is a database initialization parameter (introduced in Oracle 10g) tha
t can be used for automatic SGA memory sizing.
SGA_TARGET provides the following:
Single parameter for total SGA size
Automatically sizes SGA components
Memory is transferred to where most needed
Uses workload information
Uses internal advisory predictions
STATISTICS_LEVEL must be set to TYPICAL
SGA_TARGET is dynamic
Can be increased till SGA_MAX_SIZE
Can be reduced till some component reaches minimum size
Change in value of SGA_TARGET affects only automatically sized components
If I keep SGA_TARGET =0 then what will happen ?
Disable automatic SGA tuning by setting sga_target=0
Disable ASMM by setting SGA_TARGET=0
http://www.orafaq.com/wiki/SGA_target
SGA_TARGET is a database initialization parameter (introduced in Oracle 10g) tha
t can be used for automatic SGA memory sizing.
Default value 0 (SGA auto tuning is disabled)
What happens when you run ALTER DATABASE OPEN RESETLOGS ?
The current online redo logs are archived, the log sequence number is reset to 1
, new database incarnation is created, and the online redo logs are given a new
time stamp and SCN.
The reason to do the open the database with the resetlogs is that after doing an
incomplete recovery , the data files and control files still don t come to the sa
me point of the redo log files. And as long as the database is not consistent wi
thin all the three file-data, redo and control, you can t open the database. The r
esetlogs clause would reset the log sequence numbers within the log files and wo
uld start them from 0 thus enabling you to open the database but on the cost of
losing all what was there in the redo log files.
In what scenarios open resetlogs required ?
An ALTER DATABASE OPEN RESETLOGS statement is required,
1.after incomplete recovery (Point in Time Recovery) or
2.recovery with a backup control file.
3. recovery with a control file recreated with the reset logs option.
http://onlineappsdba.com/index.php/2009/09/11/oracle-database-incarnation-open-r
esetlogs-scn/
http://web.njit.edu/info/limpid/DOC/backup.102/b14191/osrecov009.htm
Whenever you perform incomplete recovery or recovery with a backup control file,
you must reset the online logs when you open the database. The new version of t
he reset database is called a new incarnation..
Difference between RESETLOGS and NORESETLOGS ?
http://oracleappstechnology.blogspot.in/2008/05/difference-between-resetlogs-and
.html
After recover database operation, open the database with:
ALTER DATABASE OPEN [NO]RESETLOGS
NORESETLOGS:
The NORESETLOGS option does not clear the redo log files during startup and the
online redo logs to be used for recovery. Only used in scenario where MANUAL REC
OVERY is started, CANCEL is used, and then RECOVER DATABASE is started.
RESETLOGS:
CAUTION: Never use RESETLOGS unless necessary.
Once RESETLOGS is used then the redo log files cannot be used and any completed
transactions in those redo logs are lost!!
Before using the RESETLOGS option take an offline backup of the database.
What is SCN (System Change Number) ?
The system change number (SCN) is an ever-increasing value that uniquely identif
ies a committed version of the database at a point in time. Every time a user co
mmits a transaction Oracle records a new SCN in redo logs.
Oracle uses SCNs in control files datafile headers and redo records. Every redo
log file has both a log sequence number and low and high SCN. The low SCN record
s the lowest SCN recorded in the log file while the high SCN records the highest
SCN in the log file.
What is Database Incarnation ?
Database incarnation is effectively a new version of the database that happens whe
n you reset the online redo logs using alter database open resetlogs; .
Database incarnation falls into following category Current, Parent, Ancestor and
Sibling
i) Current Incarnation : The database incarnation in which the database is curre
ntly generating redo.
ii) Parent Incarnation : The database incarnation from which the current incarna
tion branched following an OPEN RESETLOGS operation.
iii) Ancestor Incarnation : The parent of the parent incarnation is an ancestor
incarnation. Any parent of an ancestor incarnation is also an ancestor incarnati
on.
iv) Sibling Incarnation : Two incarnations that share a common ancestor are sibl
ing incarnations if neither one is an ancestor of the other.
How to view Database Incarnation history of Database ?
Using SQL> select * from v$database_incarnation;
Using RMAN>LIST INCARNATION;
However, you can use the RESET DATABASE TO INCARNATION command to specify that S
CNs are to be interpreted in the frame of reference of another incarnation.
For example my current database INCARNATION is 3 and now I have used
FLASHBACK DATABASE TO SCN 3000;then SCN 3000 will be search in current incarnati
on which is 3. However if I want to get back to SCN 3000 of INCARNATION 2 then I
have to use,
RMAN> RESET DATABASE TO INCARNATION 2;
RMAN> RECOVER DATABASE TO SCN 3000;
ORACLE BACKUP AND RECOVERY
How would you decide your backup strategy and timing for backup?
In fact backup strategy is purely depends upon your organization business need.
If no downtime then database must be run on archivelog mode and you have to take
frequently or daily backup.
If sufficient downtime is there and loss of data would not affect your business
then you can run your database in noarchivelog mode and backup can be taken in-f
requently or weekly or monthly.
In most of the case in an organization when no downtime then frequent inconsiste
nt backup needed (daily backup), multiplex online redo log files (multiple copie
s), different location for redo log files, database must run in archivelog mode
and dataguard can be implemented for extra bit of protection.
What is difference between Restoring and Recovery of database?
Restoring means copying the database object from the backup media to the destina
tion where actually it is required where as recovery means to apply the database
object copied earlier (roll forward) in order to bring the database into consis
tent state.
What is the difference between complete and incomplete recovery?
An incomplete database recovery is a recovery that it does not reach to the poin
t of failure. The recovery can be either point of time or particular SCN or Part
icular archive log specially incase of missing archive log or redolog failure wh
ere as a complete recovery recovers to the point of failure possibly when having
all archive log backup.
What is the benefit of running the DB in archivelog mode over no archivelog mode
?
When a database is in no archivelog mode whenever log switch happens there will
be a loss of some redoes log information in order to avoid this, redo logs must
be archived. This can be achieved by configuring the database in archivelog mode
.
If an oracle database is crashed?
How would you recover that transaction which is not in backup?
If the database is in archivelog we can recover that transaction otherwise we ca
nnot recover that transaction which is not in backup.
What is the difference between HOTBACKUP and RMAN backup?
For hotbackup we have to put database in begin backup mode, then take backup whe
re as RMAN would not put database in begin backup mode. RMAN is faster can perfo
rm incremental (changes only) backup, and does not place tablespace in hotbackup
mode.
Can we use Same target database as Catalog database?
No, the recovery catalog should not reside in the target database (database to b
e backed up) because the database can not be recovered in the mounted state.
Incremental backup levels:
Level 0 full backup that can be used for subsequent incrementals
RMAN> backup incremental level 0 database;
Differential Level 1 only the blocks that have changed since the last backup (whet
her it is level 0 or level 1)
RMAN> backup incremental level 1 differential database;
Cumulative Level 1 all changes since the last level 0 incremental backup
RMAN> backup incremental level 1 cumulative database;
A full backup cannot be used for a cumulative level 1 backup.
A cumulative level 1 backup must be done on top of an incremental level 0 backup
.
Why RMAN incremental backup fails even though full backup exists?
If you have taken the RMAN full backup using the command Backup database , where as
a level 0 backup is physically identical to a full backup. The only difference
is that the level 0 backup is recorded as an incremental backup in the RMAN repo
sitory so it can be used as the parent for a level 1 backup. Simply the full back
up without level 0 can not be considered as a parent backup from which you can ta
ke level 1 backup.
Can we perform RMAN level 1 backup without level 0?
If no level 0 is available, then the behavior depends upon the compatibility mod
e setting (oracle version).
If the compatibility mode less than 10.0.0, RMAN generates a level 0 backup of f
iles contents at the time of backup.
If the compatibility is greater than 10.0.0, RMAN copies all block changes since
the file was created, and stores the results as level 1 backup.
How to put Manual/User managed backup in RMAN?
In case of recovery catalog, you can put by using catalog command:
RMAN> CATALOG START WITH /oracle/backup.ctl ;
How to check RMAN version in oracle?
If you want to check RMAN catalog version then use the below query from SQL*plus
SQL> Select * from rcver;
What happens actually in case of instance Recovery?
While Oracle instance fails, Oracle performs an Instance Recovery when the assoc
iated database is being re-started. Instance recovery occurs in 2 steps:
Cache recovery: Changes being made to a database are recorded in the database bu
ffer cache as well as redo log files simultaneously. When there are enough data
in the database buffer cache, they are written to data files. If an Oracle insta
nce fails before these data are written to data files, Oracle uses online redo l
og files to recover the lost data when the associated database is re-started. Th
is process is called cache recovery.
Transaction recovery: When a transaction modifies data in a database (the before
image of the modified data is stored in an undo segment which is used to restor
e the original values in case the transaction is rolled back). At the time of an
instance failure, the database may have uncommitted transactions. It is possibl
e that changes made by these uncommitted transactions have gotten saved in data
files. To maintain read consistency, Oracle rolls back all uncommitted transacti
ons when the associated database is re-started. Oracle uses the undo data stored
in undo segments to accomplish this. This process is called transaction recover
y.
ORACLE PATCHING,CLONING & UPGRADE
When you moved oracle binary files from one ORACLE_HOME server to another server
then which oracle utility will be used to make this new ORACLE_HOME usable?
Relink all.
In which months oracle release CPU patches?
JAN, APR, JUL, OCT
When we applying single Patch, can you use opatch utility?
Yes, you can use Opatch incase of single patch. The only type of patch that cann
ot be used with OPatch is a patchset.
Is it possible to apply OPATCH without downtime?
As you know for apply patch your database and listener must be down. When you ap
ply OPTACH it will update your current ORACLE_HOME. Thus coming to your question
to the point in fact it is not possible without or zero downtime in case of sin
gle instance but in RAC you can Apply Opatch without downtime as there will be m
ore separate ORACLE_HOME and more separate instances (running once instance on e
ach ORACLE_HOME).
You have collection of patch (nearly 100 patches) or patchset. How can you apply
only one patch from it?
With Napply itself (by providing patch location and specific patch id) you can a
pply only one patch from a collection of extracted patch. For more information c
heck the opatch util NApply help. It will give you clear picture.
For Example:
opatch util napply -id 9 -skip_subset -skip_duplicate
This will apply only the patch id 9 from the patch location and will skip duplic
ate and subset of patch installed in your ORACLE_HOME.
If both CPU and PSU are available for given version which one, you will prefer t
o apply?
From the above discussion it is clear once you apply the PSU then the recommende
d way is to apply the next PSU only. In fact, no need to apply CPU on the top of
PSU as PSU contain CPU (If you apply CPU over PSU will considered you are tryin
g to rollback the PSU and will require more effort in fact). So if you have not
decided or applied any of the patches then, I will suggest you to go to use PSU
patches. For more details refer: Oracle Products [ID 1430923.1], ID 1446582.1
PSU is superset of CPU then why someone choose to apply a CPU rather than a PSU?
CPUs are smaller and more focused than PSU and mostly deal with security issues.
It seems to be theoretically more consecutive approach and can cause less troub
le than PSU as it has less code changing in it. Thus any one who is concerned on
ly with security fixes and not functionality fixes, CPU may be good approach.
How to Download Patches, Patchset or Opatch from metalink?
If you are using latest support.oracle.com then after login to metalink Dashboar
d
Click on Patches & Updates tab
On the left sidebar click on Latest Patchsets under Oracle Server/Tools .
A new window will appear.
Just mouseover on your product in the Latest Oracle Server/Tools Patchsets page.
Corresponding oracle platform version will appear. Then simply choose the patchs
et version and click on that.
You will go the download page. From the download page you can also change your p
latform and patchset version.
REFERENCES:
http://docs.oracle.com/cd/E11857_01/em.111/e12255/e_oui_appendix.htm
Oracle Universal Installer and OPatch User s Guide
11g Release 2 (11.2) for Windows and UNIX
Part Number E12255-11
What is the recent Patch applied?
What is OPatch?
How to Apply Opatch in Oracle?
1. You MUST read the Readme.txt file included in opatch file, look for any prere
q. steps/ post installation steps or and DB related changes. Also, make sure tha
t you have the correct opatch version required by this patch.
2.Make sure you have a good backup of database.
3. Make a note of all Invalid objects in the database prior to the patch.
4. Shutdown All the Oracle Processes running from that Oracle Home , including t
he Listener and Database instance, Management agent etc.
5. You MUST Backup your oracle Home and Inventory
tar -cvf $ORACLE_HOME $ORACLE_HOME/oraInventory | gzip > Backup_Software_Version
.tar.gz
6. Unzip the patch in $ORACLE_HOME/patches
7. cd to the patch direcory and do opatch -apply to apply the patch.
8. Read the output/log file to make sure there were no errors.
Patching Oracle Software with OPatch ?
opatch napply -skip_subset -skip_duplicate
OPatch skips duplicate patches and subset patches (patches under that are subset
s of patches installed in the Oracle home).
What is Opactch in Oracle?
OPATCH Utility (Oracle RDBMS Patching)
1. Download the required Patch from Metalink based on OS Bit Version and DB Vers
ion.
2. Need to down the database before applying patch.
3. Unzip and Apply the Patch using opatch apply command.On successfully applied of
patch you will see successful message OPatch succeeded. , Crosscheck your patch is
applied by using opatch lsinventory command .
4. Each patch has a unique ID, the command to rollback a patch is opatch rollback
-id command.On successfully applied of patch you will see successful message OPa
tch succeeded. , Crosscheck your patch is applied by using opatch lsinventory comman
d .
5. Patch file format will be like, p__.zip
6. We can check the opatch version using opatch -version command.
7. Generally, takes 2 minutes to apply a patch.
8. To get latest Opatch version download patch 6880880 latest opatch tool , it cont
ains OPatch directory.
9. Contents of downloaded patches will be like etc,files directories and a README
file
10. Log file for Opatch utility can be found at $ORACLE_HOME/cfgtoollogs/opatch
11. OPatch also maintains an index of the commands executed with OPatch and the
log files associated with it in the history.txt file located in the /cfgtoollogs
/opatch directory.
12. Starting with the 11.2.0.2 patch set, Oracle Database patch sets are full in
stallations of the Oracle Database software. This means that you do not need to
install Oracle Database 11g Release 2 (11.2.0.1) before installing Oracle Databa
se 11g Release 2 (11.2.0.2).
13. Direct upgrade to Oracle 10g is only supported if your database is running o
ne of the following releases: 8.0.6, 8.1.7, 9.0.1, or 9.2.0. If not, you will ha
ve to upgrade the database to one of these releases or use a different upgrade o
ption (like export/ import).
14.Direct upgrades to 11g are possible from existing databases with versions 9.2
.0.4+, 10.1.0.2+ or 10.2.0.1+. Upgrades from other versions are supported only v
ia intermediate upgrades to a supported upgrade version.
http://avdeo.com/2008/08/19/opatch-utility-oracle-rdbms-patching/
Oracle version 10.2.0.4.0 what does each number refers to?
Oracle version number refers:
10 Major database release number
2 Database Maintenance release number
0 Application server release number
4 Component Specific release number
0 Platform specific release number
ORACLE ASM
What is ASM in Oracle?
Oracle ASM is Oracle s volume manager specially designed for Oracle database data.
It is available since Oracle database version 10g and many improvements have be
en made in versions 11g release 1 and 2.
ASM offers support for Oracle RAC clusters without the requirement to install 3r
d party software, such as cluster aware volume managers or filesystems.
ASM is shipped as part of the database server software (Enterprise and Standard
editions) and does not cost extra money to run.
ASM simplifies administration of Oracle related files by allowing the administra
tor to reference disk groups
rather than individual disks and files, which are managed by ASM.
The ASM functionality is an extention of the Oracle Managed Files (OMF) function
ality that also includes striping and mirroring to provide balanced and secure s
torage. The new ASM functionality can be used in combination with existing raw a
nd cooked file systems, along with OMF and manually managed files.
Advantages of ASM in Oracle?
Provides automatic load balancing over all the available disks, thus reducing ho
t spots in the file system
Prevents fragmentation of disks, so you don t need to manually relocate data to tu
ne I/O performance
Adding disks is straight forward ASM automatically performs online disk reorgani
zation when you add or remove storage
Uses redundancy features available in intelligent storage arrays
The storage system can store all types of database files
Using disk group makes configuration easier, as files are placed into disk group
s
ASM provides stripping and mirroring (fine and coarse gain see below)
ASM and non-ASM oracle files can coexist
Striping ASM spreads data evenly across all disks in a disk group to optimize perf
ormance and utilization. This even distribution of database files eliminates the
need for regular monitoring and I/O performance tuning.
For example, if there are six disks in a disk group, pieces of each ASM file are
written to all six disks. These pieces come in 1 MB chunks known as extents. Wh
en a database file is created, it is striped (divided into extents and distribut
ed) across the six disks, and allocated disk space on all six disks grows evenly
. When reading the file, file extents are read from all six disks in parallel, g
reatly increasing performance.
Mirroring ASM can increase availability by optionally mirroring any file. ASM mirr
ors at the file level, unlike operating system mirroring, which mirrors at the d
isk level. Mirroring means keeping redundant copies, or mirrored copies, of each
extent of the file, to help avoid data loss caused by disk failures. The mirror
ed copy of each file extent is always kept on a different disk from the original
copy. If a disk fails, ASM can continue to access affected files by accessing m
irrored copies on the surviving disks in the disk group.
ASM supports 2-way mirroring, where each file extent gets one mirrored copy, and
3-way mirroring, where each file extent gets two mirrored copies.
Online storage reconfiguration and dynamic rebalancing ASM permits you to add or r
emove disks from your disk storage system while the database is operating. When
you add a disk, ASM automatically redistributes the data so that it is evenly sp
read across all disks in the disk group, including the new disk. This redistribu
tion is known as rebalancing. It is done in the background and with minimal impa
ct to database performance. When you request to remove a disk, ASM first rebalan
ces by evenly relocating all file extents from the disk being removed to the oth
er disks in the disk group.
Managed file creation and deletion ASM further reduces administration tasks by ena
bling files stored in ASM disk groups to be Oracle-managed files. ASM automatica
lly assigns filenames when files are created, and automatically deletes files wh
en they are no longer needed.
What is ASM instance in Oracle?
The ASM functionality is controlled by an ASM instance. This is not a full datab
ase instance, just the memory structures and as such is very small and lightweig
ht.
Characteristics of Oracle ASM instance
1. do not have controlfile and datafiles, do not have online redo logs
2. do have init.ora and a passwordfile
3. for connecting remotely, create passwordfile and set following in init.ora
remote_login_passwordfile=exclusive
create a password file:
$ORACLE_HOME/bin/orapwd file=orapw+ASM1 password=yourpw entries=10
4. ASM instance can not be in open status as there are not datafiles. Can be in
mount (although
there is no controlfile) and nomount status. When in mount status, database can
use the
diskgroup. The mount status actually means mount disk groups.
What are ASM Background Processes in Oracle?
Both an Oracle ASM instance and an Oracle Database instance are built on the sam
e technology. Like a database instance, an Oracle ASM instance has memory struct
ures (System Global Area) and background processes. Besides, Oracle ASM has a mi
nimal performance impact on a server. Rather than mounting a database, Oracle AS
M instances mount disk groups to make Oracle ASM files available to database ins
tances.
There are at least two new background processes added for an ASM instance:
ASM Instance Background Processes:
ARBx (ASM) Rebalance working processARBn performs the actual rebalance data exte
nt movements in an Automatic Storage Management instance. There can be many of t
hese processes running at a time, named ARB0, ARB1, and so on.These processes ar
e managed by the RBAL process. The number of ARBx processes invoked is directly
influenced by the asm_power_limit parameter.
RBAL (Re-balancer) RBAL runs in both database and ASM instances. In the database
instance, it does a global open of ASM disks. In an ASM instance, it also coord
inates rebalance activity for disk groups.RBAL, which coordinates rebalance acti
vities
for disk resources controlled by ASM.
Database Instance ASM Background Processes:
In the database instances, there are three background process to support ASM, na
mely:
ASMB, this process contact CSS using the group name and acquires the associated
ASM connect string. The connect string is subsequently used to connect to the AS
M instance.
RBAL, which performs global opens on all disks in the disk group.A global open m
eans that more than one database instance can be accessing the ASM disks at a ti
me.
O00x, a group slave processes, with a numeric sequence starting at 000.
What are the components of components of ASM are disk groups?
The main components of ASM are disk groups, each of which comprise of several ph
ysical disks that are controlled as a single unit. The physical disks are known
as ASM disks, while the files that reside on the disks are know as ASM files. Th
e locations and names for the files are controlled by ASM, but user-friendly ali
ases and directory structures can be defined for ease of reference.
Failure groups are defined within a disk group to support the required level of
redundancy. For two-way mirroring you would expect a disk group to contain two f
ailure groups so individual files are written to two locations.
What are ASM instance initialization parameters?
INSTANCE_TYPE Set to ASM or RDBMS depending on the instance type. The default is
RDBMS.
DB_UNIQUE_NAME Specifies a globally unique name for the database. This defaults
to +ASM but must be altered if you intend to run multiple ASM instances.
ASM_POWER_LIMIT -The maximum power for a rebalancing operation on an ASM instanc
e. The valid values range from 1 to 11, with 1 being the default. The higher the
limit the more resources are allocated resulting in faster rebalancing operatio
ns. This value is also used as the default when the POWER clause is omitted from
a rebalance operation.
ASM_DISKGROUPS The list of disk groups that should be mounted by an ASM instance
during instance startup, or by the ALTER DISKGROUP ALL MOUNT statement. ASM con
figuration changes are automatically reflected in this parameter.
ASM_DISKSTRING Specifies a value that can be used to limit the disks considered
for discovery. Altering the default value may improve the speed of disk group mo
unt time and the speed of adding a disk to a disk group. Changing the parameter
to a value which prevents the discovery of already mounted disks results in an e
rror. The default value is NULL allowing all suitable disks to be considered.
Advantages of ASM in Oracle?
Provides automatic load balancing over all the available disks, thus reducing ho
t spots in the file system
Prevents fragmentation of disks, so you don t need to manually relocate data to tu
ne I/O performance
Adding disks is straight forward ASM automatically performs online disk reorgani
zation when you add or remove storage
Uses redundancy features available in intelligent storage arrays
The storage system can store all types of database files
Using disk group makes configuration easier, as files are placed into disk group
s
ASM provides stripping and mirroring (fine and coarse gain see below)
ASM and non-ASM oracle files can coexist
Striping ASM spreads data evenly across all disks in a disk group to optimize perf
ormance and utilization. This even distribution of database files eliminates the
need for regular monitoring and I/O performance tuning.
For example, if there are six disks in a disk group, pieces of each ASM file are
written to all six disks. These pieces come in 1 MB chunks known as extents. Wh
en a database file is created, it is striped (divided into extents and distribut
ed) across the six disks, and allocated disk space on all six disks grows evenly
. When reading the file, file extents are read from all six disks in parallel, g
reatly increasing performance.
Mirroring ASM can increase availability by optionally mirroring any file. ASM mi
rrors at the file level, unlike operating system mirroring, which mirrors at the
disk level. Mirroring means keeping redundant copies, or mirrored copies, of ea
ch extent of the file, to help avoid data loss caused by disk failures. The mirr
ored copy of each file extent is always kept on a different disk from the origin
al copy. If a disk fails, ASM can continue to access affected files by accessing
mirrored copies on the surviving disks in the disk group.
ASM supports 2-way mirroring, where each file extent gets one mirrored copy, and
3-way mirroring, where each file extent gets two mirrored copies.
Online storage reconfiguration and dynamic rebalancing ASM permits you to add or r
emove disks from your disk storage system while the database is operating. When
you add a disk, ASM automatically redistributes the data so that it is evenly sp
read across all disks in the disk group, including the new disk. This redistribu
tion is known as rebalancing. It is done in the background and with minimal impa
ct to database performance. When you request to remove a disk, ASM first rebalan
ces by evenly relocating all file extents from the disk being removed to the oth
er disks in the disk group.
Managed file creation and deletion ASM further reduces administration tasks by ena
bling files stored in ASM disk groups to be Oracle-managed files. ASM automatica
lly assigns filenames when files are created, and automatically deletes files wh
en they are no longer needed.
Why should we use separate ASM home?
ASM should be installed separately from the database software in its own ORACLE_
HOME directory. This will allow you the flexibility to patch and upgrade ASM and
the database software independently.
How many ASM instances should one have?
Several databases can share a single ASM instance. So, although one can create m
ultiple ASM instances on a single system, normal configurations should have one
and only one ASM instance per system.
For clustered systems, create one ASM instance per node (called +ASM1, +ASM2, et
c).
How many diskgroups should one have?
Generally speaking one should have only one disk group for all database files an
d, optionally a second for recovery files (see FRA).
Data with different storage characteristics should be stored in different disk g
roups. Each disk group can have different redundancy (mirroring) settings (high,
normal and external), different fail-groups, etc. However, it is generally not
necessary to create many disk groups with the same storage characteristics (i.e.
+DATA1, +DATA2, etc. all on the same type of disks).
To get started, create 2 disk groups one for data and one for recovery files. He
re is an example:
CREATE DISKGROUP data EXTERNAL REDUNDANCY DISK /dev/d1', /dev/d2', /dev/d3', .;
CREATE DISKGROUP recover EXTERNAL REDUNDANCY DISK /dev/d10', /dev/d11', /dev/d12', .
;
Here is an example how you can enable automatic file management with such a setu
p:
ALTER SYSTEM SET db_create_file_dest = +DATA SCOPE=SPFILE;
ALTER SYSTEM SET db_recovery_file_dest = +RECOVER SCOPE=SPFILE;
You may also decide to introduce additional disk groups for example, if you deci
de to put historic data on low cost disks, or if you want ASM to mirror critical
data across 2 storage cabinets.
What is ASM Rebalancing?
The rebalancing speed is controlled by the ASM_POWER_LIMIT initialization parame
ter. Setting it to 0 will disable disk rebalancing.
ALTER DISKGROUP data REBALANCE POWER 11;
What happens when an Oracle ASM diskgroup is created?
When an ASM diskgroup is created, a hierarchialfilesystem structure is created.
How does this filesystem structure appear?
Oracle ASM diskgroup sfilesystem structure is similar to UNIX filesystem hierarchy
or Windows filesystem hierarchy.
Where are the Oracle ASM files stored?
Oracle ASM files are stored within the Oracle ASM diskgroup. If we dig into inte
rnals, oracle ASM files are stored within the Oracle ASM filesystem structures.
How are the Oracle ASM files stored within the Oracle ASM filesystem structure?
Oralce ASM files are stored within the Oracle ASM filesystem structures as objec
ts that RDBMS instances/Oracle database instance access. RDBMS/Oracle instance t
reats the Oracle ASM files as standard filesystem files.
What are the Oracle ASM files that are stored within the Oracle ASM file hierarc
hy?
Files stored in Oracle ASM diskgroup/Oracl ASM filestructures include:
1) Datafile
2) Controlfiles
3) Server Parameter Files(SPFILE)
4) Redo Log files
What happens when you create a file/database file in ASM?What commands do you us
e to create database files?
Some common commands used for creating database files are :
1) Create tabespace
2) Add Datafile
3) Add Logfile
For example,
SQL> CREATE TABLESPACE TS1 DATAFILE +DATA1' SIZE 10GB;
Above command creates a datafile in DATA1 diskgroup
How can you access a databasefile in ASM diskgroup under RDBMS?
Once the ASM file is created in ASM diskgroup, a filename is generated. This fil
e is now visible to the user via the standard RDBMS view V$DATAFILE.
What will be the syntax of ASM filenames?
ASM filename syntax is as follows:
+diskgroup_name/database_name/database_file_type/tag_name.file_number.incarnatio
n
where,
+diskgroup_name Name of the diskgroup that contains this file
database_name Name of the database that contains this file
datafile Can be one among 20 different ASM file types
tag_name corresponds to tablespace name for datafiles, groupnumber for redo log
files
file_number file_number in ASM instance is used to correlate filenames in databa
se instance
incarnation_number It is derived from the timestamp. IT is used to provide uniqu
eness
What is an incarnation number?
An incarnation number is a part of ASM filename syntax. It is derived from the t
imestamp. Once the file is created, its incarnation number doesnot change.
What is the use of an incarnation number in Oracle ASM filename?
Incarnation number distinguishes between a new file that has been created using
the same file number and another file that has been deleted
ASM s SPFile will be residing inside ASM itself. This could be found out in number
of ways, looking at the alert log of ASM when ASM starts
Machine: x86_64
Using parameter settings in server-side spfile +DATA/asm/asmparameterfile/regist
ry.253.766260991
System parameters with non-default values:
large_pool_size = 12M
instance_type = asm
remote_login_passwordfile= EXCLUSIVE
asm_diskgroups = FLASH
asm_diskgroups = DATA
asm_power_limit = 1
diagnostic_dest = /opt/app/oracle
Or using the asmcmd s spget command which shows the spfile location registered wit
h GnP profile
ASMCMD> spget
+DATA/asm/asmparameterfile/registry.253.766260991
ORACLE RAC
What is RAC? What is the benefit of RAC over single instance database?
In Real Application Clusters environments, all nodes concurrently execute transa
ctions against the same database. Real Application Clusters coordinates each nod
e s access to the shared data to provide consistency and integrity.
Benefits:
Improve response time
Improve throughput
High availability
Transparency
What is Oracle RAC One Node?
Oracle RAC one Node is a single instance running on one node of the cluster whil
e the 2nd node is in cold standby mode. If the instance fails for some reason th
en RAC one node detect it and restart the instance on the same node or the insta
nce is relocate to the 2nd node incase there is failure or fault in 1st node. Th
e benefit of this feature is that it provides a cold failover solution and it au
tomates the instance relocation without any downtime and does not need a manual
intervention. Oracle introduced this feature with the release of 11gR2 (availabl
e with Enterprise Edition).
Real Application Clusters
Oracle RAC is a cluster database with a shared cache architecture that overcomes
the limitations of traditional shared-nothing and shared-disk approaches to pro
vide a highly scalable and available database solution for all your business app
lications. Oracle RAC provides the foundation for enterprise grid computing.
Oracle s Real Application Clusters (RAC) option supports the transparent deploymen
t of a single database across a cluster of servers, providing fault tolerance fr
om hardware failures or planned outages. Oracle RAC running on clusters provides
Oracle s highest level of capability in terms of availability, scalability, and l
ow-cost computing.
One DB opened by multipe instances so the the db ll be Highly Available if an in
stance crashes.
Cluster Software. Oracles Clusterware or products like Veritas Volume Manager ar
e required to provide the cluster support and allow each node to know which node
s belong to the cluster and are available and with Oracle Cluterware to know whi
ch nodes have failed and to eject then from the cluster, so that errors on that
node can be cleared.
Oracle Clusterware has two key components Cluster Registry OCR and Voting Disk.
The cluster registry holds all information about nodes, instances, services and
ASM storage if used, it also contains state information ie they are available an
d up or similar.
The voting disk is used to determine if a node has failed, i.e. become separated
from the majority. If a node is deemed to no longer belong to the majority then
it is forcibly rebooted and will after the reboot add itself again the the surv
iving cluster nodes.
Advantages of RAC (Real Application Clusters)
Reliability if one node fails, the database won t fail
Availability nodes can be added or replaced without having to shutdown the datab
ase
Scalability more nodes can be added to the cluster as the workload increases
What is a virtual IP address or VIP?
A virtual IP address or VIP is an alternate IP address that the client connectio
ns use instead of the standard public IP address. To configure VIP address, we n
eed to reserve a spare IP address for each node, and the IP addresses must use t
he same subnet as the public network.
What is the use of VIP?
If a node fails, then the node s VIP address fails over to another node on which t
he VIP address can accept TCP connections but it cannot accept Oracle connection
s.
Give situations under which VIP address failover happens:-
VIP addresses failover happens when the node on which the VIP address runs fails
, all interfaces for the VIP address fails, all interfaces for the VIP address a
re disconnected from the network.
Using virtual IP we can save our TCP/IP timeout problem because Oracle notificat
ion service maintains communication between each nodes and listeners.
What is the significance of VIP address failover?
When a VIP address failover happens, Clients that attempt to connect to the VIP
address receive a rapid connection refused error .They don t have to wait for TCP
connection timeout messages.
What is voting disk?
Voting Disk is a file that sits in the shared storage area and must be accessibl
e by all nodes in the cluster. All nodes in the cluster registers their heart-be
at information in the voting disk, so as to confirm that they are all operationa
l. If heart-beat information of any node in the voting disk is not available tha
t node will be evicted from the cluster. The CSS (Cluster Synchronization Servic
e) daemon in the clusterware maintains the heart beat of all nodes to the voting
disk. When any node is not able to send heartbeat to voting disk, then it will
reboot itself, thus help avoiding the split-brain syndrome.
For high availability, Oracle recommends that you have a minimum of three or odd
number (3 or greater) of votingdisks.
Voting Disk is file that resides on shared storage and Manages cluster members.
Voting disk reassigns cluster ownership between the nodes in case of failure.
The Voting Disk Files are used by Oracle Clusterware to determine which nodes ar
e currently members of the cluster. The voting disk files are also used in conce
rt with other Cluster components such as CRS to maintain the clusters integrity.
Oracle Database 11g Release 2 provides the ability to store the voting disks in
ASM along with the OCR. Oracle Clusterware can access the OCR and the voting dis
ks present in ASM even if the ASM instance is down. As a result CSS can continue
to maintain the Oracle cluster even if the ASM instance has failed.
How many voting disks are you maintaining ?
http://www.toadworld.com/KNOWLEDGE/KnowledgeXpertforOracle/tabid/648/TopicID/RAC
R2ARC6/Default.aspx
By default Oracle will create 3 voting disk files in ASM.
Oracle expects that you will configure at least 3 voting disks for redundancy pu
rposes. You should always configure an odd number of voting disks >= 3. This is
because loss of more than half your voting disks will cause the entire cluster t
o fail.
You should plan on allocating 280MB for each voting disk file. For example, if y
ou are using ASM and external redundancy then you will need to allocate 280MB of
disk for the voting disk. If you are using ASM and normal redundancy you will n
eed 560MB.
Why we need to keep odd number of voting disks ?
Oracle expects that you will configure at least 3 voting disks for redundancy pu
rposes. You should always configure an odd number of voting disks >= 3. This is
because loss of more than half your voting disks will cause the entire cluster t
o fail.
What are Oracle RAC software components?
Oracle RAC is composed of two or more database instances. They are composed of M
emory structures and background processes same as the single instance database.O
racle RAC instances use two processes GES(Global Enqueue Service), GCS(Global Ca
che Service) that enable cache fusion.Oracle RAC instances are composed of follo
wing background processes:
ACMS Atomic Controlfile to Memory Service (ACMS)
GTX0-j Global Transaction Process
LMON Global Enqueue Service Monitor
LMD Global Enqueue Service Daemon
LMS Global Cache Service Process
LCK0 Instance Enqueue Process
RMSn Oracle RAC Management Processes (RMSn)
RSMN Remote Slave Monitor
What are Oracle Clusterware processes for 10g ?
Cluster Synchronization Services (ocssd) Manages cluster node membership and run
s as the oracle user; failure of this process results in cluster restart.
Cluster Ready Services (crsd) The crs process manages cluster resources (which c
ould be a database, an instance, a service, a Listener, a virtual IP (VIP) addre
ss, an application process, and so on) based on the resource s configuration infor
mation that is stored in the OCR. This includes start, stop, monitor and failove
r operations. This process runs as the root user
Event manager daemon (evmd) A background process that publishes events that crs c
reates.
Process Monitor Daemon (OPROCD) This process monitor the cluster and provide I/O
fencing. OPROCD performs its check, stops running, and if the wake up is beyond
the expected time, then OPROCD resets the processor and reboots the node. An OPR
OCD failure results in Oracle Clusterware restarting the node. OPROCD uses the h
angcheck timer on Linux platforms.
RACG (racgmain, racgimon) Extends clusterware to support Oracle-specific requirem
ents and complex resources. Runs server callout scripts when FAN events occur.
What are Oracle database background processes specific to RAC?
LMS Global Cache Service Process
LMD Global Enqueue Service Daemon
LMON Global Enqueue Service Monitor
LCK0 Instance Enqueue Process
Oracle RAC instances use two processes, the Global Cache Service (GCS) and the G
lobal Enqueue Service (GES). The GCS and GES maintain records of the statuses of
each data file and each cached block using a Global Resource Directory (GRD). T
he GRD contents are distributed across all of the active instances.
What is Cache Fusion?
Transfor of data across instances through private interconnect is called cachefu
sion.Oracle RAC is composed of two or more instances. When a block of data is re
ad from datafile by an instance within the cluster and another instance is in ne
ed of the same block,it is easy to get the block image from the insatnce which h
as the block in its SGA rather than reading from the disk. To enable inter insta
nce communication Oracle RAC makes use of interconnects. The Global Enqueue Serv
ice(GES) monitors and Instance enqueue process manages the cahce fusion
What is SCAN? (11gR2 feature)
Single Client Access Name (SCAN) is s a new Oracle Real Application Clusters (RA
C) 11g Release 2 feature that provides a single name for clients to access an Or
acle Database running in a cluster. The benefit is clients using SCAN do not nee
d to change if you add or remove nodes in the cluster.
SCAN provides a single domain name via (DNS), allowing and-users to address a RA
C cluster as-if it were a single IP address. SCAN works by replacing a hostname
or IP list with virtual IP addresses (VIP).
Single client access name (SCAN) is meant to facilitate single name for all Orac
le clients to connect to the cluster database, irrespective of number of nodes a
nd node location. Until now, we have to keep adding multiple address records in
all clients tnsnames.ora, when a new node gets added to or deleted from the clus
ter.
Single Client Access Name (SCAN) eliminates the need to change TNSNAMES entry wh
en nodes are added to or removed from the Cluster. RAC instances register to SCA
N listeners as remote listeners. Oracle recommends assigning 3 addresses to SCAN
, which will create 3 SCAN listeners, though the cluster has got dozens of nodes
.. SCAN is a domain name registered to at least one and up to three IP addresses
, either in DNS (Domain Name Service) or GNS (Grid Naming Service). The SCAN mus
t resolve to at least one address on the public network. For high availability a
nd scalability, Oracle recommends configuring the SCAN to resolve to three addre
sses.
http://www.freeoraclehelp.com/2011/12/scan-setup-for-oracle-11g-release211gr2.ht
ml
What are SCAN components in a cluster?
1.SCAN Name
2.SCAN IPs (3)
3.SCAN Listeners (3)
What is FAN?
Fast application Notification as it abbreviates to FAN relates to the events rel
ated to instances,services and nodes.This is a notification mechanism that Oracl
e RAc uses to notify other processes about the configuration and service level i
nformation that includes service status changes such as,UP or DOWN events.Applic
ations can respond to FAN events and take immediate action.
What is TAF?
TAF (Transparent Application Failover) is a configuration that allows session fa
il-over between different nodes of a RAC database cluster.
Transparent Application Failover (TAF). If a communication link failure occurs a
fter a connection is established, the connection fails over to another active no
de. Any disrupted transactions are rolled back, and session properties and serve
r-side program variables are lost. In some cases, if the statement executing at
the time of the failover is a Select statement, that statement may be automatica
lly re-executed on the new connection with the cursor positioned on the row on w
hich it was positioned prior to the failover.
After an Oracle RAC node crashes usually from a hardware failure all new application
transactions are automatically rerouted to a specified backup node. The challen
ge in rerouting is to not lose transactions that were in flight at the exact momen
t of the crash. One of the requirements of continuous availability is the abilit
y to restart in-flight application transactions, allowing a failed node to resum
e processing on another server without interruption. Oracle s answer to applicatio
n failover is a new Oracle Net mechanism dubbed Transparent Application Failover
. TAF allows the DBA to configure the type and method of failover for each Oracl
e Net client.
TAF architecture offers the ability to restart transactions at either the transa
ction (SELECT) or session level.
What are the requirements for Oracle Clusterware?
1. External Shared Disk to store Oracle Cluster ware file (Voting Disk and Oracl
e Cluster Registry OCR)
2. Two netwrok cards on each cluster ware node (and three set of IP address)
Network Card 1 (with IP address set 1) for public network
Network Card 2 (with IP address set 2) for private network (for inter node commu
nication between rac nodes used by clusterware and rac database)
IP address set 3 for Virtual IP (VIP) (used as Virtual IP address for client con
nection and for connection failover)
3. Storage Option for OCR and Voting Disk RAW, OCFS2 (Oracle Cluster File System
), NFS, ..
Which enable the load balancing of applications in RAC?
Oracle Net Services enable the load balancing of application connections across
all of the instances in an Oracle RAC database.
How to find location of OCR file when CRS is down?
If you need to find the location of OCR (Oracle Cluster Registry) but your CRS i
s down.
When the CRS is down:
Look into ocr.loc file, location of this file changes depending on the OS:
On Linux: /etc/oracle/ocr.loc
On Solaris: /var/opt/oracle/ocr.loc
When CRS is UP:
Set ASM environment or CRS environment then run the below command:
ocrcheck
In 2 node RAC, how many NIC s are r using ?
2 network cards on each clusterware node
Network Card 1 (with IP address set 1) for public network
Network Card 2 (with IP address set 2) for private network (for inter node commu
nication between rac nodes used by clusterware and rac database)
In 2 node RAC, how many IP s are r using ?
6 3 set of IP address
## eth1-Public: 2
## eth0-Private: 2
## VIP: 2
How to find IP s information in RAC ?
Edit the /etc/hosts file as shown below:
# Do not remove the following line, or various programs
# that requires network functionality will fail.
127.0.0.1 localhost.localdomain localhost
## Public Node names
192.168.10.11 node1-pub.hingu.net node1-pub
192.168.10.22 node2-pub.hingu.net node2-pub
## Private Network (Interconnect)
192.168.0.11 node1-prv node1-prv
192.168.0.22 node2-prv node2-prv
## Private Network (Network Area storage)
192.168.1.11 node1-nas node1-nas
192.168.1.22 node2-nas node2-nas
192.168.1.33 nas-server nas-server
## Virtual IPs
192.168.10.111 node1-vip.hingu.net node1-vip
192.168.10.222 node2-vip.hingu.net node2-vip
What is difference between RAC ip addresses ?
Public IP adress is the normal IP address typically used by DBA and SA to manage
storage, system and database. Public IP addresses are reserved for the Internet
.
Private IP address is used only for internal clustering processing (Cache Fusion
) (aka as interconnect). Private IP addresses are reserved for private networks.
VIP is used by database applications to enable fail over when one cluster node f
ails. The purpose for having VIP is so client connection can be failover to surv
iving nodes in case there is failure
Can application developer access the private ip ?
No. private IP address is used only for internal clustering processing (Cache Fu
sion) (aka as interconnect)
ORACLE DATAGUARD
What is Dataguard?
Data Guard provides a comprehensive set of services that create, maintain, manag
e, and monitor one or more standby databases to enable production Oracle databas
es to survive disasters and data corruptions. Data Guard maintains these standby
databases as copies of the production database. Data Guard can be used with tra
ditional backup, restoration, and cluster techniques to provide a high level of
data protection and data availability.
What is DG Broker?
DG Broker it is the management and monitoring tool .
Oracle dataguard broker is a distributed management framework that automates and
centralizes the creation , maintenance and monitoring of DG configuration.
All management operations can be performed either through OEM, which uses the br
oker (or) broker specified command-line tool interface DGMGRL .
What is the difference between Dataguard and Standby?
Dataguard :
Dataguard is mechanism/tool to maintain standby database.
The dataguard is set up between primary and standby instance .
Data Guard is only available on Enterprise Edition.
Standby Database :
Physical standby database provides a physically identical copy of the primary da
tabase, with on disk database structures that are identical to the primary datab
ase on a block-for-block basis.
Standby capability is available on Standard Edition.
REFERENCE:
http://neeraj-dba.blogspot.in/2011/06/difference-between-dataguard-and.html
What are the differences between Physical/Logical standby databases? How would y
ou decide which one is best suited for your environment?
Physical standby DB:
As the name, it is physically (datafiles, schema, other physical identity) same
copy of the primary database.
It synchronized with the primary database with Apply Redo to the standby DB.
Logical Standby DB:
As the name logical information is the same as the production database, it may b
e physical structure can be different.
It synchronized with primary database though SQL Apply, Redo received from the p
rimary database into SQL statements and then executing these SQL statements on t
he standby DB.
We can open physical stand by DB to read only and make it available to the applicat
ions users (Only select is allowed during this period). we can not apply redo lo
gs received from primary database at this time.
We do not see such issues with logical standby database. We can open the databas
e in normal mode and make it available to the users. At the same time, we can ap
ply archived logs received from primary database.
For OLTP large transaction database it is better to choose logical standby datab
ase.
Explain Active Dataguard?
11g Active Data Guard
Oracle Active Data Guard enables read-only access to a physical standby database
for queries, sorting, reporting, web-based access, etc., while continuously app
lying changes received from the production database.
Oracle Active Data Guard also enables the use of fast incremental backups when o
ffloading backups to a standby database, and can provide additional benefits of
high availability and disaster protection against planned or unplanned outages a
t the production site.
What is a Snapshot Standby Database?
11g Snapshot Standby Database
Oracle 11g introduces the Snapshot Standby database which essentially is an upda
teable standby database which has been created from a physical standby database.
We can convert a physical standby database to a snapshot standby database, do so
me kind of testing on a database which is a read write copy of the current prima
ry or production database and then finally revert it to it s earlier state as a ph
ysical standby database.
While the snapshot standby database is open in read-write mode, redo is being re
ceived from the primary database, but is not applied.
After converting it back to a physical standby database, it is resynchronized wi
th the primary by applying the accumalated redo data which was earlier shipped f
rom the primary database but not applied.
Using a snapshot standby, we are able to do real time application testing using
near real time production data. Very often we are required to do production clon
es for the purpose of testing. But using snapshot standby databases we can meet
the same requirement sparing the effort,time,resources and disk space.
REFERENCE:
http://gavinsoorma.com/2009/07/11g-snapshot-standby-database/
Snapshot Standby Database (UPDATEABLE SNAPSHOT FOR TESTING)
A snapshot standby database is a fully updatable standby database that is create
d by converting a physical standby database into a snapshot standby database.
Like a physical or logical standby database, a snapshot standby database receive
s and archives redo data from a primary database. Unlike a physical or logical s
tandby database, a snapshot standby database does not apply the redo data that i
t receives. The redo data received by a snapshot standby database is not applied
until the snapshot standby is converted back into a physical standby database,
after first discarding any local updates made to the snapshot standby database.
REFERENCE:
http://docs.oracle.com/cd/B28359_01/server.111/b28294/title.htm
What is the Default mode will the Standby will be, either SYNC or ASYNC?
ASYNC
Dataguard Architechture?
Data Guard Configurations:
A Data Guard configuration consists of one production database and one or more s
tandby databases. The databases in a Data Guard configuration are connected by O
racle Net and may be dispersed geographically. There are no restrictions on wher
e the databases are located, provided they can communicate with each other.
Dataguard Architecture
The Oracle 9i Data Guard architecture incorporates the following items:
Primary Database A production database that is used to create standby databases.
The archive logs from the primary database are transfered and applied to standb
y databases. Each standby can only be associated with a single primary database,
but a single primary database can be associated with multiple standby databases
.
Standby Database A replica of the primary database.
Log Transport Services Control the automatic transfer of archive redo log files
from the primary database to one or more standby destinations.
Network Configuration The primary database is connected to one or more standby d
atabases using Oracle Net.
Log Apply Services Apply the archived redo logs to the standby database. The Man
aged Recovery Process (MRP) actually does the work of maintaining and applying t
he archived redo logs.
Role Management Services Control the changing of database roles from primary to
standby. The services include switchover, switchback and failover.
Data Guard Broker Controls the creation and monitoring of Data Guard. It comes w
ith a GUI and command line interface.
Primary Database:
A Data Guard configuration contains one production database, also referred to as
the primary database, that functions in the primary role. This is the database
that is accessed by most of your applications.
Standby Database:
A standby database is a transactionally consistent copy of the primary database.
Using a backup copy of the primary database, you can create up to nine standby
databases and incorporate them in a Data Guard configuration. Once created, Data
Guard automatically maintains each standby database by transmitting redo data f
rom the primary database and then applying the redo to the standby database.
The types of standby databases are as follows:
Physical standby database:
Provides a physically identical copy of the primary database, with on disk datab
ase structures that are identical to the primary database on a block-for-block b
asis. The database schema, including indexes, are the same. A physical standby d
atabase is kept synchronized with the primary database, through Redo Apply, whic
h recovers the redo data received from the primary database and applies the redo
to the physical standby database.
Logical standby database:
Contains the same logical information as the production database, although the p
hysical organization and structure of the data can be different. The logical sta
ndby database is kept synchronized with the primary database through SQL Apply,
which transforms the data in the redo received from the primary database into SQ
L statements and then executes the SQL statements on the standby database.
What are the services required on the primary and standby database ?
The services required on the primary database are:
Log Writer Process (LGWR) Collects redo information and updates the online redo
logs. It can also create local archived redo logs and transmit online redo to st
andby databases.
Archiver Process (ARCn) One or more archiver processes make copies of online red
o logs either locally or remotely for standby databases.
Fetch Archive Log (FAL) Server Services requests for archive redo logs from FAL
clients running on multiple standby databases. Multiple FAL servers can be run o
n a primary database, one for each FAL request. .
The services required on the standby database are:
Fetch Archive Log (FAL) Client Pulls archived redo log files from the primary si
te. Initiates transfer of archived redo logs when it detects a gap sequence.
Remote File Server (RFS) Receives archived and/or standby redo logs from the pri
mary database.
Archiver (ARCn) Processes Archives the standby redo logs applied by the managed
recovery process (MRP).
Managed Recovery Process (MRP) Applies archive redo log information to the stand
by database.
What is RTS (Redo Transport Services) in Dataguard?
It controls the automated transfer of redo data from the production database to
one or more archival destinations. The redo transport services perform the follo
wing tasks:
a) Transmit redo data from the primary system to the standby systems in the conf
iguration.
b) Manage the process of resolving any gaps in the archived redo log files due t
o a network failure.
c) Automatically detect missing or corrupted archived redo log files on a standb
y system and automatically retrieve replacement archived redo log files from the
primary database or another standby database.
What are the Protection Modes in Dataguard?
Data Guard Protection Modes
This section describes the Data Guard protection modes.
In these descriptions, a synchronized standby database is meant to be one that m
eets the minimum requirements of the configured data protection mode and that do
es not have a redo gap. Redo gaps are discussed in Section 6.3.3.
Maximum Availability
This protectionmode provides the highest level of data protection that is possib
le without compromising the availability of a primary database. Transactions do
not commit until all redo data needed to recover those transactions has been wri
tten to the online redo log and to at least one synchronized standby database. I
f the primary database cannot write its redo stream to at least one synchronized
standby database, it operates as if it were in maximum performance mode to pres
erve primary database availability until it is again able to write its redo stre
am to a synchronized standby database.
This mode ensures that no data loss will occur if the primary database fails, bu
t only if a second fault does not prevent a complete set of redo data from being
sent from the primary database to at least one standby database.
Maximum Performance
This protectionmode provides the highest level of data protection that is possib
le without affecting the performance of a primary database. This is accomplished
by allowing transactions to commit as soon as all redo data generated by those
transactions has been written to the online log. Redo data is also written to on
e or more standby databases, but this is done asynchronously with respect to tra
nsaction commitment, so primary database performance is unaffected by delays in
writing redo data to the standby database(s).
This protection mode offers slightly less data protection than maximum availabil
ity mode and has minimal impact on primary database performance.
This is the default protection mode.
Maximum Protection
This protection mode ensures that zero data loss occurs if a primary database fa
ils. To provide this level of protection, the redo data needed to recover a tran
saction must be written to both the online redo log and to at least one synchron
ized standby database before the transaction commits. To ensure that data loss c
annot occur, the primary database will shut down, rather than continue processin
g transactions, if it cannot write its redo stream to at least one synchronized
standby database.
Because this data protection mode prioritizes data protection over primary datab
ase availability, Oracle recommends that a minimum of two standby databases be u
sed to protect a primary database that runs in maximum protection mode to preven
t a single standby database failure from causing the primary database to shut do
wn.
How to delay the application of logs to a physical standby?
A standby database automatically applies redo logs when they arrive from the pri
mary database. But in some cases, we want to create a time lag between the archi
ving of a redo log at the primary site, and the application of the log at the st
andby site.
Modify the LOG_ARCHIVE_DEST_n initialization parameter on the primary database t
o set a delay for the standby database.
Example: For 60min Delay:
ALTER SYSTEM SET LOG_ARCHIVE_DEST_2= SERVICE=stdby_srvc DELAY=60';
The DELAY attribute is expressed in minutes.
The archived redo logs are still automatically copied from the primary site to t
he standby site, but the logs are not immediately applied to the standby databas
e. The logs are applied when the specified time interval expires.
Steps to create Physical Standby database?
1.Take a full hot backup of Primary database
2.Create standby control file
3.Transfer full backup, init.ora, standby control file to standby node.
4.Modify init.ora file on standby node.
5.Restore database
6.Recover Standby database
(Alternatively, RMAN DUPLICATE DATABASE FOR STANDBY DO RECOVERY can be also used
)
7.Setup FAL_CLIENT and FAL_SERVER parameters on both sides
8.Put Standby database in Managed Recover mode
What are the DATAGUARD PARAMETERS in Oracle?
Set Primary Database Initialization Parameters
On the primary database, you define initialization parameters that control redo
transport services while the database is in the primary role. There are addition
al parameters you need to add that control the receipt of the redo data and log
apply services when the primary database is transitioned to the standby role.
DB_NAME=chicago
DB_UNIQUE_NAME=chicago
LOG_ARCHIVE_CONFIG= DG_CONFIG=(chicago,boston)
CONTROL_FILES= /arch1/chicago/control1.ctl , /arch2/chicago/control2.ctl
LOG_ARCHIVE_DEST_1=
LOCATION=/arch1/chicago/
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=chicago
LOG_ARCHIVE_DEST_2=
SERVICE=boston LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=boston
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
Primary Database: Standby Role Initialization Parameters
FAL_SERVER=boston
FAL_CLIENT=chicago
DB_FILE_NAME_CONVERT= boston , chicago
LOG_FILE_NAME_CONVERT= /arch1/boston/ , /arch1/chicago/ , /arch2/boston/ , /arch2/chicago/
STANDBY_FILE_MANAGEMENT=AUTO
Prepare an Initialization Parameter File for the Standby Database
Create a text initialization parameter file (PFILE) from the server parameter fi
le (SPFILE) used by the primary database; a text initialization parameter file c
an be copied to the standby location and modified. For example:
CREATE PFILE= /tmp/initboston.ora FROM SPFILE;
Modifying Initialization Parameters for a Physical Standby Database.
DB_NAME=chicago
DB_UNIQUE_NAME=boston
LOG_ARCHIVE_CONFIG= DG_CONFIG=(chicago,boston)
CONTROL_FILES= /arch1/boston/control1.ctl , /arch2/boston/control2.ctl
DB_FILE_NAME_CONVERT= chicago , boston
LOG_FILE_NAME_CONVERT= /arch1/chicago/ , /arch1/boston/ , /arch2/chicago/ , /arch2/boston/
LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc
LOG_ARCHIVE_DEST_1= LOCATION=/arch1/boston/
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=boston
LOG_ARCHIVE_DEST_2= SERVICE=chicago LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY
_ROLE) DB_UNIQUE_NAME=chicago
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
STANDBY_FILE_MANAGEMENT=AUTO
FAL_SERVER=chicago
FAL_CLIENT=boston
Oracle Performance Tuning
Application user is complaining the database is slow.How would you find the perf
ormance issue of SQL queries?
High performance is common expectation for end user, in fact the database is nev
er slow or fast in most of the case session connected to the database slow down
when they receives unexpected hit. Thus to solve this issue you need to find tho
se unexpected hit. To know exactly what the session is doing join your query v$s
ession with v$session_wait.
SELECT NVL(s.username, (oracle) ) as username,s.sid,s.serial#,sw.event,sw.wait_time,
sw.seconds_in_wait, sw.state FROM v$session_wait sw,v$session s
WHERE s.sid=sw.sid and s.username= &username ORDER BY sw.seconds_in_wait DESC;
1.Check the events that are waiting for something.
2.Try to find out the objects locks for that particular session.
3.Locking is not only the cause to effects the performance. Disk I/O contention
is another case. When a session retrieves data from the database datafiles on di
sk to the buffer cache, it has to wait until the disk sends the data. The wait e
vent shows up for the session as db file sequential read (for index scan) or db fil
e scattered read (for full table scan).When you see the event, you know that the
session is waiting for I/O from the disk to complete. To improve session perform
ance, you have to reduce that waiting period. The exact step depends on specific
situation, but the first technique reducing the number of blocks retrieved by a
SQL statement almost always works.Reduce the number of blocks retrieved by the SQ
L statement. Examine the SQL statement to see if it is doing a full-table scan w
hen it should be using an index, if it is using a wrong index, or if it can be r
ewritten to reduce the amount of data it retrieves.
4.Run SQL Tuning Advisor (@$ORACLE_HOME/rdbms/admin/sqltrpt.sql) by providing SQ
L_ID as the input for generating the findings and recommendations.
SQL Tuning Advisor seems to be doing logical optimization mainly by checking you
r SQL structure and statistics.
SQL Tuning Advisor suggests indexes that might be very useful.
SQL Tuning Advisor suggests query rewrites.
SQL Tuning Advisor suggests SQL profile.
More:
1.Run TOP command in Linux to check CPU usage.
2.Run VMSTAT, SAR, PRSTAT command to get more information on CPU, memory usage a
nd possible blocking.
3.Enable the trace file before running your queries,then check the trace file us
ing tkprof create output file.
According to explain plan check the elapsed time for each query,then tune them r
espectively.
What is the use of iostat/vmstat/netstat command in Linux?
Iostat reports on terminal, disk and tape I/O activity.
Vmstat reports on virtual memory statistics for processes, disk, tape and CPU ac
tivity.
Netstat reports on the contents of network data structures.
If you are getting high Busy Buffer waits , how can you find the reason behind it?
Buffer busy wait means that the queries are waiting for the blocks to be read in
to the db cache. There could be the reason when the block may be busy in the cac
he and session is waiting for it. It could be undo/data block or segment header
wait.
Run the below two query to find out the P1, P2 and P3 of a session causing buffe
r busy wait
then after another query by putting the above P1, P2 and P3 values.
SQL> Select p1 File # ,p2 Block # ,p3 Reason Code from v$session_wait Where event = buff
r busy waits ;
SQL> Select owner, segment_name, segment_type from dba_extents
Where file_id = &P1 and &P2 between block_id and block_id + blocks -1;
What to Look for in AWR Report and STATSPACK Report?
Many DBAs already know how to use STATSPACK but are not always sure what to chec
k regularly.
Remember to separate OLTP and Batch activity when you run STATSPACK, since they
usually
generate different types of waits. The SQL script spauto.sql can be used to run ST
ATSPACK
every hour on the hour. See the script in $ORACLE_HOME/rdbms/admin/spauto.sql fo
r more
information (note that JOB_QUEUE_PROCESSES must be set > 0). Since every system
is different,this is only a general list of things you should regularly check in
your STATSPACK output:
Top 5 wait events (timed events)
Load profile
Instance efficiency hit ratios
Wait events
Latch waits
Top SQL
Instance activity
File I/O and segment statistics
Memory allocation
Buffer waits
What is the difference between DB file sequential read and DB File Scattered Rea
d?
DB file sequential read is associated with index read where as DB File Scattered
Read has to do with full table scan.
The DB file sequential read, reads block into contiguous memory and DB File scat
tered read gets from multiple block and scattered them into buffer cache.
Which factors are to be considered for creating index on Table? How to select co
lumn for index?
Creation of index on table depends on size of table, volume of data. If size of
table is large and we need only few data for selecting or in report then we need
to create index. There are some basic reason of selecting column for indexing l
ike cardinality and frequent usage in where condition of select query. Business
rule is also forcing to create index like primary key, because configuring prima
ry key or unique key automatically create unique index.
It is important to note that creation of so many indexes would affect the perfor
mance of DML on table because in single transaction should need to perform on va
rious index segments and table simultaneously.
Is creating index online possible?
YES. You can create and rebuild indexes online. This enables you to update base
tables at the same time you are building or rebuilding indexes on that table. Yo
u can perform DML operations while the index building is taking place, but DDL o
perations are not allowed. Parallel execution is not supported when creating or
rebuilding an index online.
CREATE INDEX emp_name ON emp (mgr, emp1, emp2, emp3) ONLINE;
How to recover password in oracle 10g?
You can query with the table user_history$. The password history is store in thi
s table.
How can you track the password change for a user in oracle?
Oracle only tracks the date that the password will expire based on when it was l
atest changed. Thus listing the view DBA_USERS.EXPIRY_DATE and subtracting PASSW
ORD_LIFE_TIME you can determine when password was last changed. You can also che
ck the last password change time directly from the PTIME column in USER$ table (
on which DBA_USERS view is based). But If you have PASSWORD_REUSE_TIME and/or PA
SSWORD_REUSE_MAX set in a profile assigned to a user account then you can refere
nce dictionary table USER_HISTORY$ for when the password was changed for this ac
count.
SELECT user$.NAME, user$.PASSWORD, user$.ptime, user_history$.password_date
FROM SYS.user_history$, SYS.user$
WHERE user_history$.user# = user$.user#;
What is Secure External password Store (SEPS)?
Through the use of SEPS you can store password credentials for connecting to dat
abase by using a client side oracle wallet, this wallet stores signing credentia
ls. This feature introduced since oracle 10g. Thus the application code, schedul
ed job, scripts no longer needed embedded username and passwords. This reduces r
isk because the passwords are no longer exposed and password management policies
are more easily enforced without changing application code whenever username an
d password change.
Why we need CASCADE option with DROP USER command whenever dropping a user and w
hy DROP USER commands fails when we don t use it?
If a user having any object then YES in that case you are not able to drop that us
er without using CASCADE option. The DROP USER with CASCADE option command drops
user along with its all associated objects. Remember it is a DDL command after
the execution of this command rollback cannot be performed.
What is the difference between Redo,Rollback and Undo?
I find there is always some confusion when talking about Redo, Rollback and Undo
. They all sound like pretty much the same thing or at least pretty close.
Redo: Every Oracle database has a set of (two or more) redo log files. The redo
log records all changes made to data, including both uncommitted and committed c
hanges. In addition to the online redo logs Oracle also stores archive redo logs
. All redo logs are used in recovery situations.
Rollback: More specifically rollback segments. Rollback segments store the data
as it was before changes were made. This is in contrast to the redo log which is
a record of the insert/update/deletes.
Undo: Rollback segments. They both are really one in the same. Undo data is stor
ed in the undo tablespace. Undo is helpful in building a read consistent view of
data.
You have more than 3 instances running on the Linux server? How can you determin
e which shared memory and semaphores are associated with which instance?
Oradebug is undocumented oracle supplied utility by oracle. The oradebug help co
mmand list the command available with oracle.
SQL>oradebug setmypid
SQL>oradebug ipc
SQL>oradebug tracfile_name
Why drop table is not going into Recycle bin?
If you are using SYS user to drop any table then user s object will not go to the
recyclebin as there is no recyclebin for SYSTEM tablespace, even we have already
SET recycle bin parameter TRUE.
Select * from v$parameter where name = recyclebin ;
Show parameter recyclebin;
Temp Tablespace is 100% FULL and there is no space available to add datafiles to
increase temp tablespace. What can you do in that case to free up TEMP tablespa
ce?
Try to close some of the idle sessions connected to the database will help you t
o free some TEMP space. Otherwise you can also use Alter Tablespace PCTINCREASE 1
followed by Alter Tablespace PCTINCREASE 0
What is Row Chaning and Row Migration?
Row Migration:
A row migrates when an update to that row would cause it to not fit on the block
anymore (with all of the other data that exists there currently). A migration m
eans that the entire row will move and we just leave behind the forwarding addres
s. So, the original block just has the rowid of the new block and the entire row
is moved.
Row Chaining:
A row is too large to fit into a single database block. For example, if you use
a 4KB blocksize for your database, and you need to insert a row of 8KB into it,
Oracle will use 3 blocks and store the row in pieces.
Some conditions that will cause row chaining are: Tables whose rowsize exceeds t
he blocksize. Tables with LONG and LONG RAW columns are prone to having chained
rows. Tables with more then 255 columns will have chained rows as Oracle break w
ide tables up into pieces.
So, instead of just having a forwarding address on one block and the data on ano
ther we have data on two or more blocks.
How to find out background processes ?
SQL> select SID,PROGRAM from v$session where TYPE= BACKGROUND ;
SQL> select name,description from V$bgprocess;
How to findout background processes from OS:
$ ps -ef|grep ora_|grep SID
To Find and Delete bigger size and older files in Linux
To find out files size more than 5MB
find . -size +5000 -exec ls -ltr {} \;
To **Remove** files size more than 5MB
find . -size +5000k -exec rm -rf {} \;
To find out files older than 30days
find . -mtime +30 -exec ls -ltr {} \;
To find **Remove** files older than 30days
find . -mtime +30 -exec rm -rf {} \;
Email ThisBlogThis!Share to TwitterShare to Facebook

**************************&&&&&&&&&&&&&&&&&&&&&&&&&&&&**************************
***&&&&&&&&&&&&&&&&&&&&&&&&
RMAN INTERVIEW QUESTIONS

1. Which types of backups you can take in Oracle?


2. A database is running in NOARCHIVELOG mode then which type of backups y
ou can take?
3. Can you take partial backups if the Database is running in NOARCHIVELOG
mode?
4. Can you take Online Backups if the the database is running in NOARCHIVE
LOG mode?
5. How do you bring the database in ARCHIVELOG mode from NOARCHIVELOG mode
?
6. You cannot shutdown the database for even some minutes, then in which m
ode you should run
the database?
7. Where should you place Archive logfiles, in the same disk where DB is o
r another disk?
8. Can you take online backup of a Control file if yes, how?
9. What is a Logical Backup?
10. Should you take the backup of Logfiles if the database is running in ARCHI
VELOG mode?
11. Why do you take tablespaces in Backup mode?
12. What is the advantage of RMAN utility?
13. How RMAN improves backup time?
14. Can you take Offline backups using RMAN?
15. How do you see information about backups in RMAN?
16. What is a Recovery Catalog?
17. Should you place Recovery Catalog in the Same DB?
18. Can you use RMAN without Recovery catalog?
19. Can you take Image Backups using RMAN?
20. Can you use Backupsets created by RMAN with any other utility?
21. Where RMAN keeps information of backups if you are using RMAN without Cata
log?
22. You have taken a manual backup of a datafile using o/s. How RMAN will know
about it?
23. You want to retain only last 3 backups of datafiles. How do you go for it
in RMAN?
24. Which is more efficient Incremental Backups using RMAN or Incremental Expo
rt?
25. Can you start and shutdown DB using RMAN?
26. How do you recover from the loss of datafile if the DB is running in NOARC
HIVELOG mode?
27. You loss one datafile and it does not contain important objects. The impor
tant objects are there in other datafiles which are intact. How do you proceed i
n this situation?
28. You lost some datafiles and you don't have any full backup and the databas
e was running in NOARCHIVELOG mode. What you can do now?
29. How do you recover from the loss of datafile if the DB is running in ARCHI
VELOG mode?
30. You loss one datafile and DB is running in ARCHIVELOG mode. You have full
database backup of 1 week old and partial backup of this datafile which is just
1 day old. From which backup should you restore this file?
31. You loss controlfile how do you recover from this?
32. The current logfile gets damaged. What you can do now?
33. What is a Complete Recovery?
34. What is Cancel Based, Time based and Change Based Recovery?
35. Some user has accidentally dropped one table and you realize this after tw
o days. Can you recover this table if the DB is running in ARCHIVELOG mode?
36. Do you have to restore Datafiles manually from backups if you are doing re
covery using RMAN?
37. A database is running in ARCHIVELOG mode since last one month. A datafile
is added to the database last week. Many objects are created in this datafile. A
fter one week this datafile gets damaged before you can take any backup. Now can
you recover this datafile when you don't have any backups?
38. How do you recover from the loss of a controlfile if you have backup of co
ntrolfile?
39. Only some blocks are damaged in a datafile. Can you just recover these blo
cks if you are using RMAN?
40. Some datafiles were there on a secondary disk and that disk has become dam
aged and it will take some days to get a new disk. How will you recover from thi
s situation?

41. Have you faced any emergency situation. Tell us how you resolved it?
42. At one time you lost parameter file accidentally and you don't have any ba
ckup. How you will recreate a new parameter file with the parameters set to prev
ious values.
43. What is Consistent Backup?
A Consistent backup is one in which the files being backed up contain all change
s upto the same system change number (SCN)
44. What is fractured Block?
Because the database continues writing to the file during an online backup, ther
e is the possibility of backing up inconsistent data within a block. For example
, assume that either RMAN or an operating system utility reads the block while d
atabase writer is in the middle of updating the block. In this case, RMAN or the
copy utility could read the old data in the top half of the block and the new d
ata in the bottom top half of the block. The block is a fractured block, meaning
that the data in this block is not consistent.
45. What are the steps to performing complete recovery on the whole database?
Mount the database
Ensure that all datafiles you want to recover are online
Restore a backup of the whole database or the files you want to recover
Apply online or archived redo logs, or a combination of the two
46. What are the steps to performing complete recovery on a tablespace or data
file?
Take the tablespace or datafile to be recovered offline if the database is open
Restore a backup of the datafiles you want to recover
Apply online or archived redo logs, or a combination of the two

******************************************&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*******
**************&&&&&&&&&&&&&&&&&&&&&&&&&&&

RMAN Interview question with Answer:


1) What is the difference betw
een to back up the current control file and to backup up control file copy?
If you backup current control file you backup control file which is currently open
by an instance where as If you backup controlfile file copy" you backup the copy
of control file which is created either with SVRMGRL command "alter system back
up controlfile to .." or with RMAN command "copy current controlfile to ...".
In the other words, the control file copy is not current controlfile backup curr
ent controlfile creates a BACKUPSET containing controlfile.
You don't have to give the FILENAME where as backup controlfile copy creates a B
ACKUPSET from a copy of controlfile.
You have to give the FILENAME.

2) How much of overhead in running BACKUP VALIDATE DATABASE and RESTORE VALIDATE
DATABASE commands to check for block corruptions using RMAN?
Can I run these commands anytime?
Backup validate works against the backups not against the live database so no im
pact on the live database, same for restore validate they do not impact the real
thing (it is reading the files there only).

3) Is there a way to force rman to use these obsolete backups or once it is mark
ed obsolete?
As per my understanding it is just a report, they are still there until you dele
te them.

4) Can I use the same snapshot controlfile to backup multiple databases(one afte
r another) running on the same server?
This file is only use temporarily like a scratch file. Only one rman session ca
n access the snapshot controlfile at any time so this would tend to serialize yo
ur backups if you do that.
5) Why does not oracle keep RMAN info after recreating the controlfile?
Creating the new controlfile from scratch how do you expect the create controlfi
le to "make up" the missing data?
that would be like saying similarly we have drop and recreated my table and now
it is empty similarly here recreating from the scratch means the contents there
will be naturally will be gone.
Use the rman catalog to deal this situation. It is just a suggestion.
6) What is the advantage of using PIPE in rman backups? In what circumstances on
e would use PIPE to backup and restore?

It lets 3rd parties (anyone really) build an alternative interface to RMAN as it


permits anyone
that can connect to an Oracle instance to control RMAN programmatically.

7) How To turn Debug Feature on in rman?

run {

allocate channel c1 type disk;


debug on;

rman>list backup of database;

now you will see a output


You can always turn debug off by issuing

rman>debug off;
8) Assuming I have a "FULL" backup of users01.dbf containing employees table tha
t contains 1000 blocks of data.
If I truncated employees table and then an incremental level 1 backup of user s ta
blespace is taken, will RMAN include 1000 blocks that once contained data in the
incremental backup?
The blocks were not written to the only changes made by the truncate was to the
data dictionary (or file header) so no, it won't see them as changed blocks sinc
e they were not changed.
9)Where should the catalog be created?

The recovery catalog to be used by Rman should be created in a separate database


other than the target database.
The reason is that the target database will be shutdown while datafiles are rest
ored.
8)How many times does oracle ask before dropping a catalog?
The default is two times one for the actual command, the other for confirmation.
9) What are the various reports available with RMAN?

rman>list backup;
rman> list archive;
10) What is the use of snapshot controlfile in terms of RMAN backup?
Rman uses the snapshot controlfile as a way to get a read consistent copy of the
controlfile,
it uses this to do things like RESYNC the catalog (else the controlfile is a mov
ing target , constantly changing and Rman would get blocked and block the database
)
11) Can RMAN write to disk and tape Parallel? Is it possible?
Rman currently won't do tape directly, y
ou need a media manager for that, regarding disk and tape parallel not as far as
I know, you would run two backups separately (not sure).
May be trying to maintain duplicate like that could get the desired.

12) What is the difference between DELETE INPUT and DELETE ALL command in backup
?
Generally speaking LOG_ARCHIVE_DEST_n points to two disk drive locations where w
e archive the files,
when a command is issued through rman to backup archivelogs it uses one of the l
ocation to backup the data. When we specify delete input the location which was
backed up will get deleted,
if we specify delete all (all log_archive_dest_n) will get deleted.
DELETE all applies only to archived logs.
delete expired archivelog all;
13) Is it possible to restore a backupset (actually backup pieces) from a differ
ent location to where RMAN has recorded them to be.

With 9.2 and earlier it is not possible to restore a backupset (actually backup
pieces) from a

different location to where RMAN has recorded them to be. As a workaround you wo
uld have to create a link using the location of where the backup was originally
located.
Then when restoring, RMAN will think everything is the same as it was.
Starting in 10.1 it is possible to catalog the backup pieces in their new locati
on into the
controlfile and recovery catalog. This means they are available for restoration
by RMAN without creating the link.
14) What is difference between Report obsolete and Report obsolete orphan

Report obsolete backup are reported unusable according to the user s retention pol
icy where as Report obsolete orphan report the backup that are unusable because
they belong to incarnation of the database that are not direct ancestor of the c
urrent incarnation.
15) How to Increase Size of Redo Log
1. Add new log files (groups) with new size
ALTER DATABASE ADD LOGFILE GROUP

2. Switch with alter system switch log file until a new log file group is in state
current
3. Now you can delete the old log file
ALTER DATABASE DROP LOGFILE MEMBER
16) What is the difference between alter database recover and sql*plus recover
command?

ALTER DATABASE recover is useful when you as a user want to control the recovery
where as SQL*PLUS recover command is useful when we prefer automated recovery.
Difference of two view V$Backup_Set and Rc_Backup_Set in respect of Rman
The V$Backup_Set is used to check the backup details when we are not managing Rm
an catalog that is the backup information is stored in controlfile where as Rc_B
ackup_Set is used when we are using catalog as a central repository to list the
backup information.
17) Can I cancel a script from inside the script? How I cancil a select on Windo
ws client?
Use ctl-c
18) How to Find the Number of Oracle Instances Running on Windows Machine

C:\>net start |find OracleService


19) How to create an init.ora from the spfile when the database is down?
Follow the same way as you are using
SQL> connect sys/oracle as sysdba
SQL> shutdown;
SQL> create pfile from spfile;
SQL> create spfile from pfile;
20) When you shutdown the database, how does oracle maintain the user session i.
e.of sysdba?
You still have your dedicated server

!ps -auxww | grep ora920


sys@ORA920> !ps -auxww | grep ora920

sys@ORA920> shutdown

sys@ORA920> !ps -auxww | grep ora920

You can see you still have your dedicated server. When you connect as sysdba, yo
u fire up dedicated server that is where it is.

21) What is ORA-002004 error? What you will do in that case?


A disk I/O failure was detected on reading the control file.
Basically you have to check whether the control file is available, permissions a
re right on the control file,
spfile/init.ora right to the right location, if all checks were done still you a
re getting the error, then from the multiplexed control file overlay on the corr
upted one.

Let us say you have three control files control01.ctl, control02.ctl and control
03.ctl and now you are getting errors on control03.ctl then just copy control01.
ctl over to control03.ctl and you should be all set.

In order to issue ALTER DATABASE BACKUP CONTROLFILE TO TRACE;


database should be mounted and in our case it is not mounted then the only other
option available is to restore control file from backup or copy the multiplexed
control file over to the bad one.

22) Why do we need SCOPE=BOTH clause?


BOTH indicates that the change is made in memory and in the server parameter fil
e. The new setting takes effect immediately and persists after the database is s
hut down and started up again. If a server parameter file was used to start up t
he database, then BOTH is the default. If a parameter file was used to start up
the database, then MEMORY is the default, as well as the only scope you can spec
ify.

23) How to know Number of CPUs on Oracle


Login as SYSDBA

SQL>show parameter cpu_count

NAME TYPE VALUE

cpu_count integer 2
24) Could you please tell me what are the possible reason for Spfile corruption
and Recovery?
It should not be corrupt under normal circumstances, if it were, it would be a b
ug or failure of some component in your system. It could be a file system error
or could be a bug.
You can easily recover however from

a) Your alert log has the non-default parameters in it from your last restart.

b) it should be in your backups

c) strings spfile.ora > init$ORACLE_SID.ora - and then edit the resulting file t
o clean it up would be options.

25) How you will check flashback is enabled or not?


Select flashback_on from v$database;
26) In case Revoke CREATE TABLE Privilege from an USER giving ORA-01952. What is
the issue? How to do in that case?
SQL> revoke create table from Pay_payment_master;
ORA-01952: system privileges not granted to PAY_PAYMENT_MASTER
This is because this privilege is not assigned to this user directly rather it w
as assigned through role CONNECT
If you remove connect role from the user then you will not be able to create ses
sion (Connect) to database.
So basically we have to Revoke the CONNECT Role and Grant other than create tabl
e privilege to this user.

27) What kind of information is stored in UNDO segments?


Only before image of data is stored in the UNDO segments. If transaction is roll
ed back information from UNDO is applied to restore original datafile. UNDO is n
ever multiplexed.
28) How to Remove Oracle Service in windows environment?
We can add or remove Oracle Service using oradim which is available in ORACLE_HO
ME/bin
C:\Oradim delete sid

or

Oradim delete svrc


29) Why ORA-28000: the account is locked? What you will do in that case?
The Oracle 10g default is to lock an account after 10 bad password attempts and
giving ORA-28000: the account is locked.
In that case one of the solutions is increase default limit of the login attempt
s.
SQL> Alter profile default limit FAILED_LOGIN_ATTEMPTS unlimited;
30) How to Reduce the Physical Reads on Statistics?

You need to increase the Buffer Cache

Consider the situation Buffer Cache of the database is 300MB.


One SQL gave the Physical read as 100. I increased as 400MB and now the same SQL
giving the Physical read value is 0
31) How many redo groups are required for a Oracle DB?

At least 2 redo groups are required for a Oracle database to be working normally
.
32) My spfile is corrupt and now I cannot start my database running on my laptop
. Is there a way to build spfile again?
if you are on unix then

$ cd $ORACLE_HOME/dbs

$ strings spfilename temp_pfile.ora

edit the temp_pfile.ora, clean it up if there is anything "wrong" with it and th


en
SQL> startup pfile=temp_pfile.ora

SQL> create spfile from pfile;

SQL> shutdown

SQL> startup

On windows -- just try editing the spfile [do not try with the prod db first try
to check on test db. It can be dangerous], create a pfile from it. save it,
and do the same or if you got problem you can startup the db from the command li
ne using sqlplus create a pfile, do a manual startup (start the oracle service,
then use sqlplus to start the database)

33) What is a fractured block? What happens when you restore a file containing f
ractured block?
A block in which the header and footer are not consistent at a given SCN.
In a user-managed backup, an operating system utility can back up a datafile at
the same time that DBWR is updating the file.
It is possible for the operating system utility to read a block in a half-update
d state, so that the block that is copied to the backup media is updated in its
first half,
while the second half contains older data. In this case, the block is fractured.

For non-RMAN backups, the ALTER TABLESPACE ... BEGIN BACKUP or ALTER DATABASE BE
GIN BACKUP command is the solution for the fractured block problem.
When a tablespace is in backup mode, and a change is made to a data block, the d
atabase logs a copy of the entire block image before the change so that the data
base can reconstruct this block if media recovery finds that this block was frac
tured.
The block that the operating system reads can be split, that is, the top of the
block is written at one point in time while the bottom of the block is written a
t another point in time.
If you restore a file containing a fractured block and Oracle reads the block, t
hen the block is considered a corrupt.
34) You recreated the control file by using backup control file to trace and using
alter database backup controlfile to location command what have you lost in that
case?
You lost all of the backup information as using backup controlfile to trace wher
e as using other ALTER DATABASE BACKUP CONTROLFILE to D:\Backup\control01.ctl .
All backup information is retained when you take binary control file backup.

35) If a backup is issued after shutdown abort command what kind of backup

is that?

It is an inconsistent backup.
If you are in noarchivelog mode ensure that you issue the shutdown immediate com
mand or startup force is another option that you can issue:
startup force->shutdown abort;
followed by
shutdown immediate;
36) What is split brain
What is split brain ?
In RAC environment, server nodes communicate with each other using High speed pr
ivate interconnects
network. A split brain situation happens when all the links of the private inter
connect fail to respond to
each other but instances are still up and running. So each instance thinks that
the other nodes/instances are
dead and that it should take over the ownership.
In split brain situation, instances independtly access the data and modify the s
ame blocks and the database
will end up with changed database overwritten which could lead to data corruptio
n. To avoid this, various
algorithm are implemented to handle split brain scenario.
In RAC, the IMR (Instance Membership Recovery) service is one of the one of the
efficient algorithm
used to detect & resolve the split-brain syndrome. When one instance fails to co
mmunicate with other
instances or when one instance becomes inactive due to any reason and is unable
to issue the control file
heartbeat, the split brain is detected and the detecting instance will evict the
failed instance from the
database.This process is called node eviction.
37) What does the #!bin/ksh at the beginning of a shell script do? Why should it
be there?
Ans: On the first line of an interpreter script, the "#!", is the name of a prog
ram which should be used to interpret the contents of the file.
For instance, if the first line contains "#! /bin/ksh", then the contents of the
file are executed as a korn shell
38) What command is used to find the status of Oracle 10g Clusterware (CRS) and
the various components it manages
(ONS, VIP, listener, instances, etc.)?
Ans: $ocrcheck
39) How would you find the interconnect IP address from any node within an Oracl
e 10g RAC configuration?
using oifcfg command.
se the oifcfg -help command to display online help for OIFCFG. The elements of O
IFCFG commands, some of which are
optional depending on the command, are:
*nodename Name of the Oracle Clusterware node as listed in the output from the ols
nodes command
*if_name Name by which the interface is configured in the system
*subnet Subnet address of the interface
*if_type Type of interface: public or cluster_interconnect
40) 15.What is the Purpose of the voting disk in Oracle 10g Clusterware?
Voting disk record node membership information.
Oracle Clusterware uses the voting disk to determine which instances are members
of a cluster.
The voting disk must reside on a shared disk. For high availability, Oracle reco
mmends that you have a minimum of three voting disks.
If you configure a single voting disk, then you should use external mirroring to
provide redundancy.You can have up to 32 voting disks in your cluster.
41) Data Guard Protection Modes :
In some situations, a business cannot afford to lose data at any cost.
In other situations, some applications require maximum database performance and
can tolerate a potential loss of data.
Data Guard provides three distinct modes of data protection to satisfy these va
ried requirements:
*Maximum Protection > This mode offers the highest level of data protection.
Data is synchronously transmitted to the standby database from the primary datab
ase and transactions are not committed on the primary database unless the redo d
ata is available on at least one standby database configured in this mode.
If the last standby database configured in this mode becomes unavailable, proce
ssing stops on the primary database.
This mode ensures no-data-loss, even in the event of multiple failures.
*Maximum Availability > This mode is similar to the maximum protection mode, inclu
ding zero data loss.
However, if a standby database becomes unavailable (for example, because of netw
ork connectivity problems),
processing continues on the primary database.
When the fault is corrected, the standby database is automatically resynchronize
d with the primary database.
This mode achieves no-data-loss in the event of a single failure (e.g. network f
ailure, primary site failure . . .)
*Maximum Performance > This mode offers slightly less data protection on the prima
ry database, but higher performance than maximum availability mode.
In this mode, as the primary database processes transactions, redo data is asyn
chronously shipped to the standby database.
The commit operation of the primary database does not wait for the standby datab
ase to acknowledge receipt of redo data before completing write operations on th
e primary database.
If any standby destination becomes unavailable, processing continues on the prim
ary database and there is little effect on primary database performance.
42) Connection hanging? what are the possibilities?
possibilities for Oracle hanging include:
External issues - The network being down, Kerberos security issues, SSO or a fir
ewall issue can cause an Oracle connection to hang.
One way to test this is to set sqlnet.authentication_services=(none) in your sql
net.ora file and retry connecting.
Listener is not running - Start by checking the listener (check lsnrctl stat). A
lso, see my notes on diagnosing Oracle network connectivity issues.
No RAM - Over allocation of server resources, usually RAM, whereby there is not
enough RAM to spawn another connection to Oracle.
Contention - It is not uncommon for an end-user session to hang when they are tryi
ng to grab a shared data resource that is held by another end-user.
The end-user often calls the help desk trying to understand why they cannot comp
lete their transaction, and the Oracle professional must quickly identify the so
urce of the contention."
43) What is Partition Pruning ?
Partition Pruning: Oracle optimizes SQL statements to mark the partitions or sub
partitions that need to be accessed and eliminates (prunes) unnecessary partitio
ns or subpartitions from access by those SQL statements. In other words, partiti
on pruning is the skipping of unnecessary index and data partitions or subpartit
ions in a query.
44) FAN in RAC.
With Oracle RAC in place, database client applications can leverage a number of
high availability features including:
Fast Connection Failover (FCF): Allows a client application to be immediately no
tified of a planned or unplanned database service outage by subscribing to Fast
Application Notification (FAN) events.
Run-time Connection Load-Balancing: Uses the Oracle RAC Load Balancing Advisory
events to distribute work appropriately across the cluster nodes and to quickly
react to changes in cluster configuration, overworked nodes, or hangs.
Connection Affinity (11g recommended/required): Routes connections to the same d
atabase instance based on previous connections to an instance to limit performan
ce impacts of switching between instances.
RAC supports web session and transaction-based affinity for different client sce
narios.

45) Why extra standby redo log group?


Determine the appropriate number of standby redo log file groups.
Minimally, the configuration should have one more standby redo log file group
than the number of online redo log file groups on the primary database....
(maximum number of logfiles for each thread + 1) * maximum number of threads
Using this equation reduces the likelihood that the primary instance's log
writer (LGWR) process will be blocked because a standby redo log file cannot be
allocated on the standby database. For example, if the primary database has 2
log files for each thread and 2 threads, then 6 standby redo log file groups
are needed on the standby database."
I think it says that if you have groups #1 and #2 on primary and #1, #2 on
standby, and if LGWR on primary just finished #1, switched to #2, and now it
needs to switch to #1 again because #2 just became full, the standby must catch
up, otherwise the primary LGWR cannot reuse #1 because the standby is still
archiving the standby's #1. Now, if you have the extra #3 on standby, the
standby in this case can start to use #3 while its #1 is being archived. That
way, the primary can reuse the primary's #1 without delay.
46) how to take voting disk backup ?
On 10gR2 RAC used "Can be done online" for backup voting disk but in 11g you can
not use DD online (use oracle command to do it).
First, as root user, stop Oracle Clusterware (with the crsctl stop crs command)
on all nodes if you want to add/restore voting disk.
Then, determine the current voting disk by issuing the following command:
crsctl query votedisk css
issue the dd or ocopy command to back up a voting disk, as appropriate.
Give the syntax of backing up voting disks:-
On Linux or UNIX systems:
dd if=voting_disk_name of=backup_file_name
where,
voting_disk_name is the name of the active voting disk
backup_file_name is the name of the file to which we want to back up the voting
disk contents
On Windows systems, use the ocopy command:
ocopy voting_disk_name backup_file_name
47) What is the Oracle Recommendation for backing up voting disk?
Oracle recommends us to use the dd command to backup the voting disk with aminim
um block size of 4KB.
48) How do you restore a voting disk?
To restore the backup of your voting disk, issue the dd or ocopy command for Lin
ux and UNIX systems or ocopy for Windows systems respectively.
On Linux or UNIX systems:
dd if=backup_file_name of=voting_disk_name
On Windows systems, use the ocopy command:
ocopy backup_file_name voting_disk_name
where,
backup_file_name is the name of the voting disk backup file
voting_disk_name is the name of the active voting disk
49) How can we add and remove multiple voting disks?
If we have multiple voting disks, then we can remove the voting disks and add th
em back into our environment using the following commands,
where path is the complete path of the location where the voting disk resides:
crsctl delete css votedisk path
crsctl add css votedisk path
50) How do we stop Oracle Clusterware?When do we stop it?
Before making any modification to the voting disk, as root user,
stop Oracle Clusterware using the crsctl stop crs command on all nodes.
51) How do we add voting disk?
To add a voting disk, issue the following command as the root user,
replacing the path variable with the fully qualified path name for the voting di
sk we want to add:
crsctl add css votedisk path -force
52) How do we move voting disks?
To move a voting disk, issue the following commands as the root user,
replacing the path variable with the fully qualified path name for the voting d
isk we want to move:
crsctl delete css votedisk path -force
crsctl add css votedisk path -force
53) How do we remove voting disks?
To remove a voting disk,
issue the following command as the root user, replacing the path variable with t
he fully qualified path name for the voting disk we want to remove:
crsctl delete css votedisk path -force
54) What should we do after modifying voting disks?
After modifying the voting disk,
restart Oracle Clusterware using the crsctl start crs command on all nodes, and
verify the voting disk location using the following command:
crsctl query css votedisk
55) When can we use -force option?
If our cluster is down, then we can include the -force option to modify the voti
ng disk configuration,
without interacting with active Oracle Clusterware daemons.
However, using the -force option while any cluster node is active may corrupt ou
r configuration.
56) How to find Cluster Interconnect IP address from Oracle Database ?
Hello, The easiest way to find the cluster interconnect is to view the hosts file.
The hosts file is located under: UNIX .......... /etc
Windows ...... C:\WINDOWS\system32\drivers\etc
Following are the ways to find the cluster interconnect through Oracle database:
1) Query X$KSXPIA
The following query provides the interconnect IP address registered with Oracle
database:
view plaincopy to clipboardprint?
SQL> select IP_KSXPIA from x$ksxpia where PUB_KSXPIA = 'N';
IP_KSXPIA
----------------
192.168.10.11
This query should be run on all instances to find the private interconnect IP ad
dress used on their respective nodes.
2) Query GV$CLUSTER_INTERCONNECTS view
Querying GV$CLUSTER_INTERCONNECTS view lists the interconnect used by all the pa
rticipating instances of the RAC database.
view plaincopy to clipboardprint?
SQL> select INST_ID, IP_ADDRESS from GV$CLUSTER_INTERCONNECTS;
INST_ID IP_ADDRESS
---------- ----------------
1 192.168.10.11
2 192.168.10.12
57) How to Identify master node in RAC ?
Grep crsd log file
# /u1/app/../crsd>grep MASTER crsd.log | tail -1
(or)
cssd >grep -i "master node" ocssd.log | tail -1
OR You can also use V$GES_RESOURCE view to identify the master node.
58) how to monitor block transfer interconnects nodes in rac ?
The v$cache_transfer and v$file_cache_transfer views are used to examine RAC
statistics.
The types of blocks that use the cluster interconnects in a RAC environment are
monitored with the v$ cache transfer series of views:
v$cache_transfer: This view shows the types and classes of blocks that Oracle tr
ansfers over the cluster interconnect on a per-object basis.
The forced_reads and forced_writes columns can be used to determine the types o
f objects the RAC instances are sharing.
Values in the forced_writes column show how often a certain block type is transf
erred out of a local buffer cache due to the current version being requested by
another instance.
59) what is global cache service monitoring?
Global Cache Services (GCS) Monitoring
The use of the GCS relative to the number of buffer cache reads, or logical read
s can be estimated
by dividing the sum of GCS requests (global cache gets + global cache converts
+ global cache cr blocks received + global cache current blocks received )
by the number of logical reads (consistent gets + db block gets ) for a given
statistics collection interval.
A global cache service request is made in Oracle when a user attempts to access
a buffer cache to read or modify a data block and the block is not in the local
cache.
A remote cache read, disk read or change access privileges is the inevitable res
ult.
These are logical read related. Logical reads form a superset of the global cach
e service operations.

================================================================================
================================================================================
===========================================================================
Rman Interview Questions:
2. Difference between using recovery catalog and control file?
When new incarnation happens, the old backup information in control file will be
lost. It will be preserved in recovery catalog.
In recovery catalog, we can store scripts.
Recovery catalog is central and can have information of many databases.
3. Can we use same target database as catalog?
No. The recovery catalog should not reside in the target database (database to b
e backed up), because the database can't be recovered in the mounted state.
4. How do u know how much RMAN task has been completed?
By querying v$rman_status or v$session_longops
5. From where list & report commands will get input?
6. Command to delete archive logs older than 7days?
RMAN> delete archivelog all completed before sysdate-7;
7. How many days backup, by default RMAN stores?
8. What is the use of crosscheck command in RMAN?
Crosscheck will be useful to check whether the catalog information is intact wit
h OS level information.
9. What are the differences between crosscheck and validate commands?
10. Which is one is good, differential (incremental) backup or cumulative (incre
mental) backup?
A differential backup, which backs up all blocks changed after the most recent i
ncremental backup at level 1 or 0
A cumulative backup, which backs up all blocks changed after the most recent inc
remental backup at level 0
11. What is Level 0, Level 1 backup?
A level 0 incremental backup, which is the base for subsequent incremental backu
ps, copies all blocks containing data, backing the datafile up into a backup set
just as a full backup would. A level 1 incremental backup can be either of the
following types:
A differential backup, which backs up all blocks changed after the most recent i
ncremental backup at level 1 or 0
A cumulative backup, which backs up all blocks changed after the most recent inc
remental backup at level 0
12. Can we perform level 1 backup without level 0 backup?
If no level 0 backup is available, then the behavior depends upon the compatibil
ity mode setting. If compatibility < 10.0.0, RMAN generates a level 0 backup of
the file contents at the time of the backup. If compatibility is >= 10.0.0, RMAN
copies all blocks changed since the file was created, and stores the results as
a level 1 backup. In other words, the SCN at the time the incremental backup is
taken is the file creation SCN.
13. Will RMAN put the database/tablespace/datafile in backup mode?
Nope.
14. What is snapshot control file?
15. What is the difference between backup set and backup piece?
Backup set is logical and backup piece is physical.
16. RMAN command to backup for creating standby database?
RMAN> duplicate target database to standby database ....
17. How to do cloning by using RMAN?
RMAN> duplicate target database
18. You loss one datafile and DB is running in ARCHIVELOG mode. You have full da
tabase backup of 1 week/day old and don t have backup of this (newly created) data
file. How do you restore/recover file?
create the datafile and recover that datafile.
SQL> alter database create datafile path.. size n;
RMAN> recover datafile file_id;
19. What is obsolete backup & expired backup?
A status of "expired" means that the backup piece or backup set is not found in
the backup destination.
A status of "obsolete" means the backup piece is still available, but it is no l
onger needed. The backup piece is no longer needed since RMAN has been configure
d to no longer need this piece after so many days have elapsed, or so many backu
ps have been performed.
20. What is the difference between hot backup & RMAN backup?
For hot backup, we have to put database in begin backup mode, then take backup.
RMAN won t put database in backup mode.
21. How to put manual/user-managed backup in RMAN (recovery catalog)?
By using catalog command.
RMAN> CATALOG START WITH '/tmp/backup.ctl';
22. What are new features in Oracle 11g RMAN?
23. What is the difference between auxiliary channel and maintenance channel?

================================================================================
================================================================================
===========================================================================

RMAN Question & Answers


What is RMAN and How to configure it?
RMAN is an Oracle Database client
It performs backup and recovery tasks on your databases and automates administ
ration of your backup strategies
It greatly simplifies the dba jobs by managing the production database's backi
ng up, restoring, and recovering database files
This tool integrates with sessions running on an Oracle database to perform a
range of backup and recovery activities, including maintaining an RMAN repositor
y of historical data about backups
There is no additional installation required for this tool
It is by default get installed with the oracle database installation
The RMAN environment consists of the utilities and databases that play a role
in acking up your data
We can access RMAN through the command line or through Oracle Enterprise Manag
er
2) Why to use RMAN?
RMAN gives you access to several backup and recovery techniques and feature
s not available with user-managed backup and recovery. The most noteworthy are t
he following:
Automatic specification of files to include in a backup
Establishes the name and locations of all files to be backed up
Maintain backup repository
Backups are recorded in the control file, which is the main repository of RMA
N metadata
Additionally, you can store this metadata in a recovery catalog
Incremental backups
Incremental backup stores only blocks changed since a previous backup
Thus, they provide more compact backups and faster recovery, thereby reducing th
e need to apply redo during datafile media recovery
Unused block compression:
In unused block compression, RMAN can skip data blocks that have never been us
ed
Block media recovery
We can repair a datafile with only a small number of corrupt data blocks withou
t taking it offline or restoring it from backup
Binary compression
A binary compression mechanism integrated into Oracle Database reduces the size
of backups
Encrypted backups
RMAN uses backup encryption capabilities integrated into Oracle Database to st
ore backup sets in an encrypted format
Corrupt block detection
RMAN checks for the block corruption before taking its backup
3) How RMAN works?
RMAN backup and recovery operation for a target database are managed by RMAN cl
ient
RMAN uses the target database control file to gather metadata about the target
database and to store information about its own operations
The RMAN client itself does not perform backup, restore, or recovery operation
s
When you connect the RMAN client to a target database, RMAN allocates server s
essions on the target instance and directs them to perform the operations
The work of backup and recovery is performed by server sessions running on the
target database
A channel establishes a connection from the RMAN client to a target or auxilia
ry database instance by starting a server session on the instance
The channel reads data into memory, processes it, and writes it to the output
device
When you take a database backup using RMAN, you need to connect to the target
database using RMAN Client
The RMAN client can use Oracle Net to connect to a target database, so it can
be located on any host that is connected to the target host through Oracle Net
For backup you need to allocate explicit or implicit channel to the target dat
abase
An RMAN channel represents one stream of data to a device, and corresponds to on
e database server session.
This session dynamically collect information of the files from the target datab
ase control file before taking the backup or while restoring
For example if you give ' Backup database ' from RMAN, it will first get all t
he datafiles information from the controlfile
Then it will divide all the datafiles among the allocated channels. (Roughly e
qual size of work as per the datafile size)
Then it takes the backup in 2 steps
Step1:
The channel will read all the Blocks of the entire datafile to find out all the
formatted blocks to backup
Note:
RMAN do not take backup of the unformatted blocks
Step2:
In the second step it takes back up of the formatted blocks
Example:
This is the best advantage of using RMAN as it only takes back up of the require
d blocks
Lets say in a datafile of 100 MB size, there may be only 10 MB of use full dat
a and rest 90 MB is free then RMAN will only take backup of those 10 MB
4) What O/S and oracle user privilege required using RMAN?
RMAN always connects to the target or auxiliary database using the SYSDBA priv
ilege
RMAN always connects to the target or auxiliary database using the SYSDBA priv
ilege
Its connections to a database are specified and authenticated in the same way
as SQL*Plus connections to a database
The O/S user should be part of the DBA group
For remote connection it needs the password file Authentication
Target database should have the initialization parameter REMOTE_LOGIN_PASSWORD
FILE set to EXCLUSIVE or SHARED
5) RMAN terminology:
A target database:
An Oracle database to which RMAN is connected with the TARGET keyword
A target database is a database on which RMAN is performing backup and recover
y operations
RMAN always maintains metadata about its operations on a database in the contr
ol file of the database
A recovery Catalog:
A separate database schema used to record RMAN activity against one or more ta
rget databases
A recovery catalog preserves RMAN repository metadata if the control file is l
ost, making it much easier to restore and recover following the loss of the cont
rol file
The database may overwrite older records in the control file, but RMAN maintai
ns records forever in the catalog unless deleted by the user
Backup sets:
RMAN can store backup data in a logical structure called a backup set, which is
the smallest unit of an RMAN backup
One backup set contains one or more datafiles a section of datafile or archive
logs
Backup Piece:
A backup set contains one or more binary files in an RMAN-specific format
This file is known as a backup piece
Each backup piece is a single output file
The size of a backup piece can be restricted; if the size is not restricted, t
he backup set will comprise one backup piece
Backup piece size should be restricted to no larger than the maximum file size
that your filesystem will support
Image copies:
An image copy is a copy of a single file (datafile, archivelog, or controlfile)
It is very similar to an O/S copy of the file
It is not a backupset or a backup piece
No compression is performed
Snapshot Controlfile:
When RMAN needs to resynchronize from a read-consistent version of the control f
ile, it creates a temporary snapshot control file
The default name for the snapshot control file is port-specific
Database Incarnation:
Whenever you perform incomplete recovery or perform recovery using a backup cont
rol file, you must reset the online redo logs when you open the database
The new version of the reset database is called a new incarnation
The reset database command directs RMAN to create a new database incarnation r
ecord in the recovery catalog
This new incarnation record indicates the current incarnation

6) What is RMAN Configuration and how to configure it?


The RMAN backup and recovery environment is preconfigured for each target databa
se
The configuration is persistent and applies to all subsequent operations on th
is target database, even if you exit and restart RMAN
RMAN configured settings can specify backup devices, configure a connection to
a backup device , policies affecting backup strategy, encryption algorithm, sna
p shot controlfile loaion and others
By default there are few default configuration are set when you login to RMAN
You can customize them as per your requirement
Any time you can check the current setting by using the "Show all command
CONFIGURE command is used to create persistent settings in the RMAN environmen
t, which apply to all subsequent operations, even if you exit and restart RMAN
7) How to check RMAN configuration?
RMAN>Show all;
8) How to reset to default configuration?
To reset the default configuration setting use Connect to the target database fr
om sqlplus and run
SQL> connect @target_database;
SQL> execute dbms_backup_restore.resetConfig;
RMAN Catalog Database
9) What is Catalog database and How to configure it?
This is a separate database which contains catalog schema
You can use the same target database as the catalog database but it s not at all
recommended
10) How Many catalog database I can have?
You can have multiple catalog databases for the same target database
But at a time you can connect to only 1 catalog database via RMAN. Its not rec
ommended to have multiple catalog database
11) Is this mandatory to use catalog database?
No! It s an optional one
12) What is the advantage of catalog database?
Catalog database is a secondary storage of backup metadata
It s very useful in case you lost the current controlfile, as all the backup inf
ormation are there in the catalog schema
Secondly from contolfile the older backup information are aged out depending u
pon the control_file_record_keep_time
RMAN catalog database mainten the history of data
13) What is the difference between catalog database & catalog schema?
Catalog database is like any other database which contains the RMAN catalog user
's schema

14) What happen if catalog database lost?


Since catalog database is an optional there is no direct effect of loss of catal
og database
Create a new catalog database and register the target database with the newly
created catalog one All the backup information from the target database current
controlfile will be updated to the catalog schema
If any backup information which is aged out from the target database then you
need to manually catalog those backup pieces
RMAN backup:
15) What are the database file's that RMAN can backup?
RMAN can backup Controlfile, Datafiles, Archive logs, standby database controfi
le, Spfile
16) What are the database file's that RMAN cannot backup?
RMAN can not take backup of the pfile, Redo logs, network configuration files, p
assword files, external tables and the contents of the Oracle home files
17) Can I have archivelogs and datafile backup in a single backupset?
No. We can not put datafiles and archive logs in the same backupset
18) Can I have datafiles and contolfile backup in a single backup set?
Yes
If the controlfile autobackup is not ON then RMAN takes backup of controlfile
along with the datafile 1, whenever you take backup of the database or System ta
blespace
19) Can I regulate the size of backup piece and backup set?
Yes!
You can set max size of the backupset as well as the backup piece
By default one RMAN channel creates a single backupset with one backup piece i
n it
You can use the MAXPIECESIZE channel parameter to set limits on the size of ba
ckup pieces
You can also use the MAXSETSIZE parameter on the BACKUP and CONFIGURE commands
to set a limit for the size of backup sets
20) What is the difference between backup set backup and Image copy backup?
A backup set is an RMAN-specific proprietary format, whereas an image copy is a
bit-for-bit copy of a file
By default, RMAN creates backup sets
21) What is RMAN consistent backup and inconsistent backup?
A consistent backup occurs when the database is in a consistent state
That means backup of the database taken after a shutdown immediate, shutdown n
ormal or shutdown transactional
If the database is shutdown with abort option then its not a consistent backup
A backup when the database is up and running is called an inconsistent backup
When a database is restored from an inconsistent backup, Oracle must perform m
edia recovery before the database can be opened, applying any pending changes fr
om the redo logs
You can not take inconsistent backup when the database is in Noarchivelog mode
22) Can I take RMAN backup when the database is down?
No!
You can take RMAN backup only when the target database is Open or in Mount st
age
It s because RMAN keep the backup metadata in controfile
Only in open or mount mode controlfile is accessible
23) Do I need to place the database in begin backup mode while taking RMAN inco
nsistent backup?
RMAN does not require extra logging or backup mode because it knows the f
ormat of data blocks
RMAN is guaranteed not to back up fractured blocks
No extra redo is generated during RMAN backup

24) Can I compress RMAN backups?


RMAN supports binary compression of backup sets
The supported algorithms are BZIP2 (default) and ZLIB
It s not recommended to compress the RMAN backup using any other OS or third part
y utility
Note:
RMAN compressed backup with BZIP2 provides great compression but is CPU intensi
ve
Using ZLIB compression requires the Oracle Database 11g Advanced Compression Op
tion and is only supported with an 11g database
The feature is not backward compatible with 10g databases
25) Can I encrypt RMAN backup?
RMAN supports backup encryption for backup sets
You can use wallet-based transparent encryption, password-based encryption, or
both
You can use the CONFIGURE ENCRYPTION command to configure persistent transparen
t encryption
Use the SET ENCRYPTION, command at the RMAN session level to specify password-b
ased encryption
26) Can RMAN take backup to Tape?
Yes!
We can use RMAN for the tape backup
But RMAN can not able to write directly to tape
You need to have third party Media Management Software installed
Oracle has published an API specification which Media Management Vendor's who a
re members of Oracle's Backup Solutions Partner program have access to
Media Management Vendors (MMVs) then write an interface library which the Oracl
e server uses to write and read to and from tape
Starting from oracle 10g R2 oracle has its Own Media management software for the
database backup to tape called OSB

27) How RMAN Interact with Media manager?


Before performing backup or restore to a media manager, you must allocate one o
r more channels or configure default channels for use with the media manager to
handle the communication with the media manager
RMAN does not issue specific commands to load, label, or unload tapes
When backing up, RMAN gives the media manager a stream of bytes and associates
a unique name with this stream
When RMAN needs to restore the backup, it asks the media manager to retrieve th
e byte stream
All details of how and where that stream is stored are handled entirely by the
media manager
28) What is Proxy copy backup to tape?
Proxy copy is functionality, supported by few media manager in which they handl
e the entire data movement between datafiles and the backup devices
Such products may use technologies such as high-speed connections between stora
ge and media subsystems to reduce load on the primary database server
RMAN provides a list of files requiring backup or restore to the media manager,
which in turn makes all decisions regarding how and when to move the data
29) What is Oracle Secure backup?
Oracle Secure Backup is a media manager provided by oracle that provides reliab
le and secure data protection through file system backup to tape
All major tape drives and tape libraries in SAN, Gigabit Ethernet, and SCSI env
ironments are supported
30) Can I restore or duplicate my previous version database using a later versio
n of Oracle?
For example, is it possible to restore a 9i backup while using the 10g executabl
es?
It is possible to use the 10.2 RMAN executable to restore a 9.2 database (same f
or 11.2 to 11.1 or 11.1 to 10.2, etc) even if the restored datafiles will be sto
red in ASM
RMAN is configured so that a higher release is able to restore a lower release,
but it is strongly suggested you use only the same version
31) Can I restore or duplicate between two different patchset levels?
As you can restore between different Oracle versions, you can also do so betwee
n two different patchset levels
Alter database open resetlogs upgrade;
OR
alter database open resetlogs downgrade;
32) Can I restore or duplicate between two different versions of the same operat
ing system?
For example, can I restore my 9.2.0.1.0 RMAN backup taken against a host running
Solaris 9 to a different machine where 9.2.0.1.0 is installed but where that ho
st is running Solaris 10?
If the same Oracle Server installation CDs (media pack) can be used to install
9.2.0.1.0 on Solaris 9 and Solaris 10, this type of restore is supportable
33) Is it possible to restore or duplicate when the bit level (32 bit or 64 bit)
of Oracle does not match?
For example, is it possible to restore or duplicate my 9.2. 64-bit database to a
9.2.32-bit installation?
It is preferable to keep the same bit version when performing a restore/recover
y
However, excluding the use of duplicate command, the use of the same operating
system platform should allow for a restore/recovery between bit levels (32 bit
or 64 bit) of Oracle
Note, this may be specific to the particular operating system and any problems
with this should be reported to Oracle Support
If you will be running the 64-bit database against the 32-bit binary files or
vice versa, after the recovery has ended the database bit version must be conver
ted using utlirp.sql
If you do not run utlirp.sql you will see errors including but not limited to:
ORA-06553: PLS-801: INTERNAL ERROR [56319]
34) Can I restore or duplicate my RMAN backup between two different platforms su
ch as Solaris to Linux?
In general, you cannot restore or duplicate between two different platforms
35) What are the corruption types?
Datafile Block Corruption - Physical/Logical
Table/Index Inconsistency
Extents Inconsistencies
Data Dictionary Inconsistencies

Scenarios:
Goal: How to identify all the corrupted segments in the database reported by RMA
N?
Solution:
Step 1: Identify the corrupt blocks (Datafile Block Corruption - Intra block cor
ruption)
RMAN> backup validate check logical database;
To make it faster, it can be configured to use PARALLELISM with multiple channel
s:
RMAN> run {
allocate channel d1 type disk;
allocate channel d2 type disk;
allocate channel d3 type disk;
allocate channel d4 type disk;
backup validate check logical database;
}
Step2: Using the view v$database_block_corruption:
SQL> select * from v$database_block_corruption;
FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTIO
--------------------------------------------------------------------------------
----------------------------
6 10 1 818323678166
2 LOGICAL
6 42 1 0
FRACTURED
6 34 2 0
CHECKSUM
6 50 1 8183236781952
LOGICAL
6 26 4 0
FRACTURED
5 rows selected.

Datafile Block Corruption - Intra block corruption


It refers to intra block corruptions that may cause different errors like ORA-15
78, ORA-8103, ORA-1410, ORA-600 etc.
Oracle classifies the corruptions as Physical and Logical
To identify both Physical and Logical Block Corruptions use the "CHECK LOGICAL"
option
It checks the complete database for both corruptions without actually doing a b
ackup
Solution1:
$ rman target /
RMAN> backup check logical validate database;
$ rman target /
RMAN> backup check logical database;
Solution2:
Chek the view V$DATABASE_BLOCK_CORRUPTION to identify the block corruptions det
ected by RMAN
Solution3: DBVerify - Identify Datafile Block Corruptions
DBVERIFY identify Physical and Logical Intra Block Corruptions by default
Dbverify cannot be run for the whole database in a single command
It does not need a database connection either
dbv file= blocksize=
RMAN Vs DBVerify - Datafile Intra Block Corruption
When the logical option is used by RMAN, it does exactly the same checks as DBV
does for intra block corruption.
RMAN can be run with PARALLELISM using multiple channels making it faster than D
BV which can not be run in parallel in a single command
DBV checks for empty blocks. In 10g RMAN may not check blocks in free extents wh
en Locally Managed Tablespaces are used. In 11g RMAN checks for both free and us
ed extents.
Both DBV and RMAN (11g) can check for a range of blocks. RMAN: VALIDATE DATAFILE
1 BLOCK 10 to 100;. DBV: start=10 end=100
RMAN keeps corruption information in the control file (v$database_block_corrupti
on, v$backup_corruption). DBV does not.
RMAN may not report the corruption details like what is exactly corrupted in a b
lock reported as a LOGICAL corrupted block. DBV reports the corruption details i
n the screen or in a log file.
DBV can scan blocks with a higher SCN than a given SCN.
DBV does not need a connection to the database.
dentify TABLE / INDEX Inconsistency
Table / Index inconsistencies is when an entry in the Table does not exist in th
e Index or vice versa. The common errors are ORA-8102, ORA-600 [kdsgrp1], ORA-14
99 by "analyze validate structure cascade".
The tool to identify TABLE / INDEX inconsistencies is the ANALYZE command:
analyze table validate structure cascade;

When an inconsistency is identified, the above analyze command will produce erro
r ORA-1499 and a trace file.

35) What Happens When A Tablespace/Database Is Kept In Begin Backup Mode?


One danger in making online backups is the possibility of inconsistent data wit
hin a block
For example, assume that you are backing up block 100 in datafile users.dbf
Also, assume that the copy utility reads the entire block while DBWR is in the
middle of updating the block
In this case, the copy utility may read the old data in the top half of the blo
ck and the new data in the bottom top half of the block
The result is called a fractured block, meaning that the data contained in this
block is not consistent at a given SCN
Therefore oracle internally manages the consistency as below :
The first time a block is changed in a datafile that is in hot backup mode, the
entire block is written to the redo log files, not just the changed bytes
Normally only the changed bytes (a redo vector) is written
In hot backup mode, the entire block is logged the first time
This is because you can get into a situation where the process copying the dataf
ile and DBWR are working on the same block simultaneously
Lets say they are and the OS blocking read factor is 512bytes (the OS reads 512
bytes from disk at a time). The backup program goes to read an 8k Oracle block.
The OS gives it 4k. Meanwhile -- DBWR has asked to rewrite this block. the OS sc
hedules the DBWR write to occur right now. The entire 8k block is rewritten. The
backup program starts running again (multi-tasking OS here) and reads the last
4k of the block. The backup program has now gotten an fractured block -- the hea
d and tail are from two points in time.
We cannot deal with that during recovery. Hence, we log the entire block image s
o that during recovery, this block is totally rewritten from redo and is consist
ent with itself atleast. We can recover it from there.
2. The datafile headers which contain the SCN of the last completed checkpoint
are not updated while a file is in hot backup mode. This lets the recovery proce
ss understand what archive redo log files might be needed to fully recover this
file.

================================================================================
================================================================================
===========================================================================

ASM Interview questions:


*****************************
1) What are the background processes in ASM
Ans:
RABL- Rebalancer: It opens all the device files as part of disk discovery and co
ordinates the ARB processes for rebalance activity.
ARBx - Actual Rebalancer: They perform the actual rebalancing activities.
The number of ARBx processes depends on the ASM_POWER_LIMIT init parameter.
ASMB - ASM Bridge: This process is used to provide information to and from the C
luster Synchronization Service (CSS) used by ASM to manage the disk resources.
It is also used to update statistics and provide a heartbeat mechanism.

2) What is the use of ASM (or) Why ASM preferred over filesystem?
ANS: ASM provides striping and mirroring.

3) What are the init parameters related to ASM?


ANS:
INSTANCE_TYPE = ASM
ASM_POWER_LIMIT = 11
ASM_DISKSTRING = '/dev/rdsk/*s2', '/dev/rdsk/c1*'
ASM_DISKGROUPS = DG_DATA, DG_FRA

4) What is rebalancing (or) what is the use of ASM_POWER_LIMIT?


ANS:
ASM_POWER_LIMIT is dynamic parameter, which will be useful for rebalancing the d
ata across disks.
Value can be 1(lowest) to 11 (highest).

5) What are different types of redundancies in ASM & explain?


ANS:
External redundancy,
Normal redundancy,
High redundancy.
6) How to copy file to/from ASM from/to filesystem?
ANS:
By using ASMCMD cp command
7) How to find out the databases, which are using the ASM instance?
ANS:
ASMCMD> lsct
DB_Name Status Software_Version Compatible_version Instance_Name Disk_G
roup
amxdcmp1 CONNECTED 11.2.0.2.0 11.2.0.2.0 amxdcmp1 DG1_DC
M_DATA
amxddip1 CONNECTED 11.2.0.2.0 11.2.0.2.0 amxddip1 DG1_DD
I_DATA
ASMCMD>
(or)
SQL> select DB_NAME from V$ASM_CLIENT;
8) What are different types of stripings in ASM & their differences?
ANS:
Fine-grained striping
Coarse-grained striping
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_
MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 6835200 1311391
0 1311391 0 N DG1_DCM_DATA/
MOUNTED EXTERN N 512 4096 1048576 486400 154487
0 154487 0 N DG1_DDI_DATA/
ASMCMD>

SQL> select NAME,ALLOCATION_UNIT_SIZE/1024/1024 "MB" from v$asm_diskgroup;


NAME MB
------------------------------ ----------
DG1_DCM_DATA 1
DG1_DDI_DATA 1

9) What is allocation unit and what is default value of au_size and how to chang
e?
ANS:

Every ASM disk is divided into allocation units (AU).


An AU is the fundamental unit of allocation within a disk group.
A file extent consists of one or more AU. An ASM file consists of one or more fi
le extents.
CREATE DISKGROUP disk_group_2 EXTERNAL REDUNDANCY DISK '/dev/sde1' ATRRIBUTE 'au
_size' = '32M';
10) What process does the rebalancing?
ANS:
RBAL, ARBn
11) How to add/remove disk to/from diskgroup?
ANS:
add disk:
ALTER DISKGROUP DG1_ZABBIX_DATA ADD DISK
'/zabbix_u03/oradata/zbxprd1/ZBX_DATA_DISK009' name ZBX_DATA_DISK009,
'/zabbix_u04/oradata/zbxprd1/ZBX_DATA_DISK010' name ZBX_DATA_DISK010,
'/zabbix_u05/oradata/zbxprd1/ZBX_DATA_DISK011' name ZBX_DATA_DISK011;
remove disk:
alter diskgroup DG1_CIE_DATA drop disk
DG_CIE_DATA_DISK001,
DG_CIE_DATA_DISK002,
DG_CIE_DATA_DISK003,
DG_CIE_DATA_DISK004;

********************************************************************************
***********************************************************

Oracle RMAN Interview Questions/FAQs:


**************************************
1) Difference between catalog and nocatalog?
ANS: CATALOG is used when you use a repository database as catalog.
NOCATALOG is used when you used the controlfile to register your backup informat
ion.
Default in NOCATALOG.
2) Difference between using recovery catalog and control file?
ANS:
When new incarnation happens, the old backup information in control file will be
lost.
It will be preserved in recovery catalog.
In recovery catalog, we can store scripts.
Recovery catalog is central and can have information of many databases.

3) Can we use same target database as catalog?


ANS:

No.
The recovery catalog should not reside in the target database (database to be ba
cked up),
because the database can't be recovered in the mounted state.

4) How do u know how much RMAN task has been completed?


ANS:
By querying v$rman_status or v$session_longops

5) From where list & report commands will get input


LIST:
The primary purpose of the LIST command is to list backup and copies. For exampl
e, you can list:
Backups and proxy copies of a database, tablespace, datafile, archived redo log,
or control file
Backups that have expired
Backups restricted by time, path name, device type, tag, or recoverability
Archived redo log files and disk copies
REPORT:
You can use the REPORT command to answer important questions, such as:
Which files need a backup?
Which files have had unrecoverable operations performed on them?
Which backups are obsolete and can be deleted?
What was the physical schema of the target database or a database in the Data Gu
ard environment at some previous time?
Which files have not been backed up recently?

6) Command to delete archive logs older than 7days?


ANS:
RMAN> delete archivelog all completed before sysdate-7;

7) What is the use of crosscheck command in RMAN?


ANS:
Crosscheck will be useful to check whether the catalog information is intact wit
h OS level information.

8) What are the differences between crosscheck and validate commands


ANS:
Use the CROSSCHECK command to synchronize the physical reality of backups and co
pies with their logical records in the RMAN repository.
Use the VALIDATE command to check for corrupt blocks and missing files, or to de
termine whether a backup set can be restored.
9) Which is one is good, differential (incremental) backup or cumulative (increm
ental) backup?
ANS:
A differential backup, which backs up all blocks changed after the most recent i
ncremental backup at level 1 or 0
A cumulative backup, which backs up all blocks changed after the most recent inc
remental backup at level 0
10) What is Level 0, Level 1 backup?
ANS:
A level 0 incremental backup, which is the base for subsequent incremental backu
ps, copies all blocks containing data,
backing the datafile up into a backup set just as a full backup would.
A level 1 incremental backup can be either of the following types:
A differential backup, which backs up all blocks changed after the most recent i
ncremental backup at level 1 or 0
A cumulative backup, which backs up all blocks changed after the most recent inc
remental backup at level 0

11) Can we perform level 1 backup without level 0 backup?


ANS:
If no level 0 backup is available, then the behavior depends upon the compatibil
ity mode setting.
If compatibility < 10.0.0, RMAN generates a level 0 backup of the file contents
at the time of the backup.
If compatibility is >= 10.0.0, RMAN copies all blocks changed since the file was
created, and stores the results as a level 1 backup.
In other words, the SCN at the time the incremental backup is taken is the file
creation SCN.

12) Will RMAN put the database/tablespace/datafile in backup mode ?


RMAN does not require you to put the database in backup mode.
13) What is snapshot control file?
ANS:
The snapshot CONTROLFILE is a copy of the CONTROLFILE that RMAN utilizes during
long running operation (such as backup).
RMAN needs a read consistent view of the CONTROLFILE for the backup operation, b
ut by its nature the control file is extremely volatile.
Instead of putting lock on the control file and causing all kinds of db enqueue
problems, RMAN makes a copy of controlfile called snapshot controlfile.
The snapshot is refreshed at the beginning of every backup.

14) what is controlfile auto backup ?


ANS:
then RMAN automatically backs up the control file and server parameter file afte
r every backup and after database structural changes.
The control file autobackup contains metadata about the previous backup, which i
s crucial for disaster recovery.

15) What is the difference between backup set and backup piece?
ANS:
Backup set is logical and backup piece is physical.

16) What is obsolete backup & expired backup?


A status of "expired" means that the backup piece or backup set is not found in
the backup destination.
A status of "obsolete" means the backup piece is still available, but it is no l
onger needed.
The backup piece is no longer needed since RMAN has been configured to no longer
need this piece after so many days have elapsed,
or so many backups have been performed.
17) What is the difference between hot backup & RMAN backup?
For hot backup, we have to put database in begin backup mode, then take backup.
RMAN won t put database in backup mode.

18) How to put manual/user-managed backup in RMAN (recovery catalog)?


By using catalog command.
RMAN> CATALOG START WITH '/tmp/backup.ctl';

19) What is the difference between auxiliary channel and maintenance channel ?

AUXILIARY:
Specifies a connection between RMAN and an auxiliary database instance.
An auxiliary instance is used when executing the DUPLICATE or TRANSPORT TABLESPA
CE command,
and when performing TSPITR with RECOVER TABLESPACE . When specifying this option
, the auxiliary instance must be started but not mounted.
See Also: DUPLICATE to learn how to duplicate a database, and CONNECT to learn h
ow to connect to a duplicate database instance
CHANNEL:
Specifies a connection between RMAN and the target database instance.
The channel_id is the case-sensitive name of the channel.
The database uses the channel_id to report I/O errors.
Each connection initiates an database server session on the target or auxiliary
instance: this session performs the work of backing up, restoring, or recovering
RMAN backups.
You cannot make a connection to a shared server session.
Whether ALLOCATE CHANNEL allocates operating system resources immediately depend
s on the operating system.
On some platforms, operating system resources are allocated at the time the comm
and is issued.
On other platforms, operating system resources are not allocated until you open
a file for reading or writing.
Each channel operates on one backup set or image copy at a time.
RMAN automatically releases the channel at the end of the job.

********************************************************************************
***********************************************************
Oracle RAC Interview Questions/FAQs Part1 :
----------------------------------------------
1) What is the use of RAC
ANS:
Oracle RAC allows multiple computers to run Oracle RDBMS software simultaneously
while accessing a single database, thus providing clustering.
2) What are the prerequisites for RAC setup ?

3) What are Oracle Clusterware/Daemon processes and what they do?


Ans:
ocssd, crsd, evmd, oprocd, racgmain, racgimon
4) What are the special background processes for RAC (or) what is difference in
stand-alone database & RAC database background processes?
ANS:
DIAG, LCKn, LMD, LMSn, LMON
5) What are structural changes in 11g R2 RAC?
Ans:
http://satya-racdba.blogspot.com/2010/07/new-features-in-9i-10g-11g-rac.html
Grid & ASM are on one home,
Voting disk & ocrfile can be on the ASM,
SCAN,
By using srvctl, we can mange diskgroups, home, ons, eons, filesystem, srvpool,
server, scan, scan_listener, gns, vip, oc4j,GSD
6) What is cache fusion?
Ans:
Transferring of data between RAC instances by using private network.
Cache Fusion is the remote memory mapping of Oracle buffers,
shared between the caches of participating nodes in the cluster.
When a block of data is read from datafile by an instance within the cluster and
another instance is in need of the same block,
it is easy to get the block image from the instance which has the block in its S
GA rather than reading from the disk.

7) What is the purpose of Private Interconnect?


Ans:
Clusterware uses the private interconnect for cluster synchronization (network h
eartbeat) and daemon communication between the clustered nodes. This communicati
on is based on the TCP protocol.
RAC uses the interconnect for cache fusion (UDP) and inter-process communication
(TCP).

8) What are the Clusterware components?


Ans:
Voting Disk - Oracle RAC uses the voting disk to manage cluster membership by wa
y of a health check and arbitrates cluster ownership among the instances in case
of network failures. The voting disk must reside on shared disk.
Oracle Cluster Registry (OCR) - Maintains cluster configuration information as w
ell as configuration information about any cluster database within the cluster.
The OCR must reside on shared disk that is accessible by all of the nodes in you
r cluster.
The daemon OCSSd manages the configuration info in OCR and maintains the changes
to cluster in the registry.
Virtual IP (VIP) - When a node fails, the VIP associated with it is automaticall
y failed over to some other node
and new node re-arps the world indicating a new MAC address for the IP.
Subsequent packets sent to the VIP go to the new node, which will send error RST
packets back to the clients.
This results in the clients getting errors immediately.
crsd Cluster Resource Services Daemon
cssd Cluster Synchronization Services Daemon
evmd Event Manager Daemon
oprocd / hangcheck_timer Node hang detector

9) What is OCR file?


Ans:
RAC configuration information repository that manages information about the clus
ter node list and instance-to-node mapping information.
The OCR also manages information about Oracle Clusterware resource profiles for
customized applications.
Maintains cluster configuration information as well as configuration information
about any cluster database within the cluster.
The OCR must reside on shared disk that is accessible by all of the nodes in you
r cluster.
The daemon OCSSd manages the configuration info in OCR and maintains the changes
to cluster in the registry.

10) What is Voting file/disk and how many files should be there?
Ans:
Voting Disk File is a file on the shared cluster system or a shared raw device f
ile.
Oracle Clusterware uses the voting disk to determine which instances are members
of a cluster.
Voting disk is akin to the quorum disk, which helps to avoid the split-brain syn
drome.
Oracle RAC uses the voting disk to manage cluster membership by way of a health
check and arbitrates cluster ownership among the instances
in case of network failures. The voting disk must reside on shared disk.
11) How to take backup of OCR file?
Ans:
#ocrconfig -manualbackup
#ocrconfig -export file_name.dmp
#ocrdump -backupfile my_file
$cp -p -R /u01/app/crs/cdata /u02/crs_backup/ocrbackup/RAC1
12) How to recover OCR file?
Ans:
#ocrconfig -restore backup_file.ocr
#ocrconfig -import file_name.dmp

13) What is local OCR?


Ans:
/etc/oracle/local.ocr
/var/opt/oracle/local.ocr

14) How to check backup of OCR files?


Ans:
#ocrconfig showbackup

15) How to take backup of voting file?


Ans:
dd if=/u02/ocfs2/vote/VDFile_0 of=$ORACLE_BASE/bkp/vd/VDFile_0
crsctl backup css votedisk -- from 11g R2
16) How do I identify the voting disk location?
Ans:
# crsctl query css votedisk
17) How do I identify the OCR file location?
check /var/opt/oracle/ocr.loc or /etc/ocr.loc
Ans:
# ocrcheck

18) If voting disk/OCR file got corrupted and don t have backups, how to get them?
Ans:
We have to install Clusterware.

19) Who will manage OCR files?


Ans:
cssd will manage OCR.

20) Who will take backup of OCR files?


Ans:
crsd will take backup.

21) What is split brain syndrome?


Ans:
Will arise when two or more instances attempt to control a cluster database.
In a two-node environment, one instance attempts to manage updates simultaneousl
y while the other instance attempts to manage updates.

22) What are various IPs used in RAC? Or How may IPs we need in RAC?
Ans:
Public IP, Private IP, Virtual IP, SCAN IP

23) What is the use of virtual IP?


Ans:
When a node fails,
the VIP associated with it is automatically failed over to some other node and n
ew node re-arps the world indicating a new MAC address for the IP.
Subsequent packets sent to the VIP go to the new node, which will send error RST
packets back to the clients.
This results in the clients getting errors immediately.
Without using VIPs or FAN, clients connected to a node that died will often wait
for a TCP timeout period (which can be up to 10 min) before getting an error.
As a result, you don't really have a good HA solution without using VIPs.
24) What is the use of SCAN IP (SCAN name) and will it provide load balancing?
Ans:
Single Client Access Name (SCAN) is a new Oracle Real Application Clusters (RAC)
11g Release 2,
feature that provides a single name for clients to access an Oracle Database run
ning in a cluster.
The benefit is clients using SCAN do not need to change if you add or remove nod
es in the cluster.
25) How many SCAN listeners will be running?
Ans:
Three SCAN listeners only.
26) What is FAN?
Ans:
Applications can use Fast Application Notification (FAN) to enable rapid failure
detection, balancing of connection pools after failures,
and re-balancing of connection pools when failed components are repaired.
The FAN process uses system events that Oracle publishes when cluster servers be
come unreachable or if network interfaces fail.

27) What is FCF?


Ans:
Fast Connection Failover provides high availability to FAN integrated clients, s
uch as clients that use JDBC, OCI, or ODP.NET.
If you configure the client to use fast connection failover, then the client aut
omatically subscribes to FAN events and can react to database UP and DOWN events
.
In response, Oracle gives the client a connection to an active instance that pro
vides the requested database service.

30) What is TAF and TAF policies?


Ans:
Transparent Application Failover (TAF) - A runtime failover for high availabilit
y environments,
such as Real Application Clusters and Oracle Real Application Clusters Guard, TA
F refers to the failover and re-establishment of application-to-service connecti
ons.
It enables client applications to automatically reconnect to the database if the
connection fails, and optionally resume a SELECT statement that was in progress
.
This reconnect happens automatically from within the Oracle Call Interface (OCI)
library.
31) What are nodeapps?
Ans:
VIP, listener, ONS, GSD

32) What is gsd (Global Service Daemon)? [ http://www.datadisk.co.uk/html_docs


/rac/rac_cs.htm ]
runs on each node with one GSD process per node.
The GSD coordinates with the cluster manager to receive requests from clients su
ch as the DBCA, EM, and the SRVCTL utility to execute administrative job tasks s
uch as instance startup or shutdown.
The GSD is not an Oracle instance background process and is therefore not starte
d with the Oracle instance
33) How to do load balancing in RAC?

Client Side Connect-Time Load Balance:


---------------------------------------
The client load balancing feature enables clients to randomize connection reques
ts among the listeners.
This is done by client Tnsnames Parameter: LOAD_BALANCE.
The (load_balance=yes) instructs SQLNet to progress through the list of listener
addresses in the address_list section of the net service name in a random seque
nce. When set to OFF, instructs SQLNet to try the addresses sequentially until o
ne succeeds.
Client Side Connect-Time failover
-------------------------------------
This is done by client Tnsnames Parameter: FAILOVER
The (failover=on) enables clients to connect to another listener if the initial
connection to the first listener fails. Without connect-time failover, Oracle Ne
t attempts a connection with only one listener.
Server Side Listener Connection Load Balancing.
-------------------------------------------------
With server-side load balancing, the listener directs a connection request to th
e best instance currently providing the service.
Init parameter remote_listener should be set. When set, each instance registers
with the TNS listeners running on all nodes within the cluster.
There are two types of server-side load balancing:
--------------------------------------------------
Load Based Server side load balancing redirects connections by default depending
on node load. This id default.
Session Based Session based load balancing takes into account the number of sess
ions connected to each node and then distributes the connections to balance the
number of sessions across the different nodes.
From 10g release 2 the service can be setup to use load balancing advisory. This
mean connections can be routed using SERVICE TIME and THROUGHPUT. Connection lo
ad balancing means the goal of a service can be changed, to reflect the type of
connections using the service.
Transparent Application Failover (TAF) :
----------------------------------------------
Transparent Application Failover (TAF) is a feature of the Oracle Call Interface
(OCI) driver at client side. It enables the application to automatically reconn
ect to a database, if the database instance to which the connection is made fail
s. In this case, the active transactions roll back.
Tnsnames Parameter: FAILOVER_MODE
e.g (failover_mode=(type=select)(method=basic))
Failover Mode Type can be Either SESSION or SELECT.
Session failover will have just the session to failed over to the next available
node. With SELECT, the select query will be resumed.
TAF can be configured with just server side service settings by using dbms_servi
ce package.
Fast Connection Failover (FCF):
-----------------------------------
Fast Connection Failover is a feature of Oracle clients that have integrated wit
h FAN HA Events.
Oracle JDBC Implicit Connection Cache, Oracle Call Interface (OCI), and Oracle D
ata Provider for .Net (ODP.Net) include fast connection failover.
With fast connection failover, when a down event is received, cached connections
affected by the down event are immediately marked invalid and cleaned up.

34) What are the uses of services? How to find out the services in cluster?
Ans:
Applications should use the services to connect to the Oracle database.
Services define rules and characteristics (unique name, workload balancing, fail
over options, and high availability) to control how users and applications conne
ct to database instances.
35) How to find out the nodes in cluster (or) how to find out the master node?
Ans:
# olsnodes -- Which ever displayed first, is the master node of the cluster.
select MASTER_NODE from v$ges_resource;
To find out which is the master node, you can see ocssd.log file and search for
"master node number".
36) How to know the public IPs, private IPs, VIPs in RAC?
Ans:
# olsnodes -n -p -i
node1-pub 1 node1-prv node1-vip
node2-pub 2 node2-prv node2-vip

37) What utility is used to start DB/instance?


Ans:
srvctl start database d database_name
srvctl start instance d database_name i instance_name

38) How can you shutdown single instance?


Ans:
Change cluster_database=false
srvctl stop instance d database_name i instance_name
39) What is HAS (High Availability Service) and the commands?
Ans:
HAS includes ASM & database instance and listeners.
crsctl check has
crsctl config has
crsctl disable has
crsctl enable has
crsctl query has releaseversion
crsctl query has softwareversion
crsctl start has
crsctl stop has [-f]

40) How many nodes are supported in a RAC Database?


Ans:
10g Release 2, support 100 nodes in a cluster using Oracle Clusterware, and 100
instances in a RAC database.

41) What is fencing?


Ans:
I/O fencing prevents updates by failed instances, and detecting failure and prev
enting split brain in cluster.
When a cluster node fails, the failed node needs to be fenced off from all the s
hared disk devices or diskgroups.
This methodology is called I/O Fencing, sometimes called Disk Fencing or failure
fencing.

42) Why Clusterware installed in root (why not oracle)?


Oracle Clusterware works closely with the operating system, system administrator
access is required for some of the installation tasks.
In addition, some of the Oracle Clusterware processes must run as the special op
erating system user, root.

43) What are the wait events in RAC?


Ans:
http://satya-racdba.blogspot.com/2012/10/wait-events-in-oracle-rac-wait-events.h
tml
http://orainternals.wordpress.com/2009/12/23/rac-performance-tuning-understandin
g-global-cache-performance/
gc buffer busy
gc buffer busy acquire
gc current request
gc cr request
gc cr failure
gc current block lost
gc cr block lost
gc current block corrupt
gc cr block corrupt
gc current block busy
gc cr block busy
gc current block congested
gc cr block congested.
gc current block 2-way
gc cr block 2-way
gc current block 3-way
gc cr block 3-way
(gc current/cr block n-way, n is number of nodes)
gc current grant 2-way
gc cr grant 2-way
gc current grant busy
gc current grant congested
gc cr grant congested
gc cr multi block read
gc current multi block request
gc cr multi block request
gc cr block build time
gc current block flush time
gc cr block flush time
gc current block send time
gc cr block send time
gc current block pin time
gc domain validation
gc current retry
ges inquiry response
gcs log flush sync

44) What are the initialization parameters that must have same value for every i
nstance in an Oracle RAC database?
Ans:
http://satya-racdba.blogspot.com/2012/09/init-parameters-in-oracle-rac.html
ACTIVE_INSTANCE_COUNT
ARCHIVE_LAG_TARGET
COMPATIBLE
CLUSTER_DATABASE
CLUSTER_DATABASE_INSTANCE
CONTROL_FILES
DB_BLOCK_SIZE
DB_DOMAIN
DB_FILES
DB_NAME
DB_RECOVERY_FILE_DEST
DB_RECOVERY_FILE_DEST_SIZE
DB_UNIQUE_NAME
INSTANCE_TYPE
PARALLEL_MAX_SERVERS
REMOTE_LOGIN_PASSWORD_FILE
UNDO_MANAGEMENT

45) What is the difference between cr block and cur (current) block?

46) New features in Oracle Clusterware 12c ?

Oracle Flex ASM - This feature of Oracle Clusterware 12c claims to reduce per-no
de overhead of using ASM instance.
Now the instances can use remote node ASM for any planned/unplanned downtime. AS
M metadata requests can be converted by non-local instance of ASM.
ASM Disk Scrubbing - From RAC 12c, ASM comes with disk scrubbing feature so that
logical corruptions can be discovered.
Also Oracle 12c ASM can automatically correct this in normal or high redundancy
diskgroups.
Oracle ASM Disk Resync & Rebalance enhancements.
Commands Databases Supporting To the application Gameing Game What is raid
Application Continuity (AC) - is transparent to the application and in-case the
database or the infrastructure is unavailable, this new features which work on J
DBC drivers, masks recoverable outages.
This recovers database session beneath the application so that the outage actual
ly appears to be delayed connectivity or execution.
Transaction guard (improvements of Fast Application Notification).
IPv6 Support - Oracle RAC 12c now supports IPv6 for Client connectivity, Interco
nnect is still on IPv4.
Per Subnet multiple SCAN - RAC 12c, per-Subnet multiple SCAN can be configured p
er cluster.
Each RAC instance opens the Container Database (CDB) as a whole so that versions
would be same for CDB as well as for all of the Pluggable Databases (PDBs). PDB
s are also fully compatible with RAC.
Oracle installer will run root.sh script across nodes. We don't have to run the
scripts manually on all RAC nodes.
new "ghctl" command for patching.
47) New features in Oracle 9i/10g/11g RAC ? [ http://satya-racdba.blogspot.in/2
010/07/new-features-in-9i-10g-11g-rac.html ]

Oracle Real Application Clusters New features


Oracle 9i RAC:
---------------------
OPS (Oracle Parallel Server) was renamed as RAC
CFS (Cluster File System) was supported
OCFS (Oracle Cluster File System) for Linux and Windows
watchdog timer replaced by hangcheck timer
Oracle 10g R1 RAC :
-------------------
Cluster Manager replaced by CRS
ASM introduced
Concept of Services expanded
ocrcheck introduced
ocrdump introduced
AWR was instance specific
Oracle 10g R2 RAC :
-------------------
CRS was renamed as Clusterware
asmcmd introduced
CLUVFY introduced
OCR and Voting disks can be mirrored
Can use FAN/FCF with TAF for OCI and ODP.NET
The Waiting The Wait Latest News Resource Manager Installing Music Downloads

Oracle 11g R1 RAC :


---------------------
--> Oracle 11g RAC parallel upgrades - Oracle 11g have rolling upgrade features
whereby RAC database can be upgraded without any downtime.
-->Hot patching - Zero downtime patch application.
-->Oracle RAC load balancing advisor - Starting from 10g R2 we have RAC load bal
ancing advisor utility.
11g RAC load balancing advisor is only available with clients who use .NET, ODBC
, or the Oracle Call Interface (OCI).
-->ADDM for RAC - Oracle has incorporated RAC into the automatic database diagno
stic monitor, for cross-node advisories.
The script addmrpt.sql run give report for single instance, will not report all
instances in RAC, this is known as instance ADDM.
But using the new package DBMS_ADDM, we can generate report for all instances of
RAC, this known as database ADDM.
--> Optimized RAC cache fusion protocols - moves on from the general cache fusio
n protocols in 10g to deal with specific scenarios where the protocols could be
further optimized.
--> Oracle 11g RAC Grid provisioning - The Oracle grid control provisioning pack
allows us to "blow-out" a RAC node without the time-consuming install, using a
pre-installed "footprint".
Oracle 11g R2 RAC :
-----------------------
--> We can store everything on the ASM. We can store OCR & voting files also on
the ASM.
--> ASMCA
--> Single Client Access Name (SCAN) - eliminates the need to change tns entry w
hen nodes are added to or removed from the Cluster.
RAC instances register to SCAN listeners as remote listeners. SCAN is fully qual
ified name.
Oracle recommends assigning 3 addresses to SCAN, which create three SCAN listene
rs.
--> Clusterware components: crfmond, crflogd, GIPCD.
--> AWR is consolidated for the database.
--> 11g Release 2 Real Application Cluster (RAC) has server pooling technologies
so it s easier to provision and manage database grids.
This update is geared toward dynamically adjusting servers as corporations manag
e the ebb and flow between data requirements for datawarehousing and application
s.By default, LOAD_BALANCE is ON.
--> GSD (Global Service Deamon), gsdctl introduced.
--> GPnP profile.
--> Cluster information in an XML profile.
--> Oracle RAC OneNode is a new option that makes it easier to consolidate datab
ases that aren t mission critical, but need redundancy.
--> raconeinit - to convert database to RacOneNode.
--> raconefix - to fix RacOneNode database in case of failure.
--> racone2rac - to convert RacOneNode back to RAC.
--> Oracle Restart - the feature of Oracle Grid Infrastructure's High Availabili
ty Services (HAS) to manage associated listeners, ASM instances and Oracle insta
nces.
--> Oracle Omotion - Oracle 11g release2 RAC introduces new feature called Oracl
e Omotion, an online migration utility.
This Omotion utility will relocate the instance from one node to another, whenev
er instance failure happens.
Omotion utility uses Database Area Network (DAN) to move Oracle instances.
Database Area Network (DAN) technology helps seamless database relocation withou
t losing transactions.
--> Cluster Time Synchronization Service (CTSS) is a new feature in Oracle 11g R
2 RAC, which is used to synchronize time across the nodes of the cluster. --> CT
SS will be replacement of NTP protocol.
--> Grid Naming Service (GNS) is a new service introduced in Oracle RAC 11g R2.
With GNS, Oracle Clusterware (CRS) can manage Dynamic Host Configuration Protoco
l --> (DHCP) and DNS services for the dynamic node registration and configuratio
n.
--> Cluster interconnect: Used for data blocks, locks, messages, and SCN numbers
.
--> Oracle Local Registry (OLR) - From Oracle 11gR2 "Oracle Local Registry (OLR)
" something new as part of Oracle Clusterware. OLR is node s local repository, -->
similar to OCR (but local) and is managed by OHASD. It pertains data of local n
ode only and is not shared among other nodes.
--> Multicasting is introduced in 11gR2 for private interconnect traffic.
--> I/O fencing prevents updates by failed instances, and detecting failure and
preventing split brain in cluster. When a cluster node fails, the failed node ne
eds to be fenced off from all the shared disk devices or diskgroups. This method
ology is called I/O Fencing, sometimes called Disk Fencing or failure fencing.
--> Re-bootless node fencing (restart)? - instead of fast re-booting the node, a
graceful shutdown of the stack is attempted.
--> Clusterware log directories: acfs*
--> HAIP (IC VIP).
--> Redundant interconnects: NIC bonding, HAIP.
--> RAC background processes: DBRM Database Resource Manager, PING Response time
agent.
--> Virtual Oracle 11g RAC cluster - Oracle 11g RAC supports virtualization.
********************************************************************************
*****************************************************************************
Oracle GoldenGate Interview Questions/FAQs :
**********************************************
1) What are processes/components in GoldenGate?
Ans:
Manager, Extract, Replicat, Data Pump
2) What is Data Pump process in GoldenGate ?
he Data Pump (not to be confused with the Oracle Export Import Data Pump) is an
optional secondary Extract group that is created on the source system. When Data
Pump is not used, the Extract process writes to a remote trail that is located
on the target system using TCP/IP. When Data Pump is configured, the Extract pro
cess writes to a local trail and from here Data Pump will read the trail and wri
te the data over the network to the remote trail located on the target system.
The advantages of this can be seen as it protects against a network failure as i
n the absence of a storage device on the local system, the Extract process write
s data into memory before the same is sent over the network. Any failures in the
network could then cause the Extract process to abort (abend). Also if we are d
oing any complex data transformation or filtering, the same can be performed by
the Data Pump. It will also be useful when we are consolidating data from severa
l sources into one central target where data pump on each individual source syst
em can write to one common trail file on the target.

3) What is the command line utility in GoldenGate (or) what is ggsci?

ANS: Golden Gate Command Line Interface essential commands GGSCI


GGSCI -- (Oracle) GoldenGate Software Command Interpreter

4) What is the default port for GoldenGate Manager process?


ANS:
7809
5) What are important files GoldenGate?
GLOBALS, ggserr.log, dirprm, etc ...

6) What is checkpoint table?


ANS:
Create the GoldenGate Checkpoint table
GoldenGate maintains its own Checkpoints which is a known position in the trail
file from where the Replicat process will start processing after any kind of err
or or shutdown.
This ensures data integrity and a record of these checkpoints is either maintain
ed in files stored on disk or table in the database which is the preferred optio
n.

7) How can you see GoldenGate errors?


ANS:
ggsci> VIEW GGSEVT
ggserr.log file

********************************************************************************
*****************************************************************************
Oracle Data Guard Interview Questions/FAQs :
************************************************

1) How to setup Data Guard?


2) What are different types of modes in Data Guard and which is default?
ANS:
Maximum performance:
This is the default protection mode.
It provides the highest level of data protection that is possible without affect
ing the performance of a primary database.
This is accomplished by allowing transactions to commit as soon as all redo data
generated by those transactions has been written to the online log.
Maximum protection:
This protection mode ensures that no data loss will occur if the primary databas
e fails.
To provide this level of protection, the redo data needed to recover a transacti
on must be written to both the online redo log and to at least one standby datab
ase before the transaction commits.
To ensure that data loss cannot occur, the primary database will shut down, rath
er than continue processing transactions.
Maximum availability:
This protection mode provides the highest level of data protection that is possi
ble without compromising the availability of a primary database.
Transactions do not commit until all redo data needed to recover those transacti
ons has been written to the online redo log and to at least one standby database
.

3) How many standby databases we can create (in 10g/11g)?


ANS:
Till Oracle 10g, 9 standby databases are supported.
From Oracle 11g R2, we can create 30 standby databases..
4) What are the parameters we ve to set in primary/standby for Data Guard ?
ANS:
DB_UNIQUE_NAME
LOG_ARCHIVE_CONFIG
LOG_ARCHIVE_MAX_PROCESSES
DB_CREATE_FILE_DEST
DB_FILE_NAME_CONVERT
LOG_FILE_NAME_CONVERT
LOG_ARCHIVE_DEST_n
LOGARCHIVE_DEST_STATE_n
FAL_SERVER
FAL_CLIENT
STANDBY_FILE_MANAGEMENT

5) What is the use of fal_server & fal_client, is it mandatory to set these ?

ANS:
FAL_SERVER
specifies the FAL (fetch archive log) server for a standby database. The value i
s an Oracle Net service name, which is assumed to be configured properly on the
standby database system to point to the desired FAL server.

FAL_CLIENT
specifies the FAL (fetch archive log) client name that is used by the FAL servic
e, configured through the
FAL_SERVER initialization parameter, to refer to the FAL client.
The value is an Oracle Net service name, which is assumed to be configured prope
rly on the FAL server system to point to the FAL client (standby database).

6) What are differences between physical, logical, snapshot standby and ADG (or)
what are different types of standby databases?
Physical standby in mount state, MRP will apply archives
ADG in READ ONLY state, MRP will apply archives
Logical standby in READ ONLY state, LSP will run
Snapshot standby databases Physical standby database can be converted to snapsho
t standby database, which will be in READ WRITE mode, can do any kind of testing
, then we can convert back snapshot standby database to physical standby databas
e and start MRP which will apply all pending archives.
7) How to find out backlog of standby?
select round((sysdate - a.NEXT_TIME)*24*60) as "Backlog",m.SEQUENCE#-1 "Seq Appl
ied",m.process, m.status
from v$archived_log a, (select process,SEQUENCE#, status from v$managed_standby
where process like '%MRP%')m where a.SEQUENCE#=(m.SEQUENCE#-1);
8) If you didn't have access to the standby database and you wanted to find out
what error has occurred in a data guard configuration, what view would you check
in the primary database to check the error message?
ANS:
You can check the v$dataguard_status view.
select message from v$dataguard_status;
9) How can u recover standby which far behind from primary (or) without archive
logs how can we make standby sync?
ANS:
By using RMAN incremental backup.

10) What is snapshot standby (or) How can we give a physical standby to user in
READ WRITE mode and let him do updates and revert back to standby?
ANS:
Till Oralce 10g, create guaranteed restore point, open in read write, let him do
updates, flashback to restore point, start MRP.
From Oracle 11g, convert physical standby to snapshot standby, let him do update
s, convert to physical standby, start MRP.

11) What are new features in 11g Data Guard?


ANS:
Here is some data guard category and there enhancement
1) Data Protection
Advanced Compression
Lost-write protection
Fast-Start Failover
2) Increase ROI
Active Data Guard
Snapshot Standby
3) High Availability
Faster Redo Apply
Faster failover & switchover
Automatic Failover using ASYNC
4) Manageability
Mixed Windows/Linux
12) What are the uses of standby redo log files

A standby redo log is required for the maximum protection and maximum availabili
ty modes and the LGWR ASYNC transport mode is recommended for all databases. Dat
a Guard can recover and apply more redo data from a standby redo log than from a
rchived redo log files alone.
If the real-time apply feature is enabled, log apply services can apply redo dat
a as it is received, without waiting for the current standby redo log file to be
archived.
This results in faster switchover and failover times because the standby redo lo
g files have been applied already to the standby database by the time the failov
er or switchover begins.
13) What is dg_config ?
ANS:
Specify the DG_CONFIG attribute to identify the DB_UNIQUE_NAME for the primary d
atabase and each standby database in the Data Guard configuration.
The default value of this parameter enables the primary database to send redo da
ta to remote destinations and enables standby databases to receive redo data.
14) What is RTA (real time apply) mode MRP?
ANS:
real-time apply where before log shipping the LGWR process writes to a standbylo
g file simultaneously along with the online redolog file.
This standby logfile is written to standby log file on standby server. There is
no loss of any committed transaction whatsoever in Real-Time Apply scenario.
In Real Time Apply, once a transaction is committed on the Primary, the committed
changes will be available on the Standby in Real Time even without switching th
e log at the Primary
MRP - Managed recovery process - For Data Guard, the background process that app
lies archived redo log to the standby database.
15) What is the difference between normal MRP (managed apply) and RTA MRP (real
time apply)?
ANS:

The difference between Redo Apply & Real-Time Apply


------------------------------------------------------
Normally, by default, Archiver processes will be responsible for Redo Transport
from Primary to Standby.
Once a log switch happens on the Primary, the online redo log is archived in the
Local Archive destination as pointed to by Log_archive_dest_1
by an Archiver process.
Another Archiver process will then transmit the redo to the remote standby desti
nation as indicated by Log_archive_dest_2.
Data Guard Remote File Server (RFS) Process on the Standby then writes redo data
from the Standby redo log file to archive redo log file.
Log apply services then makes use of Managed Recovery Process (MRP) process to a
pply the redo to the standby database.
This method of propagating redo from the primary to standby is called Redo Apply
and it happens only on log switch at the Primary.
When using Redo Apply mode, the status of MRP in v$managed_standby view will sho
w as WAIT_FOR_LOG.
Real Time Apply, in contrast, uses either LGWR or Archiver on the Primary to wri
te redo data to Standby Redo log on the Standby and Log Apply Services can apply
the redo data in real-time without the need of the current standby redo log bei
ng archived. Once a transaction is committed on the Primary, the committed chang
es will be available on the Standby in Real Time even without switching the log.
When using Real Time Apply mode, the status of MRP in v$managed_standby view wil
l show as APPLYING_LOG.

16) What is the difference between SYNC/ASYNC, LGWR/ARCH, and AFFIRM/NOAFFIRM ?


ANS:
Specifies that network I/O is to be done synchronously (SYNC) or asynchronously
(ASYNC) when archival is performed using the log writer process (LGWR).
Specifies whether redo transport services use archiver processes (ARCn) or the l
og writer process (LGWR) to collect transaction redo data and transmit it to sta
ndby destinations. If neither the ARCH or LGWR attributes are specified, the def
ault is ARCH.
Controls whether redo transport services use synchronous or asynchronous I/O to
write redo data to disk
AFFIRM specifies that all disk I/O to archived redo log files and standby redo log
files is performed synchronously and completes successfully before the log writ
er process continues.
NOAFFIRM specifies that all disk I/O to archived redo log files and standby redo l
og files is performed asynchronously; the log writer process on the primary data
base does not wait until the disk I/O completes before continuing.

17) What is StaticConnectIdentifier property used for?


ANS:
11gr2 new database property, StaticConnectIdentifier, which allows the user to s
pecify a static connect identifier that the DGMGRL client will use to start data
base instances.
18) What is failover/switchover (or) what is the difference between failover & s
witchover
ANS:
Switchover This is done when both primary and standby databases are available. I
t is pre-planned.
Failover This is done when the primary database is NO longer available (ie in a
Disaster). It is not pre-planned.

29) What are the background processes involved in Data Guard?


ANS:
MRP, LSP,

21)

********************************************************************************
*****************************************************************************
Oracle Export/Import (exp/imp)- Data Pump (expdp/imp) Interview Questions/FAQs :
********************************************************************************
***********

1) What is use of CONSISTENT option in exp?


Cross-table consistency. Implements SET TRANSACTION READ ONLY. Default value N.
2) What is use of DIRECT=Y option in exp?
Setting direct=yes, to extract data by reading the data directly, bypasses the S
GA,
bypassing the SQL command-processing layer (evaluating buffer), so it should be
faster. Default value N.

3) What is use of COMPRESS option in exp?


Imports into one extent. Specifies how export will manage the initial extent for
the table data.
This parameter is helpful during database re-organization.
Export the objects (especially tables and indexes) with COMPRESS=Y.
If table was spawning 20 Extents of 1M each (which is not desirable, taking into
account performance), if you export the table with COMPRESS=Y, the DDL generate
d will have initial of 20M. Later on when importing the extents will be coalesce
d.
Sometime it is found desirable to export with COMPRESS=N, in situations where yo
u do not have contiguous space on disk (tablespace), and do not want imports to
fail.

4) How to improve exp performance?


ANS:
a). Set the BUFFER parameter to a high value. Default is 256KB.
b). Stop unnecessary applications to free the resources.
c). If you are running multiple sessions, make sure they write to different disk
s.
d). Do not export to NFS (Network File Share). Exporting to disk is faster.
e). Set the RECORDLENGTH parameter to a high value.
f). Use DIRECT=yes (direct mode export).

5) How to improve imp performance?


ANS:
a). Place the file to be imported in separate disk from datafiles.
b). Increase the DB_CACHE_SIZE.
c). Set LOG_BUFFER to big size.
d). Stop redolog archiving, if possible.
e). Use COMMIT=n, if possible.
f). Set the BUFFER parameter to a high value. Default is 256KB.
g). It's advisable to drop indexes before importing to speed up the import proce
ss or set INDEXES=N and building indexes later on after the import.
Indexes can easily be recreated after the data was successfully imported.
h). Use STATISTICS=NONE
i). Disable the INSERT triggers, as they fire during import.
j). Set Parameter COMMIT_WRITE=NOWAIT(in Oracle 10g) or COMMIT_WAIT=NOWAIT (in O
racle 11g) during import.

6) What is use of INDEXFILE option in imp?


ANS:
Will write DDLs of the objects in the dumpfile into the specified file.
7) What is use of IGNORE option in imp?
ANS:
Will ignore the errors during import and will continue the import.

8) What are the differences between expdp and exp (Data Pump or normal exp/imp)?
ANS:
Data Pump is server centric (files will be at server).
Data Pump has APIs, from procedures we can run Data Pump jobs.
In Data Pump, we can stop and restart the jobs.
Data Pump will do parallel execution.
Tapes & pipes are not supported in Data Pump.
Data Pump consumes more undo tablespace.
Data Pump import will create the user, if user doesn t exist.

9) Why expdp is faster than exp (or) why Data Pump is faster than conventional e
xport/import?
Data Pump is block mode, exp is byte mode.
Data Pump will do parallel execution.
Data Pump uses direct path API.

10) How to improve expdp performance?


ANS:
Using parallel option which increases worker threads. This should be set based o
n the number of cpus.

11) How to improve impdp performance?


ANS:
Using parallel option which increases worker threads. This should be set based o
n the number of cpus.

12) In Data Pump, where the jobs info will be stored (or) if you restart a job i
n Data Pump, how it will know from where to resume?
Whenever Data Pump export or import is running, Oracle will create a table with
the JOB_NAME and will be deleted once the job is done. From this table, Oracle w
ill find out how much job has completed and from where to continue etc.
Default export job name will be SYS_EXPORT_XXXX_01, where XXXX can be FULL or SC
HEMA or TABLE.
Default import job name will be SYS_IMPORT_XXXX_01, where XXXX can be FULL or SC
HEMA or TABLE.
13) What is the order of importing objects in impdp?
Tablespaces
Users
Roles
Database links
Sequences
Directories
Synonyms
Types
Tables/Partitions
Views
Comments
Packages/Procedures/Functions
Materialized views

14) How to import only metadata?


ANS:
CONTENT= METADATA_ONLY

15) How to import into different user/tablespace/datafile/table?


ANS:
REMAP_SCHEMA
REMAP_TABLESPACE
REMAP_DATAFILE
REMAP_TABLE
REMAP_DATA
16) Using Data Pump, how to export in higher version (11g) and import into lower
version (10g), can we import to 9i?
ANS:
Import data pump can always read export datapump dumpfile sets created by older
versions of database. In your case it works, normal expdp on 10g and impdp on 11
g
VERSION parameter in datapump is for other way around, if you want to import dat
a taken from 11g into 10g database you need
to specify VERSION while taking backup.
17) How to do transport tablespaces (and across platforms) using exp/imp or expd
p/impdp?
ANS: [http://satya-dba.blogspot.in/2010/01/oracle-transportable-tablespaces-tts.
html ]
We can use the transportable tablespaces feature to copy/move subset of data (se
t of user tablespaces), from an Oracle database and plug it in to another Oracle
database. The tablespaces being transported can be either dictionary managed or
locally managed.
With Oracle 8i, Oracle introduced transportable tablespace (TTS) technology that
moves tablespaces between databases. Oracle 8i supports tablespace transportati
on between databases that run on same OS platforms and use the same database blo
ck size.
With Oracle 9i, TTS (Transportable Tablespaces) technology was enhanced to suppo
rt tablespace transportation between databases on platforms of the same type, bu
t using different block sizes.
With Oracle 10g, TTS (Transportable Tablespaces) technology was further enhanced
to support transportation of tablespaces between databases running on different
OS platforms (e.g. Windows to Linux, Solaris to HP-UX), which has same ENDIAN f
ormats. Oracle Database 10g Release 1 introduced cross platform transportable ta
blespaces (XTTS), which allows data files to be moved between platforms of diffe
rent endian format. XTTS is an enhancement to the transportable tablespace (TTS)
. If ENDIAN formats are different we have to use RMAN (e.g. Windows to Solaris,
Tru64 to AIX).
select * from v$transportable_platform order by platform_id;

18)
How to determine the Schemas inside an Oracle Data Pump Export file ?
strings dumpfile.dmp | grep SCHEMA_LIST
(or)
$ strings myfile.dmp|more
********************************************************************************
*****************************************************************************
Oracle Performance Related Interview Questions/FAQs :
**********************************************************
1) What you ll check whenever user complains that his session/database is slow?

2) What is the use of statistics?


ANS:
Optimizer statistics are a collection of data that describe more details about t
he database and the objects in the database. These statistics are used by the qu
ery optimizer to choose the best execution plan for each SQL statement.

3) How to generate explain plan?


ANS:
EXPLAIN PLAN FOR ;

4) How to check explain plan of already ran SQLs?


ANS:
select * from TABLE(dbms_xplan.display_cursor('&SQL_ID'));

5) How to find out whether the query has ran with RBO or CBO?
ANS:
ts very simple..from sql alone you cannot tell wheather they used CBO or RBO..it
s like this
If your optimizer_mode=choose
then all sql statements will use the CBO
when the tables they are acessing will have statistics collected..
then all sql statements will use the RBO
when the tables they are acessing will have no statistics..

6) What are top 5 wait events (in AWR report) and how you will resolve them?
ANS:
http://satya-dba.blogspot.in/2012/10/wait-events-in-oracle-wait-events.html
db file sequential read => tune indexing, tune SQL (to do less I/O), tune disks
, increase buffer cache. This event is indicative of disk contention on index re
ads. Make sure all objects are analyzed. Redistribute I/O across disks. The wait
that comes from the physical side of the database. It related to memory starvat
ion and non selective index use. Sequential read is an index read followed by ta
ble read because it is doing index lookups which tells exactly which block to go
to.
db file scattered read => disk contention on full table scans. Add indexes, tune
SQL, tune disks, refresh statistics, and create materialized view. Caused due t
o full table scans may be because of insufficient indexes or unavailability of u
pdated statistics.
db file parallel read => tune SQL, tune indexing, tune disk I/O, increase buffe
r cache. If you are doing a lot of partition activity then expect to see that wa
it even. It could be a table or index partition.
db file parallel write => if you are doing a lot of partition activity then exp
ect to see that wait even. It could be a table or index partition.
db file single write => if you see this event than probably you have a lot of d
ata files in your database.
control file sequential read
control file parallel write
log file sync => committing too often, archive log generation is more. Tune a
pplications to commit less, tune disks where redo logs exist, try using nologgin
g/unrecoverable options, log buffer could be too large.
log file switch completion => May need more log files per group.
log file parallel write => Deals with flushing out the redo log buffer to disk.
Disks may be too slow or have an I/O bottleneck. Look for log file contention.
log buffer space => Increase LOG_BUFFER parameter or move log files to faster
disks. Tune application, use NOLOGGING, and look for poor behavior that updates
an entire row when only a few columns change.
log file switch (checkpoint incomplete) => May indicate excessive db files or sl
ow IO subsystem.
log file switch (archiving needed) => Indicates archive files are written too
slowly.
redo buffer allocation retries => shows the number of times a user process wait
ed for space in the redo log buffer.
redo log space wait time => shows cumulative time (in 10s of milliseconds) wait
ed by all processes waiting for space in the log buffer.
buffer busy waits/ read by other session => Increase DB_CACHE_SIZE. Tune SQL, t
une indexing, we often see this event along with full table scans, if the SQL is
inserting data, consider increasing FREELISTS and/or INITRANS, if the waits are
on segment header blocks, consider increasing extent sizes.
free buffer waits => insufficient buffers, process holding buffers too long or
i/o subsystem is over loaded. Also check you db writes may be getting clogged up
.
cache buffers lru chain => Freelist issues, hot blocks.
no free buffers => Insufficient buffers, dbwr contention.
latch free
latch: session allocation
latch: in memory undo latch => If excessive could be bug, check for your versio
n, may have to turn off in memory undo.
latch: cache buffer chains => check hot objects.
latch: cache buffer handles => Freelist issues, hot blocks.
direct path write => You wont see them unless you are doing some appends or data
loads.
direct Path reads => could happen if you are doing a lot of parallel query activ
ity.
direct path read temp or direct path write temp => this wait event shows Temp fi
le activity (sort,hashes,temp tables, bitmap) check pga parameter or sort area o
r hash area parameters. You might want to increase them.
library cache load lock
library cache pin => if many sessions are waiting, tune shared pool, if few sess
ions are waiting, lock is session specific.
library cache lock => need to find the session holding the lock, look for DML m
anipulating an object being accessed, if the session is trying to recompile PL/S
QL, look for other sessions executing the code.
undo segment extension => If excessive, tune undo.
wait for a undo record => Usually only during recovery of large transactions,
look at turning off parallel undo recovery.
enque wait events => Look at V$ENQUEUE_STAT
SQL*Net message from client
SQL*Net message from dblink
SQL*Net more data from client
SQL*Net message to client
SQL*Net break/reset to client

7) What are the init parameters related to performance/optimizer?


ANS:
optimizer_mode = choose
optimizer_index_caching = 90
optimizer_index_cost_adj = 25
optimizer_max_permutations = 100
optimizer_use_sql_plan_baselines=true
optimizer_capture_sql_plan_baselines=true
optimizer_use_pending_statistics = true;
optimizer_use_invisible_indexes=true
_optimizer_connect_by_cost_based=false
_optimizer_compute_index_stats= true;
8) What are the values of optimizer_mode init parameters and their meaning?
ANS:
optimizer_mode = choose

9) What is the use of AWR, ADDM, ASH?


10) How to generate AWR report and what are the things you will check in the re
port?
11). How to generate ADDM report and what are the things you will check in the r
eport?
12). How to generate ASH report and what are the things you will check in the re
port?
13) How to generate TKPROF report and what are the things you will check in the
report?
ANS:

The tkprof tool is a tuning tool used to determine cpu and execution times for S
QL statements. Use it by first setting timed_statistics to true in the initializ
ation file and then turning on tracing for either the entire database via the sq
l_trace parameter or for the session using the ALTER SESSION command. Once the t
race file is generated you run the tkprof tool against the trace file and then l
ook at the output from the tkprof tool. This can also be used to generate explai
n plan output.

14)

********************************************************************************
*****************************************************************************
UNIX Interview Questions/FAQs for Oracle DBAs:
************************************************
1) What s the difference between soft link and hard link?
Ans:
A symbolic (soft) linked file and the targeted file can be located on the same o
r different file system while for a hard link they must be located on the same f
ile system, because they share same inode number and an inode table is unique to
a file system, both must be on the same file system.

2) How you will read a file from shell script?


Ans:
while read line
do
echo $line
done < file_name
3) 3. What s the use of umask?
ANS:
Will decide the default permissions for files.
4) What is crontab and what are the arguments?
Ans:
The entries have the following elements:
field allowed values
----- --------------
minute 0-59
hour 0-23
day of month 1-31
month 1-12
day of week 0-7 (both 0 and 7 are Sunday)
user Valid OS user
command Valid command or script
? ? ? ? ? command
| | | | |_________day of the week (0-6, 0=Sunday)
| | | |___________month (1-12)
| | |_____________day of the month (1-31)
| |_______________hour (0-23)
|_________________minute (0-59)

5) How to find operating system (OS) version?


Ans:
uname a
6) How to find out the run level of the user?
Ans:
uname r

7) How to delete 7 days old trace files?


Ans:
find ./trace name *.trc mtime +7 exec rm {} \;
8) What is top command?
Ans:
top is a operating system command, it will display top processes which are takin
g high cpu and memory.

9) 8. How to get 10th line of a file (by using grep)?

10)
********************************************************************************
*****************************************************************************
Architecture:
Oracle DBA Interview Questions/FAQs Part1 :

1) What is an instance?
ANS:
SGA + background processes.
2) What is SGA?
ANS:
System/Shared Global Area.
3) What is PGA (or) what is pga_aggregate_target?
ANS:
Programmable Global Area.
4) What are new memory parameters in Oracle 10g?
ANS:
SGA_TARGET, PGA_TARGET
5) What are new memory parameters in Oracle 11g?
ANS:
MEMORY_TARGET
6) What are the mandatory background processes?
ANS:
DBWR LGWR SMON PMON CKPT RECO.
7) What are the optional background processes?
ANS:
ARCH, MMAN, MMNL, MMON, CTWR, ASMB, RBAL, ARBx etc.
8) What are the new background processes in Oracle 10g?
ANS:
MMAN MMON MMNL CTWR ASMB RBAL ARBx
9) What are the new features in Oracle 9i?
http://satya-dba.blogspot.com/2009/01/whats-new-in-9i.html
10) . What are the new features in Oracle 10g?
http://satya-dba.blogspot.com/2009/01/whats-new-in-10g.html
11). What are the new features in Oracle 11g?
http://satya-dba.blogspot.com/2009/01/whats-new-in-11g.html
12). What are the new features in Oracle 11g R2?
http://satya-dba.blogspot.com/2009/09/whats-new-in-11g-release-2.html
13) What process will get data from datafiles to DB cache?
ANS:
Server process
14) What background process will writes data to datafiles?
ANS:
DBWR
15) What background process will write undo data?
ANS:
DBWR
16) What are physical components of Oracle database?
ANS:
Oracle database is comprised of three types of files. One or more datafiles, two
or more redo log files, and one or more control files.
Password file and parameter file also come under physical components.

17) What are logical components of Oracle database?


ANS:
Blocks, Extents, Segments, Tablespaces.
18) What is segment space management?
ANS:
LMTS and DMTS.
19) What is extent management?
ANS:
Auto and Manual.
20) What are the differences between LMTS and DMTS?
Tablespaces that record extent allocation in the dictionary are called dictionar
y managed tablespaces,
and tablespaces that record extent allocation in the tablespace header are calle
d locally managed tablespaces.
********************************************************************************
*****************************************************************************
Oracle DBA Interview Questions/FAQs Part2 :
********************************************
1) What is a datafile?
ANS:
Every Oracle database has one or more physical datafiles. Datafiles contain all
the database data. The data of logical database structures such as tables and in
dexes is physically stored in the datafiles allocated for a database.
2) What are the contents of control file?
ANS:
Database name, SCN, LSN, datafile locations, redolog locations, archive mode, DB
Creation Time, RMAN Backup & Recovery Details, Flashback mode.
3) What is the use of redo log files?
ANS:
Online redo logs serve to protect the database in the event of an instance failu
re. Whenever a transaction is committed, the corresponding redo entries temporar
ily stored in redo log buffers of the system global area are written to an onlin
e redo log file by the background process LGWR.
4) What are the uses of undo tablespace or redo segments?
ANS:
Undo records are used to:
Roll back transactions when a ROLLBACK statement is issued
Recover the database
Provide read consistency
Analyze data as of an earlier point in time by using Flashback Query
Recover from logical corruptions using Flashback features
5) How undo tablespace can guarantee retain of required undo data?
ANS:
Alter tablespace undo_ts retention guarantee;

6) What is 01555 - snapshot too old error and how do you avoid it?
ANS:
http://www.dba-oracle.com/t_ora_01555_snapshot_old.htm
7) What is the use/size of temporary tablespace?
ANS:
Temporary tablespaces are used to manage space for database sort operations and
for storing global temporary tables
8) What is the use of password file?
ANS:
If the DBA wants to start up an Oracle instance there must be a way for Oracle t
o authenticate this DBA. That is if (s)he is allowed to do so. Obviously, his pa
ssword can not be stored in the database, because Oracle can not access the data
base before the instance is started up. Therefore, the authentication of the DBA
must happen outside of the database. There are two distinct mechanisms to authe
nticate the DBA: using the password file or through the operating system.
The init parameter remote_login_passwordfile specifies if a password file is use
d to authenticate the DBA or not. If it set either to shared or exclusive a pass
word file will be used.
9) How to create password file?
ANS:
$ orapwd file=orapwSID password=sys_password force=y nosysdba=y
10) How many types of indexes are there?
ANS:
Clustered and Non-Clustered
1.B-Tree index
2.Bitmap index
3.Unique index
4.Function based index
Implicit index and explicit index.
Explicit indexes are again of many types like simple index, unique index, Bitmap
index, Functional index, Organisational index, cluster index.
11) What is bitmap index & when it ll be used?
ANS:
Bitmap indexes are preferred in Data warehousing environment.
Preferred when cardinality is low.

12) What is B-tree index & when it ll be used?


ANS:
B-tree indexes are preferred in OLTP environment.
Preferred when cardinality is high.

13) How you will find out fragmentation of index?


ANS:
AUTO_SPACE_ADVISOR_JOB will run in daily maintenance window and report fragmente
d indexes/Tables.
analyze index validate structure;
This populates the table index_stats . It should be noted that this table contains
only one row and therefore only one index can be analysed at a time.
An index should be considered for rebuilding under any of the following conditio
ns:
* The percentage of deleted rows exceeds 30% of the total, i.e. if
del_lf_rows / lf_rows > 0.3.
* If the HEIGHT is greater than 4.
* If the number of rows in the index ( LF_ROWS ) is significantly smaller than LF_BLK
S this can indicate a large number of deletes, indicating that the index should b
e rebuilt.

14) What is the difference between delete and truncate?]


ANS:
Truncate will release the space. Delete won t.
Delete can be used to delete some records. Truncate can t.
Delete can be rollbacked.
Delete will generate undo (Delete command will log the data changes in the log f
ile where as the truncate will simply remove the data without it. Hence data rem
oved by Delete command can be rolled back but not the data removed by TRUNCATE).
Truncate is a DDL statement whereas DELETE is a DML statement.
Truncate is faster than delete.
15) What's the difference between a primary key and a unique key?
ANS:
Both primary key and unique enforce uniqueness of the column on which they are d
efined.
But by default primary key creates a clustered index on the column, where unique
key creates a nonclustered index by default.
Primary key doesn't allow NULLs, but unique key allows one NULL only.
16) What is the difference between schema and user?
Schema is collection of user s objects.

17) What is the difference between SYSDBA, SYSOPER and SYSASM?


ANS:
SYSOPER can t create and drop database.
SYSOPER can t do incomplete recovery.
SYSOPER can t change character set.
SYSOPER can t CREATE DISKGROUP, ADD/DROP/RESIZE DISK
SYSASM can do anything SYSDBA can do.
18) What is the difference between SYS and SYSTEM?
SYSTEM can t shutdown the database.
SYSTEM can t create another SYSTEM, but SYS can create another SYS or SYSTEM.
19) What is the difference between view and materialized view?
View is logical, will store only the query, and will always gets latest data.
Mview is physical, will store the data, and may not get latest data.

20)
********************************************************************************
****************************************************************************
Oracle DBA Interview Questions/FAQs Part3 :
*********************************************
1) What are materialized view refresh types and which is default?
ANS:
Complete, fast, force(default)
2) How to find out when was a materialized view refreshed?
ANS:
Query dba_mviews or dba_mview_analysis or dba_mview_refresh_times
SQL> select MVIEW_NAME, to_char(LAST_REFRESH_DATE,'YYYY-MM-DD HH24:MI:SS') from
dba_mviews;
(or)
SQL> select NAME, to_char(LAST_REFRESH,'YYYY-MM-DD HH24:MI:SS') from dba_mview_r
efresh_times;
(or)
SQL> select MVIEW_NAME, to_char(LAST_REFRESH_DATE,'YYYY-MM-DD HH24:MI:SS') from
dba_mview_analysis;

3) What is atomic refresh in mviews?


ANS:
From Oracle 10g, complete refresh of single materialized view can do delete inst
ead of truncate.
To force the refresh to do truncate instead of delete, parameter ATOMIC_REFRESH
must be set to false.
ATOMIC_REFRESH = FALSE, mview will be truncated and whole data will be inserted.
The refresh will go faster, and no undo will be generated.
ATOMIC_REFRESH = TRUE (default), mview will be deleted and whole data will be in
serted. Undo will be generated. We will have access at all times even while it i
s being refreshed.
SQL> EXEC DBMS_MVIEW.REFRESH('mv_emp', 'C', atomic_refresh=FALSE);
4) How to find out whether database/tablespace/datafile is in backup mode or not
?
ANS:
Query V$BACKUP view.
5) What is row chaining?
ANS:
If the row is too large to fit into an empty data block in this case the oracle
stores the data for the row in a chain of one or more data blocks. Can occur whe
n the row is inserted.
6) What is row migration?
ANS:
An update statement increases the amount of data in a row so that the row no lon
ger fits in its data blocks.
Now the oracle tries to find another free block with enough space to hold the en
tire row if such a block is available oracle moves entire row to new block.

7) What are different types of partitions?


ANS:
With Oracle8, Range partitioning (on single column) was introduced.
With Oracle8i, Hash and Composite(Range-Hash) partitioning was introduced.
With Oracle9i, List partitioning and Composite(Range-List) partitioning was intr
oduced.
With Oracle 11g, Interval partitioning, REFerence partitioning, Virtual column b
ased partitioning, System partitioning and Composite partitioning [Range-Range,
List-List, List-Range, List-Hash, Interval-Range, Interval-List, Interval-Interv
al] was introduced.
8) What is local partitioned index and global partitioned index?
ANS:
A local index is an index on a partitioned table which is partitioned in the exa
ct same manner as the underlying partitioned table. Each partition of a local in
dex corresponds to one and only one partition of the underlying table.
A global partitioned index is an index on a partitioned or non partitioned table
s which are partitioned using a different partitioning key from the table and ca
n have different number of partitions. Global partitioned indexes can only be pa
rtitioned using range partitioning.
9) How you will recover if you lost one/all control file(s)?
10) Why more archivelogs are generated, when database is begin backup mode?
ANS:
During begin backup mode datafile headers get freezed and as result row informat
ion cannot be retrieved as a result the entire block is copied to redo logs as a
result more redo generated and more log switch and in turn more archive logs.
Normally only deltas (change vectors) are logged to the redo logs.
When in backup mode, Oracle will write complete changed blocks to the redo log f
iles.
Mainly to overcome fractured blocks. Most of the cases Oracle block size is equa
l to or a multiple of the operating system block size.
e.g. Consider Oracle blocksize is 2k and OSBlocksize is 4k. so each OS Block is
comprised of 2 Oracle Blocks. Now you are doing an update when your db is in bac
kup mode. An Oracle Block is updating and at the same time backup is happening o
n the OS block which is having this particular DB block. Backup will not be cons
istent since the one part of the block is being updated and at the same time it
is copied to the backup location. In this case we will have a fractured block, s
o as to avoid this Oracle will copy the whole OS block to redo logfile which can
be used for recovery. Because of this redo generation is more.
11) What UNIX parameters you will set while Oracle installation?
ANS:
shmmax, shmmni, shmall, sem,
12) What is the use of inittrans and maxtrans in table definition?
13) What are differences between dbms_job and dbms_schedular?
Through dbms_schedular we can schedule OS level jobs also.
14) What are differences between dbms_schedular and cron jobs?
Through dbms_schedular we can schedule database jobs, through cron we can t set.
15) Difference between CPU & PSU patches?
CPU - Critical Patch Update - includes only Security related patches.
PSU - Patch Set Update - includes CPU + other patches deemed important enough to
be released prior to a minor (or major) version release.
16) What you will do if (local) inventory corrupted [or] opatch lsinventory is
giving error?
17) What are the entries/location of oraInst.loc?
ANS:
/etc/oraInst.loc is pointer to central/local Oracle Inventory.

18) What is the difference between central/global inventory and local inventory?
ANS:

19)
********************************************************************************
*****************************************************************************
Oracle DBA Interview Questions/FAQs Part4 :
**********************************************
1) What is the use of root.sh & oraInstRoot.sh?
Ans:
Changes ownership & permissions of oraInventory
Creating oratab file in the /etc directory
In RAC, starts the clusterware stack
2) How can you transport tablespaces across platforms with different endian form
ats?
Ans:
RMAN
3) What is transportable tablespace (and across platforms)?
4) What is xtss (cross platform transportable tablespace)?
5) What is the difference between restore point & guaranteed restore point?
6) How to find if your Oracle database is 32 bit or 64 bit?
Ans:
execute the command "file $ORACLE_HOME/bin/oracle", you should see output like /
u01/db/bin/oracle: ELF 64-bit MSB executable SPARCV9 Version 1
means you are on 64 bit oracle.
If your oracle is 32 bit you should see output like below
oracle: ELF 32-bit MSB executable SPARC Version 1

7) How to find opatch Version ?


Ans:
opatch is utility to apply database patch, In order to find opatch version execu
te"$ORACLE_HOME/OPatch/opatch version"

8) suppose i created one table after few days i did some insert,update how can i
know when will i did ddl or dml operation is undergone on that table ?
ANS:
DDL:
select OWNER,OBJECT_NAME,CREATED,LAST_DDL_TIME,from dba_objects where OBJECT_NAM
E='&object_name';

DML:
SQL> select max(ora_rowscn), scn_to_timestamp(max(ora_rowscn)) from PS_PAY_TAX;
MAX(ORA_ROWSCN) SCN_TO_TIMESTAMP(MAX(ORA_ROWSCN))
--------------- ----------------------------------------------------------------
-----------
6016929147 04-JAN-12 08.41.20.000000000 AM
SQL>
SQL> select table_name, inserts, updates, deletes, timestamp,truncated from use
r_tab_modifications where table_name='TEST1';
TABLE_NAME INSERTS UPDATE DELETES TIMESTAMP TRU DROP_SEG
--------- -------- ------- -------- ------------------- --- --------
TEST1 4 0 0 04.08.2008 12:03:32 NO 0
=====================================================================
THE END
====================================================================

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*********************************&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&***************&&&&&&&&&&&&&&&&&&&

What are the Oracle Architectural components?


Q: What are the Oracle Memory Components?
Q: What is the Server Parameter File?
Q: What is the Parameter File?
Q: How do you use the init.ora file?
Q: What is the System Global Area (SGA)?
Q: What is the Shared Pool in SGA?
Q: What is the Buffer Cache in SGA?
Q: What does the Buffer Cache hold in SGA?
Q: What are the differences between the Library Cache and Dictionary Cache?
Q: What is the Redo Log Buffer in SGA?
Q: Describe the Large Pool component in SGA?
Q: Describe the Multi-threaded Server process?
Q: What are PGA and UGA?
Q: Describe the log writer background process (LGWR)?
Q: How often LGWR writes user s entries to the Online Redo Log Buffer files?
Q: Describe the Checkpoint process?
Q: How do you automatically force the Oracle to perform a checkpoint?
Q: What is the Recovery Process?
Q: What is the Lock Background Process?
Q: How does the Archive Process work?
Q: How do you configure your database to do an automatic archiving?
Q: What is the System Monitor Process?
Q: Describe the Program Monitor Process Job?
Q: What are the differences between the SPFILE and PFILE startup?
Q: What is the controlfile?
Q: How do you backup your database controlfiles?
Q: What does a controlfile contain?
Q: Describe the password file?
Q: How do you create a password file?
Q: Describe the Online Redo Log file?

What error messages did u notice in Alert and Trace log files (give 3(2 easy and
1 tough) examples) for both. Also let me know what actions did u take for resolv
ing the issues.
1.How to check which instance is serving the user query in a 2 node rac database
2.What is the use of backing up the standby controlfile.
3.What is the use of pfile and spfile in rac environment
4.How to check which listener is accepting the user connections in 2 node rac da
tabase
5.What is the use of scan ip's And virtual ip's and why virtual ip's are used wh
en scan ip's are already in use?
6.How the scan ip's process the incoming connections of a user
7.Background process of RAC?
8.How a select query will function in a 2 node rac database.
9.How to restore and recover a incremental backup from standalone to 2node rac d
atabase
10.USING Of scan and vip in grid,oracle homes
11.check sr about listener issue.
12.What is client-side and server-side load balancing
13.What is the use of sqlnames.ora
14.How to take the awr report for a standby database.
15.finding in awr report and how to analyze the root cause analysis.
16.How to restore a database from one server to another server.
17.set_io_options=all
18.Does rman take the ongoing transactions backup when we initiate backup
19.What is the need of spfile while archive_dest_loc_1 is specified in pfile and
restarted with spfile to change the archive destination dynamically
20.DOES RESTORE DATABASE FROM BACKUP WILL REPLACE THE EXISTING DATABASE
21.What will happen if we issue ALTER DATABASE RECOVER database using backup co
ntrolfile until cancel on standby?
22.When a user comes to you and asks that a particular SQL query is taking more
time. How will you solve this
23.What is recover database until cancel using backup controlfile

RMAN INTERVIEW QUESTIONS


Some of the Common Backup and Recovery Interview Questions for Oracle Database A
dministrator. These questions are common for both Senior Oracle DBA or Junior D
BA. I have compiled these questions based upon the feedback I got from many cand
idates who have attended interviews in various MNC's
1. Which types of backups you can take in Oracle?
2. A database is running in NOARCHIVELOG mode then which type of backups you can
take?
3. Can you take partial backups if the Database is running in NOARCHIVELOG mode?
4. Can you take Online Backups if the the database is running in NOARCHIVELOG mo
de?
5. How do you bring the database in ARCHIVELOG mode from NOARCHIVELOG mode?
6. You cannot shutdown the database for even some minutes, then in which mode yo
u should run
the database?
7. Where should you place Archive logfiles, in the same disk where DB is or anot
her disk?
8. Can you take online backup of a Control file if yes, how?
9. What is a Logical Backup?
10. Should you take the backup of Logfiles if the database is running in ARCHIVE
LOG mode?
11. Why do you take tablespaces in Backup mode?
12. What is the advantage of RMAN utility?
13. How RMAN improves backup time?
14. Can you take Offline backups using RMAN?
15. How do you see information about backups in RMAN?
16. What is a Recovery Catalog?
17. Should you place Recovery Catalog in the Same DB?
18. Can you use RMAN without Recovery catalog?
19. Can you take Image Backups using RMAN?
20. Can you use Backupsets created by RMAN with any other utility?

21. Where RMAN keeps information of backups if you are using RMAN without Catalo
g?
22. You have taken a manual backup of a datafile using o/s. How RMAN will know a
bout it?
23. You want to retain only last 3 backups of datafiles. How do you go for it in
RMAN?
24. Which is more efficient Incremental Backups using RMAN or Incremental Export
?
25. Can you start and shutdown DB using RMAN?
26. How do you recover from the loss of datafile if the DB is running in NOARCHI
VELOG mode?
27. You loss one datafile and it does not contain important objects. The importa
nt objects are there in other datafiles which are intact. How do you proceed in
this situation?
28. You lost some datafiles and you don't have any full backup and the database
was running in NOARCHIVELOG mode. What you can do now?
29. How do you recover from the loss of datafile if the DB is running in ARCHIVE
LOG mode?
30. You loss one datafile and DB is running in ARCHIVELOG mode. You have full da
tabase backup of 1 week old and partial backup of this datafile which is just 1
day old. From which backup should you restore this file?
31. You lost controlfile how do you recover from this?
32. The current logfile gets damaged. What you can do now?
33. What is a Complete Recovery?
34. What is Cancel Based, Time based and Change Based Recovery?
35. Some user has accidentally dropped one table and you realize this after two
days. Can you recover this table if the DB is running in ARCHIVELOG mode?
36. Do you have to restore Datafiles manually from backups if you are doing reco
very using RMAN?
37. A database is running in ARCHIVELOG mode since last one month. A datafile is
added to the database last week. Many objects are created in this datafile. Aft
er one week this datafile gets damaged before you can take any backup. Now can y
ou recover this datafile when you don't have any backups?
38. How do you recover from the loss of a controlfile if you have backup of cont
rolfile?
39. Only some blocks are damaged in a datafile. Can you just recover these block
s if you are using RMAN?
40. Some datafiles were there on a secondary disk and that disk has become damag
ed and it will take some days to get a new disk. How will you recover from this
situation?
41. Have you faced any emergency situation. Tell us how you resolved it?
42. At one time you lost parameter file accidentally and you don't have any back
up. How you will recreate a new parameter file with the parameters set to previo
us values.

****************************************&&&&&&&&&&&&&&&&&&&&&&&&&&**************
***&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&**********&

DESC dba_objects
desc dba_properties
desc dba_temp_usage
desc dba_segments
desc dba_extents
desc dba_users
desc dba_free_space
all_objects
sm$ts_used,free,avail.
v$session
desc user_segments
desc v$session and v$process views
desc dba_tab_partitions
desc v$session_longops
desc v$sql
desc v$sqlarea
desc dba_indexex
desc dba_ind_columns
desc dba_hist_active_session_history
desc dba_hist_snapshot
desc v$datafile
desc v$controlfile,v$redolog
desc v$spparameter
desc v$parameter
role_sys_privs
dba_tab_privs
dba_sys_privs
dba_tables
desc registry$history
desc dba_audit_trail
desc dba_datapump_jobs
desc dba_datapump_sessions
desc dba_directories
desc dba_hist_sqlbind
desc dba_hist_sqltext
desc dba_hist_sqlstat
desc dba_hist_wr_control
desc dba_ind_partitions
desc dba_jobs
desc dba_jobs_running
desc dba_objects
desc dba_role_privs
desc dba_scheduler_jobs
desc dba_sequences
desc dba_profiles
desc dba_tab_columns
desc dba_tablespaces
desc dba_tables
desc dba_temp_files
desc dba_users
desc nls_database_parameters
desc nls_session_parameters

You might also like