0% found this document useful (0 votes)
303 views28 pages

List of Top Oracle Interview Questions

The document provides answers to 26 questions about Oracle databases. It discusses Oracle database editions, software release formats, data types like VARCHAR and VARCHAR2, commands like TRUNCATE and DELETE, the RAW datatype, join types, functions like SUBSTR and INSTR, finding duplicate values, the ON DELETE CASCADE statement, and more. It also covers topics like database objects, transactions, aggregate functions, set operators, and converting dates to strings.

Uploaded by

Andrew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
303 views28 pages

List of Top Oracle Interview Questions

The document provides answers to 26 questions about Oracle databases. It discusses Oracle database editions, software release formats, data types like VARCHAR and VARCHAR2, commands like TRUNCATE and DELETE, the RAW datatype, join types, functions like SUBSTR and INSTR, finding duplicate values, the ON DELETE CASCADE statement, and more. It also covers topics like database objects, transactions, aggregate functions, set operators, and converting dates to strings.

Uploaded by

Andrew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 28

List Of Top Oracle Interview Questions

Q #1) What is Oracle and what are its different editions?

Answer: Oracle is one of the popular databases provided by Oracle Corporation, which


works on relational management concepts and hence it is referred to as Oracle RDBMS
as well. It is widely used for online transaction processing, data warehousing, and
enterprise grid computing.

Q #2) How will you identify Oracle Database Software Release?

Answer: Oracle follows a number of formats for every release.

For Example,

Release 10.1.0.1.1 can be referred to as:

10: Major DB Release Number


1: DB Maintenance Release Number
0: Application Server Release Number
1: Component Specific Release Number
1: Platform Specific Release Number

Q #3) How will you differentiate between VARCHAR & VARCHAR2?

Answer: Both VARCHAR & VARCHAR2 are Oracle data types that are used to store
character strings of variable length. Their differences are:

 VARCHAR can store characters up to 2000 bytes while VARCHAR2 can


store up to 4000 bytes.
 VARCHAR will hold the space for characters defined during declaration even
if all of them are not used whereas VARCHAR2 will release the unused space.

Q #4) What is the difference between TRUNCATE & DELETE command?

Answer: Both the commands are used to remove data from the database.

The difference between the two include:

 TRUNCATE is a DDL operation while DELETE is a DML operation.


 TRUNCATE  removes all the rows but leaves the table structure intact. It can
not be rolled back as it issues COMMIT before and after the command
execution while the DELETE command can be rolled back.
 The TRUNCATE command will free the object storage space while the
DELETE command does not.
 TRUNCATE is faster compared to DELETE.

Q #5) What is meant by RAW datatype?

Answer: RAW datatype is used to store variable-length binary data or byte strings.

The difference between RAW & VARCHAR2 datatype is that PL/SQL does not recognize
this data type and hence, cannot do any conversions when RAW data is transferred to
different systems. This data type can only be queried or inserted in a table.

Syntax: RAW (precision)

Q #6) What is meant by Joins? List the types of Joins.

Answer: Joins are used to extract data from multiple tables using some common
columns or conditions.

There are various types of Joins as listed below:

 INNER JOIN
 OUTER JOIN
 CROSS JOINS or CARTESIAN PRODUCT
 EQUI JOIN
 ANTI JOIN
 SEMI JOIN

Q #7) What is the difference between SUBSTR & INSTR functions?

Answer:

 SUBSTR function returns the sub-part identified by numeric values from the
provided string.
 For Example, [SELECT SUBSTR (‘India is my country’, 1, 4) from
dual] will return “Indi”.
 INSTR will return the position number of the sub-string within the string.
 For Example, [SELECT INSTR (‘India is my country’, ‘a’) from dual]
will return 5.

Q #8) How can we find out the duplicate values in an Oracle table?

Answer: We can use the below example query to fetch the duplicate records.

SELECT EMP_NAME, COUNT (EMP_NAME)


FROM EMP
GROUP BY EMP_NAME
HAVING COUNT (EMP_NAME) > 1;
Q #9) How does the ON-DELETE-CASCADE statement work?

Answer: Using ON DELETE CASCADE will automatically delete a record in the child


table when the same is deleted from the parent table. This statement can be used with
Foreign Keys.

We can add ON DELETE CASCADE option on an existing table using the below set of
commands.

Syntax:

ALTER TABLE CHILD_T1 ADD CONSTRAINT CHILD_PARENT_FK REFERENCES


PARENT_T1 (COLUMN1) ON DELETE CASCADE;

Q #10) What is an NVL function? How can it be used?

Answer: NVL is a function that helps the user to substitute value if null is encountered for
an expression.

It can be used as the below syntax.

NVL (Value_In, Replace_With)

Q #11) What is the difference between a Primary Key & a Unique Key?

Answer: Primary Key is used to identify each table row uniquely, while a Unique Key
prevents duplicate values in a table column.

Given below are a few differences:

 The primary key can be only one on the table while unique keys can be
multiple.
 The primary key cannot hold null value at all while the unique key allows
multiple null values.
 The primary key is a clustered index while a unique key is a non-clustered
index.

Q #12) How TRANSLATE command is different from REPLACE?

Answer: TRANSLATE command translates characters one by one in the provided string


with the substitution character. REPLACE command will replace a character or a set of
characters with a complete substitution string.

For Example:

TRANSLATE (‘Missisippi’,’is’,’15) => M155151pp1


REPLACE (‘Missisippi’,’is’,’15) =>  M15s15ippi
Q #13) How can we find out the current date and time in Oracle?

Answer: We can find the current date & time using SYSDATE command in Oracle.

Syntax:

