PDF Tutorials and Interview Questions
PDF Tutorials and Interview Questions
PDF Tutorials and Interview Questions
com
Page 1 of 140
Bureau Veritas
What are the various types of queries in Oracle ?
Users' information
Your request to URL "http://www.facebook.com/
href=http://facebook.com/pages/PDF-T utorialscom/147676691957980&width=800&colorscheme=light&show_faces=
=false&header=true&height=300" is listed in Websense category
security policy, these categories are not allowed.On
accessible, thank you to contact your Help Desk:
Co-related queries
Nested queries
Compound queries
What are the components of physical database structure of Oracle database?
Oracle database is comprised of three types of files. One or more datafiles, two are more
redo log files, and one or more control files.
Sections
ACCESS
Adobe AIR
Adobe illustrator
Adobe InDesign
Android
AutoCAD
BSD
expressions referenced in the parameter list of a subprogram call are actual parameters.For
C#
example, the following procedure call lists two actual parameters named emp_num and
amount:
CATIA
COBOL
CPP
Eg.raise_salary(emp_num, amount);
Dreamweaver
EXCEL
the subprogram body are formal parameters.For example, the following procedure declares
Fireworks
Flash
GIMP
J2EE
J2ME
JAVA
JavaFX
MAINFRAME
Equijoins
ORACLE Database
Non-equijoins
osCommerce
self join
Peoplesoft
outer join
Photoshop
PHP
PYTHON
questions
SAP
SOA Architecture
Software Testing
32 bit
SOLARIS
SYMBIAN
UBUNTU
Visual Basic ( VB )
Web Content Management
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
What is a tablespace?
A database is divided into Logical Storage Unit called tablespaces. A tablespace is used to
grouped related logical structures together.
Page 2 of 140
WebLogic Server
XML
Networking
System Admin
UML
UNIX
PERL
HTML
CCNA
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 3 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 4 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 5 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 6 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 7 of 140
small transactions as with OLTP, use a smaller block size. With fewer but larger transactions,
as with a DSS application, use a larger block size. If you are using a volume manager,
consider your operating system block size to be 8K. This is because volume manager
products use 8K blocks (and this is not configurable).
What are the different approaches used by Optimizer in choosing an execution plan ?
Rule-based and Cost-based.
What does ROLLBACK do ?
ROLLBACK retracts any of the changes resulting from the SQL statements in the transaction.
How does one coalesce free space ? (for DBA)
SMON coalesces free space (extents) into larger, contiguous extents every 2 hours and even
then, only for a short period of time.
SMON will not coalesce free space if a tablespaces default storage parameter pctincrease
is set to 0. With Oracle 7.3 one
can manually coalesce a tablespace using the ALTER TABLESPACE COALESCE; command,
until then use:
SQL> alter session set events immediate trace name coalesce level n;
Where n is the tablespace number you get from SELECT TS#, NAME FROM SYS.TS$;
You
can
get
status
information
about
this
process
by
selecting
from
the
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 8 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 9 of 140
What is a Schema ?
The set of objects owned by user account is called the schema.
What is a cluster Key ?
The related columns of the tables are called the cluster key. The cluster key is indexed using
a cluster index and its value is stored only once for multiple tables in the cluster.
What are the Data Control statements?
What is Parallel Server ?
Multiple instances accessing the same database (Only In Multi-CPU environments)
What are the basic element of Base configuration of an oracle Database ?
It consists of
one or more data files.
one or more control files.
two or more redo log files.
The Database contains
multiple users/schemas
one or more rollback segments
one or more tablespaces
Data dictionary tables
User objects (table,indexes,views etc.,)
The server that access the database consists of
SGA (Database buffer, Dictionary Cache Buffers, Redo log buffers, Shared SQL pool)
SMON (System MONito)
PMON (Process MONitor)
LGWR (LoG Write)
DBWR (Data Base Write)
ARCH (ARCHiver)
CKPT (Check Point)
RECO
Dispatcher
User Process with associated PGS
What is clusters ?
Group of tables physically stored together because they share common columns and are
often used together is called Cluster.
Describe data models?
What is an Index ? How it is implemented in Oracle Database ?
An index is a database structure used by the server to have direct access of a row in a table.
An index is automatically created when a unique of primary key constraint clause is specified
in create table comman (Ver 7.0)
What is a Database instance ? Explain
A database instance (Server) is a set of memory structure and background processes that
access a set of database files.The process can be shared by all users. The memory structure
that are used to store most queried data from database. This helps up to improve database
performance by decreasing the amount of I/O performed against data file.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 10 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 11 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 12 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 13 of 140
What is snapshots?
Snapshot is an object used to dynamically replicate data between distribute database at
specified time intervals. In ver 7.0 they are read only.
What are the various type of snapshots?
Simple and Complex.
Describe two phases of Two-phase commit ?
Prepare phase The global coordinator (initiating node) ask a participants to prepare (to
promise to commit or rollback the transaction, even if there is a failure) Commit Phase If
all participants respond to the coordinator that they are prepared, the coordinator asks all
nodes to commit the transaction, if all participants cannot prepare, the coordinator asks all
nodes to roll back the transaction.
What are the min.extents allocated to a rollback extent in Oracle ?
Two
What is snapshot log ?
It is a table that maintains a record of modifications to the master table in a snapshot. It is
stored in the same database as master table and is only available for simple snapshots. It
should be created before creating snapshots.
What are the benefits of distributed options in databases?
Database on other servers can be updated and those transactions can be grouped together
with others in a logical unit.
Database uses a two phase commit.
What are the options available to refresh snapshots ?
COMPLETE Tables are completely regenerated using the snapshots query and the master
tables every time the snapshot referenced.
FAST If simple snapshot used then a snapshot log can be used to send the changes to the
snapshot tables.
FORCE Default value. If possible it performs a FAST refresh; Otherwise it will perform a
complete refresh.
What is a SNAPSHOT LOG ?
A snapshot log is a table in the master database that is associated with the master table.
ORACLE uses a snapshot log to track the rows that have been updated in the master table.
Snapshot logs are used in updating the snapshots based on the master table.
What is Distributed database ?
A distributed database is a network of databases managed by multiple database servers that
appears to a user as single
logical database. The data of all databases in the distributed database can be simultaneously
accessed and modified.
How can we reduce the network traffic?
- Replication of data in distributed environment.
- Using snapshots to replicate data.
- Using remote procedure calls.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 14 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 15 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 16 of 140
What are the sql clauses supported in the link property sheet?
Where start with having.
What is trigger associated with the timer?
When-timer-expired.
What are the trigger associated with image items?
When-image-activated fires when the operators double clicks on an image itemwhen-imagepressed fires when an operator clicks
or double clicks on an image item
What are the different windows events activated at runtimes?
When_window_activated
When_window_closed
When_window_deactivated
When_window_resized
Within this triggers, you can examine the built in system variable system. event_window to
determine the name of the window
for which the trigger fired.
When do you use data parameter type?
When the value of a data parameter being passed to a called product is always the name of
the record group defined in the
current form. Data parameters are used to pass data to products invoked with the
run_product built-in subprogram.
What is difference between open_form and call_form?
when one form invokes another form by executing open_form the first form remains
displayed, and operators can navigate
between the forms as desired. when one form invokes another form by executing call_form,
the called form is modal with
respect to the calling form. That is, any windows that belong to the calling form are disabled,
and operators cannot navigate
to them until they first exit the called form.
What is new_form built-in?
When one form invokes another form by executing new_form oracle form exits the first form
and releases its memory before
loading the new form calling new form completely replace the first with the second. If there
are changes pending in the first
form, the operator will be prompted to save them before the new form is loaded.
What is the LOV of Validation Property of an item? What is the use of it?
When LOV for Validation is set to True, Oracle Forms compares the current value of the text
item to the values in the first
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 17 of 140
column displayed in the LOV. Whenever the validation event occurs. If the value in the text
item matches one of the values in
the first column of the LOV, validation succeeds, the LOV is not displayed, and processing
continues normally. If the value
in the text item does not match one of the values in the first column of the LOV, Oracle
Forms displays the LOV and uses the
text item value as the search criteria to automatically reduce the list.
What is the diff. when Flex mode is mode on and when it is off?
When flex mode is on, reports automatically resizes the parent when the child is resized.
What is the diff. when confine mode is on and when it is off?
When confine mode is on, an object cannot be moved outside its parent in the layout.
What are visual attributes?
Visual attributes are the font, color, pattern proprieties that you set for form and menu
objects that appear in your
application interface.
Which of the two views should objects according to possession?
view by structure.
What are the two types of views available in the object navigator(specific to report 2.5)?
View by structure and view by type .
What are the vbx controls?
Vbx control provide a simple method of building and enhancing user interfaces. The controls
can use to obtain user inputs and
display program outputs.vbx control where originally develop as extensions for the ms
visual basic environments and include
such items as sliders, rides and knobs.
What is the use of transactional triggers?
Using transactional triggers we can control or modify the default functionality of the oracle
forms.
How do you create a new session while open a new form?
Using open_form built-in setting the session option Ex. Open_form(Stocks ,active, session).
when invoke the multiple forms
with open form and call_form in the same application, state whether the following are
true/False
What are the ways to monitor the performance of the report?
Use reports profile executable statement. Use SQL trace facility.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 18 of 140
If two groups are not linked in the data model editor, What is the hierarchy between them?
Two group that is above are the left most rank higher than the group that is to right or below
it.
An open form can not be execute the call_form procedure if you chain of called forms has
been initiated by another open form?
True
Explain about horizontal, Vertical tool bar canvas views?
Tool bar canvas views are used to create tool bars for individual windows. Horizontal tool
bars are display at the top of a
window, just under its menu bar. Vertical Tool bars are displayed along the left side of a
window
What is the purpose of the product order option in the column property sheet?
To specify the order of individual group evaluation in a cross products.
What is the use of image_zoom built-in?
To manipulate images in image items.
How do you reference a parameter indirectly?
To indirectly reference a parameter use the NAME IN, COPY built-ins to indirectly set and
reference the parameters value
Example name_in (capital parameter my param), Copy (SURESH,Parameter my_param)
What is a timer?
Timer is an internal time clock that you can programmatically create to perform an action
each time the times.
What are the two phases of block coordination?
There are two phases of block coordination: the clear phase and the population phase.
During, the clear phase, Oracle Forms
navigates internally to the detail block and flushes the obsolete detail records. During the
population phase, Oracle Forms
issues a SELECT statement to repopulate the detail block with detail records associated with
the new master record. These
operations are accomplished through the execution of triggers.
What are Most Common types of Complex master-detail relationships?
There are three most common types of complex master-detail relationships:
master with dependent details
master with independent details
detail with two masters
What is a text list?
The text list style list item appears as a rectangular box which displays the fixed number of
values. When the text list
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 19 of 140
contains values that can not be displayed, a vertical scroll bar appears, allowing the operator
to view and select
undisplayed values.
What is term?
The term is terminal definition file that describes the terminal form which you are using
r20run.
What is use of term?
The term file which key is correspond to which oracle report functions.
What is pop list?
The pop list style list item appears initially as a single field (similar to a text item field). When
the operator selects
the list icon, a list of available choices appears.
What is the maximum no of chars the parameter can store?
The maximum no of chars the parameter can store is only valid for char parameters, which
can be upto 64K. No parameters
default to 23Bytes and Date parameter default to 7Bytes.
What are the default extensions of the files created by library module?
The default file extensions indicate the library module type and storage format .pll pl/sql
library module binary
What are the Coordination Properties in a Master-Detail relationship?
The coordination properties are
Deferred
Auto-Query
These Properties determine when the population phase of block
coordination should occur.
How do you display console on a window ?
The console includes the status line and message line, and is displayed at the bottom of the
window to which it is
assigned.To specify that the console should be displayed, set the console window form
property to the name of any window in
the form. To include the console, set console window to Null.
What are the different Parameter types?
Text ParametersData Parameters
State any three mouse events system variables?
System.mouse_button_pressedSystem.mouse_button_shift
What are the types of calculated columns available?
Summary, Formula, Placeholder column.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 20 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 21 of 140
It is better to backup tablespace for tablespace than to put all tablespaces in backup mode.
Backing them up separately
incurs less overhead. When done, remember to backup your control files. Look at this
example:
ALTER SYSTEM SWITCH LOGFILE; Force log switch to update control file headers
ALTER DATABASE BACKUP CONTROLFILE TO /backupDir/control.dbf;
NOTE: Do not run on-line backups during peak processing periods. Oracle will write
complete database blocks instead of the
normal deltas to redo log files while in backup mode. This will lead to excessive database
archiving and even database
freezes.
What are the different file extensions that are created by oracle reports?
Rep file and Rdf file.
What is strip sources generate options?
Removes the source code from the library file and generates a library files that contains only
pcode. The resulting file can
be used for final deployment, but can not be subsequently edited in the designer.ex. f45gen
module=old_lib.pll
userid=scott/tiger strip_source YES output_file
How does one put a database into ARCHIVELOG mode? (for DBA )
The main reason for running in archivelog mode is that one can provide 24-hour availability
and guarantee complete data
recoverability. It is also necessary to enable ARCHIVELOG mode before one can start to use
on-line database backups. To
enable ARCHIVELOG mode, simply change your database startup command script, and
bounce the database:
SQLPLUS> connect sys as sysdba
SQLPLUS> startup mount exclusive;
SQLPLUS> alter database archivelog;
SQLPLUS> archive log start;
SQLPLUS> alter database open;
NOTE1: Remember to take a baseline database backup right after enabling archivelog mode.
Without it one would not be able to
recover. Also, implement an archivelog backup to prevent the archive log directory from
filling-up.
NOTE2: ARCHIVELOG mode was introduced with Oracle V6, and is essential for database
point-in-time recovery. Archiving can be
used in combination with on-line and off-line database backups.
NOTE3: You may want to set the following INIT.ORA parameters when enabling ARCHIVELOG
mode: log_archive_start=TRUE,
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 22 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 23 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 24 of 140
an
administrative
user
belongs
to
the
dba
group
on
Unix,
or
the
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 25 of 140
terminals, you can rely on operating system passwords, with Windows, you cannot.
If you set REMOTE_OS_AUTHENT=TRUE in your init.ora file, Oracle assumes that the remote
OS has authenticated the user. If
REMOTE_OS_AUTHENT is set to FALSE (recommended), remote users will be unable to
connect without a password. IDENTIFIED
EXTERNALLY will only be in effect from the local host. Also, if you are using OPS$ as your
prefix, you will be able to log
on locally with or without a password, regardless of whether you have identified your ID
with a password or defined it to be
IDENTIFIED EXTERNALLY.
Do user parameters appear in the data modal editor in 2.5?
No
Can you pass data parameters to forms?
No
Is it possible to link two groups inside a cross products after the cross products group has
been created?
no
What are the different modals of windows?
Modalless windows
Modal windows
What are modal windows?
Modal windows are usually used as dialogs, and have restricted functionality compared to
modelless windows. On some platforms
for example operators cannot resize, scroll or iconify a modal window.
What are the different default triggers created when Master Deletes Property is set to Nonisolated?
Master Deletes Property Resulting Triggers
Non-Isolated(the default) On-Check-Delete-Master
On-Clear-Details
On-Populate-Details
What are the different default triggers created when Master Deletes Property is set to
isolated?
Master Deletes Property Resulting Triggers
Isolated On-Clear-Details
On-Populate-Details
What are the different default triggers created when Master Deletes Property is set to
Cascade?
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 26 of 140
Cascading On-Clear-Details
On-Populate-Details
Pre-delete
What is the diff. bet. setting up of parameters in reports 2.0 reports2.5?
LOVs can be attached to parameters in the reports 2.5 parameter form.
What are the difference between lov & list item?
Lov is a property where as list item is an item. A list item can have only one column, lov can
have one or more columns.
What is the advantage of the library?
Libraries provide a convenient means of storing client-side program units and sharing them
among multiple applications. Once
you create a library, you can attach it to any other form, menu, or library modules. When
you can call library program units
from triggers menu items commands and user named routine, you write in the modules to
which you have attach the library. When
a library attaches another library, program units in the first library can reference program
units in the attached library.
Library support dynamic loading-that is library program units are loaded into an application
only when needed. This can
significantly reduce the run-time memory requirements of applications.
What is lexical reference? How can it be created?
Lexical reference is place_holder for text that can be embedded in a sql statements. A lexical
reference can be created using
& before the column or parameter name.
What is system.coordination_operation?
It represents the coordination causing event that occur on the master block in master-detail
relation.
What is synchronize?
It is a terminal screen with the internal state of the form. It updates the screen display to
reflect the information that
oracle forms has in its internal representation of the screen.
What use of command line parameter cmd file?
It is a command line argument that allows you to specify a file that contain a set of
arguments for r20run.
What is a Text_io Package?
It allows you to read and write information to a file in the file system.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 27 of 140
What is forms_DDL?
Issues dynamic Sql statements at run time, including server side pl/SQl and DDL
How is link tool operation different bet. reports 2 & 2.5?
In Reports 2.0 the link tool has to be selected and then two fields to be linked are selected
and the link is automatically
created. In 2.5 the first field is selected and the link tool is then used to link the first field to
the second field.
What are the different styles of activation of ole Objects?
In place activationExternal activation
How do you reference a Parameter?
In Pl/Sql, You can reference and set the values of form parameters using bind variables
syntax. Ex. PARAMETER name = or
:block.item = PARAMETER Parameter name
What is the difference between object embedding & linking in Oracle forms?
In Oracle forms, Embedded objects become part of the form module, and linked objects are
references from a form module to a
linked source file.
Name of the functions used to get/set canvas properties?
Get_view_property, Set_view_property
What are the built-ins that are used for setting the LOV properties at runtime?
get_lov_property
set_lov_property
What are the built-ins used for processing rows?
Get_group_row_count(function)
Get_group_selection_count(function)
Get_group_selection(function)
Reset_group_selection(procedure)
Set_group_selection(procedure)
Unset_group_selection(procedure)
What are built-ins used for Processing rows?
GET_GROUP_ROW_COUNT(function)
GET_GROUP_SELECTION_COUNT(function)
GET_GROUP_SELECTION(function)
RESET_GROUP_SELECTION(procedure)
SET_GROUP_SELECTION(procedure)
UNSET_GROUP_SELECTION(procedure)
What are the built-in used for getting cell values?
Get_group_char_cell(function)
Get_groupcell(function)
Get_group_number_cell(function)
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 28 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 29 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 30 of 140
involves?
By dragging the column outside the group.
What is the use of place holder column? What are the various sub events a mouse double
click event involves?
A placeholder column is used to hold calculated values at a specified place rather than
allowing is to appear in the actual
row where it has to appear.
What is the use of hidden column? What are the various sub events a mouse double click
event involves?
A hidden column is used to when a column has to embed into boilerplate text.
What database aspects should be monitored? (for DBA)
One should implement a monitoring system to constantly monitor the following aspects of a
database. Writing custom scripts,
implementing Oracles Enterprise Manager, or buying a third-party monitoring product can
achieve this. If an alarm is
triggered, the system should automatically notify the DBA (e-mail, page, etc.) to take
appropriate action.
Infrastructure availability:
. Is the database up and responding to requests
. Are the listeners up and responding to requests
. Are the Oracle Names and LDAP Servers up and responding to requests
. Are the Web Listeners up and responding to requests
Things that can cause service outages:
. Is the archive log destination filling up?
. Objects getting close to their max extents
. User and process limits reached
Things that can cause bad performance:
See question What tuning indicators can one use?.
Where should the tuning effort be directed? (for DBA)
Consider the following areas for tuning. The order in which steps are listed needs to be
maintained to prevent tuning side
effects. For example, it is no good increasing the buffer cache if you can reduce I/O by
rewriting a SQL statement. Database
Design (if its not too late):
Poor system performance usually results from a poor database design. One should generally
normalize to the 3NF. Selective
denormalization can provide valuable performance improvements. When designing, always
keep the data access path in mind.
Also look at proper data partitioning, data replication, aggregation tables for decision
support systems, etc.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 31 of 140
Application Tuning:
Experience showed that approximately 80% of all Oracle system performance problems are
resolved by coding optimal SQL. Also
consider proper scheduling of batch tasks after peak working hours.
Memory Tuning:
Properly size your database buffers (shared pool, buffer cache, log buffer, etc) by looking at
your buffer hit ratios. Pin
large objects into memory to prevent frequent reloads.
Disk I/O Tuning:
Database files needs to be properly sized and placed to provide maximum disk subsystem
throughput. Also look for frequent
disk sorts, full table scans, missing indexes, row chaining, data fragmentation, etc
Eliminate Database Contention:
Study database locks, latches and wait events carefully and eliminate where possible. Tune
the Operating System:
Monitor and tune operating system CPU, I/O and memory utilization. For more information,
read the related Oracle FAQ dealing
with your specific operating system.
What are the various sub events a mouse double click event involves? What are the various
sub events a mouse double click
event involves?
Double clicking the mouse consists of the mouse down, mouse up, mouse click, mouse
down & mouse up events.
What are the default parameter that appear at run time in the parameter screen? What are
the various sub events a mouse
double click event involves?
Destype and Desname.
What are the built-ins used for Creating and deleting groups?
CREATE-GROUP (function)
CREATE_GROUP_FROM_QUERY(function)
DELETE_GROUP(procedure)
What are different types of canvas views?
Content canvas views
Stacked canvas views
Horizontal toolbar
vertical toolbar.
What are the different types of Delete details we can establish in Master-Details?
Cascade
Isolate
Non-isolate
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 32 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 33 of 140
old export version, and import it using a later version of the import utility. This is quite an
effective way of upgrading a
database from one release of Oracle to the next.
Oracle also ships some previous catexpX.sql scripts that can be executed as user SYS
enabling older imp/exp versions to work
(for
backwards
compatibility).
For
example,
one
can
run
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 34 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 35 of 140
What are the built -ins used for Modifying a groups structure?
ADD-GROUP_COLUMN (function)
ADD_GROUP_ROW (procedure)
DELETE_GROUP_ROW(procedure)
What is an user exit used for?
A way in which to pass control (and possibly arguments ) form Oracle report to another
Oracle products of 3 GL and then
return control ( and ) back to Oracle reports.
What is the User-Named Editor?
A user named editor has the same text editing functionality as the default editor, but,
because it is a named object, you can
specify editor attributes such as windows display size, position, and title.
My database was terminated while in BACKUP MODE, do I need to recover? (for DBA)
If a database was terminated while one of its tablespaces was in BACKUP MODE (ALTER
TABLESPACE xyz BEGIN BACKUP;), it will
tell you that media recovery is required when you try to restart the database. The DBA is
then required to recover the
database and apply all archived logs to the database. However, from Oracle7.2, you can
simply take the individual datafiles
out of backup mode and restart the database.
ALTER DATABASE DATAFILE /path/filename END BACKUP;
One can select from V$BACKUP to see which datafiles are in backup mode. This normally
saves a significant amount of database
down time.
Thiru Vadivelu contributed the following:
From Oracle9i onwards, the following command can be used to take all of the datafiles out
of hot backup mode:
ALTER DATABASE END BACKUP;
The above commands need to be issued when the database is mounted.
What is a Static Record Group?
A static record group is not associated with a query, rather, you define its structure and row
values at design time, and
they remain fixed at runtime.
What is a record group?
A record group is an internal Oracle Forms that structure that has a column/row framework
similar to a database table.
However, unlike database tables, record groups are separate objects that belong to the form
module which they are defined.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 36 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 37 of 140
What are the differences between EBU and RMAN? (for DBA)
Enterprise Backup Utility (EBU) is a functionally rich, high performance interface for backing
up Oracle7 databases. It is
sometimes referred to as OEBU for Oracle Enterprise Backup Utility. The Oracle Recovery
Manager (RMAN) utility that ships
with Oracle8 and above is similar to Oracle7s EBU utility. However, there is no direct
upgrade path from EBU to RMAN.
How does one create a RMAN recovery catalog? (for DBA)
Start by creating a database schema (usually called rman). Assign an appropriate tablespace
to it and grant it the
recovery_catalog_owner role. Look at this example:
sqlplus sys
SQL>create user rman identified by rman;
SQL> alter user rman default tablespace tools temporary tablespace temp;
SQL> alter user rman quota unlimited on tools;
SQL> grant connect, resource, recovery_catalog_owner to rman;
SQL> exit;
Next, log in to rman and create the catalog schema. Prior to Oracle 8i this was done by
running the catrman.sql script. rman
catalog rman/rman
RMAN>create catalog tablespace tools;
RMAN> exit;
You can now continue by registering your databases in the catalog. Look at this example:
rman catalog rman/rman target backdba/backdba
RMAN> register database;
How can a group in a cross products be visually distinguished from a group that does not
form a cross product?
A group that forms part of a cross product will have a thicker border.
What is the frame & repeating frame?
A frame is a holder for a group of fields. A repeating frame is used to display a set of records
when the no. of records that are to displayed is not known before.
What is a combo box?
A combo box style list item combines the features found in list and text item. Unlike the pop
list or the text list style
list items, the combo box style list item will both display fixed values and accept one
operator entered value.
What are three panes that appear in the run time pl/sql interpreter?
1. Source pane.
2. interpreter pane.
3. Navigator pane.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 38 of 140
What are the two panes that Appear in the design time pl/sql interpreter?
1. Source pane.
2. Interpreter pane
What are the two ways by which data can be generated for a parameters list of values?
1. Using static values.
2. Writing select statement.
What are the various methods of performing a calculation in a report ?
1. Perform the calculation in the SQL statements itself.
2. Use a calculated / summary column in the data model.
What are the default extensions of the files created by menu module?
.mmb,
.mmx
What are the default extensions of the files created by forms modules?
.fmb form module binary
.fmx form module executable
To display the page no. for each page on a report what would be the source & logical page
no. or & of physical page no.?
& physical page no.
It is possible to use raw devices as data files and what is the advantages over file. system
files ?
Yes. The advantages over file system files. I/O will be improved because Oracle is byepassing the kernnel which writing into disk. Disk Corruption will be very less.
What are disadvantages of having raw devices ?
We should depend on export/import utility for backup/recovery (fully reliable) The tar
command cannot be used for physical file backup, instead we can use dd command which is
less flexible and has limited recoveries.
What is the significance of having storage clause ?
We can plan the storage for a table as how much initial extents are required, how much can
be extended next, how much % should leave free for managing row updations etc.,
What is the use of INCTYPE option in EXP command ?
Type export should be performed COMPLETE,CUMULATIVE,INCREMENTAL. List the sequence
of events when a large transaction that
exceeds beyond its optimal value when an entry wraps and causes the rollback segment
toexpand into anotion Completes. e. will be written.
What is the use of FILE option in IMP command ?
The name of the file from which import should be performed.
What is a Shared SQL pool?
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 39 of 140
The data dictionary cache is stored in an area in SGA called the Shared SQL Pool. This will
allow sharing of parsed SQL statements among concurrent users.
What is hot backup and how it can be taken?
Taking backup of archive log files when database is open. For this the ARCHIVELOG mode
should be enabled. The following files
need to be backed up. All data files. All Archive log, redo log files. All control files.
List the Optional Flexible Architecture (OFA) of Oracle database? or How can we organize the
tablespaces in Oracle database
to have maximum performance ?
SYSTEM Data dictionary tables.
DATA Standard operational tables.
DATA2- Static tables used for standard operations
INDEXES Indexes for Standard operational tables.
INDEXES1 Indexes of static tables used for standard operations.
TOOLS Tools table.
TOOLS1 Indexes for tools table.
RBS Standard Operations Rollback Segments,
RBS1,RBS2 Additional/Special Rollback segments.
TEMP Temporary purpose tablespace
TEMP_USER Temporary tablespace for users.
USERS User tablespace.
How to implement the multiple control files for an existing database ?
Shutdown the database Copy one of the existing control file to new location Edit Config ora
file by adding new control file.name Restart the database.
What is advantage of having disk shadowing/ Mirroring ?
Shadow set of disks save as a backup in the event of disk failure. In most Operating System if
any disk failure occurs it
automatically switchover to place of failed disk. Improved performance because most OS
support volume shadowing can direct
file I/O request to use the shadow set of files instead of the main set of files. This reduces
I/O load on the main set of
disks.
How will you force database to use particular rollback segment ?
SET TRANSACTION USE ROLLBACK SEGMENT rbs_name.
Why query fails sometimes ?
Rollback segment dynamically extent to handle larger transactions entry loads. A single
transaction may wipeout all available
free space in the Rollback Segment Tablespace. This prevents other user using Rollback
segments.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 40 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 41 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 42 of 140
:= dbms_utility.make_data_block_address(1,12);
print x
alter session set events immediate trace name blockdump level 50360894
/
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 43 of 140
import
using
the
command
imp
system/manager
file=export.dmp
indexfile=newrite.sql.
This will create all definitions into newfile.sql. Drop necessary objects.
Run the script newfile.sql after altering the tablespaces.
Import from the backup for the necessary objects.
How does Space allocation table place within a block ?
Each block contains entries as follows
Fixed block header
Variable block header
Row Header,row date (multiple rows may exists)
PCTEREE (% of free space for row updation in future)
What are the factors causing the reparsing of SQL statements in SGA?
Due to insufficient Shared SQL pool size. Monitor the ratio of the reloads takes place while
executing SQL statements. If the
ratio is greater than 1 then increase the SHARED_POOL_SIZE. LOGICAL & PHYSICAL
ARCHITECTURE OF DATABASE.
What is dictionary cache ?
Dictionary cache is information about the databse objects stored in a data dictionary table.
What is a Control file ?
Database overall physical architecture is maintained in a file called control file. It will be
used to maintain internal
consistency and guide recovery operations. Multiple copies of control files are advisable.
What is Database Buffers ?
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 44 of 140
Database buffers are cache in the SGA used to hold 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 decides the size.
How will you create multiple rollback segments in a database ?
Create a database which implicitly creates a SYSTEM Rollback Segment in a SYSTEM
tablespace. Create a Second Rollback Segment
name R0 in the SYSTEM tablespace. Make new rollback segment available (After shutdown,
modify init.ora file and Start
database) Create other tablespaces (RBS) for rollback segments. Deactivate Rollback
Segment R0 and activate the newly created
rollback segments.
What is cold backup? What are the elements of it?
Cold backup is taking backup of all physical files after normal shutdown of database. We
need to take.
- All Data files.
- All Control files.
- All on-line redo log files.
- The init.ora file (Optional)
What is meant by redo log buffer ?
Changes made to entries are written to the on-line redo log files. So that they can be used in
roll forward operations during
database recoveries. Before writing them into the redo log files, they will first brought to
redo log buffers in SGA and LGWR
will write into files frequently. LOG_BUFFER parameter will decide the size.
How will you estimate the space required by a non-clustered tables?
Calculate the total header size
Calculate the available dataspace per data block
Calculate the combined column lengths of the average row
Calculate the total average row size.
Calculate the average number rows that can fit in a block
Calculate the number of blocks and bytes required for the table.
After arriving the calculation, add 10 % additional space to calculate the initial extent size for
a working table.
How will you monitor the space allocation ?
By querying DBA_SEGMENT table/view.
What is meant by free extent ?
A free extent is a collection of continuous free blocks in tablespace. When a segment is
dropped its extents are reallocated
and are marked as free.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 45 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 46 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 47 of 140
block level ?
a. ON-INSERT b. POST-INSERT c. PRE-INSERT
State the order in which these triggers are executed ?
POST-FIELD,ON-VALIDATE-FIELD,POST-CHANGE
and
KEY-NEXTFLD.
KEY-NEXTFLD,POST-
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 48 of 140
Key-others
Key-startup
What is the difference between a Function Key Trigger and Key Function Trigger ?
Function key triggers are associated with individual SQL*FORMS function keys You can
attach Key function triggers to 10 keys
or key sequences that normally do not perform any SQL * FORMS operations. These keys
referred as key F0 through key F9.
Committed block sometimes refer to a BASE TABLE ?
False
Error_Code is a package proecdure ?
a. True b. false
False
When is cost based optimization triggered? (for DBA)
Its important to have statistics on all tables for the CBO (Cost Based Optimizer) to work
correctly. If one table involved
in a statement does not have statistics, Oracle has to revert to rule-based optimization for
that statement. So you really
want for all tables to have statistics right away; it wont help much to just have the larger
tables analyzed.
Generally, the CBO can change the execution plan when you:
1. Change statistics of objects by doing an ANALYZE;
2. Change some initialization parameters (for example: hash_join_enabled, sort_area_size,
db_file_multiblock_read_count).
How can one optimize %XYZ% queries? (for DBA)
It is possible to improve %XYZ% queries by forcing the optimizer to scan all the entries from
the index instead of the table.
This can be done by specifying hints. If the index is physically smaller than the table (which
is usually the case) it will
take less time to scan the entire index than to scan the entire table.
What Enter package procedure does ?
Enter Validate-data in the current validation unit.
Where can one find I/O statistics per table? (for DBA)
The UTLESTAT report shows I/O per tablespace but one cannot see what tables in the
tablespace has the most I/O. The
$ORACLE_HOME/rdbms/admin/catio.sql script creates a sample_io procedure and table to
gather the required information. After
executing the procedure, one can do a simple SELECT * FROM io_per_object; to extract the
required information. For more
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 49 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 50 of 140
cheaper.
. Remember that you MUST supply the leading column of an index, for the index to be used
(unless you use a FAST FULL SCAN or
SKIP SCANNING).
. There are many other factors that affect the cost, but sometimes the above can help to
show why an index is not being used
by the CBO. If from checking the above you still feel that the query should be using an index,
try specifying an index hint.
Obtain an explain plan of the query either using TKPROF with TIMED_STATISTICS, so that one
can see the CPU utilization, or
with AUTOTRACE to see the statistics. Compare this to the explain plan when not using an
index.
When should one rebuild an index? (for DBA)
You can run the ANALYZE INDEX VALIDATE STRUCTURE command on the affected indexes
each invocation of this command creates
a single row in the INDEX_STATS view. This row is overwritten by the next ANALYZE INDEX
command, so copy the contents of the
view into a local table after each ANALYZE. The badness of the index can then be judged by
the ratio of DEL_LF_ROWS to
LF_ROWS.
What are the unrestricted procedures used to change the popup screen position during run
time ?
Anchor-view
Resize -View
Move-View.
What is a type?
What is an Alert ?
An alert is window that appears in the middle of the screen overlaying a portion of the
current display.
Deleting a page removes information about all the fields in that page ?
a. True. b. False
a. True.
Two popup pages can appear on the screen at a time ?Two popup pages can appear on the
screen at a time ?
a. True. b. False?
a. True.
Classify the restricted and unrestricted procedure from the following.
a. Call
b. User-Exit
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 51 of 140
c. Call-Query
d. Up
e. Execute-Query
f. Message
g. Exit-From
h. Post
i. Break?
a. Call unrestricted
b. User Exit Unrestricted
c. Call_query Unrestricted
d. Up Restricted
e. Execute Query Restricted
f. Message Restricted
g. Exit_form Restricted
h. Post Restricted
i. Break Unrestricted.
What is an User Exits ?
A user exit is a subroutine which are written in programming languages using pro*C pro
*Cobol , etc., that link into the SQL
* forms executable.
What is a Trigger ?
A piece of logic that is executed at or triggered by a SQL *forms event.
What is a Package Procedure ?
A Package procedure is built in PL/SQL procedure.
What is the maximum size of a form ?
255 character width and 255 characters Length.
What is the difference between system.current_field and system.cursor_field ?
1. System.current_field gives name of the field.
2. System.cursor_field gives name of the field with block name.
List the system variables related in Block and Field?
1. System.block_status
2. System.current_block
3. System.current_field
4. System.current_value
5. System.cursor_block
6. System.cursor_field
7. System.field_status.
What are the different types of Package Procedure ?
1. Restricted package procedure.
2. Unrestricted package procedure.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 52 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 53 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 54 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 55 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 56 of 140
Populate_group(Function)
Populate_group_with_query(Function)
Set_group_Char_cell(procedure)
List the built-in routines for the controlling canvas views during run-time?
Find_canvas
Get-Canvas_property
Get_view_property
Hide_View
Replace_content_view
Scroll_view
Set_canvas_property
Set_view_property
Show_view
Alert
System.effective_date system variable is read only True/False?
False
What are the built_in used to trapping errors in forms 4?
Error_type return character
Error_code return number
Error_text return char
Dbms_error_code return no.
Dbms_error_text return char
What is Oracle Financials? (for DBA)
Oracle Financials products provide organizations with solutions to a wide range of long- and
short-term accounting system
issues. Regardless of the size of the business, Oracle Financials can meet accounting
management demands with:
Oracle Assets: Ensures that an organizations property and equipment investment is
accurate and that the correct asset tax
accounting strategies are chosen.
Oracle General Ledger: Offers a complete solution to journal entry, budgeting, allocations,
consolidation, and financial
reporting needs.
Oracle Inventory: Helps an organization make better inventory decisions by minimizing stock
and maximizing cash flow.
Oracle Order Entry: Provides organizations with a sophisticated order entry system for
managing customer commitments.
Oracle Payables: Lets an organization process more invoices with fewer staff members and
tighter controls. Helps save money
through maximum discounts, bank float, and prevention of duplicate payment.
Oracle Personnel: Improves the management of employee- related issues by retaining and
making available every form of
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 57 of 140
personnel data.
Oracle Purchasing: Improves buying power, helps negotiate bigger discounts, eliminates
paper flow, increases financial
controls, and increases productivity.
Oracle Receivables:. Improves cash flow by letting an organization process more payments
faster, without off-line research.
Helps correctly account for cash, reduce outstanding receivables, and improve collection
effectiveness.
Oracle Revenue Accounting Gives an organization timely and accurate revenue and flexible
commissions reporting.
Oracle Sales Analysis: Allows for better forecasting, planning. and reporting of sales
information.
What are the design facilities available in forms 4.0?
Default Block facility.
Layout Editor.
Menu Editor.
Object Lists.
Property Sheets.
PL/SQL Editor.
Tables Columns Browser.
Built-ins Browser.
What is the most important module in Oracle Financials? (for DBA)
The General Ledger (GL) module is the basis for all other Oracle Financial modules. All other
modules provide information to
it. If you implement Oracle Financials, you should switch your current GL system first.GL is
relatively easy to implement.
You should go live with it first to give your implementation team a chance to be familiar with
Oracle Financials.
What are the types of canvas-views?
Content View, Stacked View.
%type and %rowtype are attributes for?
What is the MultiOrg and what is it used for? (for DBA)
MultiOrg or Multiple Organizations Architecture allows multiple operating units and their
relationships to be defined within
a single installation of Oracle Applications. This keeps each operating units transaction data
separate and secure.
Use the following query to determine if MuliOrg is intalled:
select multi_org_flag from fnd_product_groups;
What is the difference between Fields and FlexFields? (for DBA)
A field is a position on a form that one uses to enter, view, update, or delete information. A
field prompt describes each
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 58 of 140
field by telling what kind of information appears in the field, or alternatively, what kind of
information should be entered
in the field.
A flexfield is an Oracle Applications field made up of segments. Each segment has an
assigned name and a set of valid values.
Oracle Applications uses flexfields to capture information about your organization. There are
two types of flexfields: key
flexfields and descriptive flexfields.
Explain types of Block in forms4.0?
Base table Blocks.
Control Blocks.
1. A base table block is one that is associated with a specific database table or view.
2. A control block is a block that is not associated with a database table. ITEMS
What is an Alert?
An alert is a modal window that displays a message notifies the operator of some
application condition
What are the built-in routines is available in forms 4.0 to create and manipulate a parameter
list?
Add_parameter
Create_Parameter_list
Delete_parameter
Destroy_parameter_list
Get_parameter_attr
Get_parameter_list
set_parameter_attr
What is a record Group?
A record group is an internal oracle forms data structure that has a similar column/row
frame work to a database table
What is a Navigable item?
A navigable item is one that operators can navigate to with the keyboard during default
navigation, or that Oracle forms can
navigate to by executing a navigational built-in procedure.
What is a library in Forms 4.0?
A library is a collection of Pl/SQL program units, including user named procedures, functions
& packages
How image_items can be populate to field in forms 4.0?
A fetch from a long raw database column PL/Sql assignment to executing the
read_image_file built_in procedure to get an image
from the file system.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 59 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 60 of 140
What are two virtual tables available during database trigger execution ?
The table columns are referred as OLD.column_name and NEW.column_name.
For triggers related to INSERT only NEW.column_name values only available.
For triggers related to UPDATE only OLD.column_name NEW.column_name values only
available.
For triggers related to DELETE only OLD.column_name values only available.
What is Fine Grained Auditing? (for DBA)
Fine Grained Auditing (DBMS_FGA) allows auditing records to be generated when certain
rows are selected from a table. A list
of defined policies can be obtained from DBA_AUDIT_POLICIES. Audit records are stored in
DBA_FGA_AUDIT_TRAIL. Look at this
example:
o Add policy on table with autiting condition
execute dbms_fga.add_policy(HR, EMP, policy1, deptno > 10);
o Must ANALYZE, this feature works with CBO (Cost Based Optimizer)
analyze table EMP compute statistics;
select * from EMP where c1 = 11; Will trigger auditing
select * from EMP where c1 = 09; No auditing
o Now we can see the statments that triggered the auditing condition
select sqltext from sys.fga_log$;
delete from sys.fga_log$;
What is a package ? What are the advantages of packages ? What is Pragma
EXECPTION_INIT ? Explain the usage ?
The PRAGMA EXECPTION_INIT tells the complier to associate an exception with an oracle
error. To get an error message of a
specific oracle error. e.g. PRAGMA EXCEPTION_INIT (exception name, oracle error number)
What is a Virtual Private Database? (for DBA)
Oracle 8i introduced the notion of a Virtual Private Database (VPD). A VPD offers FineGrained Access Control (FGAC) for
secure separation of data. This ensures that users only have access to data that pertains to
them. Using this option, one
could even store multiple companies data within the same schema, without them knowing
about it. VPD configuration is done
via the DBMS_RLS (Row Level Security) package. Select from SYS.V$VPD_POLICY to see
existing VPD configuration.
What is Raise_application_error ?
Raise_application_error is a procedure of package DBMS_STANDARD which allows to issue an
user_defined error messages from
stored sub-program or database trigger.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 61 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 62 of 140
What happens if a procedure that updates a column of table X is called in a database trigger
of the same table ?
Mutation of table occurs.
Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT in
Database Trigger ? Why ?
It is not possible. As triggers are defined for each table, if you use COMMIT of ROLLBACK in a
trigger, it affects logical
transaction processing.
How many types of database triggers can be specified on a table ? What are they ?
Insert Update Delete
Before Row o.k. o.k. o.k.
After Row o.k. o.k. o.k.
Before Statement o.k. o.k. o.k.
After Statement o.k. o.k. o.k.
If FOR EACH ROW clause is specified, then the trigger for each Row affected by the
statement.
If WHEN clause is specified, the trigger fires according to the returned Boolean value.
What are the modes of parameters that can be passed to a procedure ?
IN,OUT,IN-OUT parameters.
Where the Pre_defined_exceptions are stored ?
In the standard package.
Procedures, Functions & Packages ;
Write the order of precedence for validation of a column in a table ?
I. done using Database triggers.
ii. done using Integarity Constraints.?
I & ii.
Give the structure of the function ?
FUNCTION name (argument list ..) Return datatype is
local variable declarations
Begin
executable statements
Exception
execution handlers
End;
Explain how procedures and functions are called in a PL/SQL block ?
Function is called as part of an expression.
sal := calculate_sal (a822);
procedure is called as a PL/SQL statement
calculate_bonus (A822);
What are advantages fo Stored Procedures?
Extensibility,Modularity, Reusability, Maintainability and one time compilation.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 63 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 64 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 65 of 140
% FOUND to check whether cursor has fetched any row. True if rows are fetched.
% NOT FOUND to check whether cursor has fetched any row. True if no rows are featched.
These attributes are proceeded with SQL for Implicit Cursors and with Cursor name for
Explicit Cursors.
What are % TYPE and % ROWTYPE ? What are the advantages of using these over datatypes?
% TYPE provides the data type of a variable or a database column to that variable.
% ROWTYPE provides the record type that represents a entire row of a table or view or
columns selected in the cursor.
The advantages are :
I. Need not know about variables data type
ii. If the database definition of a column in a table changes, the data type of a variable
changes accordingly.
What is difference between % ROWTYPE and TYPE RECORD ?
% ROWTYPE is to be used whenever query returns a entire row of a table or view.
TYPE rec RECORD is to be used whenever query returns columns of different table or views
and variables.
E.g. TYPE r_emp is RECORD (eno emp.empno% type,ename emp ename %type );
e_rec emp% ROWTYPE
cursor c1 is select empno,deptno from emp;
e_rec c1 %ROWTYPE.
What are the different types of PL/SQL program units that can be defined and stored in
ORACLE database ?
Procedures and Functions,Packages and Database Triggers.
What are the advantages of having a Package ?
Increased functionality (for example,global package variables can be declared and used by
any proecdure in the package) and
performance (for example all objects of the package are parsed compiled, and loaded into
memory once)
What are the uses of Database Trigger ?
Database triggers can be used to automatic data generation, audit data modifications,
enforce complex Integrity constraints,
and customize complex security authorizations.
What is a Procedure ?
A Procedure consist of a set of SQL and PL/SQL statements that are grouped together as a
unit to solve a specific problem or
perform a set of related tasks.
What is a Package ?
A Package is a collection of related procedures, functions, variables and other package
constructs together as a unit in the
database.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 66 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 67 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 68 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 69 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 70 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 71 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 72 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 73 of 140
indicating the types of the select list that will eventually be returned by the cursor variable.
How do you find the numbert of rows in a Table ?
A bad answer is count them (SELECT COUNT(*) FROM table_name)
A good answer is :By generating SQL to ANALYZE TABLE table_name COUNT STATISTICS by querying Oracle
System Catalogues (e.g. USER_TABLES or
ALL_TABLES).
The best answer is to refer to the utility which Oracle released which makes it unnecessary
to do ANALYZE TABLE for each
Table individually.
What is the maximum buffer size that can be specified using the DBMS_OUTPUT.ENABLE
function?
1,000,00
What are cursor attributes?
-%ROWCOUNT
-%NOTFOUND
-%FOUND
-%ISOPEN
There is a % sign in one field of a column. What will be the query to find it?
Should be used before %.
What is ON DELETE CASCADE ?
When ON DELETE CASCADE is specified ORACLE maintains referential integrity by
automatically removing dependent foreign key
values if a referenced primary or unique key value is removed.
What is the fastest way of accessing a row in a table ?
Using ROWID.CONSTRAINTS
What is difference between TRUNCATE & DELETE ?
TRUNCATE commits after deleting entire table i.e., can not be rolled back. Database triggers
do not fire on TRUNCATEDELETE
allows the filtered deletion. Deleted records can be rolled back or committed. Database
triggers fire on DELETE.
What is a transaction ?
Transaction is logical unit between two commits and commit and rollback.
What are the advantages of VIEW ?
To protect some of the columns of a table from other users.To hide complexity of a query.To
hide complexity of calculations.
How will you a activate/deactivate integrity constraints ?
The integrity constraints can be enabled or disabled by ALTER TABLE ENABLE
constraint/DISABLE constraint.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 74 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 75 of 140
If an unique key constraint on DATE column is created, will it validate the rows that are
inserted with SYSDATE ?
It wont, Because SYSDATE format contains time attached with it.
How does one stop and start the OMS? (for DBA)
Use the following command sequence to stop and start the OMS (Oracle Management
Server):
oemctl start oms
oemctl status oms sysman/oem_temp
oemctl stop oms sysman/oem_temp
Windows NT/2000 users can just stop and start the required services. The default OEM
administrator is sysman with a
password of oem_temp.
NOTE: Use command oemctrl instead of oemctl for Oracle 8i and below.
What is an Integrity Constraint ?
Integrity constraint is a rule that restricts values to a column in a table.
How does one create a repository? (for DBA)
For OEM v2 and above, start the Oracle Enterprise Manager Configuration Assistant (emca
on Unix) to create and configure the
management server and repository. Remember to setup a backup for the repository
database after creating it.
If a View on a single base table is manipulated will the changes be reflected on the base
table ?
If changes are made to the tables which are base tables of a view will the changes be
reference on the view.
The following describes means to create a OEM V1.x (very old!!!) repository on WindowsNT:
. Create a tablespace that would hold the repository data. A size between 200- 250 MB would
be ideal. Let us call it
Dummy_Space.
. Create an Oracle user who would own this repository. Assign DBA, SNMPAgent,
Exp_Full_database, Imp_Full_database roles to
this user. Lets call this user Dummy_user. Assign Dummy_Space as the default tablespace.
. Create an operating system user with the same name as the Oracle username. I.e.
Dummy_User. Add Log on as a batch job
under advanced rights in User manager.
. Fire up Enterprise manager and log in as Dummy_User and enter the password. This would
trigger the creation of the
repository. From now on, Enterprise manager is ready to accept jobs.
What is a database link ?
Database Link is a named path through which a remote database can be accessed.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 76 of 140
How does one list ones databases in the OEM Console? (for DBA)
Follow these steps to discover databases and other services from the OEM Console:
1. Ensure the GLOBAL_DBNAME parameter is set for all databases in your LISTENER.ORA file
(optional). These names will be
listed in the OEM Console. Please note that names entered are case sensitive. A portion of a
listener.ora file:
(SID_DESC =
(GLOBAL_DBNAME = DB_name_for_OEM)
(SID_NAME =
2. Start the Oracle Intelligent Agent on the machine you want to discover. See section How
does one start the Oracle
Intelligent Agent?.
3. Start the OEM Console, navigate to menu Navigator/ Discover Nodes. The OEM Discovery
Wizard will guide you through the
process of discovering your databases and other services.
What is CYCLE/NO CYCLE in a Sequence ?
CYCLE specifies that the sequence continues to generate values after reaching either
maximum or minimum value. After pan
ascending sequence reaches its maximum value, it generates its minimum value. After a
descending sequence reaches its
minimum, it generates its maximum.NO CYCLE specifies that the sequence cannot generate
more values after reaching its maximum
or minimum value.
What is correlated sub-query ?
Correlated sub query is a sub query which has reference to the main query.
What are the data types allowed in a table ?
CHAR,VARCHAR2,NUMBER,DATE,RAW,LONG and LONG RAW.
What is difference between CHAR and VARCHAR2 ? What is the maximum SIZE allowed for
each type ?
CHAR pads blank spaces to the maximum length. VARCHAR2 does not pad blank spaces. For
CHAR it is 255 and 2000 for VARCHAR2.
Can a view be updated/inserted/deleted? If Yes under what conditions ?
A View can be updated/deleted/inserted if it has only one base table if the view is based on
columns from one or more tables
then insert, update and delete is not possible.
What are the different types of Coordinations of the Master with the Detail block?
POPULATE_GROUP(function)
POPULATE_GROUP_WITH_QUERY(function)
SET_GROUP_CHAR_CELL(procedure)
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 77 of 140
SET_GROUPCELL(procedure)
SET_GROUP_NUMBER_CELL(procedure)
Use the ADD_GROUP_COLUMN function to add a column to a record group that was created
at design time?
I) TRUE II) FALSE
II) FALSE
Use the ADD_GROUP_ROW procedure to add a row to a static record group?
I) TRUE II) FALSE
I) FALSE
maxvalue.sql Select the Nth Highest value from a table?
select level, max(col_name) from my_table where level = &n connect by prior (col_name) >
col_name)
group by level;
Example:
Given a table called emp with the following columns:
id number
name varchar2(20)
sal number
3700
Suppose a customer table is having different columns like customer no, payments.What will
be the query to select top three
max payments?
SELECT customer_no, payments from customer C1
WHERE 3<=(SELECT COUNT(*) from customer C2
WHERE C1.payment <= C2.payment)
How you will avoid your query from using indexes?
SELECT * FROM emp
Where emp_no+ =12345;
i.e you have to concatenate the column name with space within codes in the where
condition.
SELECT /*+ FULL(a) */ ename, emp_no from emp
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 78 of 140
where emp_no=1234;
i.e using HINTS
What utility is used to create a physical backup?
Either rman or alter tablespace begin backup will do..
What are the Back ground processes in Oracle and what are they.
This is one of the most frequently asked question.There are basically 9 Processes but in a
general system we need to mention
the first five background processes.They do the house keeping activities for the Oracle and
are common in any system.
The various background processes in oracle are
a) Data Base Writer(DBWR) :: Data Base Writer Writes Modified blocks from Database buffer
cache to Data Files.This is
required since the data is not written whenever a transaction is committed.
b)LogWriter(LGWR) :: LogWriter writes the redo log entries to disk. Redo Log data is
generated in redo log buffer of SGA. As
transaction commits and log buffer fills, LGWR writes log entries into a online redo log file.
c) System Monitor(SMON) :: The System Monitor performs instance recovery at instance
startup. This is useful for recovery
from system failure
d)Process Monitor(PMON) :: The Process Monitor performs process recovery when user
Process fails. Pmon Clears and Frees
resources that process was using.
e) CheckPoint(CKPT) :: At Specified times, all modified database buffers in SGA are written to
data files by DBWR at
Checkpoints and Updating all data files and control files of database to indicate the most
recent checkpoint
f)Archieves(ARCH) :: The Archiver copies online redo log files to archival storal when they are
busy.
g) Recoveror(RECO) :: The Recoveror is used to resolve the distributed transaction in network
h) Dispatcher (Dnnn) :: The Dispatcher is useful in Multi Threaded Architecture
i) Lckn :: We can have upto 10 lock processes for inter instance locking in parallel sql.
How many types of Sql Statements are there in Oracle
There are basically 6 types of sql statments.They are
a) Data Definition Language(DDL) :: The DDL statements define and maintain objects and
drop objects.
b) Data Manipulation Language(DML) :: The DML statements manipulate database data.
c) Transaction Control Statements :: Manage change by DML
d) Session Control :: Used to control the properties of current session enabling and disabling
roles and changing .e.g. ::
Alter Statements, Set Role
e) System Control Statements :: Change Properties of Oracle Instance .e.g.:: Alter System
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 79 of 140
f) Embedded Sql :: Incorporate DDL, DML and T.C.S in Programming Language.e.g:: Using the
Sql Statements in languages such as
C, Open, Fetch, execute and close
What is a Transaction in Oracle
A transaction is a Logical unit of work that compromises one or more SQL Statements
executed by a single User. According to
ANSI, a transaction begins with first executable statement and ends when it is explicitly
committed or rolled back.
Key Words Used in Oracle
The Key words that are used in Oracle are ::
a) Committing :: A transaction is said to be committed when the transaction makes
permanent changes resulting from the SQL
statements.
b) Rollback :: A transaction that retracts any of the changes resulting from SQL statements in
Transaction.
c) SavePoint :: For long transactions that contain many SQL statements, intermediate
markers or savepoints are declared.
Savepoints can be used to divide a transaction into smaller points.
d) Rolling Forward :: Process of applying redo log during recovery is called rolling forward.
e) Cursor :: A cursor is a handle ( name or a pointer) for the memory associated with a
specific stamen. A cursor is
basically an area allocated by Oracle for executing the Sql Statement. Oracle uses an implicit
cursor statement for Single
row query and Uses Explicit cursor for a multi row query.
f) System Global Area(SGA) :: The SGA is a shared memory region allocated by the Oracle
that contains Data and control
information for one Oracle Instance. It consists of Database Buffer Cache and Redo log
Buffer.
g) Program Global Area (PGA) :: The PGA is a memory buffer that contains data and control
information for server process.
g) Database Buffer Cache :: Database Buffer of SGA stores the most recently used blocks of
database data. The set of database
buffers in an instance is called Database Buffer Cache.
h) Redo log Buffer :: Redo log Buffer of SGA stores all the redo log entries.
i) Redo Log Files :: Redo log files are set of files that protect altered database data in memory
that has not been written
to Data Files. They are basically used for backup when a database crashes.
j) Process :: A Process is a thread of control or mechanism in Operating System that
executes series of steps.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 80 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 81 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 82 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 83 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 84 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 85 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 86 of 140
used to denote the percentage of the used space that is to be used when creating a table
eg.:: Pctfree 20, Pctused 40
What is Row Chaining
The data of a row in a table may not be able to fit the same data block.Data for row is stored
in a chain of data blocks .
What is a 2 Phase Commit
Two Phase commit is used in distributed data base systems. This is useful to maintain the
integrity of the database so that
all the users see the same values. It contains DML statements or Remote Procedural calls
that reference a remote object.
There are basically 2 phases in a 2 phase commit.
a) Prepare Phase :: Global coordinator asks participants to prepare
b) Commit Phase :: Commit all participants to coordinator to Prepared, Read only or abort
Reply
What is the difference between deleting and truncating of tables
Deleting a table will not remove the rows from the table but entry is there in the database
dictionary and it can be
retrieved But truncating a table deletes it completely and it cannot be retrieved.
What are mutating tables
When a table is in state of transition it is said to be mutating. eg :: If a row has been deleted
then the table is said to
be mutating and no operations can be done on the table except select.
What are Codd Rules
Codd Rules describe the ideal nature of a RDBMS. No RDBMS satisfies all the 12 codd rules
and Oracle Satisfies 11 of the 12
rules and is the only Rdbms to satisfy the maximum number of rules.
What is Normalisation
Normalisation is the process of organising the tables to remove the redundancy.There are
mainly 5 Normalisation rules.
a) 1 Normal Form :: A table is said to be in 1st Normal Form when the attributes are atomic
b) 2 Normal Form :: A table is said to be in 2nd Normal Form when all the candidate keys are
dependant on the primary key
c) 3rd Normal Form :: A table is said to be third Normal form when it is not dependant
transitively
What is the Difference between a post query and a pre query
A post query will fire for every row that is fetched but the pre query will fire only once.
Deleting the Duplicate rows in the table
We can delete the duplicate rows in the table by using the Rowid
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 87 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 88 of 140
SYSTEM.DATE_THRESHOLD
SYSTEM.EFFECTIVE_DATE
SYSTEM.SUPPRESS_WORKING
What are object group?
An object group is a container for a group of objects. You define an object group when you
want to package related objects so
you can copy or reference them in another module.
What are referenced objects?
Referencing allows you to create objects that inherit their functionality and appearance from
other objects. Referencing an
object is similar to copying an object, except that the resulting reference object maintains a
link to its source object. A
reference object automatically inherits any changes that have been made to the source
object when you open or regenerate the
module that contains the reference object.
Can you store objects in library?
Referencing allows you to create objects that inherit their functionality and appearance from
other objects. Referencing an
object is similar to copying an object, except that the resulting reference object maintains a
link to its source object. A
reference object automatically inherits any changes that have been made to the source
object when you open or regenerate the
module that contains the reference object.
Is forms 4.5 object oriented tool ? why?
yes , partially. 1) PROPERTY CLASS inheritance property 2) OVERLOADING : procedures and
functions.
Can you issue DDL in forms?
yes, but you have to use FORMS_DDL.
Referencing allows you to create objects that inherit their functionality and appearance from
other objects. Referencing an
object is similar to copying an object, except that the resulting reference object maintains a
link to its source object. A
reference object automatically inherits any changes that have been made to the source
object when you open or regenerate the
module that contains the reference object. Any string expression up to 32K:
- a literal
- an expression or a variable representing the text of a block of dynamically created PL/SQL
code
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 89 of 140
- a DML statement or
- a DDL statement
Restrictions:
The statement you pass to FORMS_DDL may not contain bind variable references in the
string, but the values of bind variables
can be concatenated into the string before passing the result to FORMS_DDL.
What is SECURE property?
- Hides characters that the operator types into the text item. This setting is typically used for
password protection.
What are the types of triggers and how the sequence of firing in text item
Triggers can be classified as Key Triggers, Mouse Triggers ,Navigational Triggers.
Key Triggers :: Key Triggers are fired as a result of Key action.e.g :: Key-next-field, Key-up,KeyDown
Mouse Triggers :: Mouse Triggers are fired as a result of the mouse navigation.e.g.
When-mouse-button-presed,when-mouse-doubleclicked,etc
Navigational Triggers :: These Triggers are fired as a result of Navigation. E.g. : Post-Textitem,Pre-text-item.
We also have event triggers like when ?new-form-instance and when-new-block-instance.
We cannot call restricted procedures like go_to(?my_block.first_item?) in the Navigational
triggers
But can use them in the Key-next-item.
The Difference between Key-next and Post-Text is an very important question. The key-next
is fired as a result of the key
action while the post text is fired as a result of the mouse movement. Key next will not fire
unless there is a key event.
The sequence of firing in a text item are as follows ::
a) pre text
b) when new item
c) key-next
d) when validate
e) post text
Can you store pictures in database? How?
Yes , in long Raw datatype.
What are property classes ? Can property classes have trigger?
Property class inheritance is a powerful feature that allows you to quickly define objects that
conform to your own interface
and functionality standards. Property classes also allow you to make global changes to
applications quickly. By simply
changing the definition of a property class, you can change the definition of all objects that
inherit properties from that
class.
Yes . All type of triggers .
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 90 of 140
If you have property class attached to an item and you have same trigger written for the
item . Which will fire first?
Item level trigger fires , If item level trigger fires, property level trigger wont fire. Triggers at
the lowest level are
always given the first preference. The item level trigger fires first and then the block and
then the Form level trigger.
What are record groups ? * Can record groups created at run-time?
A record group is an internal Oracle Forms data structure that has a column/row framework
similar to a database table.
However, unlike database tables, record groups are separate objects that belong to the form
module in which they are defined.
A record group can have an unlimited number of columns of type CHAR, LONG, NUMBER, or
DATE provided that the total number of
columns does not exceed 64K. Record group column names cannot exceed 30 characters.
Programmatically, record groups can be used whenever the functionality offered by a twodimensional array of multiple data
types is desirable.
TYPES OF RECORD GROUP:
Query Record Group A query record group is a record group that has an associated SELECT
statement. The columns in a query
record group derive their default names, data types, and lengths from the database columns
referenced in the SELECT
statement. The records in a query record group are the rows retrieved by the query
associated with that record group.
Non-query Record Group A non-query record group is a group that does not have an
associated query, but whose structure and
values can be modified programmatically at runtime.
Static Record Group A static record group is not associated with a query; rather, you define
its structure and row values at
design time, and they remain fixed at runtime.
What are ALERT?
An ALERT is a modal window that displays a message notifying operator of some application
condition.
Can a button have icon and label at the same time ?
-NO
What is mouse navigate property of button?
When Mouse Navigate is True (the default), Oracle Forms performs standard navigation to
move the focus to the item when the
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 91 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 92 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 93 of 140
container application. OLE automation provides a way for an OLE container application to
use the features of an OLE server
application to manipulate an OLE object from the OLE container environment. (FORMS_OLE)
What does invoke built-in do?
This procedure invokes a method.
Syntax:
PROCEDURE OLE2.INVOKE
(object obj_type,
method VARCHAR2,
list list_type := 0);
Parameters:
object Is an OLE2 Automation Object.
method Is a method (procedure) of the OLE2 object.
list Is the name of an argument list assigned to the OLE2.CREATE_ARGLIST function.
What are OPEN_FORM,CALL_FORM,NEW_FORM? diff?
CALL_FORM : It calls the other form. but parent remains active, when called form completes
the operation , it releases lock
and control goes back to the calling form.
When you call a form, Oracle Forms issues a savepoint for the called form. If the
CLEAR_FORM function causes a rollback when
the called form is current, Oracle Forms rolls back uncommitted changes to this savepoint.
OPEN_FORM : When you call a form, Oracle Forms issues a savepoint for the called form. If
the CLEAR_FORM function causes a
rollback when the called form is current, Oracle Forms rolls back uncommitted changes to
this savepoint.
NEW_FORM : Exits the current form and enters the indicated form. The calling form is
terminated as the parent form. If the
calling form had been called by a higher form, Oracle Forms keeps the higher call active and
treats it as a call to the new
form. Oracle Forms releases memory (such as database cursors) that the terminated form
was using.
Oracle Forms runs the new form with the same Runform options as the parent form. If the
parent form was a called form, Oracle
Forms runs the new form with the same options as the parent form.
What is call form stack?
When successive forms are loaded via the CALL_FORM procedure, the resulting module
hierarchy is known as the call form stack.
Can u port applictions across the platforms? how?
Yes we can port applications across platforms.Consider the form developed in a windows
system.The form would be generated in
unix system by using f45gen my_form.fmb scott/tiger
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 94 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 95 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 96 of 140
Complete database recovery from disk failure is possible only in ARCHIVELOG mode. Online
database backup is possible only in
ARCHIVELOG mode.
What are the steps involved in Database Shutdown ?
Close the Database, Dismount the Database and Shutdown the Instance.
What is Archived Redo Log ?
Archived Redo Log consists of Redo Log files that have archived before being reused.
What is Restricted Mode of Instance Startup ?
An instance can be started in (or later altered to be in) restricted mode so that when the
database is open connections are
limited only to those whose user accounts have been granted the RESTRICTED SESSION
system privilege.
Can u have OLE objects in forms?
Yes.
Can u have VBX and OCX controls in forms ?
Yes.
What r the types of windows (Window style)?
Specifies whether the window is a Document window or a Dialog window.
What is OLE Activation style property?
Specifies the event that will activate the OLE containing item.
Can u change the mouse pointer ? How?
Yes. Specifies the mouse cursor style. Use this property to dynamically change the shape of
the cursor.
How many types of columns are there and what are they
Formula columns :: For doing mathematical calculations and returning one value Summary
Columns :: For doing summary
calculations such as summations etc. Place holder Columns :: These columns are useful for
storing the value in a variable
Can u have more than one layout in report
It is possible to have more than one layout in a report by using the additional layout option
in the layout editor.
Can u run the report with out a parameter form
Yes it is possible to run the report without parameter form by setting the PARAM value to
Null
What is the lock option in reports layout
By using the lock option we cannot move the fields in the layout editor outside the frame.
This is useful for maintaining the
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 97 of 140
fields .
What is Flex
Flex is the property of moving the related fields together by setting the flex property on
What are the minimum number of groups required for a matrix report
The minimum of groups required for a matrix report are 4 e
What is a Synonym ?
A synonym is an alias for a table, view, sequence or program unit.
What is a Sequence ?
A sequence generates a serial list of unique numbers for numerical columns of a databases
tables.
What is a Segment ?
A segment is a set of extents allocated for a certain logical structure.
What is schema?
A schema is collection of database objects of a User.
Describe Referential Integrity ?
A rule defined on a column (or set of columns) in one table that allows the insert or update
of a row only if the value for
the column or set of columns (the dependent value) matches a value in a column of a
related table (the referenced value). It
also specifies the type of data manipulation allowed on referenced data and the action to be
performed on dependent data as a
result of any action on referenced data.
What is Hash Cluster ?
A row is stored in a hash cluster based on the result of applying a hash function to the rows
cluster key value. All rows
with the same hash key value are stores together on disk.
What is a Private Synonyms ?
A Private Synonyms can be accessed only by the owner.
What is Database Link ?
A database link is a named object that describes a path from one database to another.
What is index cluster?
A cluster with an index on the cluster key.
What is hash cluster?
A row is stored in a hash cluster based on the result of applying a hash function to the rows
cluster key value. All rows
with the same hash key value are stores together on disk.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 98 of 140
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Page 99 of 140
data for the row is stored in a chain of data block (one or more) reserved for that segment.
What is an extent?
An extent is a specific number of contiguous data blocks, obtained in a single allocation and
used to store a specific type
of information.
What are the different types of segments?
Data segment, index segment, rollback segment and temporary segment.
What is a data segment?
Each non-clustered table has a data segment. All of the tables data is stored in the extents
of its data segment. Each
cluster has a data segment. The data of every table in the cluster is stored in the clusters
data segment.
What is an index segment?
Each index has an index segment that stores all of its data.
What is rollback segment?
A database contains one or more rollback segments to temporarily store undo
information.
What are the uses of rollback segment?
To generate read-consistent database information during database recovery and to rollback
uncommitted transactions by the
users.
What is a temporary segment?
Temporary segments are created by Oracle when a SQL statement needs a temporary work
area to complete execution. When the
statement finishes execution, the temporary segment extents are released to the system for
future use.
What is a datafile?
Every Oracle database has one or more physical data files. A databases data files contain all
the database data. The data of
logical database structures such as tables and indexes is physically stored in the data files
allocated for a database.
What are the characteristics of data files?
A data file can be associated with only one database. Once created a data file cant change
size. One or more data files form
a logical unit of database storage called a tablespace.
What is a redo log?
The set of redo log files for a database is collectively known as the database redo log.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Explain the difference between a hot backup and a cold backup and the benefits associated
with each.
A hot backup is basically taking a backup of the database while it is still up and running and
it must be in archive log
mode. A cold backup is taking a backup of the database while it is shut down and does not
require being in archive log mode.
The benefit of taking a hot backup is that the database is still available for use while the
backup is occurring and you can
recover the database to any point in time. The benefit of taking a cold backup is that it is
typically easier to administer
the backup and recovery process. In addition, since you are taking cold backups the
database does not require being in
archive log mode and thus there will be a slight performance gain as the database is not
cutting archive logs to disk.
You have just had to restore from backup and do not have any control files. How would you
go about bringing up this database?
I would create a text based backup control file, stipulating where on disk all the data files
where and then issue the
recover command with the using backup control file clause.
How do you switch from an init.ora file to a spfile?
Issue the create spfile from pfile command.
Explain the difference between a data block, an extent and a segment.
A data block is the smallest unit of logical storage for a database object. As objects grow they
take chunks of additional
storage that are composed of contiguous data blocks. These groupings of contiguous data
blocks are called extents. All the
extents that an object takes when grouped together are considered the segment of the
database object.
Give two examples of how you might determine the structure of the table DEPT.
Use the describe command or use the dbms_metadata.get_ddl package.
Where would you look for errors from the database engine?
In the alert log.
Compare and contrast TRUNCATE and DELETE for a table.
Both the truncate and delete command have the 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
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
rollback. The delete command, on the other hand, is a DML operation, which will produce a
rollback and thus take longer to
complete.
Give the reasoning behind using an index.
Faster access to data blocks in a table.
Give the two types of tables involved in producing a star schema and the type of data they
hold.
Fact tables and dimension tables. A fact table contains measurements while dimension
tables will contain data that will help
describe the fact tables.
What type of index should you use on a fact table?
A Bitmap index.
Give two examples of referential integrity constraints.
A primary key and a foreign key.
A table is classified as a parent table and you want to drop and re-create it. How would you
do this without affecting the
children tables?
Disable the foreign key constraint to the parent, drop the table, re-create the table, enable
the foreign key constraint.
Explain the difference between ARCHIVELOG mode and NOARCHIVELOG mode and the
benefits and disadvantages to each.
ARCHIVELOG mode is a mode that you can put the database in for creating a backup of all
transactions that have occurred in
the database so that you can recover to any point in time. NOARCHIVELOG mode is basically
the absence of ARCHIVELOG mode and
has the disadvantage of not being able to recover to any point in time. NOARCHIVELOG
mode does have the advantage of not
having to write transactions to an archive log and thus increases the performance of the
database slightly.
What command would you use to create a backup control file?
Alter database backup control file to trace.
Give the stages of instance startup to a usable state where normal users may access it.
STARTUP NOMOUNT Instance startup
STARTUP MOUNT The database is mounted
STARTUP OPEN The database is opened
What column differentiates the V$ views to the GV$ views and how?
The INST_ID column which indicates the instance in a RAC environment the information
came from.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
What is the use of break group? What are the various sub events a mouse double click event
involves?
A break group is used to display one record for one group ones. While multiple related
records in other group can be
displayed.
What tuning indicators can one use? (for DBA)
The following high-level tuning indicators can be used to establish if a database is
performing optimally or not:
. Buffer Cache Hit Ratio
Formula: Hit Ratio = (Logical Reads Physical Reads) / Logical Reads
Action: Increase DB_CACHE_SIZE (DB_BLOCK_BUFFERS prior to 9i) to increase hit ratio
. Library Cache Hit Ratio
Action: Increase the SHARED_POOL_SIZE to increase hit ratio
What tools/utilities does Oracle provide to assist with performance tuning? (for DBA)
Oracle provide the following tools/ utilities to assist with performance monitoring and
tuning:
. TKProf
. UTLBSTAT.SQL and UTLESTAT.SQL Begin and end stats monitoring
. Statspack
. Oracle Enterprise Manager Tuning Pack
What is STATSPACK and how does one use it? (for DBA)
Statspack is a set of performance monitoring and reporting utilities provided by Oracle from
Oracle8i and above. Statspack
provides improved BSTAT/ESTAT functionality, though the old BSTAT/ESTAT scripts are still
available. For more information
about STATSPACK, read the documentation in file $ORACLE_HOME/rdbms/admin/spdoc.txt.
Install Statspack:
cd $ORACLE_HOME/rdbms/admin
sqlplus / as sysdba @spdrop.sql Install Statspack sqlplus / as sysdba @spcreate.sql Enter tablespace names when prompted
Use Statspack:
sqlplus perfstat/perfstat
exec statspack.snap; Take a performance snapshots
exec statspack.snap;
o Get a list of snapshots
select SNAP_ID, SNAP_TIME from STATS$SNAPSHOT;
@spreport.sql Enter two snapshot ids for difference report
Other Statspack Scripts:
. sppurge.sql Purge a range of Snapshot Ids between the specified begin and end Snap Ids
. spauto.sql Schedule a dbms_job to automate the collection of STATPACK statistics
. spcreate.sql Installs the STATSPACK user, tables and package on a database (Run as SYS).
. spdrop.sql Deinstall STATSPACK from database (Run as SYS)
. sppurge.sql Delete a range of Snapshot Ids from the database
. spreport.sql Report on differences between values recorded in two snapshots
. sptrunc.sql Truncates all data in Statspack tables
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
What are the common RMAN errors (with solutions)? (for DBA)
Some of the common RMAN errors are:
RMAN-20242: Specification does not match any archivelog in the recovery catalog.
Add to RMAN script: sql alter system archive log current;
RMAN-06089: archived log xyz not found or out of sync with catalog
Execute from RMAN: change archivelog all validate;
How can you execute the user defined triggers in forms 3.0 ?
Execute Trigger (trigger-name)
What ERASE package procedure does ?
Erase removes an indicated global variable.
What is the difference between NAME_IN and COPY ?
Copy is package procedure and writes values into a field.
Name in is a package function and returns the contents of the variable to which you apply.
What package procedure is used for calling another form ?
Call (E.g. Call(formname)
When the form is running in DEBUG mode, If you want to examine the values of global
variables and other form variables, What
package procedure command you would use in your trigger text ?
Break.
SYSTEM VARIABLES
The value recorded in system.last_record variable is of type
a. Number
b. Boolean
c. Character. ?
b. Boolean.
What is mean by Program Global Area (PGA) ?
It is area in memory that is used by a Single Oracle User Process.
What is hit ratio ?
It is a measure of well the data cache buffer is handling requests for data. Hit Ratio = (Logical
Reads Physical Reads Hits Misses)/ Logical Reads.
How do u implement the If statement in the Select Statement
We can implement the if statement in the select statement by using the Decode statement.
e.g. select DECODE
(EMP_CAT,1,First,2,SecondNull); Here the Null is the else statement where null is done .
How many types of Exceptions are there
There are 2 types of exceptions. They are
a) System Exceptions
e.g. When no_data_found, When too_many_rows
b) User Defined Exceptions
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
discontinuous buffers in the SGA. This statistic is NORMALLY indicating disk contention on
full table scans. Rarely, data
from full table scans could be fitted into a contiguous buffer area, these waits would then
show up as sequential reads
instead of scattered reads.
The following query shows average wait time for sequential versus scattered reads:
prompt AVERAGE WAIT TIME FOR READ REQUESTS
select a.average_wait SEQ READ, b.average_wait SCAT READ
from sys.v_$system_event a, sys.v_$system_event b
where a.event = db file sequential read
and b.event = db file scattered read;
What is the use of PARFILE option in EXP command ?
Name of the parameter file to be passed for export.
What is the use of TABLES option in EXP command ?
List of tables should be exported.ze)
What is the OPTIMAL parameter?
It is used to set the optimal length of a rollback segment.
How does one use ORADEBUG from Server Manager/ SQL*Plus? (for DBA)
Execute the ORADEBUG HELP command from svrmgrl or sqlplus to obtain a list of valid
ORADEBUG commands. Look at these
examples:
SQLPLUS> REM Trace SQL statements with bind variables
SQLPLUS> oradebug setospid 10121
Oracle pid: 91, Unix process pid: 10121, image: oracleorcl
SQLPLUS> oradebug EVENT 10046 trace name context forever, level 12
Statement processed.
SQLPLUS> ! vi /app/oracle/admin/orcl/bdump/ora_10121.trc
SQLPLUS> REM Trace Process Statistics
SQLPLUS> oradebug setorapid 2
Unix process pid: 1436, image: ora_pmon_orcl
SQLPLUS> oradebug procstat
Statement processed.
SQLPLUS>> oradebug TRACEFILE_NAME
/app/oracle/admin/orcl/bdump/pmon_1436.trc
SQLPLUS> REM List semaphores and shared memory segments in use
SQLPLUS> oradebug ipc
SQLPLUS> REM Dump Error Stack
SQLPLUS> oradebug setospid
SQLPLUS> oradebug event immediate trace name errorstack level 3
SQLPLUS> REM Dump Parallel Server DLM locks
SQLPLUS> oradebug lkdebug -a convlock
SQLPLUS> oradebug lkdebug -a convres
SQLPLUS> oradebug lkdebug -r (i.e 0x8066d338 from convres dump)
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
this
functionality
was
available
with
ORADBX
(ls
-l
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
If you changed the location of backup set it is compulsory for you to register it using RMAN
or while you are trying to
restore backup It resulted in hanging situations
There is no method to know whether during recovery database restore is going to fail
because of missing archive log file.
Compulsory Media Management only if using tape backup
Incremental backups though used to consume less space used to be slower since it used to
read the entire database to find the
changed blocks and also They have difficult time streaming the tape device. .
Considerable improvement has been made in 10g to optimize the algorithm to handle
changed block.
Observation
Introduced in Oracle 8 it has become more powerful and simpler with newer version of
Oracle 9 and 10 g.
So if you really dont want to miss something critical please start using RMAN.
Explain UNION,MINUS,UNION ALL, INTERSECT ?
INTERSECT returns all distinct rows selected by both queries.MINUS returns all distinct
rows selected by the first query
but not by the second.UNION returns all distinct rows selected by either queryUNION ALL
returns all rows selected by
either query, including all duplicates.
Should the OEM Console be displayed at all times (when there are scheduled jobs)? (for DBA)
When a job is submitted the agent will confirm the status of the job. When the status shows
up as scheduled, you can close
down the OEM console. The processing of the job is managed by the OIA (Oracle Intelligent
Agent). The OIA maintains a .jou
file in the agents subdirectory. When the console is launched communication with the Agent
is established and the contents
of the .jou file (binary) are reported to the console job subsystem. Note that OEM will not be
able to send e-mail and paging
notifications when the Console is not started.
Difference between SUBSTR and INSTR ?
INSTR (String1,String2(n,(m)),INSTR returns the position of the mth occurrence of the string
2 instring1. The search begins
from nth position of string1.SUBSTR (String1 n,m)SUBSTR returns a character string of size m
in string1, starting from nth
position of string1.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
What kind of jobs can one schedule with OEM? (for DBA)
OEM comes with pre-defined jobs like Export, Import, run OS commands, run sql scripts,
SQL*Plus commands etc. It also gives
you the flexibility of scheduling custom jobs written with the TCL language.
What are the pre requisites ?
I. to modify data type of a column ? ii. to add a column with NOT NULL constraint ? To
Modify the datatype of a column the
column must be empty. to add a column with NOT NULL constrain, the table must be empty.
How does one backout events and jobs during maintenance slots? (for DBA)
Managemnet and data collection activity can be suspended by imposing a blackout. Look at
these examples:
agentctl start blackout # Blackout the entrire agent
agentctl stop blackout # Resume normal monitoring and management
agentctl start blackout ORCL # Blackout database ORCL
agentctl stop blackout ORCL # Resume normal monitoring and management
agentctl start blackout -s jobs -d 00:20 # Blackout jobs for 20 minutes
What are the types of SQL Statement ?
Data Definition Language :
CREATE,ALTER,DROP,TRUNCATE,REVOKE,NO AUDIT & COMMIT.
Data Manipulation Language:
INSERT,UPDATE,DELETE,LOCK
TABLE,EXPLAIN PLAN & SELECT.Transactional Control:
COMMIT & ROLLBACKSession Control: ALTERSESSION & SET
ROLESystem Control :
ALTER SYSTEM.
What is the Oracle Intelligent Agent? (for DBA)
The Oracle Intelligent Agent (OIA) is an autonomous process that needs to run on a remote
node in the network to make the
node OEM manageable. The Oracle Intelligent Agent is responsible for:
. Discovering targets that can be managed (Database Servers, Net8 Listeners, etc.);
. Monitoring of events registered in Enterprise Manager; and
. Executing tasks associated with jobs submitted to Enterprise Manager.
How does one start the Oracle Intelligent Agent? (for DBA)
One needs to start an OIA (Oracle Intelligent Agent) process on all machines that will to be
managed via OEM.
For OEM 9i and above:
agentctl start agent
agentctl stop agent
For OEM 2.1 and below:
lsnrctl dbsnmp_start
lsnrctl dbsnmp_status
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
GRANTS=y
COMPRESS=y
NOTE: If you do not like command line utilities, you can import and export data with the
Schema Manager GUI that ships with
Oracle Enterprise Manager (OEM).
What are the types of visual attribute settings?
Custom Visual attributes Default visual attributes Named Visual attributes. Window
Can one export a subset of a table? (for DBA)
From Oracle8i one can use the QUERY= export parameter to selectively unload a subset of
the data from a table. Look at this
example:
exp scott/tiger tables=emp query=\where deptno=10\
What are the two ways to incorporate images into a oracle forms application?
Boilerplate Images
Image_items
Can one monitor how fast a table is imported? (for DBA)
If you need to monitor how fast rows are imported from a running import job, try one of the
following methods:
Method 1:
select substr(sql_text,instr(sql_text,INTO ),30) table_name,
rows_processed,
round((sysdate-to_date(first_load_time,yyyy-mm-dd hh24:mi:ss))*24*60,1) minutes,
trunc(rows_processed/((sysdate-to_date(first_load_time,yyyy-mm-dd
hh24:mi:ss))*24*60))
rows_per_min
from sys.v_$sqlarea
where sql_text like INSERT %INTO %
and command_type = 2
and open_versions > 0;
For this to work one needs to be on Oracle 7.3 or higher (7.2 might also be OK). If the import
has more than one table, this
statement will only show information about the current table being imported.
Contributed by Osvaldo Ancarola, Bs. As. Argentina.
Method 2:
Use the FEEDBACK=n import parameter. This command will tell IMP to display a dot for
every N rows imported.
Can one import tables to a different tablespace? (for DBA)
Oracle offers no parameter to specify a different tablespace to import data into. Objects will
be re-created in the
tablespace they were originally exported from. One can alter this behaviour by following one
of these procedures: Pre-create
the table(s) in the correct tablespace:
. Import the dump file using the INDEXFILE= option
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
. Edit the indexfile. Remove remarks and specify the correct tablespaces.
. Run this indexfile against your database, this will create the required tables in the
appropriate tablespaces
. Import the table(s) with the IGNORE=Y option.
Change the default tablespace for the user:
. Revoke the UNLIMITED TABLESPACE privilege from the user
. Revoke the users quota from the tablespace from where the object was exported. This
forces the import utility to create
tables in the users default tablespace.
. Make the tablespace to which you want to import the default tablespace for the user
. Import the table
What do you mean by a block in forms4.0?
Block is a single mechanism for grouping related items into a functional unit for storing,
displaying and manipulating
records.
How is possible to restrict the user to a list of values while entering values for parameters?
By setting the Restrict To List property to true in the parameter property sheet.
What is SQL*Loader and what is it used for? (for DBA)
SQL*Loader is a bulk loader utility used for moving data from external files into the Oracle
database. Its syntax is similar
to that of the DB2 Load utility, but comes with more options. SQL*Loader supports various
load formats, selective loading,
and multi-table loads.
How does one use the SQL*Loader utility? (for DBA)
One can load data into an Oracle database by using the sqlldr (sqlload on some platforms)
utility. Invoke the utility without
arguments to get a list of available parameters. Look at the following example:
sqlldr scott/tiger control=loader.ctl
This sample control file (loader.ctl) will load an external data file containing delimited data:
load data
infile c:\data\mydata.csv
into table emp
fields terminated by , optionally enclosed by
( empno, empname, sal, deptno )
The mydata.csv file may look like this:
10001,Scott Tiger, 1000, 40
10002,Frank Naude, 500, 20
Another Sample control file with in-line data formatted as fix length records. The trick is to
specify * as the name of the
data file, and use BEGINDATA to start the data section in the control file.
load data
infile *
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
replace
into table departments
( dept position (02:05) char(4),
deptname position (08:27) char(20)
)
begindata
COSC COMPUTER SCIENCE
ENGL ENGLISH LITERATURE
MATH MATHEMATICS
POLY POLITICAL SCIENCE
How can a cross product be created?
By selecting the cross products tool and drawing a new group surrounding the base group of
the cross products.
Is there a SQL*Unloader to download data to a flat file? (for DBA)
Oracle does not supply any data unload utilities. However, you can use SQL*Plus to select
and format your data and then spool
it to a file:
set echo off newpage 0 space 0 pagesize 0 feed off head off trimspool on
spool oradata.txt
select col1 || , || col2 || , || col3
from tab1
where col2 = XYZ;
spool off
Alternatively use the UTL_FILE PL/SQL package:
rem Remember to update initSID.ora, utl_file_dir=c:\oradata parameter
declare
fp utl_file.file_type;
begin
fp := utl_file.fopen(c:\oradata,tab1.txt,w);
utl_file.putf(fp, %s, %s\n, TextField, 55);
utl_file.fclose(fp);
end;
/
You might also want to investigate third party tools like SQLWays from Ispirer Systems,
TOAD from Quest, or ManageIT Fast
Unloader from CA to help you unload data from Oracle.
Can one load variable and fix length data records? (for DBA)
Yes, look at the following control file examples. In the first we will load delimited data
(variable length):
LOAD DATA
INFILE *
INTO TABLE load_delimited_data
FIELDS TERMINATED BY , OPTIONALLY ENCLOSED BY
TRAILING NULLCOLS
( data1,
data2
)
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
BEGINDATA
11111,AAAAAAAAAA
22222,A,B,C,D,
If you need to load positional data (fixed length), look at the following control file example:
LOAD DATA
INFILE *
INTO TABLE load_positional_data
( data1 POSITION(1:5),
data2 POSITION(6:15)
)
BEGINDATA
11111AAAAAAAAAA
22222BBBBBBBBBB
Can one skip header records load while loading?
Use the SKIP n keyword, where n = number of logical rows to skip. Look at this example:
LOAD DATA
INFILE *
INTO TABLE load_positional_data
SKIP 5
( data1 POSITION(1:5),
data2 POSITION(6:15)
)
BEGINDATA
11111AAAAAAAAAA
22222BBBBBBBBBB
Can one modify data as it loads into the database? (for DBA)
Data can be modified as it loads into the Oracle Database. Note that this only applies for the
conventional load path and not
for direct path loads.
LOAD DATA
INFILE *
INTO TABLE modified_data
( rec_no my_db_sequence.nextval,
region CONSTANT 31,
time_loaded to_char(SYSDATE, HH24:MI),
data1 POSITION(1:5) :data1/100,
data2 POSITION(6:15) upper(:data2),
data3 POSITION(16:22)to_date(:data3, YYMMDD)
)
BEGINDATA
11111AAAAAAAAAA991201
22222BBBBBBBBBB990112
LOAD DATA
INFILE mail_orders.txt
BADFILE bad_orders.txt
APPEND
INTO TABLE mailing_list
FIELDS TERMINATED BY ,
( addr,
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
city,
state,
zipcode,
mailing_addr decode(:mailing_addr, null, :addr, :mailing_addr),
mailing_city decode(:mailing_city, null, :city, :mailing_city),
mailing_state
)
Can one load data into multiple tables at once? (for DBA)
Look at the following control file:
LOAD DATA
INFILE *
REPLACE
INTO TABLE emp
WHEN empno !=
( empno POSITION(1:4) INTEGER EXTERNAL,
ename POSITION(6:15) CHAR,
deptno POSITION(17:18) CHAR,
mgr POSITION(20:23) INTEGER EXTERNAL
)
INTO TABLE proj
WHEN projno !=
( projno POSITION(25:27) INTEGER EXTERNAL,
empno POSITION(1:4) INTEGER EXTERNAL
)
What is the difference between boiler plat images and image items?
Boiler plate Images are static images (Either vector or bit map) that you import from the file
system or database to use a
graphical elements in your form, such as company logos and maps. Image items are special
types of interface controls that
store and display either vector or bitmap images. Like other items that store values, image
items can be either base table
items(items that relate directly to database columns) or control items. The definition of an
image item is stored as part of
the form module FMB and FMX files, but no image file is actually associated with an image
item until the item is populate at
run time.
What are the triggers available in the reports?
Before report, Before form, After form , Between page, After report.
Why is a Where clause faster than a group filter or a format trigger?
Because, in a where clause the condition is applied during data retrievalthan after retrieving
the data.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Can one selectively load only the records that one need? (for DBA)
Look at this example, (01) is the first character, (30:37) are characters 30 to 37:
LOAD DATA
INFILE mydata.dat BADFILE mydata.bad DISCARDFILE mydata.dis
APPEND
INTO TABLE my_selective_table
WHEN (01) <> H and (01) <> T and (30:37) = 19991217
(
region CONSTANT 31,
service_key POSITION(01:11) INTEGER EXTERNAL,
call_b_no POSITION(12:29) CHAR
)
Can one skip certain columns while loading data? (for DBA)
One cannot use POSTION(x:y) with delimited data. Luckily, from Oracle 8i one can specify
FILLER columns. FILLER columns are
used to skip columns/fields in the load file, ignoring fields that one does not want. Look at
this example: One cannot use
POSTION(x:y) as it is stream data, there are no positional fields-the next field begins after
some delimiter, not in column
X. >
LOAD DATA
TRUNCATE INTO TABLE T1
FIELDS TERMINATED BY ,
( field1,
field2 FILLER,
field3
)
How does one load multi-line records? (for DBA)
One can create one logical record from multiple physical records using one of the following
two clauses:
. CONCATENATE: use when SQL*Loader should combine the same number of physical
records together to form one logical record.
. CONTINUEIF use if a condition indicates that multiple records should be treated as one.
Eg. by having a # character in
column 1.
How can get SQL*Loader to COMMIT only at the end of the load file? (for DBA)
One cannot, but by setting the ROWS= parameter to a large value, committing can be
reduced. Make sure you have big rollback
segments ready when you use a high value for ROWS=.
Can one improve the performance of SQL*Loader? (for DBA)
A very simple but easily overlooked hint is not to have any indexes and/or constraints
(primary key) on your load tables
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
during the load process. This will significantly slow down load times even with ROWS= set to
a high value.
Add the following option in the command line: DIRECT=TRUE. This will effectively bypass
most of the RDBMS processing.
Turn off database logging by specifying the UNRECOVERABLE option. This option can only be
used with direct data loads. Run multiple load jobs concurrently.
How does one use SQL*Loader to load images, sound clips and documents? (for DBA)
SQL*Loader can load data from a primary data file, SDF (Secondary Data file for loading
nested tables and VARRAYs) or LOGFILE. The LOBFILE method provides and easy way to load
documents, images and audio clips into BLOB and CLOB columns.
What is the difference between the conventional and direct path loader? (for DBA)
The conventional path loader essentially loads the data by using standard INSERT
statements. The direct path loader (DIRECT=TRUE) bypasses much of the logic involved with
that, and loads directly into the Oracle data files. More information about the restrictions of
direct path loading can be obtained from the Utilities Users Guide.
What are the various types of Exceptions ?
User defined and Predefined Exceptions.
Can we define exceptions twice in same block ?
No.
What is the difference between a procedure and a function ?
Functions return a single variable by value whereas procedures do not return any variable
by value. Rather they return multiple variables by passing variables by reference through
their OUT parameter.
Can you have two functions with the same name in a PL/SQL block ?
Yes.
Can you have two stored functions with the same name ?
Yes.
Can you call a stored function in the constraint of a table ?
No.
What are the various types of parameter modes in a procedure ?
IN, OUT AND INOUT.
What is Over Loading and what are its restrictions ?
OverLoading means an object performing different functions depending upon the no. of
parameters or the data type of the parameters passed to it.
Can functions be overloaded ?
Yes.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Can 2 functions have same name & input parameters but differ only by return datatype ?
No.
What are the constructs of a procedure, function or a package ?
The constructs of a procedure, function or a package are :
variables and constants
cursors
exceptions
Why Create or Replace and not Drop and recreate procedures ?
So that Grants are not dropped.
Can you pass parameters in packages ? How ?
Yes. You can pass parameters to procedures or functions in a package.
What are the parts of a database trigger ?
The parts of a trigger are:
A triggering event or statement
A trigger restriction
A trigger action
What are the various types of database triggers ?
There are 12 types of triggers, they are combination of :
Insert, Delete and Update Triggers.
Before and After Triggers.
Row and Statement Triggers.
(3*2*2=12)
What is the advantage of a stored procedure over a database trigger ?
We have control over the firing of a stored procedure but we have no control over the firing
of a trigger.
What is the maximum no. of statements that can be specified in a trigger statement ?
One.
Can views be specified in a trigger statement ?
No
What are the values of :new and
ld in Insert/Delete/Update Triggers ?
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
If all the values from a cursor have been fetched and another fetch is issued, the output will
be : error, last record or
first record ?
Last Record
A table has the following data : [[5, Null, 10]]. What will the average function return ?
7.5
Is Sysdate a system variable or a system function?
System Function
Consider a sequence whose currval is 1 and gets incremented by 1 by using the nextval
reference we get the next number 2. Suppose at this point we issue an rollback and again
issue a nextval. What will the output be ?
3
Definition of relational DataBase by Dr. Codd (IBM)?
A Relational Database is a database where all data visible to the user is organized strictly as
tables of data values and where all database operations work on these tables.
What is Multi Threaded Server (MTA) ?
In a Single Threaded Architecture (or a dedicated server configuration) the database
manager creates a separate process for each database user. But in MTA the database
manager can assign multiple users (multiple user processes) to a single dispatcher (server
process), a controlling process that queues request for work thus reducing the databases
memory requirement and resources.
Which are initial RDBMS, Hierarchical & N/w database ?
RDBMS R system
Hierarchical IMS
N/W DBTG
What is Functional Dependency
Given a relation R, attribute Y of R is functionally dependent on attribute X of R if and only if
each X-value has associated with it precisely one -Y value in R
What is Auditing ?
The database has the ability to audit all actions that take place within it.
a) Login attempts, b) Object Accesss, c) Database Action Result of Greatest(1,NULL) or Least
(1,NULL) NULL
While designing in client/server what are the 2 imp. things to be considered ?
Network Overhead (traffic), Speed and Load of client server
When to create indexes ?
To be created when table is queried for less than 2% or 4% to 25% of the table rows.
How can you avoid indexes ?
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
TO make index access path unavailable Use FULL hint to optimizer for full table scan Use
INDEX or AND-EQUAL hint to optimizer to use one index or set to indexes instead of
another. Use an expression in the Where Clause of the SQL.
What is the result of the following SQL :
Select 1 from dual
UNION
Select A from dual;
Error
Can database trigger written on synonym of a table and if it can be then what would be the
effect if original table is accessed.
Yes, database trigger would fire.
Can you alter synonym of view or view ?
No
Can you create index on view ?
No
What is the difference between a view and a synonym ?
Synonym is just a second name of table used for multiple link of database. View can be
created with many tables, and with virtual columns and with conditions. But synonym can be
on view.
What is the difference between alias and synonym ?
Alias is temporary and used with one query. Synonym is permanent and not used as alias.
What is the effect of synonym and table name used in same Select statement ?
Valid
Whats the length of SQL integer ?
32 bit length
What is the difference between foreign key and reference key ?
Foreign key is the key i.e. attribute which refers to another table primary key. Reference key
is the primary key of table referred by another table. Can dual table be deleted, dropped or
altered or updated or inserted ?
Yes
If content of dual is updated to some value computation takes place or not ?
Yes
If any other table same as dual is created would it act similar to dual?
Yes
For which relational operators in where clause, index is not used ?
<> , like % is NOT functions, field +constant, field ||
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Assume that there are multiple databases running on one machine. How can you switch
from one to another ?
Changing the ORACLE_SID
What are the advantages of Oracle ?
Portability : Oracle is ported to more platforms than any of its competitors, running on more
than 100 hardware platforms and 20 networking protocols. Market Presence : Oracle is by
far the largest RDBMS vendor and spends more on R & D than most of its competitors earn
in total revenue. This market clout means that you are unlikely to be left in the lurch by
Oracle and there are always lots of third party interfaces available. Backup and Recovery :
Oracle provides industrial strength support for on-line backup and recovery and good
software fault tolerence to disk failure. You can also do point-in-time recovery.
Performance : Speed of a tuned Oracle Database and application is quite good, even with
large databases. Oracle can manage > 100GB databases.
Multiple database support : Oracle has a superior ability to manage multiple databases
within the same transaction using a two-phase commit protocol.
What is a forward declaration ? What is its use ?
PL/SQL requires that you declare an identifier before using it. Therefore, you must declare a
subprogram before calling it. This declaration at the start of a subprogram is called forward
declaration. A forward declaration consists of a subprogram specification terminated by a
semicolon.
What are actual and formal parameters ?
Actual Parameters : Subprograms pass information using parameters. The variables or
expressions referenced in the parameter list of a subprogram call are actual parameters. For
example, the following procedure call lists two actual parameters named
emp_num and amount:
Eg. raise_salary(emp_num, amount);
Formal Parameters : The variables declared in a subprogram specification and referenced in
the subprogram body are formal parameters. For example, the following procedure declares
two formal parameters named emp_id and increase: Eg. PROCEDURE raise_salary (emp_id
INTEGER, increase REAL) IS current_salary REAL;
What are the types of Notation ?
Position, Named, Mixed and Restrictions.
What all important parameters of the init.ora are supposed to be increased if you want to
increase the SGA size ?
In our case, db_block_buffers was changed from 60 to 1000 (std values are 60, 550 & 3500)
shared_pool_size was changed from 3.5MB to 9MB (std values are 3.5, 5 & 9MB)
open_cursors was changed from 200 to 300 (std values are 200 & 300) db_block_size was
changed from 2048 (2K) to 4096 (4K) {at the time of database creation}. The initial SGA was
around 4MB when the server RAM was 32MB and The new SGA was around 13MB when the
server RAM was increased to 128MB.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
If I have an execute privilege on a procedure in another users schema, can I execute his
procedure even though I do not have privileges on the tables within the procedure ?
Yes
What are various types of joins ?
Equijoins, Non-equijoins, self join, outer join
What is a package cursor ?
A package cursor is a cursor which you declare in the package specification without an SQL
statement. The SQL statement for the cursor is attached dynamically at runtime from calling
procedures.
If you insert a row in a table, then create another table and then say Rollback. In this case
will the row be inserted ?
Yes. Because Create table is a DDL which commits automatically as soon as it is executed.
The DDL commits the transaction
even if the create statement fails internally (eg table already exists error) and not
syntactically.
What are the various types of queries ??
Normal Queries
Sub Queries
Co-related queries
Nested queries
Compound queries
What is a transaction ?
A transaction is a set of SQL statements between any two COMMIT and ROLLBACK
statements.
What is implicit cursor and how is it used by Oracle ?
An implicit cursor is a cursor which is internally created by Oracle. It is created by Oracle for
each individual SQL.
Which of the following is not a schema object : Indexes, tables, public synonyms, triggers
and packages ?
Public synonyms
What is PL/SQL?
PL/SQL is Oracles Procedural Language extension to SQL. The language includes object
oriented programming techniques such as encapsulation, function overloading, information
hiding (all but inheritance), and so, brings state-of-the-art programming to the Oracle
database server and a variety of Oracle tools.
Is there a PL/SQL Engine in SQL*Plus?
No. Unlike Oracle Forms, SQL*Plus does not have a PL/SQL engine. Thus, all your PL/SQL are
send directly to the database engine for execution. This makes it much more efficient as SQL
statements are not stripped off and send to the database individually.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013
Related Tutorials
SQL interview Questions
What is the full form of SQL ? Structured Query Language (SQL). It is pronounced sequel.SQl is a
language that...
VB INTERVIEW QUESTIONS
What are the three main differences between flexgrid control and dbgrid(Data bound Grid) control The
Microsoft FlexGrid (MSFlexGrid) control displays...
Posted on October 13, 2011 by Tutorial Master. This entry was posted in questions. Bookmark the permalink.
http://www.pdftutorials.com/questions/oracle-interview-questions.html
3/11/2013