Вы находитесь на странице: 1из 32

Oracle DBA interview questions Schema objects are the logical structures that

directly refer to the database's data. Schema objects


include tables, views, sequences, synonyms,
indexes, clusters, database triggers, procedures,
functions packages and database links.
Oracle Concepts and Architecture Database
Structures
8. Can objects of the same schema reside in
different tablespaces?
1. What are the components of physical database
Yes.
structure of Oracle database?
9. Can a tablespace hold objects from different
Oracle database is comprised of three types of files.
schemes?
One or more datafiles, two are more redo log files,
and one or more control files.
Yes.
2. What are the components of logical database
10. What is Oracle table?
structure of Oracle database?
A table is the basic unit of data storage in an Oracle
There are tablespaces and database's schema
database. The tables of a database hold all of the
objects.
user accessible data. Table data is stored in rows
and columns.
3. What is a tablespace?
11. What is an Oracle view?
A database is divided into Logical Storage Unit
called tablespaces. A tablespace is used to grouped
A view is a virtual table. Every view has a query
related logical structures together.
attached to it. (The query is a SELECT statement
that identifies the columns and rows of the table(s)
4. What is SYSTEM tablespace and when is it
the view uses.)
created?
12. Do a view contain data?
Every Oracle database contains a tablespace named
SYSTEM, which is automatically created when the
Views do not contain or store data.
database is created. The SYSTEM tablespace
always contains the data dictionary tables for the
13. Can a view based on another view?
entire database.
Yes.
5. Explain the relationship among database,
tablespace and data file.
14. What are the advantages of views?
Each databases logically divided into one or more
- Provide an additional level of table security, by
tablespaces one or more data files are explicitly
restricting access to a predetermined set of rows and
created for each tablespace.
columns of a table.
- Hide data complexity.
6. What is schema?
- Simplify commands for the user.
- Present the data in a different perspective from
A schema is collection of database objects of a user.
that of the base table.
- Store complex queries.
7. What are Schema Objects?
15. What is an Oracle sequence?
A sequence generates a serial list of unique numbers The related columns of the tables in a cluster are
for numerical columns of a database's tables. called the cluster key.

16. What is a synonym? 25. What is index cluster?

A synonym is an alias for a table, view, sequence or A cluster with an index on the cluster key.
program unit.
26. What is hash cluster?
17. What are the types of synonyms?
A row is stored in a hash cluster based on the result
There are two types of synonyms private and of applying a hash function to the row's cluster key
public. value. All rows with the same hash key value are
stores together on disk.
18. What is a private synonym?
27. When can hash cluster used?
Only its owner can access a private synonym.
Hash clusters are better choice when a table is often
19. What is a public synonym? queried with equality queries. For such queries the
specified cluster key value is hashed. The resulting
Any database user can access a public synonym. hash key value points directly to the area on disk
that stores the specified rows.
20. What are synonyms used for?
28. What is database link?
- Mask the real name and owner of an object.
- Provide public access to an object A database link is a named object that describes a
- Provide location transparency for tables, views or "path" from one database to another.
program units of a remote database.
- Simplify the SQL statements for database users. 29. What are the types of database links?

21. What is an Oracle index? Private database link, public database link &
network database link.
An index is an optional structure associated with a
table to have direct access to rows, which can be 30. What is private database link?
created to increase the performance of data
retrieval. Index can be created on one or more Private database link is created on behalf of a
columns of a table. specific user. A private database link can be used
only when the owner of the link specifies a global
22. How are the index updates? object name in a SQL statement or in the definition
of the owner's views or procedures.
Indexes are automatically maintained and used by
Oracle. Changes to table data are automatically 31. What is public database link?
incorporated into all relevant indexes.
Public database link is created for the special user
23. What are clusters? group PUBLIC. A public database link can be used
when any user in the associated database specifies a
Clusters are groups of one or more tables physically global object name in a SQL statement or object
stores together to share common columns and are definition.
often used together.
32. What is network database link?
24. What is cluster key?
Network database link is created and managed by a
network domain service. A network database link
can be used when any user of any database in the Each index has an index segment that stores all of
network specifies a global object name in a SQL its data.
statement or object definition.
41. What is rollback segment?
33. What is data block?
A database contains one or more rollback segments
Oracle database's data is stored in data blocks. One to temporarily store "undo" information.
data block corresponds to a specific number of
bytes of physical database space on disk. 42. What are the uses of rollback segment?

34. How to define data block size? To generate read-consistent database information
during database recovery and to rollback
A data block size is specified for each Oracle uncommitted transactions by the users.
database when the database is created. A database
users and allocated free database space in Oracle 43. What is a temporary segment?
data blocks. Block size is specified in init.ora file
and cannot be changed latter. Temporary segments are created by Oracle when a
SQL statement needs a temporary work area to
35. What is row chaining? complete execution. When the statement finishes
execution, the temporary segment extents are
In circumstances, all of the data for a row in a table released to the system for future use.
may not be able to fit in the same data block. When
this occurs, the data for the row is stored in a chain 44. What is a datafile?
of data block (one or more) reserved for that
segment. Every Oracle database has one or more physical
data files. A database's data files contain all the
36. What is an extent? database data. The data of logical database
structures such as tables and indexes is physically
An extent is a specific number of contiguous data stored in the data files allocated for a database.
blocks, obtained in a single allocation and used to
store a specific type of information. 45. What are the characteristics of data files?

37. What is a segment? A data file can be associated with only one
database. Once created a data file can't change size.
A segment is a set of extents allocated for a certain One or more data files form a logical unit of
logical structure. database storage called a tablespace.

38. What are the different types of segments? 46. What is a redo log?

Data segment, index segment, rollback segment and The set of redo log files for a database is
temporary segment. collectively known as the database redo log.

39. What is a data segment? 47. What is the function of redo log?

Each non-clustered table has a data segment. All of The primary function of the redo log is to record all
the table's data is stored in the extents of its data changes made to data.
segment. Each cluster has a data segment. The data
of every table in the cluster is stored in the cluster's 48. What is the use of redo log information?
data segment.
The information in a redo log file is used only to
40. What is an index segment? recover the database from a system or media failure
prevents database data from being written to a An index is a database structure used by the server
database's data files. to have direct access of a row in a table. An index is
automatically created when a unique of primary key
49. What does a control file contains? constraint clause is specified in create table
command
- Database name
- Names and locations of a database's files and 55. What are clusters?
redolog files.
- Time stamp of database creation. Group of tables physically stored together because
they share common columns and are often used
50. What is the use of control file? together is called cluster.

When an instance of an Oracle database is started, 56. What is a cluster key?


its control file is used to identify the database and
redo log files that must be opened for database The related columns of the tables are called the
operation to proceed. It is also used in database cluster key. The cluster key is indexed using a
recovery. cluster index and its value is stored only once for
multiple tables in the cluster.

57. What are the basic element of base


configuration of an Oracle database?

Data Base Administration It consists of


one or more data files.
one or more control files.
two or more redo log files.
51. What is a database instance? Explain. The Database contains
multiple users/schemas
A database instance (Server) is a set of memory one or more rollback segments
structure and background processes that access a set one or more tablespaces
of database files. The processes can be shared by all Data dictionary tables
of the users. User objects (table,indexes,views etc.,)
The server that access the database consists of
The memory structure that is used to store the most SGA (Database buffer, Dictionary Cache
queried data from database. This helps up to Buffers, Redo log buffers, Shared SQL pool)
improve database performance by decreasing the SMON (System MONito)
amount of I/O performed against data file. PMON (Process MONitor)
LGWR (LoG Write)
52. What is Parallel Server? DBWR (Data Base Write)
ARCH (ARCHiver)
Multiple instances accessing the same database CKPT (Check Point)
(only in multi-CPU environments) RECO
Dispatcher
User Process with associated PGS
53. What is a schema?
58. What is a deadlock? Explain.
The set of objects owned by user account is called
the schema. Two processes waiting to update the rows of a table,
which are locked by other processes then deadlock
54. What is an index? How it is implemented in arises.
Oracle database?
In a database environment this will often happen Monitor the ratio of the reloads takes place while
because of not issuing the proper row lock executing SQL statements. If the ratio is greater
commands. Poor design of front-end application than 1 then increase the SHARED_POOL_SIZE.
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 Database Logical & Physical Architecture
this processes being killed externally.

64. What is Database Buffers?

Database buffers are cache in the SGA used to hold


Memory Management the data blocks that are read from the data segments
in the database such as tables, indexes and clusters
DB_BLOCK_BUFFERS parameter in INIT.ORA
59. What is SGA? decides the size.

The System Global Area in an Oracle database is 65. What is dictionary cache?
the area in memory to facilitate the transfer of
information between users. It holds the most Dictionary cache is information about the database
recently requested structural information between objects stored in a data dictionary table.
users. It holds the most recently requested structural
information about the database. The structure is 66. What is meant by recursive hints?
database buffers, dictionary cache, redo log buffer
and shared pool area. Number of times processes repeatedly query the
dictionary table is called recursive hints. It is due to
60. What is a shared pool? the data dictionary cache is too small. By increasing
the SHARED_POOL_SIZE parameter we can
The data dictionary cache is stored in an area in optimize the size of data dictionary cache.
SGA called the shared pool. This will allow sharing
of parsed SQL statements among concurrent users. 67. What is redo log buffer?

61. What is mean by Program Global Area Changes made to the records are written to the on-
(PGA)? line redo log files. So that they can be used in roll
forward operations during database recoveries.
It is area in memory that is used by a single Oracle Before writing them into the redo log files, they will
user process. first brought to redo log buffers in SGA and LGWR
will write into files frequently. LOG_BUFFER
62. What is a data segment? parameter will decide the size.

Data segment are the physical areas within a 68. How will you swap objects into a different
database block in which the data associated with table space for an existing database?
tables and clusters are stored.
- Export the user
63. What are the factors causing the reparsing of - Perform import using the command imp
SQL statements in SGA? system/manager file=export.dmp
indexfile=newrite.sql. This will create all
Due to insufficient shared pool size. definitions into newfile.sql.
- Drop necessary objects.
- Run the script newfile.sql after altering the
tablespaces.
- Import from the backup for the necessary objects.
Each block contains entries as follows
69. List the Optional Flexible Architecture (OFA) Fixed block header
of Oracle database? How can we organize the Variable block header
tablespaces in Oracle database to have maximum Row Header, row date (multiple rows may exists)
performance? PCTEREE (% of free space for row updating in
future)
SYSTEM - Data dictionary tables.
DATA - Standard operational tables. 75. What is the role of PCTFREE parameter is
DATA2- Static tables used for standard operations storage clause?
INDEXES - Indexes for Standard operational
tables. This is used to reserve certain amount of space in a
INDEXES1 - Indexes of static tables used for block for expansion of rows.
standard operations.
TOOLS - Tools table. 76. What is the OPTIMAL parameter?
TOOLS1 - Indexes for tools table.
RBS - Standard Operations Rollback Segments, It is used to set the optimal length of a rollback
RBS1,RBS2 - Additional/Special Rollback segment.
segments.
TEMP - Temporary purpose tablespace 77. What is the functionality of SYSTEM table
TEMP_USER - Temporary tablespace for users. space?
USERS - User tablespace.
To manage the database level transactions such as
70. How will you force database to use particular modifications of the data dictionary table that
rollback segment? record information about the free space usage.