SELECT SYSDATE into CURRENT_DATE from dual;

Q #14) Why do we use COALESCE function in Oracle?

Answer: COALESCE function is used to return the first non-null expression from the list
of arguments provided in the expression. There must be a minimum of two arguments in
an expression.

Syntax:

COALESCE (expr 1, expr 2, expr 3…expr n)

Q #15) How will you write a query to get 5th RANK students from the table
STUDENT_REPORT?

Answer: The query will be as follows:

SELECT TOP 1 RANK


FROM (SELECT TOP 5 RANK
FROM STUDENT_REPORT
ORDER BY RANK DESC) AS STUDENT
ORDER BY RANK ASC;

Q #16) When do we use the GROUP BY clause in SQL Query?

Answer: GROUP BY clause is used to identify and group the data by one or more
columns in the query results. This clause is often used with aggregate functions like
COUNT, MAX, MIN, SUM, AVG, etc.

Syntax:

SELECT COLUMN_1, COLUMN_2


FROM TABLENAME
WHERE [condition]
GROUP BY COLUMN_1, COLUMN_2

Q #17) What is the quickest way to fetch the data from a table?

Answer: The quickest way to fetch the data would be to use ROWID in the SQL query.

Q #18) Where do we use DECODE and CASE Statements?


Answer: Both DECODE & CASE statements will function like IF-THEN-ELSE statement
and they are the alternatives for each other. These functions are used in Oracle to
transform the data values.

For Example:

DECODE Function 

Select ORDERNUM,
DECODE (STATUS,'O', ‘ORDERED’,'P', ‘PACKED,’S’,’SHIPPED’,’A’,’ARRIVED’)
FROM ORDERS;

CASE Function

Select ORDERNUM
, CASE (WHEN STATUS ='O' then ‘ORDERED’
WHEN STATUS ='P' then PACKED
WHEN STATUS ='S' then ’SHIPPED’
ELSE ’ARRIVED’) END
FROM ORDERS;

Both the commands will display order numbers with their respective status as,

If,

Status O= Ordered
Status P= Packed
Status S= Shipped
Status A= Arrived

Q #19) Why do we need integrity constraints in a database?

Answer: Integrity constraints are required to enforce business rules so as to maintain the


integrity of the database and prevent the entry of invalid data into the tables. With the
help of the below-mentioned constraints, relationships can be maintained between the
tables.

Various integrity constraints are available which include Primary Key, Foreign Key,
UNIQUE KEY, NOT NULL & CHECK.

Q #20) What do you mean by MERGE in Oracle and how can we merge two tables?

Answer: The MERGE statement is used to merge the data from two tables. It selects the
data from the source table and inserts/updates it in the other table based on the condition
provided in the MERGE query.

Syntax:
MERGE INTO TARGET_TABLE_1
USING SOURCE_TABLE_1
ON SEARCH_CONDITION
WHEN MATCHED THEN
INSERT (COL_1, COL_2…)
VALUES (VAL_1, VAL_2…)
WHERE <CONDITION>
WHEN NOT MATCHED THEN
UPDATE SET COL_1=VAL_1, COL_2=VAL_2…
WHEN <CONDITION>

Q #21) What is the use of Aggregate functions in Oracle?

Answer: Aggregate functions perform summary operations on a set of values to provide


a single value. There are several aggregate functions that we use in our code to perform
calculations. These are:

 AVG
 MIN
 MAX
 COUNT
 SUM
 STDEV

Q #22) What are the set operators UNION, UNION ALL, MINUS & INTERSECT meant
to do?

Answer: The set operator facilitates the user to fetch the data from two or more than two
tables at once if the columns and relative data types are the same in the source tables.

 UNION operator returns all the rows from both the tables except the duplicate
rows.
 UNION ALL returns all the rows from both the tables along with the duplicate
rows.
 MINUS returns rows from the first table, which does not exist in the second
table.
 INTERSECT returns only the common rows in both the tables.

Q #23) Can we convert a date to char in Oracle and if so, what would be the
syntax?

Answer: We can use the TO_CHAR function to do the above conversion.

Syntax:

SELECT to_char (to_date ('30-01-2018', 'DD-MM-YYYY'), 'YYYY-MM-DD') FRO
M dual;

Q #24) What do you mean by a database transaction & what all TCL statements are
available in Oracle?
Answer: Transaction occurs when a set of SQL statements are executed in one go. To
control the execution of these statements, Oracle has introduced TCL i.e. Transaction
Control Statements that use a set of statements.

The set of statements include:

 COMMIT: Used to make a transaction permanent.


 ROLLBACK: Used to roll back the state of DB to last the commit point.
 SAVEPOINT: Helps to specify a transaction point to which rollback can be
done later.

Q #25) What do you understand by a database object? Can you list a few of them?

Answer: Object used to store the data or references of the data in a database is known
as a database object. The database consists of various types of DB objects such as
tables, views, indexes, constraints, stored procedures, triggers, etc.

Q #26) What is a nested table and how is it different from a normal table?

Answer: A nested table is a database collection object, which can be stored as a column
in a table. While creating a normal table, an entire nested table can be referenced in a
single column. Nested tables have only one column with no restriction of rows.

For Example:

CREATE TABLE EMP (
EMP_ID NUMBER,
EMP_NAME  TYPE_NAME)

Here, we are creating a normal table as EMP and referring a nested table TYPE_NAME
as a column.

Q #27) Can we save images in a database and if yes, how?

Answer: BLOB stands for Binary Large Object, which is a data type that is generally
used to hold images, audio & video files or some binary executables. This datatype has
the capacity of holding data up to 4 GB.

Q #28) What do you understand by database schema and what does it hold?

