Oracle Architecture Q&A
Oracle Architecture Q&A
racle SID is the unique name that uniquely identifies your instance/database where as the
O
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
2
oracle installation?
Initially set up disks and kernel parameters, then create oracle user and DBA group, and finally
run installer to start the installation process. The SHMMAX & SHMMNI two kernel parameter
required to set before installation process.
data block is the smallest unit of logical storage for a database object. As objects grow they
A
take chunks of additional storage that are composed of contiguous data blocks. These
groupings of contiguous data blocks are called extents. All the extents that an object takes when
grouped together are considered the segment of the database object.
hen you are running dedicated server then process information stored inside the process
W
global area (PGA) and when you are using shared server then the process information stored
inside user global area (UGA).
he system global area is a group of shared memory area that is dedicated to oracle instance.
T
All oracle process uses the SGA to hold information. The SGA is used 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.
MON (System Monitor) performs recovery after instance failure, monitor temporary segments
S
and extents; clean temp segment, coalesce free space. It is mandatory process of DB and starts
by default.
PMON (Process Monitor) failed process resources. In shared server architecture monitor and
restarts any failed dispatcher or server process. It is mandatory process of DB and starts by
default.
. What is the main purpose of ‘CHECKPOINT’ in oracle database? How do you automatically
9
force the oracle to perform a checkpoint?
checkpoint is a database event, which synchronize the database blocks in memory with the
A
datafiles on disk. It has two main purposes: To establish a data consistency and enable faster
database Recovery.
he following are the parameter that will be used by DBA to adjust time or interval of how
T
frequently its checkpoint should occur in database.
LOG_CHECKPOINT_TIMEOUT = 3600; # Every one hour
LOG_CHECKPOINT_INTERVAL = 1000; # number of OS blocks.
irst it will check the syntax and semantics in library cache, after that it will create execution
F
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 cache after that it will
send server and finally server send to the client.
11. What is the use of large pool, which case you need to set the large pool?
ou need to set large pool if you are using: MTS (Multi thread server) and RMAN Backups.
Y
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 buffers from local process memory rather
than shared memory. Then there is no use of large pool.
12. What does database do during the mounting process?
hile mounting the database oracle reads the data from controlfile which is used for verifying
W
physical database files during sanity check. Background processes are started before mounting
the database only.
“ CURRENT” state means that redo records are currently being written to that group. It 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 ‘ACTIVE’ state. As
we know log file keep changes made to the data blocks then data blocks are modified in buffer
cache (dirty blocks). These dirty blocks must be written 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 state.
he point at which oracle ends writing to one online redo log file and begins writing to another is
T
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;
racle Instance:
O
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 files, Redo log files.
(optional param file, passwd file, archived log)
ackground processes:
B
Started when an Oracle Instance is started.
Background Processes Maintains and enforces relationships between physical and memory
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
rainstRoot.sh needs to be run to change the Permissions and groupname to 770 and to dba.
o
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/local/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.sh' from the oracle
inventory directory.this script needs to run the first time only when any oracle product is installed
on the server.
8. What is the Difference Between Local Inventory and Global Inventory? What is oraInventory
1
?
raInventory is repository (directory) which store/records oracle software products & their
o
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 format & called as binary Inventory.
There are basically two kind of inventories,
One is Local Inventory (also called as Oracle Home Inventory) and other is Global Inventory
(also called as Central Inventory).
lobal Inventory holds information about Oracle Products on a Machine. These products can be
G
various oracle components like database, oracle application server, collaboration suite, soa
suite, forms & reports or discoverer server . This global 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 machine check for file inventory.xml under ContentsXML in oraInventory Please
note if you have multiple global Inventory on machine check all oraInventory directories)
You will see entry like
HOME NAME=”ORA10g_HOME” LOC=”/u01/oracle/10.2.0/db” TYPE=”O” IDX=”1?/
Inventory inside each Oracle Home is called as local Inventory or oracle_home Inventory. This
Inventory holds information to that oracle_home only.
racle home inventory or local inventory is present inside each Oracle home. It only contains
O
information relevant to a particular Oracle home. This file is located in the following location:
$ORACLE_HOME/inventory
It contains the following files and folders:
· Components File
· Home Properties File
· Other Folders
o need to worry if your global Inventory is corrupted, you can recreate global Inventory on
N
machine using Universal Installer and attach already Installed oracle 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=”{}”
5. If any one of these 6 mandatory background processes is killed/not running, the instance will
2
be aborted ?
7. Select * from emp where dept=10; what level should i configure for better performance
2
Where Clause .... Literal or Bind Variables? Expalin?
28. What is a Baseline?
29. Incarnation? Explain in detail? Where the incarnation information will be stored?