SET TRANSACTION USE ROLLBACK 78. How will you create multiple rollback
SEGMENT rbs_name. segments in a database?

71. What is meant by free extent? - Create a database, which implicitly creates a
SYSTEM rollback segment in a SYSTEM
A free extent is a collection of continuous free tablespace.
blocks in tablespace. When a segment is dropped its
extents are reallocated and are marked as free. - Create a second rollback segment name R0 in the
SYSTEM tablespace.
72.Which parameter in Storage clause will
reduce number of rows per block? - Make new rollback segment available (after
shutdown, modify init.ora file and start database)
PCTFREE parameter
- Create other tablespaces (RBS) for rollback
Row size also reduces no of rows per block. segments.

73. What is the significance of having storage - Deactivate rollback segment R0 and activate the
clause? newly created rollback segments.

We can plan the storage for a table as how much 79. How the space utilization takes place within
initial extents are required, how much can be rollback segments?
extended next, how much % should leave free for
managing row updating, etc., It will try to fit the transaction in a cyclic fashion to
all existing extents. Once it found an extent is in use
74. How does Space allocation table place within then it forced to acquire a new extent (number of
a block? extents is based on the optimal size)
RBS extents
80. Why query fails sometimes? The data dictionary tables for space management
are updated.
Rollback segment dynamically extent to handle Transaction Completes.
larger transactions entry loads.
84. How can we plan storage for very large
A single transaction may wipeout all available free tables?
space in the rollback segment tablespace. This
prevents other user using rollback segments. Limit the number of extents in the table
Separate table from its indexes.
81. How will you monitor the space allocation? Allocate sufficient temporary storage.

By querying DBA_SEGMENT table/view 85. How will you estimate the space required by
a non-clustered tables?
82. How will you monitor rollback segment
status? Calculate the total header size
Calculate the available data space per data block
Querying the DBA_ROLLBACK_SEGS view Calculate the combined column lengths of the
average row
IN USE - Rollback Segment is on- Calculate the total average row size.
line. Calculate the average number rows that can fit in a
AVAILABLE - Rollback Segment block
available but not on-line. Calculate the number of blocks and bytes required
OFF-LINE - Rollback Segment off- for the table.
line
INVALID - Rollback Segment After arriving the calculation, add 10 % additional
Dropped. space to calculate the initial extent size for a
NEEDS RECOVERY - Contains data but need working table.
recovery or corrupted.
PARTLY AVAILABLE - Contains data from an 86. It is possible to use raw devices as data files
unresolved transaction involving a and what are the advantages over file system
distributed database. files?

83. List the sequence of events when a large Yes.


transaction that exceeds beyond its optimal value
when an entry wraps and causes the rollback The advantages over file system files are that I/O
segment to expand into another extend. will be improved because Oracle is bye-passing the
kernel which writing into disk. Disk corruption will
Transaction Begins. be very less.

An entry is made in the RES header for new 87. What is a Control file?
transactions entry
Database's overall physical architecture is
Transaction acquires blocks in an extent of RBS maintained in a file called control file. It will be
used to maintain internal consistency and guide
The entry attempts to wrap into second extent. None recovery operations. Multiple copies of control files
is available, so that the RBS must extent. are advisable.

The RBS checks to see if it is part of its OPTIMAL 88. How to implement the multiple control files
size. for an existing database?
RBS chooses its oldest inactive segment.
Oldest inactive segment is eliminated. Shutdown the database
Copy one of the existing controlfile to new location Hit Ratio = (Logical Reads - Physical Reads - Hits
Edit Config ora file by adding new control filename Misses)/ Logical Reads.
Restart the database.
94. When will be a segment released?
89. What is redo log file mirroring? How can be
achieved? When Segment is dropped.
When Shrink (RBS only)
Process of having a copy of redo log files is called When truncated (TRUNCATE used with drop
mirroring. storage option)

This can be achieved by creating group of log files 95. What are disadvantages of having raw
together, so that LGWR will automatically writes devices?
them to all the members of the current on-line redo
log group. If any one group fails then database We should depend on export/import utility for
automatically switch over to next group. It degrades backup/recovery (fully reliable)
performance.
The tar command cannot be used for physical file
90. What is advantage of having disk shadowing backup, instead we can use dd command, which is
/ mirroring? less flexible and has limited recoveries.

Shadow set of disks save as a backup in the event of 96. List the factors that can affect the accuracy
disk failure. In most operating systems if any disk of the estimations?
failure occurs it automatically switchover to place
of failed disk. - The space used transaction entries and deleted
records, does not become free immediately after
Improved performance because most OS support completion due to delayed cleanout.
volume shadowing can direct file I/O request to use
the shadow set of files instead of the main set of - Trailing nulls and length bytes are not stored.
files. This reduces I/O load on the main set of disks.
- Inserts of, updates to and deletes of rows as well
91. What is use of rollback segments in Oracle as columns larger than a single data block, can
database? cause fragmentation a chained row pieces.

They allow the database to maintain read


consistency between multiple transactions.

92. What is a rollback segment entry? Database Security & Administration

It is the set of before image data blocks that contain


rows that are modified by a transaction. 97. What is user Account in Oracle database?
Each rollback segment entry must be completed
within one rollback segment. A user account is not a physical structure in
database but it is having important relationship to
A single rollback segment can have multiple the objects in the database and will be having
rollback segment entries. certain privileges.

93. What is hit ratio? 98. How will you enforce security using stored
procedures?
It is a measure of well the data cache buffer is
handling requests for data. Don't grant user access directly to tables within the
application.
Instead grant the ability to access the procedures Join is a query, which retrieves related columns or
that access the tables. rows from multiple tables.

When procedure executed it will execute the Self Join - Joining the table with itself.
privilege of procedures owner. Users cannot access Equi Join - Joining two tables by equating two
tables except via the procedure. common columns.
Non-Equi Join - Joining two tables by equating two
99. What are the dictionary tables used to common columns.
monitor a database space? Outer Join - Joining two tables in such a way that
query can also retrieve rows that do not have
DBA_FREE_SPACE corresponding join value in the other table.
DBA_SEGMENTS
DBA_DATA_FILES. 104. What is the sub-query?

Sub-query is a query whose return values are used


in filtering conditions of the main query.

SQL*Plus Statements 105. What is correlated sub-query?

Correlated sub-query is a sub-query, which has