Answer: Schema is a collection of database objects owned by a database user who can


create or manipulate new objects within this schema. The schema can contain any DB
objects like table, view, indexes, clusters, stored procs, functions, etc.

Q #29) What is a data dictionary and how can it be created?


Answer: Whenever a new database is created, a database-specific data dictionary gets
created by the system. This dictionary is owned by the SYS user and maintains all the
metadata related to the database. It has a set of read-only tables and views and it is
physically stored in the SYSTEM tablespace.

Q #30) What is a View and how is it different from a table?

Answer: View is a user-defined database object that is used to store the results of an


SQL query, which can be referenced later. Views do not store this data physically but as
a virtual table, hence it can be referred to as a logical table.

View is different from the table as:

 A table can hold data but not SQL query results whereas View can save the
query results, which can be used in another SQL query as a whole.
 The table can be updated or deleted while Views cannot be done so.

Q #31) What is meant by a deadlock situation?

Answer: Deadlock is a situation when two or more users are simultaneously waiting for
the data, which is locked by each other. Hence it results in all blocked user sessions.

Q #32) What is meant by an index?

Answer: An index is a schema object, which is created to search the data efficiently
within the table. Indexes are usually created on certain columns of the table, which are
accessed the most. Indexes can be clustered or non-clustered.

Q#33) What is a ROLE in the Oracle database?

Answer: Giving access to individual objects to the individual users is a tough


administrative task. In order to make this job easy, a group of common privileges is
created in a database, which is known as ROLE. The ROLE, once created can be
assigned to or revoked from the users by using GRANT & REVOKE command.

Syntax: 

CREATE ROLE READ_TABLE_ROLE;


GRANT SELECT ON EMP TO READ_TABLE_ROLE;
GRANT READ_TABLE_ROLE TO USER1;
REVOKE READ_TABLE_ROLE FROM USER1;

Q #34) What are the attributes that are found in a CURSOR?

Answer: A CURSOR has various attributes as mentioned below:

(i) %FOUND:
 Returns INVALID_CURSOR if the cursor has been declared but closed.
 Returns NULL if fetch has not happened but the cursor is open only.
 Returns TRUE, if the rows are fetched successfully and FALSE if no rows are
returned.

(ii) NOT FOUND:

 Returns INVALID_CURSOR if the cursor has been declared but closed.


 Returns NULL if fetch has not happened but the cursor is open only.
 Returns FALSE, if rows are fetched successfully and TRUE if no rows are
returned

(iii) %ISOPEN: Returns TRUE, if the cursor is OPEN else FALSE

(iv) %ROWCOUNT: Returns the count of fetched rows.

Q #35) Why do we use %ROWTYPE & %TYPE in PLSQL?

Answer: %ROWTYPE & %TYPE are the attributes in PL/SQL that can inherit the
datatypes of a table defined in a database. The purpose of using these attributes is to
provide data independence and integrity.

If any of the datatypes or precision gets changed in the database, PL/SQL code gets
updated automatically with the changed data type.

%TYPE is used for declaring a variable that needs to have the same data type as of a
table column.

While %ROWTYPE will be used to define a complete row of records having a structure
similar to the structure of a table.

Q #36) Why do we create Stored Procedures & Functions in PL/SQL and how are
they different?

Answer: A stored procedure is a set of SQL statements that are written to perform a
specific task. These statements can be saved as a group in the database with an
assigned name and can be shared with different programs if permissions are there to
access the same.

Functions are again subprograms that are written to perform specific tasks but there are
differences between both of them.

Stored Procedures Functions

Stored Procedures may or may not return a value and can Function will always
return multiple values as well. single value.
Stored Procedures Functions

Stored Procedures can include DML statements like insert, We cannot use DML sta
update & delete. function.

Stored Procedures can call functions. Functions cannot call


procedures.

Stored Procedures support exception handling using Try/Catch Functions does not su
block. Try/Catch block.

Q #37) What are the parameters that we can pass through a stored procedure?

Answer: We can pass IN, OUT & INOUT parameters through a stored procedure and
they should be defined while declaring the procedure itself.

Q #38) What is a trigger and what are its types?

Answer: A trigger is a stored program which is written in such a way that it gets executed
automatically when some event occurs. This event can be any DML or a DDL operation.

PL/SQL supports two types of triggers:

 Row Level
 Statement Level

Q #39) How will you distinguish a global variable with a local variable in PL/SQL?

Answer: Global variable is the one, which is defined at the beginning of the program and
survives until the end. It can be accessed by any methods or procedures within the
program, while the access to the local variable is limited to the procedure or method
where it is declared.

Q #40) What are the packages in PL SQL?

Answer: A package is a group of related database objects like stored procs, functions,
types, triggers, cursors, etc. that are stored in the Oracle database. It is a kind of library
of related objects which can be accessed by multiple applications if permitted.

Top Oracle DBA, RAC, And Performance Tuning


Questions
Enlisted is the most important Oracle Interview Questions on Advanced Topics along
with the answers.
Let’s start!!!

Q #1) Why do we use the materialized view instead of a table or views?

Answer: Materialized view is a database object that holds query results. If


materialized views are used instead of tables or views in complex query executions,
performance gets enhanced as re-execution is not required for repeated queries.

Q #2) How is the Clustered Index different from the Non-Clustered Index?

Answer: An index is a schema object, which can search the data efficiently within
the table.

Indexes can be clustered or non-clustered. Differences include:

 In a clustered index, table records are sorted physically and stored in a


particular order. Hence, a table can have a single clustered index only. While
in a non-clustered index, logical sorting happens which does not match the
physical order of the records.
 Leaf node of a clustered index holds the data pages while the non-clustered
