Architecture Questions
Architecture Questions
net/upenpriti/oracle-dba-interviewquestions-with-answer
http://www.slideshare.net/upenpriti/oracle-dba-interviewquestions-with-answer
The related columns of the tables are called the cluster key. The
cluster key is indexed using a cluster index and its value is stored
only once for multiple tables in the cluster.
57. What is the basic element of base configuration of an
Oracle database?
It consists of
one or more data files.
one or more control files.
two or more redo log files.
The Database contains
multiple users/schemas
one or more rollback segments
one or more tablespaces
Data dictionary tables
User objects (table,indexes,views etc.,)
The server that access the database consists of
SGA (Database buffer, Dictionary Cache Buffers, Redo log buffers,
Shared SQL pool)
SMON (System MONito)
PMON (Process MONitor)
LGWR (LoG Write)
DBWR (Data Base Write)
ARCH (ARCHiver)
CKPT (Check Point)
RECO
Dispatcher
User Process with associated PGS
58. What is a deadlock? Explain.
Two processes waiting to update the rows of a table, which are
locked by other processes then deadlock arises.
In a database environment this will often happen because of not
issuing the proper row lock commands. Poor design of front-end
application may cause this situation and the performance of
server will reduce drastically.
These locks will be released automatically when a
commit/rollback operation performed or any one of this processes
being killed externally.
More practical questions here in this blog
Memory Management
59. What is SGA?
The System Global Area in an Oracle database is the area in
memory to facilitate the transfer of information between users. It
holds the most recently requested structural information between
users. It holds the most recently requested structural information
about the database. The structure is database buffers, dictionary
cache, redo log buffer and shared pool area.
DBA Interview Question & Answers with practical
examples
60. What is a shared pool?
The data dictionary cache is stored in an area in SGA called the
shared pool. This will allow sharing of parsed SQL statements
among concurrent users.
61. What is mean by Program Global Area (PGA)?
It is area in memory that is used by a single Oracle user process.
Yes.
The advantages over file system files are that I/O will be improved
because Oracle is bye-passing the kernel which writing into disk.
Disk corruption will be very less.
87. What is a Control file?
Databases overall physical architecture is maintained in a file
called control file. It will be used to maintain internal consistency
and guide recovery operations. Multiple copies of control files are
advisable.
88. How to implement the multiple control files for an
existing database?
Shutdown the database
Copy one of the existing control file to new location
Edit Config ora file by adding new control filename
Restart the database.
89. What is redo log file mirroring? How can be achieved?
Process of having a copy of redo log files is called mirroring.
This can be achieved by creating group of log files together, so
that LGWR will automatically writes them to all the members of
the current on-line redo log group. If any one group fails then
database automatically switch over to next group. It degrades
performance.
90. What is advantage of having disk shadowing /
mirroring?
Shadow set of disks save as a backup in the event of disk failure.
In most operating systems if any disk failure occurs it
automatically switchover to place of failed disk.
Improved performance because most OS support volume
shadowing can direct file I/O request to use the shadow set of files
instead of the main set of files. This reduces I/O load on the main
set of disks.
91. What is use of rollback segments in Oracle database?
They allow the database to maintain read consistency between
multiple transactions.
92. What is a rollback segment entry?
It is the set of before image data blocks that contain rows that are
modified by a transaction.
Each rollback segment entry must be completed within one
rollback segment.
A single rollback segment can have multiple rollback segment
entries.
93. What is hit ratio?
It is a measure of well the data cache buffer is handling requests
for data.
Hit Ratio = (Logical Reads Physical Reads Hits Misses)/ Logical
Reads.
94. When will be a segment released?
When Segment is dropped.
When Shrink (RBS only)
When truncated (TRUNCATE used with drop storage option)
95. What are disadvantages of having raw devices?
We should depend on export/import utility for backup/recovery
(fully reliable)
The tar command cannot be used for physical file backup, instead
we can use dd command, which is less flexible and has limited
recoveries.
96. List the factors that can affect the accuracy of the
estimations?
- The space used transaction entries and deleted records, does
not become free immediately after completion due to delayed
cleanout.
- Trailing nulls and length bytes are not stored.
- Inserts of, updates to and deletes of rows as well as columns
larger than a single data block, can cause fragmentation a
chained row pieces.
Database Security & Administration
97. What is user Account in Oracle database?
A user account is not a physical structure in database but it is
having important relationship to the objects in the database and
will be having certain privileges.
98. How will you enforce security using stored
procedures?
Dont grant user access directly to tables within the application.
Instead grant the ability to access the procedures that access the
tables.
When procedure executed it will execute the privilege of
procedures owner. Users cannot access tables except via the
procedure.
99. What are the dictionary tables used to monitor a
database space?
DBA_FREE_SPACE
DBA_SEGMENTS
DBA_DATA_FILES.
SQL*Plus Statements
Outer Join Joining two tables in such a way that query can also
retrieve rows that do not have corresponding join value in the
other table.
104. What is the sub-query?
Sub-query is a query whose return values are used in filtering
conditions of the main query.
105. What is correlated sub-query?
Correlated sub-query is a sub-query, which has reference to the
main query.
106. Explain CONNECT BY PRIOR?
Retrieves rows in hierarchical order eg.
select empno, ename from emp where.
107. Difference between SUBSTR and INSTR?
INSTR (String1, String2 (n, (m)),
INSTR returns the position of the m-th occurrence of the string 2
in string1. The search begins from nth position of string1.
SUBSTR (String1 n, m)
SUBSTR returns a character string of size m in string1, starting
from n-th position of string1.
108. Explain UNION, MINUS, UNION ALL and INTERSECT?
INTERSECT returns all distinct rows selected by both queries.
MINUS returns all distinct rows selected by the first query but
not by the second.
UNION returns all distinct rows selected by either query
UNION ALL returns all rows selected by either query, including
all duplicates.
123. How to access the current value and next value from
a sequence? Is it possible to access the current value in a
session before accessing next value?
Sequence name CURRVAL, sequence name NEXTVAL. It is not
possible. Only if you access next value in the session, current
value can be accessed.
124. What is CYCLE/NO CYCLE in a Sequence?
CYCLE specifies that the sequence continue to generate values
after reaching either maximum or minimum value. After panascending sequence reaches its maximum value, it generates its
minimum value. After a descending sequence reaches its
minimum, it generates its maximum.
NO CYCLE specifies that the sequence cannot generate more
values after reaching its maximum or minimum value.
125. What are the advantages of VIEW?
- To protect some of the columns of a table from other users.
- To hide complexity of a query.
- To hide complexity of calculations.
126. Can a view be updated/inserted/deleted? If Yes
under what conditions?
A View can be updated/deleted/inserted if it has only one base
table if the view is based on columns from one or more tables
then insert, update and delete is not possible.
What is Oltp database?OLTP means Online Transaction Processing. OLAP means Online
Analytical Processing. OLTP deals with processing of data from transactional systems. For example, an
application that loads the reservation data of a hotel is an OLTP system. An OLTP system is designed
mainly keeping in the mind the performance of the end application. It comprises of the application,
database & the reporting system that directly works on this database. The database in an OLTP system
would be designed in a manner as to facilitate the improvement in the application efficiency thereby
reducing the processing time of the application.
OLAP systems were mainly developed using data in a warehouse. Having said that a need was felt to
isolate older data, it was necessary to store them in a format that would be useful in easing out the
reporting bottlenecks. A need was felt to isolate the data & redesign the application data to such a format
& structure that this data repository would be the prime source of business decisions. Coming back to
OLAP systems, these systems were mainly developed on the isolated data.