reference to the main query.
100. What are the types of SQL statement?
106. Explain CONNECT BY PRIOR?
Data Definition Language: CREATE, ALTER,
DROP, TRUNCATE, REVOKE, NO AUDIT & Retrieves rows in hierarchical order eg.
COMMIT.
Data Manipulation Language: INSERT, UPDATE, select empno, ename from emp where.
DELETE, LOCK TABLE, EXPLAIN PLAN &
SELECT. 107. Difference between SUBSTR and INSTR?
Transactional Control: COMMIT & ROLLBACK
Session Control: ALTERSESSION & SET ROLE INSTR (String1, String2 (n, (m)),
System Control: ALTER SYSTEM. INSTR returns the position of the m-th occurrence
of the string 2 in string1. The search begins from
101. What is a transaction? nth position of string1.

Transaction is logical unit between two commits SUBSTR (String1 n, m)


and commit and rollback. SUBSTR returns a character string of size m in
string1, starting from n-th position of string1.
102. What is difference between TRUNCATE &
DELETE? 108. Explain UNION, MINUS, UNION ALL and
INTERSECT?
TRUNCATE commits after deleting entire table i.e.,
cannot be rolled back. INTERSECT - returns all distinct rows selected by
Database triggers do not fire on TRUNCATE both queries.
MINUS - returns all distinct rows selected by
DELETE allows the filtered deletion. Deleted the first query but not by the second.
records can be rolled back or committed. UNION - returns all distinct rows selected by
Database triggers fire on DELETE. either query
UNION ALL - returns all rows selected by either
103. What is a join? Explain the different types query, including all duplicates.
of joins?
109. What is ROWID?
117. How many LONG columns are allowed in a
ROWID is a pseudo column attached to each row of table? Is it possible to use LONG columns in
a table. It is 18 characters long, blockno, WHERE clause or ORDER BY?
rownumber are the components of ROWID.
Only one LONG column is allowed. It is not
110. What is the fastest way of accessing a row in possible to use LONG column in WHERE or
a table? ORDER BY clause.

Using ROWID. 118. What are the pre-requisites to modify


CONSTRAINTS datatype of a column and to add a column with
NOT NULL constraint?
111. What is an integrity constraint?
- To modify the datatype of a column the column
Integrity constraint is a rule that restricts values to a must be empty.
column in a table. - To add a column with NOT NULL constrain, the
table must be empty.
112. What is referential integrity constraint?
119. Where the integrity constraints are stored in
Maintaining data integrity through a set of rules that data dictionary?
restrict the values of one or more columns of the
tables based on the values of primary key or unique The integrity constraints are stored in
key of the referenced table. USER_CONSTRAINTS.

113. What is the usage of SAVEPOINTS? 120. How will you activate/deactivate integrity
constraints?
SAVEPOINTS are used to subdivide a transaction
into smaller parts. It enables rolling back part of a The integrity constraints can be enabled or disabled
transaction. Maximum of five save points are by ALTER TABLE ENABLE CONSTRAINT /
allowed. DISABLE CONSTRAINT.

114. What is ON DELETE CASCADE? 121. If unique key constraint on DATE column is
created, will it validate the rows that are inserted
When ON DELETE CASCADE is specified Oracle with SYSDATE?
maintains referential integrity by automatically
removing dependent foreign key values if a It won't, Because SYSDATE format contains time
referenced primary or unique key value is removed. attached with it.

115. What are the data types allowed in a table? 122. What is a database link?

CHAR, VARCHAR2, NUMBER, DATE, RAW, Database link is a named path through which a
LONG and LONG RAW. remote database can be accessed.

116. What is difference between CHAR and 123. How to access the current value and next
VARCHAR2? What is the maximum SIZE value from a sequence? Is it possible to access
allowed for each type? the current value in a session before accessing
next value?
CHAR pads blank spaces to the maximum length.
VARCHAR2 does not pad blank spaces. Sequence name CURRVAL, sequence name
For CHAR the maximum length is 255 and 2000 for NEXTVAL. It is not possible. Only if you access
VARCHAR2. next value in the session, current value can be
accessed.
124. What is CYCLE/NO CYCLE in a administer the backup and recovery process. In
Sequence? addition, since you are taking cold backups the
database does not require being in archive log
CYCLE specifies that the sequence continue to mode and thus there will be a slight performance
generate values after reaching either maximum or gain as the database is not cutting archive logs to
minimum value. After pan-ascending sequence disk.
reaches its maximum value, it generates its 2. You have just had to restore from backup and
do not have any control files. How would you go
minimum value. After a descending sequence about bringing up this database?
reaches its minimum, it generates its maximum.
I would create a text based backup control file,
stipulating where on disk all the data files where
NO CYCLE specifies that the sequence cannot
and then issue the recover command with the
generate more values after reaching its maximum or
using backup control file clause.
minimum value. 3. How do you switch from an init.ora file to a
spfile?
125. What are the advantages of VIEW? Issue the create spfile from pfile command.
4. Explain the difference between a data block, an
- To protect some of the columns of a table from extent and a segment.
other users. A data block is the smallest unit of logical storage
- To hide complexity of a query. for a database object. As objects grow they take
- To hide complexity of calculations. chunks of additional storage that are composed of
contiguous data blocks. These groupings of
126. Can a view be updated/inserted/deleted? If contiguous data blocks are called extents. All the
Yes - under what conditions? extents that an object takes when grouped together
are considered the segment of the database object.
A View can be updated/deleted/inserted if it has 5. Give two examples of how you might determine
only one base table if the view is based on columns the structure of the table DEPT.

from one or more tables then insert, update and Use the describe command or use the
delete is not possible. dbms_metadata.get_ddl package.
6. Where would you look for errors from the
database engine?
127. If a view on a single base table is
manipulated will the changes be reflected on the In the alert log.
base table?
7. Compare and contrast TRUNCATE and DELETE
for a table.
If changes are made to the tables and these tables
are the base tables of a view, then the changes will Both the truncate and delete command have the
be reference on the view. desired outcome of getting rid of all the rows in a
table. The difference between the two is that the
truncate command is a DDL operation and just
moves the high water mark and produces a now
1. Explain the difference between a hot backup rollback. The delete command, on the other hand,
and a cold backup and the benefits associated with
each. is a DML operation, which will produce a rollback
and thus take longer to complete.
A hot backup is basically taking a backup of the 8. Give the reasoning behind using an index.
database while it is still up and running and it
must be in archive log mode. A cold backup is Faster access to data blocks in a table.
9. Give the two types of tables involved in
taking a backup of the database while it is shut producing a star schema and the type of data they
down and does not require being in archive log hold.
mode. The benefit of taking a hot backup is that Fact tables and dimension tables. A fact table
the database is still available for use while the contains measurements while dimension tables
backup is occurring and you can recover the will contain data that will help describe the fact
database to any ball in time. The benefit of taking tables.
a cold backup is that it is typically easier to 10. What type of index should you use on a fact
table?
A Bitmap index. increasing the undo retention or increasing the
11. Give two examples of referential integrity size of rollbacks. You should also look at the logic
constraints.
involved in the application getting the error
A primary key and a foreign key. message.
12. A table is classified as a parent table and you 20. Explain the difference between $ORACLE_HOME
want to drop and re-create it. How would you do and $ORACLE_BASE.
this without affecting the children tables?
ORACLE_BASE is the root directory for oracle.
Disable the foreign key constraint to the parent,
ORACLE_HOME located beneath
drop the table, re-create the table, enable the
ORACLE_BASE is where the oracle products
foreign key constraint.
13. Explain the difference between ARCHIVELOG
reside.
mode and NOARCHIVELOG mode and the benefits 1. Describe the difference between a procedure,
and disadvantages to each.
function and anonymous pl/sql block.
ARCHIVELOG mode is a mode that you can put
Candidate should mention use of DECLARE
the database in for creating a backup of all
statement, a function must return a value while a
transactions that have occurred in the database so
procedure doesn?t have to.
that you can recover to any ball in time.
NOARCHIVELOG mode is basically the absence 2. What is a mutating table error and how can you
of ARCHIVELOG mode and has the disadvantage get around it?
of not being able to recover to any ball in time. This happens with triggers. It occurs because the
NOARCHIVELOG mode does have the trigger is trying to update a row it is currently
advantage of not having to write transactions to an using. The usual fix involves either use of views
archive log and thus increases the performance of or temporary tables so the database is selecting
the database slightly. from one while updating the other.
14. What command would you use to create a
backup control file? 3. Describe the use of %ROWTYPE and %TYPE in
PL/SQL
Alter database backup control file to trace.
15. Give the stages of instance startup to a usable Expected answer: %ROWTYPE allows you to
state where normal users may access it. associate a variable with an entire table row. The
STARTUP NOMOUNT - Instance startup %TYPE associates a variable with a single
STARTUP MOUNT - The database is mounted column type.
STARTUP OPEN - The database is opened 4. 4What packages (if any) has Oracle provided
16. What column differentiates the V$ views to the for use by developers?
GV$ views and how?
Expected answer: Oracle provides the DBMS_
The INST_ID column which indicates the series of packages. There are many which
instance in a RAC environment the information developers should be aware of such as
came from. DBMS_SQL, DBMS_PIPE,
17. How would you go about generating an
EXPLAIN plan?
DBMS_TRANSACTION, DBMS_LOCK,
DBMS_ALERT, DBMS_OUTPUT, DBMS_JOB,
Create a plan table with utlxplan.sql. DBMS_UTILITY, DBMS_DDL, UTL_FILE. If
Use the explain plan set statement_id = 'tst1' into they can mention a few of these and describe how
plan_table for a SQL statement they used them, even better. If they include the
Look at the explain plan with utlxplp.sql or SQL routines provided by Oracle, great, but not
utlxpls.sql really what was asked.
18. How would you go about increasing the buffer
cache hit ratio? 5. Describe the use of PL/SQL tables

Use the buffer cache advisory over a given Expected answer: PL/SQL tables are scalar arrays
workload and then query the v$db_cache_advice that can be referenced by a binary integer. They
table. If a change was necessary then I would use can be used to hold values for use in later queries
the alter system set db_cache_size command. or calculations. In Oracle 8 they will be able to be
19. Explain an ORA-01555 of the %ROWTYPE designation, or RECORD.
You get this error when you get a snapshot too old 6. When is a declare statement needed ?
within rollback. It can usually be solved by
The DECLARE statement is used in PL/SQL There are several possible methods, export-
anonymous blocks such as with stand alone, non- import, CREATE TABLE... AS SELECT, or
stored PL/SQL procedures. It must come first in a COPY.
PL/SQL stand alone file if it is used.
2. What is the purpose of the IMPORT option
7. In what order should a open/fetch/loop set of IGNORE? What is it?s default setting
commands in a PL/SQL block be implemented if you The IMPORT IGNORE option tells import to
use the %NOTFOUND cursor variable in the exit
when statement? Why? ignore "already exists" errors. If it is not specified
the tables that already exist will be skipped. If it is
Expected answer: OPEN then FETCH then LOOP
specified, the error is ignored and the tables data
followed by the exit when. If not specified in this
will be inserted. The default value is N.
order will result in the final return being done
twice because of the way the %NOTFOUND is 3. You have a rollback segment in a version 7.2
handled by PL/SQL. database that has expanded beyond optimal, how
can it be restored to optimal
8. What are SQLCODE and SQLERRM and why are Use the ALTER TABLESPACE ..... SHRINK
they important for PL/SQL developers?
command.
Expected answer: SQLCODE returns the value of
the error number for the last error encountered. 4. If the DEFAULT and TEMPORARY tablespace
clauses are left out of a CREATE USER command
The SQLERRM returns the actual error message what happens? Is this bad or good? Why
for the last error encountered. They can be used in
The user is assigned the SYSTEM tablespace as a
exception handling to report, or, store in an error
default and temporary tablespace. This is bad
log table, the error that occurred in the code.
because it causes user objects and temporary
These are especially useful for the WHEN
segments to be placed into the SYSTEM
OTHERS exception.
tablespace resulting in fragmentation and
9. How can you find within a PL/SQL block, if a improper table placement (only data dictionary
cursor is open? objects and the system rollback segment should be
Expected answer: Use the %ISOPEN cursor status in SYSTEM).
variable.
5. What are some of the Oracle provided
10. How can you generate debugging output from packages that DBAs should be aware of
PL/SQL? Oracle provides a number of packages in the form
Expected answer: Use the DBMS_OUTPUT of the DBMS_ packages owned by the SYS user.
package. Another possible method is to just use The packages used by DBAs may include:
the SHOW ERROR command, but this only DBMS_SHARED_POOL, DBMS_UTILITY,
shows errors. The DBMS_OUTPUT package can DBMS_SQL, DBMS_DDL, DBMS_SESSION,
be used to show intermediate results from loops DBMS_OUTPUT and DBMS_SNAPSHOT. They
and the status of variables as the procedure is may also try to answer with the UTL*.SQL or
executed. The new package UTL_FILE can also CAT*.SQL series of SQL procedures. These can
be used. be viewed as extra credit but aren?t part of the
answer.
11. What are the types of triggers?
Expected Answer: There are 12 types of triggers 6. What happens if the constraint name is left out
of a constraint clause
in PL/SQL that consist of combinations of the
BEFORE, AFTER, ROW, TABLE, INSERT, The Oracle system will use the default name of
UPDATE, DELETE and ALL key words: SYS_Cxxxx where xxxx is a system generated
number. This is bad since it makes tracking which
BEFORE ALL ROW INSERT
table the constraint belongs to or what the
AFTER ALL ROW INSERT constraint does harder.
BEFORE INSERT
7. What happens if a tablespace clause is left off
AFTER INSERT etc. of a primary key constraint clause
1. Give one method for transferring a table from
one schema to another:
This results in the index that is automatically
generated being placed in then users default
tablespace. Since this will usually be the same 13. A user is getting an ORA-00942 error yet you
know you have granted them permission on the
tablespace as the table is being created in, this can table, what else should you check
cause serious performance problems. You need to check that the user has specified the
8. What is the proper method for disabling and re- full name of the object (select empid from
enabling a primary key constraint scott.emp; instead of select empid from emp;) or
You use the ALTER TABLE command for both. has a synonym that balls to the object (create
However, for the enable clause you must specify synonym emp for scott.emp;)
the USING INDEX and TABLESPACE clause for
14. A developer is trying to create a view and the
primary keys. database won?t let him. He has the "DEVELOPER"
role which has the "CREATE VIEW" system privilege
9. What happens if a primary key constraint is and SELECT grants on the tables he is using, what
disabled and then enabled without fully specifying is the problem
the index clause
You need to verify the developer has direct grants
The index is created in the user?s default on all tables used in the view. You can?t create a
tablespace and all sizing information is lost. stored object with grants given through views.
Oracle doesn?t store this information as a part of
the constraint definition, but only as part of the 15. If you have an example table, what is the best
way to get sizing data for the production table
index definition, when the constraint was disabled implementation
the index was dropped and the information is
gone. The best way is to analyze the table and then use
the data provided in the DBA_TABLES view to
10. (On UNIX) When should more than one DB get the average row length and other pertinent
writer process be used? How many should be used data for the calculation. The quick and dirty way
If the UNIX system being used is capable of is to look at the number of blocks the table is
asynchronous IO then only one is required, if the actually using and ratio the number of rows in the
system is not capable of asynchronous IO then up table to its number of blocks against the number
to twice the number of disks used by Oracle of expected rows.
number of DB writers should be specified by use
16. How can you find out how many users are
of the db_writers initialization parameter. currently logged into the database? How can you
find their operating system id
11. You are using hot backup without being in
archivelog mode, can you recover in the event of a There are several ways. One is to look at the
failure? Why or why not v$session or v$process views. Another way is to
You can?t use hot backup without being in check the current_logins parameter in the
archivelog mode. So no, you couldn?t recover. v$sysstat view. Another if you are on UNIX is to
do a "ps -ef|grep oracle|wc -l? command, but this
12. What causes the "snapshot too old" error? How
can this be prevented or mitigated only works against a single instance installation.
This is caused by large or long running 17. A user selects from a sequence and gets back
transactions that have either wrapped onto their two values, his select is:
own rollback space or have had another SELECT pk_seq.nextval FROM dual;What is
transaction write on part of their rollback space. the problem
This can be prevented or mitigated by breaking Somehow two values have been inserted into the
the transaction into a set of smaller transactions or dual table. This table is a single row, single
increasing the size of the rollback segments and column table that should only have one value in it.
their extents.
18. How can you determine if an index needs to be
dropped and rebuilt
13. How can you tell if a database object is invalid
Run the ANALYZE INDEX command on the
By checking the status column of the DBA_,
index to validate its structure and then calculate
ALL_ or USER_OBJECTS views, depending
the ratio of
upon whether you own or only have permission
LF_BLK_LEN/LF_BLK_LEN+BR_BLK_LEN
on the view or are using a DBA account.
and if it isn?t near 1.0 (i.e. greater than 0.7 or so)
then the index should be rebuilt. Or if the ratio
BR_BLK_LEN/ LF_BLK_LEN+BR_BLK_LEN
6. What SQLPlus command is used to format
is nearing 0.3 output from a select
1. How can variables be passed to a SQL routine
This is best done with the COLUMN command.
By use of the & symbol. For passing in variables
the numbers 1-8 can be used (&1, &2,...,&8) to 7. You want to group the following set of select
pass the values after the command into the returns, what can you group on
SQLPLUS session. To be prompted for a specific Max(sum_of_cost), min(sum_of_cost),
variable, place the ampersanded variable in the count(item_no), item_no
code itself: The only column that can be grouped on is the
"select * from dba_tables where "item_no" column, the rest have aggregate
owner=&owner_name;" . Use of double functions associated with them.
ampersands tells SQLPLUS to resubstitute the
8. What special Oracle feature allows you to
value for each subsequent use of the variable, a specify how the cost based system treats a SQL
single ampersand will cause a reprompt for the statement
value unless an ACCEPT statement is used to get The COST based system allows the use of HINTs
the value from the user. to control the optimizer path selection. If they can
2. You want to include a carriage return/linefeed give some example hints such as FIRST ROWS,
in your output from a SQL script, how can you do ALL ROWS, USING INDEX, STAR, even better.
this
9. You want to determine the location of identical
The best method is to use the CHR() function rows in a table before attempting to place a unique
(CHR(10) is a return/linefeed) and the index on the table, how can this be done
concatenation function "||". Another method, Oracle tables always have one guaranteed unique
although it is hard to document and isn?t always column, the rowid column. If you use a min/max
portable is to use the return/linefeed as a part of a function against your rowid and then select
quoted string. against the proposed primary key you can squeeze
3. How can you call a PL/SQL procedure from SQL out the rowids of the duplicate rows pretty quick.
For example:
By use of the EXECUTE (short form EXEC)
command. select rowid from emp e
where e.rowid > (select min(x.rowid)
4. How do you execute a host operating system
command from within SQL from emp x
By use of the exclamation ball "!" (in UNIX and where x.emp_no = e.emp_no);
some other OS) or the HOST (HO) command. In the situation where multiple columns make up
5. You want to use SQL to build SQL, what is this the proposed key, they must all be used in the
called and give an example where clause.
This is called dynamic SQL. An example would 10. What is a Cartesian product
be:
A Cartesian product is the result of an unrestricted
set lines 90 pages 0 termout off feedback off join of two or more tables. The result set of a three
verify off table Cartesian product will have x * y * z number
spool drop_all.sql of rows where x, y, z correspond to the number of
select ?drop user ?||username||? cascade;? from rows in each table involved in the join.
dba_users
where username not in ("SYS?,?SYSTEM?); 11. You are joining a local and a remote table, the
network manager complains about the traffic
spool off involved, how can you reduce the network traffic
Essentially you are looking to see that they know Push the processing of the remote data to the
to include a command (in this case DROP remote instance by using a view to pre-select the
USER...CASCADE;) and that you need to information for the join. This will result in only
concatenate using the ?||? the values selected from the data required for the join being sent across.
the database.
11. What is the default ordering of an ORDER BY 1. A tablespace has a table with 30 extents in it.
clause in a SELECT statement Is this bad? Why or why not.

Ascending Multiple extents in and of themselves aren?t bad.


However if you also have chained rows this can
12. What is tkprof and how is it used hurt performance.
The tkprof tool is a tuning tool used to determine
2. How do you set up tablespaces during an
cpu and execution times for SQL statements. You Oracle installation?
use it by first setting timed_statistics to true in the
initialization file and then turning on tracing for You should always attempt to use the Oracle
either the entire database via the sql_trace Flexible Architecture standard or another
parameter or for the session using the ALTER partitioning scheme to ensure proper separation of
SESSION command. Once the trace file is SYSTEM, ROLLBACK, REDO LOG, DATA,
generated you run the tkprof tool against the trace TEMPORARY and INDEX segments.
file and then look at the output from the tkprof 3. You see multiple fragments in the SYSTEM
tool. This can also be used to generate explain tablespace, what should you check first?
plan output. Ensure that users don?t have the SYSTEM
tablespace as their TEMPORARY or DEFAULT
13. What is explain plan and how is it used
tablespace assignment by checking the
The EXPLAIN PLAN command is a tool to tune DBA_USERS view.
SQL statements. To use it you must have an
explain_table generated in the user you are 4. What are some indications that you need to
increase the SHARED_POOL_SIZE parameter?
running the explain plan for. This is created using
the utlxplan.sql script. Once the explain plan table Poor data dictionary or library cache hit ratios,
exists you run the explain plan command giving getting error ORA-04031. Another indication is
as its argument the SQL statement to be explained. steadily decreasing performance with all other
The explain_plan table is then queried to see the tuning parameters the same.
execution plan of the statement. Explain plans can
5. What is the general guideline for sizing
also be run using tkprof. db_block_size and db_multi_block_read for an
application that does many full table scans?
14. How do you set the number of lines on a page
of output? The width Oracle almost always reads in 64k chunks. The
The SET command in SQLPLUS is used to two should have a product equal to 64 or a
control the number of lines generated per page multiple of 64.
and the width of those lines, for example SET 6. What is the fastest query method for a table
PAGESIZE 60 LINESIZE 80 will generate reports Fetch by rowid
that are 60 lines long with a line width of 80
characters. The PAGESIZE and LINESIZE 7. Explain the use of TKPROF? What initialization
options can be shortened to PAGES and LINES. parameter should be turned on to get full TKPROF
output?
15. How do you prevent output from coming to the The tkprof tool is a tuning tool used to determine
screen
cpu and execution times for SQL statements. You
The SET option TERMOUT controls output to the use it by first setting timed_statistics to true in the
screen. Setting TERMOUT OFF turns off screen initialization file and then turning on tracing for
output. This option can be shortened to TERM. either the entire database via the sql_trace
parameter or for the session using the ALTER
16. How do you prevent Oracle from giving you
informational messages during and after a SQL SESSION command. Once the trace file is
statement execution generated you run the tkprof tool against the trace
The SET options FEEDBACK and VERIFY can file and then look at the output from the tkprof
be set to OFF. tool. This can also be used to generate explain
plan output.
17. How do you generate file output from SQL
8. When looking at v$sysstat you see that sorts
By use of the SPOOL command (disk) is high. Is this bad or good? If bad -How do
you correct it?
If you get excessive disk sorts this is bad. This Buffer busy waits could indicate contention in
indicates you need to tune the sort area parameters redo, rollback or data blocks. You need to check
in the initialization files. The major sort are the v$waitstat view to see what areas are causing
parameter is the SORT_AREA_SIZe parameter. the problem. The value of the "count" column tells
where the problem is, the "class" column tells you
9. When should you increase copy latches? What
parameters control copy latches
with what. UNDO is rollback segments, DATA is
data base buffers.
When you get excessive contention for the copy
latches as shown by the "redo copy" latch hit ratio. 14. If you see contention for library caches how
You can increase copy latches via the initialization can you fix it
parameter LOG_SIMULTANEOUS_COPIES to Increase the size of the shared pool.
twice the number of CPUs on your system.
15. If you see statistics that deal with "undo" what
10. Where can you get a list of all initialization are they really talking about
parameters for your instance? How about an Rollback segments and associated structures.
indication if they are default settings or have been
changed
16. If a tablespace has a default pctincrease of
You can look in the init.ora file for an indication zero what will this cause (in relationship to the
smon process)
of manually set parameters. For all parameters,
their value and whether or not the current value is The SMON process won?t automatically coalesce
the default value, look in the v$parameter view. its free space fragments.

11. Describe hit ratio as it pertains to the database 17. If a tablespace shows excessive fragmentation
buffers. What is the difference between what are some methods to defragment the
instantaneous and cumulative hit ratio and which tablespace? (7.1,7.2 and 7.3 only)
should be used for tuning
In Oracle 7.0 to 7.2 The use of the 'alter session
The hit ratio is a measure of how many times the set events 'immediate trace name coalesce level
database was able to read a value from the buffers ts#';? command is the easiest way to defragment
verses how many times it had to re-read a data contiguous free space fragmentation. The ts#
value from the disks. A value greater than 80-90% parameter corresponds to the ts# value found in
is good, less could indicate problems. If you the ts$ SYS table. In version 7.3 the ?alter
simply take the ratio of existing parameters this tablespace coalesce;? is best. If the free space
will be a cumulative value since the database isn?t contiguous then export, drop and import of
started. If you do a comparison between pairs of the tablespace contents may be the only way to
readings based on some arbitrary time span, this is reclaim non-contiguous free space.
the instantaneous ratio for that time span.
Generally speaking an instantaneous reading gives 18. How can you tell if a tablespace has excessive
fragmentation
more valuable data since it will tell you what your
instance is doing for the time it was generated If a select against the dba_free_space table shows
over. that the count of a tablespaces extents is greater
than the count of its data files, then it is
12. Discuss row chaining, how does it happen? How fragmented.
can you reduce it? How do you correct it
Row chaining occurs when a VARCHAR2 value 19. You see the following on a status report:

is updated and the length of the new value is redo log space requests 23
longer than the old value and won?t fit in the redo log space wait time 0
remaining block space. This results in the row
Is this something to worry about? What if redo
chaining to another block. It can be reduced by
log space wait time is high? How can you fix
setting the storage parameters on the table to
this
appropriate values. It can be corrected by export
and import of the effected table. Since the wait time is zero, no. If the wait time
was high it might indicate a need for more or
13. When looking at the estat events report you larger redo logs.
see that you are getting busy buffer waits. Is this
bad? How can you find what is causing it 20. What can cause a high value for recursive
calls? How can this be fixed
A high value for recursive calls is cause by 26. You have room for each to grow by 20 more
extents each. Is there a problem? Should you take
improper cursor usage, excessive dynamic space any action
management actions, and or excessive statement No there is not a problem. You have 40 extents
re-parses. You need to determine the cause and showing and an average of 40 concurrent users.
correct it By either relinking applications to hold Since there is plenty of room to grow no action is
cursors, use proper space management techniques needed.
(proper storage and sizing) or ensure repeat
queries are placed in packages for proper reuse. 27. You see multiple extents in the temporary
tablespace. Is this a problem
21. If you see a pin hit ratio of less than 0.8 in the
estat library cache report is this a problem? If so,
As long as they are all the same size this isn?t a
how do you fix it problem. In fact, it can even improve performance
This indicate that the shared pool may be too since Oracle won?t have to create a new extent
small. Increase the shared pool size. when a user needs one.

22. If you see the value for reloads is high in the 28. Define OFA.
estat library cache report is this a matter for OFA stands for Optimal Flexible Architecture. It is
concern
a method of placing directories and files in an
Yes, you should strive for zero reloads if possible. Oracle system so that you get the maximum
If you see excessive reloads then increase the size flexibility for future tuning and file placement.
of the shared pool.
29. How do you set up your tablespace on
23. You look at the dba_rollback_segs view and see installation
that there is a large number of shrinks and they are
of relatively small size, is this a problem? How can The answer here should show an understanding of
it be fixed if it is a problem separation of redo and rollback, data and indexes
A large number of small shrinks indicates a need and isolation os SYSTEM tables from other
to increase the size of the rollback segment tables. An example would be to specify that at
extents. Ideally you should have no shrinks or a least 7 disks should be used for an Oracle
small number of large shrinks. To fix this just installation so that you can place SYSTEM
increase the size of the extents and adjust optimal tablespace on one, redo logs on two (mirrored
accordingly. redo logs) the TEMPORARY tablespace on
another, ROLLBACK tablespace on another and
24. You look at the dba_rollback_segs view and see still have two for DATA and INDEXES. They
that you have a large number of wraps is this a
problem should indicate how they will handle archive logs
A large number of wraps indicates that your extent and exports as well. As long as they have a logical
size for your rollback segments are probably too plan for combining or further separation more or
small. Increase the size of your extents to reduce less disks can be specified.
the number of wraps. You can look at the average 30. What should be done prior to installing Oracle
transaction size in the same view to get the (for the OS and the disks)
information on transaction size. adjust kernel parameters or OS tuning parameters
in accordance with installation guide. Be sure
25. In a system with an average of 40 concurrent
users you get the following from a query on enough contiguous disk space is available.
rollback extents:
31. You have installed Oracle and you are now
ROLLBACK CUR EXTENTS setting up the actual instance. You have been
waiting an hour for the initialization script to finish,
--------------------- -------------------------- what should you check first to determine if there is
R01 11 a problem

R02 8 Check to make sure that the archiver isn?t stuck.


If archive logging is turned on during install a
R03 12
large number of logs will be created. This can fill
R04 9 up your archive log destination causing Oracle to
SYSTEM 4 stop to wait for more space.
32. When configuring SQLNET on the server what False. While 3NF is good for logical design most
files must be set up
databases, if they have more than just a few tables,
INITIALIZATION file, TNSNAMES.ORA file, will not perform well using full 3NF. Usually
SQLNET.ORA file some entities will be denormalized in the logical
33. When configuring SQLNET on the client what to physical transfer process.
files need to be set up
43. What is an ERD
SQLNET.ORA, TNSNAMES.ORA
An ERD is an Entity-Relationship-Diagram. It is
34. What must be installed with ODBC on the client used to show the entities and relationships for a
in order for it to work with Oracle database logical model.
SQLNET and PROTOCOL (for example: TCPIP
44. Why are recursive relationships bad? How do
adapter) layers of the transport programs. you resolve them

35. You have just started a new instance with a A recursive relationship (one where a table relates
large SGA on a busy existing server. Performance is to itself) is bad when it is a hard relationship (i.e.
terrible, what should you check for
neither side is a "may" both are "must") as this can
The first thing to check with a large SGA is that it result in it not being possible to put in a top or
isn?t being swapped out. perhaps a bottom of the table (for example in the
36. What OS user should be used for the first part EMPLOYEE table you couldn?t put in the
of an Oracle installation (on UNIX) PRESIDENT of the company because he has no
You must use root first. boss, or the junior janitor because he has no
subordinates). These type of relationships are
37. When should the default values for Oracle usually resolved by adding a small intersection
initialization parameters be used as is
entity.
Never
45. What does a hard one-to-one relationship mean
38. How many control files should you have? Where (one where the relationship on both ends is "must")
should they be located
Expected answer: This means the two entities
At least 2 on separate disk spindles. Be sure they should probably be made into one entity.
say on separate disks, not just file systems.
46. How should a many-to-many relationship be
39. How many redo logs should you have and how handled
should they be configured for maximum
recoverability By adding an intersection entity table
You should have at least three groups of two redo 47. What is an artificial (derived) primary key?
logs with the two logs each on a separate disk When should an artificial (or derived) primary key
be used
spindle (mirrored by Oracle). The redo logs
should not be on raw devices on UNIX if it can be A derived key comes from a sequence. Usually it
avoided. is used when a concatenated key becomes too
cumbersome to use as a foreign key.
40. You have a simple application with no "hot"
tables (i.e. uniform IO and access requirements). 48. When should you consider denormalization
How many disks should you have assuming
standard layout for SYSTEM, USER, TEMP and Whenever performance analysis indicates it would
ROLLBACK tablespaces be beneficial to do so without compromising data
At least 7, see disk configuration answer above. integrity.
41. Describe third normal form 49. How can you determine if an Oracle instance is
up from the operating system level
Something like: In third normal form all attributes
in an entity are related to the primary key and only There are several base Oracle processes that will
to the primary key be running on multi-user operating systems, these
will be smon, pmon, dbwr and lgwr. Any answer
42. Is the following statement true or false: that has them using their operating system process
"All relational databases must be in third normal showing feature to check for these is acceptable.
form" For example, on UNIX a ps -ef|grep dbwr will
show what instances are up.
50. Users from the PC clients are getting messages 56. You attempt to add a datafile and get:
indicating :
ORA-01118: cannot add anymore datafiles:
ORA-06114: (Cnct err, can't get err txt. See limit of 40 exceeded
Servr Msgs & Codes Manual)
What is the problem and how can you fix it
What could the problem be When the database was created the db_files
parameter in the initialization file was set to 40.
The instance name is probably incorrect in their
You can shutdown and reset this to a higher value,
connection string.
up to the value of MAX_DATAFILES as specified
51. Users from the PC clients are getting the at database creation. If the MAX_DATAFILES is
following error stack: set to low, you will have to rebuild the control file
ERROR: ORA-01034: ORACLE not available to increase it before proceeding.
ORA-07318: smsget: open error when opening 57. You look at your fragmentation report and see
sgadef.dbf file. that smon hasn?t coalesced any of you tablespaces,
even though you know several have large chunks of
HP-UX Error: 2: No such file or directory contiguous free extents. What is the problem
Check the dba_tablespaces view for the value of
What is the probable cause pct_increase for the tablespaces. If pct_increase is
The Oracle instance is shutdown that they are zero, smon will not coalesce their free space.
trying to access, restart the instance.
58. Your users get the following error:
52. How can you determine if the SQLNET process ORA-00055 maximum number of DML locks
is running for SQLNET V1? How about V2
exceeded
For SQLNET V1 check for the existence of the
What is the problem and how do you fix it
orasrv process. You can use the command "tcpctl
status" to get a full status of the V1 TCPIP server, The number of DML Locks is set by the
other protocols have similar command formats. initialization parameter DML_LOCKS. If this
For SQLNET V2 check for the presence of the value is set to low (which it is by default) you will
LISTENER process(s) or you can issue the get this error. Increase the value of
command "lsnrctl status". DML_LOCKS. If you are sure that this is just a
temporary problem, you can have them wait and
53. What file will give you Oracle instance status then try again later and the error should clear.
information? Where is it located
The alert.ora log. It is located in the directory 59. You get a call from you backup DBA while you
are on vacation. He has corrupted all of the control
specified by the background_dump_dest files while playing with the ALTER DATABASE
parameter in the v$parameter table. BACKUP CONTROLFILE command. What do you do

54. Users aren?t being allowed on the system. The


As long as all datafiles are safe and he was
following message is received: successful with the BACKUP controlfile
ORA-00257 archiver is stuck. Connect internal command you can do the following:
only, until freed CONNECT INTERNAL
What is the problem STARTUP MOUNT
The archive destination is probably full, backup (Take any read-only tablespaces offline before
the archive logs and remove them and the archiver next step ALTER DATABASE DATAFILE ....
will re-start. OFFLINE;)
55. Where would you look to find out if a redo log
RECOVER DATABASE USING BACKUP
was corrupted assuming you are using Oracle CONTROLFILE
mirrored redo logs
ALTER DATABASE OPEN RESETLOGS;
There is no message that comes to the SQLDBA
(bring read-only tablespaces back online)
or SRVMGR programs during startup in this
situation, you must check the alert.log file for this Shutdown and backup the system, then restart
information.
If they have a recent output file from the ALTER FOPEN function-Opens a file for input or output
DATABASE BACKUP CONTROL FILE TO with the default line size.
TRACE; command, they can use that to recover as IS_OPEN function -Determines if a file handle
well. refers to an open file.
If no backup of the control file is available then FCLOSE procedure -Closes a file.
the following will be required: FCLOSE_ALL procedure -Closes all open file
handles.
CONNECT INTERNAL
GET_LINE procedure -Reads a line of text from an
STARTUP NOMOUNT open file.
CREATE CONTROL FILE .....; PUT procedure-Writes a line to a file. This does not
However, they will need to know all of the append a line terminator.
datafiles, logfiles, and settings for NEW_LINE procedure-Writes one or more OS-
MAXLOGFILES, MAXLOGMEMBERS, specific line terminators to a file.
MAXLOGHISTORY, MAXDATAFILES for the PUT_LINE procedure -Writes a line to a file. This
database to use the command. appends an OS-specific line terminator.
PUTF procedure -A PUT procedure with
formatting.
FFLUSH procedure-Physically writes all pending
output to a file.
Oracle DBA Interview questions FOPEN function -Opens a file with the maximum
line size specified.
Differentiate between TRUNCATE and
DELETE. Difference between database triggers and form
triggers?
The Delete command will log the data changes in
the log file where as the truncate will simply Database triggers are fired whenever any database
remove the data without it. Hence Data removed by action like INSERT, UPATE, DELETE, LOGON
Delete command can be rolled back but not the data LOGOFF etc occurs. Form triggers on the other
removed by TRUNCATE. Truncate is a DDL hand are fired in response to any event that takes
statement whereas DELETE is a DML statement. place while working with the forms, say like
navigating from one field to another or one block to
What is the maximum buffer size that can be another and so on.
specified using the DBMS_OUTPUT.ENABLE
function? What is OCI. What are its uses?

1000000 OCI is Oracle Call Interface. When applications


developers demand the most powerful interface to
Can you use a commit statement within a the Oracle Database Server, they call upon the
database trigger? Oracle Call Interface (OCI). OCI provides the most
comprehensive access to all of the Oracle Database
Yes, if you are using autonomous transactions in the functionality. The newest performance, scalability,
Database triggers. and security features appear first in the OCI API. If
you write applications for the Oracle Database, you
What is an UTL_FILE? What are different likely already depend on OCI. Some types of
procedures and functions associated with it? applications that depend upon OCI are:

The UTL_FILE package lets your PL/SQL · PL/SQL applications executing SQL
programs read and write operating system (OS) text · C++ applications using OCCI
files. It provides a restricted version of standard OS · Java applications using the OCI-based JDBC
stream file input/output (I/O). driver
Subprogram -Description · C applications using the ODBC driver
· VB applications using the OLEDB driver
· Pro*C applications <CONTEXT>.env under $APPL_TOP,
· Distributed SQL <CONTEXT>.env under 806 ORACLE_HOME
and custom.env for any Customized environment
What are ORACLE PRECOMPILERS? files.

A precompiler is a tool that allows programmers to Whats main concurrent Manager types.
embed SQL statements in high-level source
programs like C, C++, COBOL, etc. The # ICM - Internal Concurrent Manager which
precompiler accepts the source program as input, manages concurrent Managers
translates the embedded SQL statements into # Standard Managers - Which Manage processesing
standard Oracle runtime library calls, and generates of requests.
a modified source program that one can compile, # CRM - Conflict Resolution Managers , resolve
link, and execute in the usual way. Examples are the conflicts in case of incompatibility.
Pro*C Precompiler for C, Pro*Cobol for Cobol,
SQLJ for Java etc. Whats US directory in $AD_TOP or under
various product TOP's .
What is syntax for dropping a procedure and a
function? Are these operations possible? US directory is defauly language directory in Oracle
Applications. If you have multiple languages
Drop Procedure/Function ; yes, if they are Installed in your Applications then you will see
standalone procedures or functions. If they are a other languages directories besides US, that
part of a package then one have to remove it from directory will contain reports, fmx and other code in
the package definition and body and recompile the that respective directory like FR for France, AR for
package. arabic, simplifies chinese or spanish.

How to check if Apps 11i System is Autoconfig Where is Concurrent Manager log file location.
enabled ?
By default standard location is
Under $AD_TOP/bin check for file adcfginfo.sh $APPLCSF/$APPLLOG , in some cases it can go to
and if this exists use adcfginfo.sh $FND_TOP/log as well.
contextfile=<CONTEXT> show=enabled
If this file is not there , look for any configuration Where would i find .rf9 file, and what execatly it
file under APPL_TOP if system is Autoconfig dose ?
enabled then you will see entry like
These files are used during restart of patch in case
How to check if Oracle Apps 11i System is Rapid of patch failure because of some reason.
Clone enabled ?
Where is appsweb.cfg or
For syetem to be Rapid Clone enabled , it should be appsweb_$CONTEXT.cfg stored and why its
Autoconfig enabled (Check above How to confirm used ?
if Apps 11i is Autoconfig enabled). You should have
Rapid Clone Patches applied , Rapid Clone is part This file is defined by environment variable
of Rapid Install Product whose Family Pack Name FORMS60_WEB_CONFIG_FILE This is usually
is ADX. By default all Apps 11i Instances 11.5.9 in directory $OA_HTML/bin on forms tier.
and above are Autoconfig and Rapid Clone enabled. This file is used by any forms client session. When
a user try to access forms , f60webmx picks up this
Whats is difference between two env files in file and based on this configuration file creates a
<CONTEXT>.env and APPS<CONTEXT>.env forms session to user/client.
under $APPL_TOP ?
What is Multi Node System ?
APPS<CONTEXT>.env is main environment file
which inturn calls other environment files like
Multi Node System in Oracle Applications 11i function, but it appears in the parameter list and you
means you have Applications 11i Component on can, of course, have as many OUT parameters as
more than one system. Typical example is Database, you like.
Concurrent Manager on one machine and forms,
Web Server on second machine is example of Two Inside the program, an OUT parameter acts like a
Node System. variable that has not been initialised. In fact, the
OUT parameter has no value at all until the program
Can a function take OUT parameters. If not terminates successfully (without raising an
why? exception, that is). During the execution of the
program, any assignments to an OUT parameter are
yes, IN, OUT or IN OUT. actually made to an internal copy of the OUT
parameter. When the program terminates
Can the default values be assigned to actual successfully and returns control to the calling block,
parameters? the value in that local copy is then transferred to the
actual OUT parameter. That value is then available
Yes. In such case you don’t need to specify any in the calling PL/SQL block.
value and the actual parameter will take the default
value provided in the function definition. IN OUT - With an IN OUT parameter, you can pass
values into the program and return a value back to
What is difference between a formal and an the calling program (either the original, unchanged
actual parameter? value or a new value set within the program). The
IN OUT parameter shares two restrictions with the
The formal parameters are the names that are OUT parameter:
declared in the parameter list of the header of a
module. The actual parameters are the values or An IN OUT parameter cannot have a default value.
expressions placed in the parameter list of the actual
call to the module. An IN OUT actual parameter or argument must be a
variable. It cannot be a constant, literal, or
What are different modes of parameters used in expression, since these formats do not provide a
functions and procedures? receptacle in which PL/SQL can place the outgoing
value.
There are three different modes of parameters: IN,
OUT, and IN OUT. Difference between procedure and function.

IN - The IN parameter allows you to pass values in A function always returns a value, while a
to the module, but will not pass anything out of the procedure does not. When you call a function you
module and back to the calling PL/SQL block. In must always assign its value to a variable.
other words, for the purposes of the program, its IN
parameters function like constants. Just like Can cursor variables be stored in PL/SQL tables.
constants, the value of the formal IN parameter If yes how. If not why?
cannot be changed within the program. You cannot
assign values to the IN parameter or in any other Yes. Create a cursor type - REF CURSOR and
way modify its value. declare a cursor variable of that type.
DECLARE
IN is the default mode for parameters. IN /* Create the cursor type. */
parameters can be given default values in the TYPE company_curtype IS REF CURSOR
program header. RETURN company%ROWTYPE;

OUT - An OUT parameter is the opposite of the IN /* Declare a cursor variable of that type. */
parameter. Use the OUT parameter to pass a value company_curvar company_curtype;
back from the program to the calling PL/SQL block.
An OUT parameter is like the return value for a /* Declare a record with same structure as cursor
variable. */ How you put Applications 11i in Maintenance
company_rec company%ROWTYPE; mode ?
BEGIN
/* Open the cursor variable, associating with it a Use adadmin to change Maintenance mode is
SQL statement. */ Oracle Apps. With AD.I you need to enable
OPEN company_curvar FOR SELECT * FROM maintenance mode in order to apply apps patch via
company; adpatch utility. If you don't want to put apps in
maintenance mode you can use adpatch
/* Fetch from the cursor variable. */ options=hotpatch feature.
FETCH company_curvar INTO company_rec;
Can you apply patch without putting
/* Close the cursor object associated with variable. Applications 11i in Maintenance mode ?
*/
CLOSE company_curvar; Yes, use options=hotpatch as mentioned above with
END; adpatch.

Can you clone from multi node system to single What are various options available with
node system and vice versa ? adpatch ?

Yes , this is now supported via Rapid Clone, Check Various options available with adpatch depending
if your system has all prereq. patches for Rapid on your AD version are autoconfig,
Clone and you are on latest rapid clone patch. check_exclusive, checkfile, compiledb, compilejsp,
copyportion, databaseprtion, generateportion,
Does rapid clone takes care of Updating Global hotpatch, integrity, maintainmrc, parallel, prereq,
oraInventory or you have to register manually in validate
Global OraInventory after clone ?
ADIDENT UTILITY is used for what ?
Rapid Clone will automatically Update Global
oraInventory during configuration phase. You don't ADIDENT UTILITY in oracle apps is used to find
have to do any thing manually for Global version of any file . AD Identification. for ex.
oraInventory. "adident Header <filename>

What is .dbc file , where its stored , whats use of How do you pass cursor variables in PL/SQL?
.dbc file ?
Pass a cursor variable as an argument to a procedure
dbc as name says is database connect descriptor file or function. You can, in essence, share the results of
which stores database connection information used a cursor by passing the reference to that result set.
by application tier to connect to database. This file
is in directory $FND_TOP/secure also called as How do you open and close a cursor variable.
FND_SECURE Why it is required?

Whats things you do to reduce patch timing ? Using OPEN cursor_name and CLOSE
cursor_name commands. The cursor must be
You can take advantage of following - opened before using it in order to fetch the result set
# Merging patches via admrgpch of the query it is associated with. The cursor needs
# Use various adpatch options like nocompiledb or to be closed so as to release resources earlier than
nocompilejsp end of transaction, or to free up the cursor variable
# Use defaults file to be opened again.
# Staged APPL_TOP during upgrades
# Increase batch size (Might result into negative ) What should be the return type for a cursor
variable. Can we use a scalar data type as return
type?
The return type of a cursor variable can be same by executing environment file under
%ROWTYPE or record_name%TYPE or a record $IAS_ORACLE_HOME
type or a ref cursor type. A scalar data type like
number or varchar can’t be used but a record type If we run autoconfig which files will get
may evaluate to a scalar value. effected ?

What is use of a cursor variable? How it is In order to check list of files changes during
defined? Autoconfig , you can run adchkcfg utility which
will generate HTML report. This report will list all
Cursor variable is used to mark a work area where files and profile options going to change when you
Oracle stores a multi-row query output for run AutoConfig.
processing. It is like a pointer in C or Pascal.
Because it is a TYPE, it is defined as TYPE REF What is difference between .xml file and
CURSOR RETURN ; AutoConfig ?

What WHERE CURRENT OF clause does in a Autoconfig is Utility to configure your Oracle
cursor? Application environment. .xml file is repository of
all configuration from which AutoConfig picks
The Where Current Of statement allows you to configuration and polulates related files.
update or delete the record that was last fetched by
the cursor. What is .lgi files ?

Difference between NO DATA FOUND and lgi files are created with patching along with .log
%NOTFOUND files . .lgi files are informative log files containing
information related to patch. You can check .lgi files
NO DATA FOUND is an exception which is raised to see what activities patch has done. Usually
when either an implicit query returns no data, or informative logs.
you attempt to reference a row in the PL/SQL table
which is not yet defined. SQL%NOTFOUND, is a How will you skip worker during patch ?
BOOLEAN attribute indicating whether the recent
SQL statement does not match to any row. If in your adctrl there are six option shown then
seventh is hidden option.(If there are seven options
What is a cursor for loop? visible then 8th option is to Skip worker depending
on ad version).
A cursor FOR loop is a loop that is associated with
(actually defined by) an explicit cursor or a Which two tables created at start of Apps Patch
SELECT statement incorporated directly within the and drops at end of Patch ?
loop boundary. Use the cursor FOR loop whenever
(and only if) you need to fetch and process each and FND_INSTALLED_PROCESS and
every record from a cursor, which is a high AD_DEFFERED_JOBS are the tables that get
percentage of the time with cursors. updated while applying a patch mainly d or unified
driver.
What is iAS Patch ?
How to compile an Oracle Reports file ?
iAS Patch are patches released to fix bugs
associated with IAS_ORACLE_HOME (Web Utility adrepgen is used to compile Reports. Synatx
Server Component) Usually these are shiiped as is given below adrepgen userid=apps\<psswd>
Shell scripts and you apply iAS patches by source = $PRODUCT_TOP\srw\filename.rdf
executing Shell script. Note that by default dest=$PRODUCT_TOP\srw\filename.rdf
ORACLE_HOME is pointing to 8.0.6 stype=rdffile dtype=rdffile logfile=x.log
ORACLE_HOME and if you are applying iAS overwrite=yes batch=yes dunit=character
patch export ORACLE_HOME to iAS . You can do
What is difference between AD_BUGS and Where is Jserv configuration files stored ?
AD_APPLID_PATCHES ?
Jserv configuration files are stored in
AD_BUGS holds information about the various $IAS_ORACLE_HOME/Apache/Jserv/etc
Oracle Applications bugs whose fixes have been
applied (ie. patched) in the Oracle Applications Where is applications start/stop scripts stored ?
installation.
applications start/stop scripts are in directory
AD_APPLIED_PATCHES holds information about $COMMON_TOP/admin/scripts/$CONTEXT_NA
the "distinct" Oracle Applications patches that have ME
been applied. If 2 patches happen to have the same
name but are different in content (eg. "merged" What are main configuration files in Web Server
patches), then they are considered distinct and this (Apache) ?
table will therefore hold 2 records.
Main configuration files in Oracle Apps Web Server
What is ADSPLICE UTILITY ? are
# httpd.conf, apps.conf, oracle_apache.conf,
ADSPLICE UTILITY in oracle apps is utility to httpd_pls.conf
add a new product. # jserv.conf, ssp_init.txt, jserv.properties,
zone.properties
How can you licence a product after # plsql.conf, wdbsvr.app, plsql.conf
installation ?
Can C driver in apps patch create Invalid Object
You can use ad utility adlicmgr to licence product in in database ?
Oracle Apps.
No , C driver only copies files in File System.
What is MRC ? What you do as Apps DBA for Database Object might be invalidated during D
MRC ? driver when these objects are
created/dropped/modified.
MRC also called as Multiple Reporting Currency in
oracle Apps. Default you have currency in US What is dev60cgi and f60cgi ?
Dollars but if your organization operating books are
in other currency then you as apps dba need to CGI stands for Common Gateway Interface and
enable MRC in Apps. How to enable MRC coming these are Script Alias in Oracle Apps used to access
soon.. forms server . Usually Form Server access directly
via http://hostname:port/dev60cgi/f60cgi
What is access_log in apache , what entries are
recored in access_log ? Where is default location Why does a worker fails in Oracle Apps Patch
of thsi file ? and few scenarios in which it failed for you ?

access_log in Oracle Application Server records all Apps Patch worker can fail in case it doesn't find
users accessing oracle applications 11i. This file expected data, object, files or any thing which
location is defined in httpd.conf with default driver is trying to update/edit/modify. Possible
location at symptoms may be underlying tables/objects are
$IAS_ORACLE_HOME/Apache/Apache/logs. invalid, a prereq patch is missing , login information
Entries in this file is defined by directive is incorrect, inconsistency in seeded data...
LogFormat in httpd.conf Typical entry in access_log
is What is difference between mod_osso and
198.0.0.1 - - [10/Sep/2006:18:37:17 +0100] "POST mod_ose in Oracle HTTP Server ?
/OA_HTML/OA.jsp?.... HTTP/1.1" 200 28035
where 200 is HTTP status code and last digits
28035 is bytes dowloaded as this page(Size of page)
mod_osso is Oracle Single Sign-On Module where Cursor attributes are used to get the information
as mod_ose is module for Oracle Servlet Engine. about the current status of your cursor. Both explicit
mod_osso is module in Oracle's HTTP Server and implicit cursors have four attributes, as shown:
serves as Conduit between Oracle Apache Server Name Description
and Singl Sign-On Server where as mod_ose is also %FOUND Returns TRUE if record was fetched
another module in Oracle's HTTP Server serves as successfully, FALSE otherwise.
conduit between Oracle Apache and Oracle Servlet %NOTFOUND Returns TRUE if record was not
Engine. fetched successfully, FALSE otherwise.
%ROWCOUNT Returns number of records fetched
What is difference between from cursor at that point in time.
COMPILE_ALL=SPECIAL and %ISOPEN Returns TRUE if cursor is open, FALSE
COMPILE=ALL while compiling Forms ? otherwise.

Both the options will compile all the PL/SQL in the Difference between an implicit and an explicit
resultant .FMX, .PLX, or .MMX file but cursor.
COMPILE_ALL=YES also changes the cached
version in the source .FMB, .PLL, or .MMB file. The implicit cursor is used by Oracle server to test
This confuses version control and build tools (CVS, and parse the SQL statements and the explicit
Subversion, make, scons); they believe you've made cursors are declared by the programmers.
significant changes to the source.
COMPILE_ALL=SPECIAL does not do this. What is a cursor?

What is GSM in Oracle application E-Business A cursor is a mechanism by which you can assign a
Suite ? name to a “select statement” and manipulate the
information within that SQL statement.
GSM stands for Generic Service Management
Framework. Oracle E-Business Suite consist of What is the purpose of a cluster?
various compoennts like Forms, Reports, Web
Server, Workflow, Concurrent Manager .. A cluster provides an optional method of storing
table data. A cluster is comprised of a group of
Earlier each service used to start at their own but tables that share the same data blocks, which are
managing these services (given that) they can be on grouped together because they share common
various machines distributed across network. So columns and are often used together. For example,
Generic Service Management is extension of the EMP and DEPT table share the DEPTNO
Concurrent Processing which manages all your column. When you cluster the EMP and DEPT,
services , provide fault tolerance (If some service is Oracle physically stores all rows for each
down ICM through FNDSM and other processes department from both the EMP and DEPT tables in
will try to start it even on remote server) With GSM the same data blocks. You should not use clusters
all services are centrally managed via this for tables that are frequently accessed individually.
Framework.
How do you find the number of rows in a Table ?
What is FNDSM ?
select count(*) from table, or from NUM_ROWS
FNDSM is executable and core component in GSM column of user_tables if the table statistics has been
( Generic Service Management Framework collected.
discussed above). You start FNDSM services via
APPS listener on all Nodes in Application Tier in E- Display the number value in Words?
Business Suite.
What is a pseudo column. Give some examples?
What are cursor attributes?
Information such as row numbers and row
descriptions are automatically stored by Oracle and
is directly accessible, ie. not through tables. This PLSSQL and session cache are stored under
information is contained within pseudo columns. $IAS_ORACLE_HOME/ Apache/modplsql/cache
These pseudo columns can be retrieved in queries. directory.
These pseudo columns can be included in queries
which select data from tables. What is *.DBC file and whats is location of DBC
file ?
Available Pseudo Columns
· ROWNUM - row number. Order number in which DBC as name stands for is database connect
a row value is retrieved. descriptor file used to connect to database. This file
· ROWID - physical row (memory or disk address) by default located in $FND_TOP/secure directory
location, ie. unique row identification. also called as $FND_SECURE directory.
· SYSDATE - system or today’s date.
· UID - user identification number indicating the What is content of DBC file and why its
current user. important ?
· USER - name of currently logged in user.
DBC file is quite important as whenever Java or any
Whats is location of access_log file ? other program like forms want to connect to
database it uses DBC file. Typical entry in DBC file
access_log file by default is located in is
$IAS_ORACLE_HOME/ Apache/Apache/logs. GUEST_USER_PWD
Location of this file is defined in httpd.conf by APPS_JDBC_URL
patameter CustomLog or TransferLog DB_HOST

What is your Oracle Apps 11i Webserver Version What are few profile options which you update
and how to find it ? after cloning ?

From 11.5.8 to 11.5.10 Webserver version is iAS Rapid clone updates profile options specific to site
1.0.2.2.2, In order to find version under level . If you have any profile option set at other
$IAS_ORACLE_HOME/Apache/Apache/bin levels like server, responsibility, user....level then
execute ./httpd -version reset them.
./httpd -version
Server version: Oracle HTTP Server Powered by How to retrieve SYSADMIN password ?
Apache/1.3.19
Server built: Dec 6 2005 14:59:13 (iAS 1.0.2.2.2 If forgot password link is enabled and SYSADMIN
rollup 5) account is configured with mail id user forget
password link else you can reset sSYSADMIN
What is Location of Jserv configuration files ? password via FNDCPASS.

Jserv configuration files are located in Whats is TWO_TASK in Oracle Database ?


$IAS_ORACLE_HOME /Apache/Jserv/etc .
TWO_TASK mocks your tns alias which you are
What is plssql/database cache ? going to use to connect to database. Lets assume
you have database client with tns alias defined as
In order to improve performance mod_pls (Apache PROD to connect to Database PROD on machine
component) caches some database content to file. teachmeoracle.com listening on port 1521. Then
This database/plssql cache is usually of type session usual way to connect is sqlplus
and plsql cache username/passwd@PROD ; now if you don't want
# session cache is used to store session information. to use @PROD then you set TWO_TASK=PROD
# plsql cache is used to store plsql cache i.e. used by and then can simply use sqlplus username/passwd
mod_pls then sql will check that it has to connect to tnsalias
define by value PROD i.e. TWO_TASK
Where is DATABASE/PLSSQL cache stored ?
What is GWYUID ? where t1.x = t2.y;

GWYUID , stands for Gateway User ID and The sub query is evaluated, distinct’ed, indexed (or
password. Usually like APPLSYSPUB/PUB hashed or sorted) and then joined to the original
table — typically. As opposed to select * from t1
Where GWYUID defined and what is its used in where exists ( select null from t2 where y = x )
Oracle Applications ?
That is processed more like:
GWYUID is defined in dbc i.e. Database Connect for x in ( select * from t1 )
Descriptor file . It is used to connect to database by loop
think clients. if ( exists ( select null from t2 where y = x.x )
then
If APPS_MRC schema is not used in 11.5.10 and OUTPUT THE RECORD
higher then How MRC is working ? end if
end loop
For products like Payable, Recievables which uses
MRC and if MRC is enabled then each transaction It always results in a full scan of T1 whereas the
table in base schema related to currency now has an first query can make use of an index on T1(x). So,
assoicated MRC Subtables. when is where exists appropriate and in
appropriate? Lets say the result of the sub query
When you apply C driver patch does it require ( select y from T2 ) is “huge” and takes a long time.
database to be Up and Why ? But the table T1 is relatively small and executing
( select null from t2 where y = x.x ) is very fast
Yes , database and db listener should be Up when (nice index on t2(y)). Then the exists will be faster
you apply any driver patch in apps. even if driver is as the time to full scan T1 and do the index probe
not updating any database object connection is into T2 could be less then the time to simply full
required to validate appsand other schema and to scan T2 to build the sub query we need to distinct
upload patch history information in database tables. on.

How you will avoid your query from using Lets say the result of the sub query is small — then
indexes? IN is typically more appropriate. If both the sub
query and the outer table are huge — either might
By changing the order of the columns that are used work as well as the other — depends on the indexes
in the index, in the Where condition, or by and other factors.
concatenating the columns with some constant
values. When do you use WHERE clause and when do
you use HAVING clause?
What is a OUTER JOIN?
The WHERE condition lets you restrict the rows
An OUTER JOIN returns all rows that satisfy the selected to those that satisfy one or more conditions.
join condition and also returns some or all of those Use the HAVING clause to restrict the groups of
rows from one table for which no rows from the returned rows to those groups for which the
other satisfy the join condition. specified condition is TRUE.

Which is more faster - IN or EXISTS? There is a % sign in one field of a column. What
will be the query to find it?
Well, the two are processed very differently.
Select * from T1 where x in ( select y from T2 ) SELECT column_name FROM table_name
is typically processed as: WHERE column_name LIKE ‘%\%%’ ESCAPE
select * ‘\’;
from t1, ( select distinct y from t2 ) t2
Where will you find forms configuration details Oracle HTML Cache is available at
apart from xml file ? $COMMON_TOP/_pages for some previous
versions you might find it in $OA_HTML/_pages
Forms configuration at time of startup is in script
adfrmctl.sh and appsweb_$CONTEXT_NAME.cfg Where is plssql cache stored in Oracle Apps ?
(defined by environment variable
FORMS60_WEB_CONFIG_FILE) for forms client Usually two type of cache session and plssql stored
connection used each time a user initiates forms under
connection. $IAS_ORACLE_HOME/Apache/modplsql/cache

What is forms server executable Name ? What happens if you don't give cache size while
defining Concurrent Manager ?
f60srvm
Lets first understand what is cache size in
What are different modes of forms in which you Concurrent Manager. When Manager picks request
can start Forms Server and which one is from FND CONCURRENT REQUESTS Queues, it
default ? will pick up number of requests defined by cache
size in one shot and will work on them before going
You can start forms server in SOCKET or to sleep. If you don't define cache size while
SERVLET by defualt Forms are configured to start defining CM then it will take default value 1, i.e.
in socket mode. picking up one request per cycle.

How you will start Discoverer in Oracle Apps 11i There are lot of DBC file under $FND_SECURE,
? How its determined that which dbc file to use
from $FND_SECURE ?
In order to start dicoverer you can use script
addisctl.sh under This value is determined from profile option
$OAD_TOP/admin/scripts/$CONTEXT_NAME or "Applications Database ID"
startall.sh under $ORACLE_HOME/discwb4/util
(under Middle/Application Tier) What is RRA/FNDFS ?

How many ORACLE HOME are Oracle Apps Report Review Agent(RRA) also referred by
and whats significance of each ? executable FNDFS is default text viewer in Oracle
Applications 11i for viewing output files and log
There are three $ORACLE_HOME in Oracle Apps, files. As most of apps dba's are not clear about
Two for Application Tier (Middle Tier) and One in Report Server and RRA, I'll discuss one on my blog
Database Tier. and update link here .
# ORACLE_HOME 1 : On Application Tier used to
store 8.0.6 techstack software. This is used by What is PCP is Oracle Applications 11i ?
forms, reports and discoverer. ORACLE_HOME
should point to this ORACLE_HOME which PCP is acronym for Parallel Concurrurent
applying Apps Patch. processing. Usually you have one Concurrent
# ORACLE_HOME 2: On Application Tier used by Manager executing your requests but if you can
iAS (Web Server) techstack software. This is used configure Concurrent Manager running on two
by Web Listener and contains Apache. machines (Yes you need to do some additional steps
# ORACLE_HOME 3: On Database Tier used by in order to configure Parallel Concurrent
Database Software usually 8i,9i or 10g database. Processing) . So for some of your requests primary
CM Node is on machine1 and secondary CM node
Where is HTML Cache stored in Oracle Apps on machine2 and for some requests primary CM is
Server ? on machine2 and secondary CM on machine1.
Why I need two Concurrent Processing Nodes or # ICM stand for Internal Concurrent Manager,
in what scenarios PCP is Used ? which controls other managers. If it finds other
managers down , it checks and try to restart them.
Well If you are running GL Month end reports or You can say it as administrator to other concurrent
taxation reports annually these reposrts might take managers. It has other tasks as well.
couple of days. Some of these requests are very # Standard Manager These are normal managers
resource intensive so you can have one node which control/action on the requests nd does batch
running long running , resource intensive requests or single request processing. # CRM acronym for
while other processing your day to day short Conflict Resolution Manager is used to resolve
running requets. conflicts between managers nd request. If a request
Another scenario is when your requests are very is submitted whose execution is clashing or it is
critical and you want high resilience for your defined not to run while a particular type of request
Concurrent Processing Node , you can configure is running then such requests are actioned/assigned
PCP. So if node1 goes down you still have CM node to CRM for Incompatibilities and Conflict
available processing your requests. resolution.

Output and Logfiles for requests executed on What is difference between SUBSTR and
source Instance not working on cloned Instance INSTR?

Here is exact problem description - You cloned an INSTR function search string for sub-string and
Oracle Apps Instance from PRODBOX to another returns an integer indicating the position of the
box with Instance name say CLONEBOX on 1st of character in string that is the first character of this
August. You can any CM logs/output files after 1st occurrence. SUBSTR function return a portion of
of August only becuase these all are generated on string, beginning at character position,
CLONEBOX itself, But unable to view the substring_length characters long. SUBSTR
logs/output files which are prior to 1st August. calculates lengths using characters as defined by the
What will you do and where to check ? input character set.
Log , Output file path and location is stored in table
FND_CONCURRENT_REQUESTS. Check select Which data type is used for storing graphics and
logfile_name, logfile_node_name, outfile_name, images?
outfile_node_name from fnd_concurrent_requests
where request_id=&requestid ; where requestid is id Raw, Long Raw, and BLOB.
of request for which you are not able to see log or
out files. You should see output like What is difference between SQL and
/u01/PRODBOX/log/l123456.req, SQL*PLUS?
host1,/u01/PRODBOX/out/o123456.out, host1
Update it according to your cloned Instance SQL is the query language to manipulate the data
Variables. from the database. SQL*PLUS is the tool that lets
to use SQL to fetch and display the data.
How to confirm if Report Server is Up and
Running ? What is difference between UNIQUE and
PRIMARY KEY constraints?
Report Server is started by executable rwmts60 on
concurrent manager Node and this file is under An UNIQUE key can have NULL whereas
$ORACLE_HOME/bin .execute command on your PRIMARY key is always not NOT NULL. Both
server like bears unique values.
ps -ef | grep rwmts60
You should get output like What is difference between Rename and Alias?
applmgr ....... rwmts60 name=REP60_VISION
Rename is actually changing the name of an object
What is difference between ICM, Standard whereas Alias is giving another name (additional
Managers and CRM in Concurrent Manager ? name) to an existing object.
using query SQLPLUS> select count(*) from
Rename is a permanent name given to a table or dba_objects where status like 'INVALID';
column whereas Alias is a temporary name given to
a table or column which do not exist once the SQL How to compile Invalid Objects in database ?
statement is executed.
You can use adadmin utility to compile or you can
What are various joins used while writing use utlrp.sql script shipped with Oracle Database to
SUBQUERIES? compile Invalid Database Objects.

=, , IN, NOT IN, IN ANY, IN ALL, EXISTS, NOT How to compile JSP in Oracle Apps ?
EXISTS.
You can use ojspCompile.pl perl script shipped with
What is use of Apps listener ? Oracle apps to compile JSP files. This script is
under $JTF_TOP/admin/scripts. Sample
Apps Listener usually running on All Oracle compilation method is
Applications 11i Nodes with listener alias as perl ojspCompile.pl --compile --quiet
APPS_$SID is mainly used for listening requests
for services like FNDFS and FNDSM. What is difference between ADPATCH and
OPATCH ?
How to start Apps listener ?
# ADPATCH is utility to apply oracle apps Patches
In Oracle 11i, you have script adalnctl.sh which will whereas
start your apps listener. You can also start it by # OPATCH is utility to apply database patches
command lsnrctl start APPS_$SID (Replace sid by
your Instance SID Name) Can you use both ADPATCH and OPATCH in
Apps ?
How to confirm if Apps Listener is Up and
Running ? Yes you have to use both in apps , for apps patches
you will use ADPATCH UTILITY and for applying
execute below command database patch in apps you will use opatch
lsnrctl status APPS_$SID (replcae SID with your UTILITY.
Instance Name)
so If your SID is VISION then use lsnrctl status
APPS_VISION out put should be like
Services Summary...
FNDFS has 1 service handler(s)
FNDSM has 1 service handler(s)

What is Web Listener ?

Web Listener is Web Server listener which is


listening for web Services(HTTP) request. This
listener is started by adapcctl.sh and defined by
directive (Listen, Port) in httpd.conf for Web Server.
When you initially type request like
http://becomeappsdba.blogspot.com:80 to access
application here port number 80 is Web Listener
port.

How will you find Invalid Objects in database ?

Вам также может понравиться