index holds the index rows.
Q #3) What are the different responsibilities of a DBA?

Answer: DBA is the database administrator who performs all administrative tasks.

Administrative tasks include:

 User-level administration i.e. creates users, remove existing users or modifies


user permissions.
 Maintains database security.
 Manages database storage & objects.
 Tunes performance of a database.
 Performs backups & recovery tasks.
Q #4) What do you mean by Database Normalization and why is it important?

Answer: Normalization technique is a set of rules that are used to organize the


relational database to prevent data redundancy and dependency. Once initial
database objects are identified, normalization helps in identifying the relationships
between schema objects.

Different normalization forms are as follows:

 First Normal Form (1NF)


 Second Normal Form (2NF)
 Third Normal Form (3NF)
 Boyce-Codd Normal Form (BCNF)
 Fourth Normal Form (4NF)
 Fifth Normal Form (5NF)
Q #5) Can you list down the different components of physical and logical
database structure?

Answer: Given below is the list of different components.


The physical structure includes:

 Data files, which hold all the DB objects like tables, views, indexes, etc.
 Redo Log files, which maintains the records of database changes as a result
of user transactions.
 Control files, which maintain the database status and physical structure.
The logical structure includes:

 Tablespace, which is a logical storage unit where the database object


resides.
 Segments are logical storage units only but within a tablespace.
 Extent is the logical unit where various contiguous data blocks and extents
together form a segment.
 A data block is the smallest logical storage unit in the database.
Q #6) What is a SYSTEM tablespace and why do we need it?

Answer: System tablespace is created at the time of database creation. This


tablespace holds all the data dictionary tables and hence it is used for the creation of
various database objects. System tablespace must stay online for the database to
function smoothly.

Q #7) What do you mean by SGA and how is it different from PGA?

Answer: SGA means System Global Area is the memory area that is defined by
Oracle during instance startup. This area can be shared by the system-level
processes and hence it is known as the Shared Global Area as well.

PGA is Program Global Area is memory specific to a process or session. It is created


when the Oracle process gets started and each process will have a dedicated PGA.

Q #8) What is a password file in a database and why is it required when a user
can be authenticated using data dictionary tables?

Answer: Database users can be authenticated using data dictionary tables as they


store the username & password. If the password provided by a user matches with the
one stored in the database, then the user would be able to log in. However, this can
happen only if the database is open.

If the database is in shutdown mode, then these tables cannot be accessed and
hence password file will be used by the database administrators to log in and open
the database.

Q #9) What are the different types of backups that are available in Oracle?

Answer: On a higher level, there are 2 types of backup that are available in Oracle
which are physical & logical.

During physical backup, copies of physical database files (like data files, control files,
redo logs & other executables) are created and saved for the future. This can be
achieved using either operating system utilities or RMAN.
In contrast, logical backup allows taking a backup of the database objects like tables,
views, indexes, stored procedures, etc. individually through Export/Import utility
provided by Oracle.

Q #10) What do we mean by hot backup & cold backup and how are they
different?

Answer: Hot backup is the process of taking database backup while the database is
in running mode. Hence, it is also known as Online Backup. While cold backup can
be taken only when the database is in shut down mode and hence it is known as
Offline Backup as well.

There are few websites like banking & trading ones, which are 24 hours operational
and hence, cannot support bringing the database down. Hence, DBAs need to take
the backup in online mode only.

Q #11) What is the difference between restoring a database and recovering a


database? 

Answer: During the restoration process, backup files are copied from the hard disk,
media or tapes to the restoration location and later make the database operational.
Recovery has an additional step of updating these data files by applying redo logs so
as to recover the changes which are not backed up.

Let us understand this with the help of a scenario.

 Database full backup is taken on Friday 11 PM


 Database crash happened on Saturday 7 AM
We can restore the lost files using the 11 PM full backup which is Restoration.
However, the data will be restored up till Friday at 11 PM and not till Saturday at 7
AM. In order to do the same, redo logs can be applied which will bring the database
to the point of failure.

Q #12) What do you understand by Redo Log file mirroring?

Answer: Redo log is the most crucial component of database architecture that


records all transactions within the database even before it goes to the data file.

Hence, the mirroring of these files is done to protect them. Redo Log file mirroring
allows redo logs to be copied to different disks simultaneously. And this can be
achieved using Data Guard and other utilities.

Q #13) How is incremental backup different from differential backup?

Answer: Incremental backup is known for keeping back up of only the changed data
files since the last backup, which might be full or incremental. For Example, An
incremental/full backup is done at 10 AM on Friday and the next backup is done at 10
AM Saturday. The second incremental backup will only have the transactions
occurred after Friday at 10 AM.

While Differential backup backs up the files that changed during the last full backup.
If you take a full back up on Friday at 10 AM and then differential backup on Saturday
at 10 AM, it will take the backup of the files changed since Friday, 10 AM. Further, if
the differential backup is taken on Sunday at 10 AM, it will take the backup of the files
changed since Friday, 10 AM.

Q #14) What is a Flashback Query and when should it be used?

Answer: Oracle has introduced a flashback technology to recover the past states of


database objects. It can recover the accidental changes, which got committed as
well. Recovery depends on the specified value of the UNDO_RETENTION
parameter.

For Example, the UNDO_RETENTION parameter is set to 2 hours and if a user


accidentally deletes the data at 11 AM with commit performed. Then, using
FLASHBACK QUERY, he can retrieve these rows until 1 PM only.

Q #15) How is RMAN better than the user-managed backup recovery process?

Answer: Recovery Manager (RMAN) is an Oracle built-in utility that can automate


database backup & recovery processes and administrate backup strategies as well.
In user-managed backups, the user needs to perform backup manually.

RMAN backup time will be less when compared to user-managed backups as RMAN
maintains all the metadata in the Central Repository and can quickly retrieve the
same.

RMAN does incremental backup rather than taking full file backups which are done
by user-managed backups, which again saves time.

RMAN creates backup and recovery scripts that can be re-used and scheduled and
does not need manual intervention.

RMAN can detect corrupted data blocks automatically during the backup process and
recover them, whereas it doesn’t happen in user-managed backups.

Q #16) What is a Recovery Catalog?

Answer: Recovery catalog is a database schema that holds the metadata used by


RMAN for restoration and recovery processes.

It basically stores information on

 Datafiles & their backup files.


 Archived Redo Logs & their backup sets.
 Stored scripts
 Incarnation
 Backup history
The catalog gets updated once RMAN takes the backup or switches redo log or
changes data file.

Q #17) How do you recover a lost control file?


Answer: If one of the control files is lost or gets corrupted, we can use another copy
of the control file maintained at the OS level. If all the copies of control files are lost or
if a user is maintaining only one copy of the control file which gets lost, then a user
can

 Manually create a control file.


 Restore it from the backup control file using the below command.
ALTER DATABASE BACKUP CONTROL FILE TO TRACE;

 Restore using RMAN backup by using the below commands.


setdbid XX;

restorecontrolfile;

Q #18) What is the difference between media recovery & crash recovery?

Answer: Media recovery is the process of recovering the database from the backup
whenever a disk failure is there. Physical files like data files, control files or server
parameter files get recovered during media recovery. However, crash recovery will
be performed whenever a database instance failure occurs.

Media recovery needs to be performed by DBA while crash recovery is an automated


process that is taken care of SMON background process.

Q #19) What is RAC and what are the various benefits of using RAC
architecture?

Answer: RAC or Real Application Cluster allows the database to be installed across


multiple servers forming a cluster and sharing the storage structure at the same time.
This prevents the database from a single point of failure as one or the other instance
will always stay up even if the other fails.

Using RAC helps in

 Maintaining high availability of the system.


 Managing workload with the least expenses.
 Scalability & agility.
Q #20) How would you differentiate between cluster and grid?

Answer: Clustering is an integral part of grid infrastructure and focuses on a specific


objective.

While grid, which may or may not consist of multiple clusters, possesses a wider
framework that enables sharing of storage systems, data resources and remaining
others across different geographical locations.

A cluster will have single ownership but the grid can have multiple ownership based
on the number of the cluster it holds.

Q #21) What do you understand from Cache Fusion?


Answer: Cache fusion is the process of transferring data from one instance buffer
cache to another at a very high speed within a cluster. Instead of fetching data from
physical disk which is a slow process, the data block can be accessed from the
cache.

For Example, Instance A wants to access a data block, owned by instance B. It will


send an access request to instance B and hence can access the same using the
other instance B’s buffer cache.

Q #22) How can a single instance environment be converted into the RAC
environment and how will they be different?

Answer: Single instance can be converted into RAC using one of the below
methods:

 Enterprise Manager
 DBCA i.e. Database Configuration Assistant
 RCONFIG Utility
Single Instance environment Vs RAC Environment

Single Instance
Parameters RAC Environment
Environment

Instance Instance Multiple

Memory Instance will have Every instance will have separate S


dedicated SGA

Access to Only one instance will Data files and Control Files are sh
physical files access data files  all instances.
 and control files.

Flash  Recovery Accessed by single Shared by multiple instances.


Log instance.

Redo Logs Dedicated to single


instance. Only one instance can write at a ti
others can read data during recover
archiving process.
Q #23) How can we monitor the space allocations in a database?

Answer: We can use the below data dictionary tables to monitor the space
allocations:;

 DBA_FREE_SPACE
 DBA_SEGMENTS
 DBA_DATA_FILES
Q #24) What do you understand by “Performance Tuning of DB” & what are the
different areas where we can perform tuning?

Answer: It is the process of enhancing database performance by making optimal use


of the available resources.

Performance can be enhanced by tuning any of the below areas:

 Database design.
 Memory allocation.
 Disk I/Os.
 Database contention.
 OS level (CPU).
Q #25) What are the different tools that are provided by Oracle to assist
performance monitoring?

Answer: Various tools include:

 AWR(Automatic Workload Repository)


 ADDM(Automated Database Diagnostics Monitor)
 TKPROF
 STATSPACK
 OEM(Oracle Enterprise Manager)
Q #26) What are the different optimizers that are used to optimize the
database?

Answer: There are two types of optimizers:

 Rule-Based Optimizer (RBO): If the referenced objects don’t maintain any


internal statistics, RBO is used.
 Cost-Based Optimizer (CBO): If the referenced objects maintain internal
statistics, CBO will check all the possible execution plans and select the one
with the lowest cost.
Q #27) What is an explain plan and how does it help in optimizing the SQL
query?

Answer: An explain plan is a statement that displays the execution plan selected by
the Oracle optimizer for SELECT, INSERT, UPDATE & DELETE statements. By
looking at this plan, one can figure out Oracle selection of the right indexes, proper
joins & sorts operations, etc.

Q #28) How can we collect the statistics of different database objects?

Answer: ANALYZE statement can be used to collect the statistics of various


database objects like tables, indexes, partitions, cluster or object references. Using
this statement we can also identify migrated as well as chained rows within a table or
cluster.

Q #29) Why do we need to rebuild indexes?

Answer: Rebuilding indexes is required in order to improve the performance of an


application. Due to various INSERT & DELETE operations, the index gets
fragmented & unstructured, thereby making the application slow. To reorganize data
within these indexes, rebuilding is performed.

Q #30) What is TKPROF and how can we use it?

Answer: TKPROF is a tuning utility provided by Oracle which can convert SQL trace
files into a readable format.

Once trace file is generated using SQL Trace Utility, the TKPROF tool can be run
against trace file and output can be read. It can also generate the execution plan for
SQL statements. The executable for TKPROF is located in the ORACLE HOME/bin
directory.

Q #31) How can we tune a SQL query to optimize the performance of a


database?

Answer: Enlisted are a few of the best practices for writing SQL queries.

 Column names should be provided instead of * in SELECT statements.


 Joins should be used in the place of sub-queries.
 EXISTS should be used instead of IN to verify the existence of data.
 UNION ALL should be used in the place of UNION.
 HAVING should be used only for filtering the resulted rows from the SQL
query.
Q #32) How would you identify the SHARED_POOL_SIZE parameter that needs
to be adjusted?

Answer: Below is the indications for the same:

 Getting an ORA-04031 error.


 Degrading the performance even when all the other parameters are already
optimized.
 Poor library cache/data dictionary hits.
Q #33) What do you understand by Row Chaining?

Answer: When a row is too large that it cannot fit in a block, then it will end up using
consequent blocks which lead to the concept of Row Chaining. It can be avoided by
updating the storage parameters to an appropriate value.

Q #34) What is table partitioning and why is it required?

Answer: It is a process of dividing a table into smaller chunks so as to make the data
retrieval easy and quick. Each piece will be known as a partition and can be
accessed separately. Apart from tables, indexes can also be partitioned.

Q #35) How can we identify the resources for which the sessions are waiting?

Answer: We can find it out using v$session_waits and v$ system _waits.

Top Oracle Forms And Reports Interview


Questions
Oracle Forms Interview Questions
Q #1) What do you understand by Oracle Forms and why are they required?

Answer: Oracle Forms are the user interfaces that are developed to present the data
to the user. This data can be presented once retrieved from the Oracle database. If
required, forms can be integrated with web services or Java to follow SOA
architecture. Forms are created at source as .fmb files and later compiled into .fmx
(executable file).

Oracle Forms include:

 Forms Developer: It helps in the development and compilation of Oracle


Forms.
 Forms Services: It is considered for the deployment of Forms.
Q #2) Explain the different levels at which Oracle Form Services interact.

Answer: Oracle Form Services is a three-tier application and hence it will interact


at the below levels:

 Client Level
 Server Level
 Database Level
At the client level, HTTP requests will be sent by a client to the system. This request
will be received by the Forms Listener Servlet at the server and it will initiate Forms
Runtime process. This process will send the request to the database to retrieve the
information and send it back to the client.

This completes the workflow of user interaction through Oracle Forms Services.

Q #3) Can we invoke one form from another in a multi-forms application?

Answer: Yes, we can invoke one form from another with the help of the below
built-in functions:

 OPEN_FORM: It opens up the requested form along with the current form
and the user can navigate to both the forms in the same session.
 NEW_FORM: It will also open up a new form but after exiting from the current
form.
 CALL_FORM: It will open the requested form by keeping the parent form
active but hidden. Once exited from the requested form, control goes back to
the parent form.
Q #4) What do you understand by LOV and how can it be used?

Answer: LOV is a list of values populated in a pop-up window and is displayed to the


end-user for selection. These values can be assigned and invoked statically or
dynamically in LOV.

There is a related property known as ‘LOV for Validation’ which is used to validate
contents of LOV. If this property is set to true, the current value of text item is
compared with the values displayed in the first column of LOV.
If any of the LOV values match the text item, then validation succeeds and LOV will
not be displayed. If the value does not match, LOV will be displayed and a search will
happen based on the text item.

Q #5) What is a canvas in Oracle Forms?

Answer: Canvas is a layer within a window where the visual objects like interface
items or graphics can be placed.

Oracle Forms support four types of canvas as mentioned below:

 Content canvas (default canvas)


 Tab canvas
 Toolbar canvas
 Stacked canvas
Q #6) In what sequence do triggers get fired by Oracle Forms?

Answer: Oracle Forms follow the below hierarchy for trigger execution:

 Pre-form
 Pre-block
 Pre-record
 Pre-text item
 When-new-form-instance
 When-new-block-instance
 When-new-record-instance
 When-new-item-instance
 Post-text_item
 Post-Record
 Post-Block
 Post-Form
Q #7) Explain the Master-Detail relationship with some examples.

Answer: Master-Detail relationship is the relationship among different business


entities which follows the parent-child relationship pattern. There will be one parent
entity linked to many child entities.

For Example, we can have one master named COMPANY with different details as
DEPARTMENTS (HR, FINANCE, OPERATIONS, ADMIN, etc.).

This relationship can be implemented with the help of two data blocks where the first
data block represents the master table while the other represents a detailed table.

Q #8) Name the different triggers associated with Oracle Forms having a
master-detail relationship.

Answer: Enlisted triggers gets created during the creation of the master-detail


block:

 ON-CHECK-DELETE-MASTER
 ON-CLEAR-DETAILS
 ON-POPULATE-DETAILS
Q #9) What are the various configuration files that are used by Oracle Forms?
Answer: The configuration files include:

 default.env
 formsweb.cfg
 ftrace.cfg
 base.htm,basejini.htm & basejpi.htm
Using the above config files, a user can specify different parameters for the forms as
per the requirement.

Q #10) What do we mean by record group in Oracle Forms?

Answer: A record group is a framework of rows and columns within the Oracle
Forms similar to a table in the Oracle database.

Record groups can be:

 Query Record Group


 Non-Query Record Group
 Static Record Group
A query record group is associated to SELECT statement and can be created or
updated during design or execution. While a non-query record group is not
associated with any query and hence it can be created or updated during execution
only.

The static record group is again not associated with any query and can be created or
updated during the design phase only.

Oracle Reports Interview Questions


Q #11) What is an Oracle Report? List its various types.

Answer: Oracle Report is a tool provided by Oracle Fusion Middleware, which is


used to generate reports based on the data stored in the Oracle database. It consists
of Oracle Reports Developer, a report designing tool and Oracle Application Server
Reports Services.

Various types of Report include:

 Tabular
 Master-Detail Reports
 Form Reports
 Form Letter Reports
 Mailing Labels Reports
 Matrix Reports
Q #12) What is an implicit anchor and how is it a different form explicit anchor
in a report builder?

Answer: An anchor is used to determine the position of an object in horizontal and


vertical directions. This position of an object will always be relative to the position of
the other objects, which can be called parent objects for these child objects.
During runtime, an implicit anchor will be generated by the Oracle Forms Builder for
each layout object, which is not holding an explicit anchor. The implicit anchor will be
created during the runtime of a report while explicit anchors are created by a user
explicitly.

Q #13) Name different triggers supported by Oracle Reports and their firing
order.

Answer: Listed below are the triggers supported by Oracle Reports:

 Before Parameter Form: Gets fired before the display of runtime parameter


form on the screen.
 After Parameter Form: Gets fired after the display of runtime parameter form
on the screen.
 Before Report: Gets fired before the execution of a report but after the
queries get parsed.
 Between Pages: Gets fired before formatting is done for every page except
the first page.
 After Report: Gets fired either at the exit of the Previewer or once the report
output is shared with the destination.
Q #14) What is the difference between bind and lexical parameter?

Answer: Bind parameters are the variables, which can replace a single value in
SQL/PLSQL such as number, character, string or date.

While lexical parameter can replace clauses or multiple values embedded in


SELECT query possibly after SELECT, FROM, WHERE, GROUP BY, ORDER BY,
HAVING, CONNECT BY, and START WITH.

Q #15) List the different types of columns in Oracle Reports.

Answer: There are three types of columns in Oracle reports. They are:

 Formula Columns: Column that can do user-defined calculations on values


within other columns and return some value.
 Summary Columns: Column, which can do summary computations like sum,
average, etc. on values placed in the other columns.
 Placeholder Columns: Column for which data type or value can be set using
PL/SQL.
Q #16) What is a User exit program in Oracle Reports?

Answer: User exit is a program that is written to perform some relevant action. They
can be called from report triggers and once executed, it gives back the control to
Report Builder.

Few of the user exits are listed as shown below:

 FND SRWINIT
 FND SRWEXIT
 FND FORMAT_CURRENCY
 FND FLEXSQL
 FND FLEXIDVAL
Q #17) How can we generate report output in Excel format?
Answer: To get report data in an Excel format, we can use:

 SPOOL Command
 Text_IO Package
 UTL Package
Q #18) What is the difference between flex mode and confined mode?

Answer: Confined mode, if set restricts the child object within enclosing parent
objects. If not set on, the child objects can move out of parent objects.

During flex mode, parent objects will adjust its border if the child object expands or
moves. If not set, parent borders stay fixed when the child objects move.

Q #19) What is a matrix report and how many minimum groups are required to
prepare the same?

Answer: A matrix is a kind of report that looks like an information grid with one row of
labels and one column of columns. At least 4 groups are required in the data model
to prepare a matrix report. One should be a cross-product group, one cell group & at
least two groups should be within a cross-product group.

Q #20) Is it possible to have multiple layouts in a report?

Answer: Yes, it is possible to have multiple layouts. We can use an additional layout


option in the layout editor tool.

Top Oracle Apps Technical And Oracle SOA


Questions
Oracle SOA Interview Questions
Q #1) What do you understand by SOA and what are the benefits of using this
architecture?

Answer: SOA stands for Service Oriented Architecture, which can be used to


develop Enterprise Applications. Using this architecture, application components will
interact with each other using interoperable services by following the communication
protocol over the network.

Benefits of using SOA are:

 Components stay loosely coupled and can be reconfigured.


 Business services can be reused.
 Data security & confidentiality.
 Well defined Interfaces.
 Better flexibility and maintenance.
Q #2) What is Oracle SOA Suite and what are its different components?

Ans: Oracle SOA Suite belongs to the Oracle Fusion Middleware group of software
products.
This tool is based on SOA architecture and helps in creating, managing & integrating
services with the application components so as to deliver SOA composite application
as one unit. This suite consists of five components.

Service components further consist of:

 BPEL Process
 Oracle Mediator
 Human Task Flow
 Decision Services
Binding components include:

 Services
 References
Q #3 ) Can you explain the difference between architecture followed in 10g &
11g?

Answer: Given below are the differences between 10g and 11g:

 SCA architecture is followed in 11g but not in 10g.


 In 11g, all of the SOA components (like BPEL, ESB, etc.), related to project
can be deployed at once as a single unit using a composite.xml file. In 10g,
these components need to be deployed individually to the respective servers.
 App server container for 11g is Web Logic Server while for 10g is OC4J.
 In 11g, Enterprise Manager takes care of all SOA components while in 10g
separate consoles are maintained for each component.
Q #4) What is the concept of SOA Governance?

Answer: SOA governance is introduced to administrate services in a service-


oriented architecture.

This governance is required to:

 Create new services when required.


 Update existing services.
 Manage the lifecycle of services.
 Enforce the rules on policies to maintain consistency.
 Monitoring and tuning performance of services.
 Manages user permissions on services.
Q #5) How can a process be deployed in SOA?

Answer: A process can be deployed using any of the below options:

 JDeveloper
 EMC(Enterprise Manager Console)
 WebLogic Scripting.
Q #6) What is SCA and how is it useful?

Answer: Service Component Architecture (SCA) is a model for building applications


and systems using SOA concepts. The composite service has the assembly of
different components of the application and these components can be deployed
together at once using SCA.
The various specifications of SCA are:

 Assembly Model Specification.


 Binding Specification.
 Components Implementation Specification.
 Policy Framework Specification.
Q #7) How can you achieve loose coupling in the SOA framework?

Answer: Loose coupling can be achieved by abstracting and resolving the


differences between different systems so as to provide seamless integration.

OSB facilitates the same and resolves the issues between service clients and
business systems. SOA uses web services as building blocks to accomplish
enterprise integration and component re-usage through the loose coupling.

Q #8) Can you differentiate between mediator and OSB?

Answer: Mediator can be differentiated from OSB as:

 A mediator is part of a composite application and is used to mediate between


the different components within and outside a composite application. While
OSB i.e. Oracle Bus Service is a standalone ESB which mediates with
heterogeneous clients and services without being a part of them.
 A mediator can be deployed as an SCA component while an OSB cannot.
 For a mediator, development can happen through JDeveloper IDE while for
OSB, it can be done using Eclipse IDE or Web Console.
Q #9) Is SOA a part of Oracle Fusion Middleware?

Answer: Yes SOA is a part of Oracle Fusion Middleware behaving as a UI within the


big Fusion platform.

Q #10) How is choreography different from orchestration?

Answer: Choreography and orchestration, are critical parts of the collaboration layer


within service orientation i.e. SOA & BPM.

During Choreography, systems get integrated without following any business


processes. There is no process defined to control the integration and it is done as per
the defined sequence of levels.

In Orchestration, a central process which can be a Web Service itself controls the
other web services involved in the integration of systems. This central coordinator will
coordinate the execution of various operations of web services involved in the
operation and completes the integration.

Oracle Apps Technical Interview Questions


Q #11) Can you define an ERP System?

Answer: ERP stands for Enterprise Resource Planning. It is a business software


system that allows an organization to automate and integrate with the various
business processes sharing common data across enterprises.
ERP software typically integrates the different facets of an operation like product
planning, development, and manufacturing, sales, marketing, etc. using a single
database, application, and interface.

Q #12) Explain Oracle Apps architecture.

Answer: Oracle Apps is a multi-tier architecture environment where the application


server serves as an interface between clients and database servers.

Hence, the components of this architecture are:

 Clients
 Application servers
 Database servers
Clients will initiate the request for an operation to be executed by the database. The
application server will act as an intermediate layer by sending the client request to
the database and providing the requested data to the client.

Q #13) Can we create tables in APPS schema?

Answer: No, we cannot create tables in APPS schema and this schema will only
have synonyms.

Q #14) What is a flexfield? List out its types.

Answer: Flexfield is a database field possessing inbuilt flexibility of defining reporting


structure, which is relevant to specific organizations. A flexfield is made up of
segments or subfields.

There are two types of flex fields:

 Key flexfields: They are used to record key data elements.


 Descriptive flexfields: They are user-defined flexfields and can be
customized.
Q #15) What are the different components you should consider while defining
responsibility in Oracle Apps?

Answer: A responsibility is a group of components. These are:

 Menu (mandatory): It is an arrangement of forms in a hierarchical manner.


 Data Group (mandatory): It defines the mapping between Oracle App
products like forms, reports, concurrent programs, and Oracle database Ids.
 Responsibilities and Request Security Groups (mandatory): A request
security group is the request group assigned to a responsibility.
 Function and Menu Exclusions (optional): Responsibility may or may not
have an associated function and menu exclusion rules.
Q #16) What is a Value Set? List its various types.

Answer: As the name itself suggests, the value set is a predefined list of values used
by Oracle for validation. It restricts the end-user to enter junk data by providing an
option to select a value from the predefined set of values.
Oracle supports eight types of value set validations. These are:

 None (validated minimally)


 Independent
 Dependent
 Table
 Special (advanced)
 Pair (advanced)
 Translated Independent
 Translatable Dependent
Q #17) How can we import the data into a database using SQL * Loader?

Answer: SQL * Loader is a utility that is used to import the data in bulk from external
files.

Various features of this command-line utility are as shown below:

 They can perform selective loading.


 They can perform multi-table loads.
 Supports various format files.
This utility can be invoked using a set of commands.

SQLLDR CONTROL=Test.ctl, LOG=Test.log, BAD=Test.bad,


DATA=Test.dat USERID=superuser/XXX, ERRORS=999, LOAD=3000,
DISCARD=toss.dsc, DISCARDMAX=6

Q #18) What do you understand by Concurrent programs?

Answer: An executable file that can execute simultaneously with the other programs
and utilize the hardware capacity to the fullest is called the concurrent program.
Generally, these types of programs would be long-running and data-intensive. They
can be grouped with reports to form a request group.

Q #19) What does the APPL_TOP directory contain?

Answer: APPL directory stores Oracle e-business suite files and hence it is


commonly known as APPL_TOP directory.

This directory contains the files along with the relative directories:

 Technology files
 Product files
 Oracle e-business suite environment files
Q #20) What do you understand by a set of books?

Answer: The set of books is a financial reporting entity. It determines the functional


currency, account structure, and calendar for a company or a group of companies.

There are two types of set of books.

 Primary: It consists of functional currency


 Secondary: It consists of reporting currency

You might also like