You are on page 1of 32

How can I get 5th highest sal. from employee tab?

Select max(sal) from emp where sal<(select max(sal) from emp where sal<(select max (sal) from emp where sal<(select max (sal) from emp where sal<(select max(sal) from emp)))); SELECT TOP 1 salary FROM (SELECT DISTINCT TOP 5 salary FROM employee ORDER BY salary DESC) a ORDER BY salary FOR nth HIGHEST ENTRY:SELECT MAX(SALARY) FROM employee e1 WHERE &N = ( SELECT COUNT(DISTINCT(SALARY)) FROM employee e2 WHERE e1.SALARY <= e2.SALARY); Put the value for the n & you can find any no. of highest salary.

select rownum,employee_id,salary from (select employee_id,salary from employees order by salary desc) where rownum<=5;

What is a JOIN? Explain types of JOIN in oracle.

Latest answer: A JOIN is used to match/equate different fields from 2 or more tables using primary/foreign keys. Output is based on type of Join and what is tobe queries...................... Read answer
What is a join, explain the types of joins?

Latest answer: A join is a query that extracts data from two or more tables, views or snapshots........... Read answer
Explain the types of joins.

Latest answer: Types of joins are: Equijoins, Non-equijoins, self join, outer join. A Join is used to create query using two or more tables and views.......... Read answer
What is object data type in oracle?

Latest answer: Object data type is created using object type in oracle. The object data type can only be created using SQL data type such as Number, Varchar 2, Date etc................. Read answer
What is composite data type?

Latest answer: Collections are usually referred to as Composite Data types. Composite type is one that has components in it. A variable of a composite type contains one or more scalar types................ Read answer
Differences between CHAR and NCHAR in Oracle.

Latest answer: CHAR and NCHAR are character data types which and have a fixed length. However, CHAR has a specified size in bytes by default and NCHAR has a size specified in characters by default................ Read answer
Differences between CHAR and VARCHAR2 in Oracle.

Latest answer: CHAR values have a fixed length. They are padded with space characters to match the specified length........... Read answer
Differences between DATE and TIMESTAMP in Oracle

Latest answer: TIMESTAMP and DATE vary in formats as follows: DATE stores values as century, year, month, date, hour, minute, and second............ Read answer
Define CLOB and NCLOB datatypes.

Latest answer: Both CLOB and NCLOB are used to store huge character data in the database, CLOBs store single-byte character set data............ Read answer
What is the BFILE datatypes?

Latest answer: The BFILE datatype is used to store unstructured binary data outside the database. The column of BFILE type stores file locator that points the OS file which

actually stores data........... Read answer


What is Varrays?

Latest answer: Varrays, variable length array is quite similar to array of C++ or Java. It has fixed upper-bound size that has to be specified while it is declared.......... Read answer
What are LOB datatypes?

Latest answer: The LOB datatypes such as BLOB, CLOB, NCLOB and BFile can store large blocks of unstructured data such as graphics, image, video clips etc............ Read answer
What is a cursor? What are its types?

Latest answer: Oracle engine uses private working area to process queries. This work area is called as cursor. The data that is stored in the cursor is called as Active Data Set............. Read answer
Explain the attributes of implicit cursor

Latest answer: There are four attributes of implicit cursor in oracle: SQL%IsOPEN Implicit cursor always returns FALSE as it gets closed automatically........... Read answer
Explain the attributes of explicit cursor.

Latest answer: There are four attributes of explicit cursor in oracle. %IsOPEN - This evaluates TRUE when cursor is open else FALSE.......... Read answer
What is the ref cursor in Oracle?

Latest answer: Cursor is a reference type in oracle. We can allocate different storage locations to the cursor when the program runs............ Read answer
What are the drawbacks of a cursor?

Latest answer: Implicit cursors are less efficient than explicit cursors, Implicit cursors are more vulnerable to data errors.................. Read answer
What is a cursor variable?

Latest answer: A cursor variable is capable to get associated with different SELECT statements at run time. It is a reference type which is quite similar to pointer in C. In order to use cursor variable........... Read answer
Business object interview questions

Latest answer: Differentiate between Data Mining and Data warehousing. What is Data purging? What are CUBES? What are OLAP and OLTP? What are the different problems that Data mining can solve? What are different stages of Data mining?..................... . Read answer
OLAP interview questions

Latest answer: Explain the concepts and capabilities of OLAP. Explain the functionality of OLAP. What are MOLAP and ROLAP? Explain the role of bitmap indexes to solve aggregation problems. Explain the encoding technique used in bitmaps indexes. What is Binning? What is candidate check?.................. Read answer

What is implicit cursor in Oracle?

Latest answer: An implicit cursor is a cursor which is internally created by Oracle, It is created by Oracle for each individual SQL........... Read answer
Can you pass a parameter to a cursor? Explain with an explain

Latest answer: Yes, explicit cursors can take parameters........... Read answer
What is a package cursor?

Latest answer: In a package cursor, the SQL statement for the cursor is attached dynamically at runtime from calling procedures............ Read answer
Explain why cursor variables are easier to use than cursors.

Latest answer: They are easier to define as there is no need to specify a query statement, The query can also be specified dynamically at the opening time........... Read answer
What is locking, advantages of locking and types of locking in oracle?

Latest answer: Locking protect table when several users are accessing the same table. Locking is a concurrency control technique in oracle. It helps in data integrity while allowing maximum.......... Read answer
What are transaction isolation levels supported by Oracle?

Latest answer: READ COMMITTED: If row locks are obtained by a certain transaction, then any other transaction that contains DML needs to wait until the row locks have been released by that particular transaction............. Read answer
Explain how to view existing locks on the database.

Latest answer: A number of data locks need to be monitored, in order to maintain a good performance level for all sessions, along with the time for which they last............ Read answer
Explain how to lock and unlock a user account in Oracle.

Latest answer: SQL> ALTER USER user_name ACCOUNT LOCK; SQL> ALTER USER user_name ACCOUNT UNLOCK; Read answer
What are background processes in oracle?

Latest answer: Oracle uses background process to increase performance : Database writer, DBWn, Log Writer, LGWR, Checkpoint, CKPT, System Monitor, SMON, Process Monitor, PMON, Archiver, ARCn........... Read answer
What is SQL*Loader?

Latest answer: It is a database tool that allows data to be loaded from external files into database tables, It is available as part of the free Oracle 10g Expression Edition.......... Read answer
What is a SQL*Loader Control File?

Latest answer: A SQL*Loader control file contains the following specification: location of the input data file, format of the input date file, target table where the data should be loaded............ Read answer
Explain oracle memory structures.

Latest answer: Two memory area: System global area(SGA), Program Global Area(PGA).......... Read answer
What is Program Global Area (PGA)?

Latest answer: The PGA is a memory area that contains data and control information for the Oracle server processes. This area consists of the following components:............. Read answer
What is a shared pool?

Latest answer: It is the area in SGA that allows sharing of parsed SQL statements among concurrent users........... Read answer
What is snapshot in oracle?

Latest answer: A recent copy of a table or a subset of rows or cols of a table is called as snapshot in oracle. A snapshot is more useful in distributed computing environment. We can create.......... Read answer
What is a synonym?

Latest answer: Synonym simplifies the use of the table, the table for which synonym is created can be referred by synonym name............ Read answer
What is a schema?

Latest answer: Schema represents structure of the database. Database has two main types of schemas partitioned : Physical schema: Describes the database design at the physical level............. Read answer
Explain how to list all indexes in your schema.

Latest answer: The list of all indexes in a schema can be obtained through the USER_INDEXES view with a SELECT statement:........... Read answer
What are Schema Objects?

Latest answer: Schema objects are the logical database structure that represents database's data. Schema objects include tables, views, sequences, synonyms, indexes,

clusters, database............ Read answer


What is an Archiver?

Latest answer: Archiving is the process of removing of old data and unused data from the main databases. This process keeps databases smaller, more manageable and thus acquires............. Read answer
What is a sequence in oracle?

Latest answer: A Sequence is a user created database object. A sequence can be shared by multiple users to generate unique integers. This object is used to create a primary key value............... Read answer
Difference between a hot backup and a cold backup

Latest answer: Cold Backup : In this type of backup, after the database is shut down, DBA exits the SVRMGR utility and copies the log files, data files and control files onto a backup media........... Read answer
How to retrieve 5th highest sal from emp table?

SELECT DISTINCT (emp1.sal) FROM EMP emp1 WHERE &N = (SELECT COUNT (DISTINCT (emp2.sal)).......... Read answer
What is $FLEX$ and $PROFILES$? Where are they used?

$FLEX$ is used to get a value used in the previous value set. It is usually used to retrieve the Flex value contained in an AOL value.......... Read answer
How to call a trigger inside a stored procedure?

A trigger cannot be called within a stored procedure. Triggers are executed automatically as a result of DML or DDl commands............ Read answer
What is WATER MARK IN oracle? Explain the significance of High water mark.

WATER MARK is a divided segment of used and free blocks. Blocks which are below high WATER MARK i.e. used blocks, have at least once........... Read answer

What is an object groups?

Object group is a container for a group of objects.......... Read answer


Difference between clustering and mirroring

Clustering means one than one database server configured for the same user connection. When users connect, one of the servers responds.......... Read answer
Difference between paging and fragmentation

Paging is a concept occurring in memory, whereas, Fragmentation occurs on disk level.......... Read answer
Can you explain how to insert an image in table in oracle?

Insert image into a table: Create the following table: create table pics_table (bfile_id number,......... Read answer
How to find out second largest value in the table?

SELECT * FROM EMP WHERE SAL IN (SELECT MAX(SAL) FROM EMP......... Read answer
Disadvantage of user defined function in oracle.

Disadvantage of UDF in Oracle: Oracle does not support calling UDFs with Boolean parameters or return types.......... Read answer
Explain the significance of cluster table or non cluster table.

A Cluster provides an alternate method of storing table data. It is made up of a group of tables that share the same data......... Read answer
What are the purposes of Import and Export utilities?

Latest answer: Import and Export utilities are helpful in following ways: They can be used for backup and recovery process, they can also be used while moving database between two different............... Read answer
Difference between ARCHIVELOG mode and NOARCHIVELOG mode

Latest answer: There are two modes in which the hot backup works: ARCHIEVELOG mode, NOARCHIVELOG mode........ Read answer
What are the original Export and Import Utilities?

Latest answer: The import and export utilities of oracle provide a very simple way to transfer data objects between Oracle databases. These may reside on heterogeneous software and hardware............ Read answer
What are data pump Export and Import Modes?

Latest answer: Data pump export and import modes are used to determine the type and portions of database to be exported and imported:............... Read answer
What are SQLCODE and SQLERRM and why are they important for PL/SQL developers?

Latest answer: When a SQL statement raises an exception, Oracle captures the error codes by using the SQLCODE and SQLERRM globally-defined variables............... Read answer
Explain user defined exceptions in oracle. Explain the concepts of Exception in Oracle. Explain its type.

Latest answer: Exceptions in oracle occur when unwanted situations happen during the execution of a program. They can occur due to system error, user error or application error............. Read answer
How exceptions are raised in oracle?

Latest answer: Internal exceptions are raised implicitly by the run-time system. However, user-defined exceptions must be raised explicitly by RAISE statements................ Read answer
What is tkprof and how is it used?

Latest answer: Tkprof is a performance diagnosing utility available to DBAs. It formats a trace file into a more readable format for performance analysis. So that the DBA can identify and resolve............... Read answer
What is Oracle Server Autotrace?

Latest answer: The Autotrace feature of Oracle server generates two statement execution reports which are useful for performance tuning. They are: Statement execution path.............. Read answer
Explain the different types of queries in Oracle.

Latest answer: Session Queries are implicitly constructed and executed by a Session based on input parameters.Input parameters are used to perform the most common data source actions on objects............ Read answer
What is SQL*Plus?

Latest answer: SQL*Plus is an interactive and batch query tool, it gets installed with every Oracle Database Server or Client installation............. Read answer
Explain how to change SQL*Plus system settings.

Latest answer: The SET command can be used to change the settings in the SQl*PLUS environment : SET AUTOCOMMIT OFF: Turns off the auto-commit feature, SET FEEDBACK OFF............ Read answer
What are SQL*Plus Environment variables?

Latest answer: The behaviour of SQL PLUS depends on some environmental variables predefined in the OS: ORACLE_HOME: This variable stores the home directory where the Oracle client............. Read answer
What is Output Spooling in SQL*Plus?

Latest answer: The spooling feature facilitates copying of all the contents of the command line SQL*Plus to a specified file. This feature is called Spooling............ Read answer
What is Input Buffer in SQL*Plus?

Latest answer: Input buffer feature of the command-line SQL*Plus tool allows a revision of multiple-line command and rerunning it with a couple of simple commands. The last SQL statement is........... Read answer
What is a subquery in Oracle?

Latest answer: When a query needs to be run which has a condition that needs to be a result of another query then, the query in the condition part of the main one is called a sub-query............... Read answer
What is Data Block?

Latest answer: Data blocks are also called logical blocks, Oracle blocks, or pages. At the finest level of granularity, Oracle stores data in data blocks............ Read answer
Explain the difference between a data block, an extent and a segment.

Latest answer: 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............. Read answer
What are the uses of Rollback Segment?

Latest answer: Rollback segments undo changes when a transaction is rolled back, they also ensure that transactions leave the uncommitted changes unnoticed.............. Read answer
What is Rollback Segment in oracle?

Latest answer: Rollback Segment in oracle is used to store "undo" information temporarily......... Read answer
What are the different types of Segments?

Latest answer: Data Segment, Index Segment, Rollback Segment, and Temporary Segment........... Read answer
Explain difference between SQL and PL/SQL.

Latest answer: PL/SQL is a transaction processing language that offers the following advantages:

support for SQL - SQL is flexible, powerful and easy to learn. support for object-oriented programming............... Read answer

Write a PL/SQL program for a function returning total tax collected from a particular place.

Latest answer: PL/SQL program Create of Replace Function Tax-Amt Place varchar2, Return Number is............ Read answer
What are the types PL/SQL code blocks?

Latest answer: Anonymous Block, Stored Program Unit, Trigger........... Read answer
Advantages of PL/SQL

Latest answer: Support SQL data manipulation, provide facilities like conditional checking, branching and looping............. Read answer
What is WebDB?

Latest answer: WebDB is a tool written in PL/SQL, used to develop HTML based application that can easily interact with Oracle data................... Read answer
What is Nested Table?

Latest answer: Nested Table is a table inside a table. It can have several rows for each row of its parent table............ Read answer
What is clusters?

Latest answer: Clusters group together tables that share common columns. These tables are often used together......... Read answer
Explain how to add a new column to an existing Table in Oracle.

Latest answer: Use the ALTER TABLE command to do this ALTER TABLE employee ADD (department VARCHAR2);......... Read answer
How many types of Tables supported by Oracle? Explain them

Latest answer: Ordinary (heap-organized) table, Clustered table, Index-organized table, Partitioned table........... Read answer
Explain how to view all columns in an Existing Table.

Latest answer: Use the command DESC and the table name to view the information about the columns.......... Read answer
Explain how to recover a dropped Table in Oracle.

Latest answer: select * from recyclebin where original_name = 'table_name'; Then u can use flashback table table_name to before drop;..................... Read answer
What is an Oracle Recycle Bin?

Latest answer: The tables that have been dropped can be retrieved back using the reycle bin feature of Oracle, they can be recovered back by the Flashback Drop action............ Read answer
What is an External Table?

Latest answer: A table with its data stored outside the database as an OS file is an external table........... Read answer
Describe how to load data through External Tables.

Latest answer: Create an external table with columns matching data fields in the external file........... Read answer
What is the role of Archiver [ARCn]?

ARCn is an oracle background process responsible for copying the entirely filled online redo log file to the archive log......... Read answer
Structural difference between bitmap and btree index in oracle.

Btree It is made of branch nodes and leaf nodes. Branch nodes holds prefix key value along with the link to the leaf node. The leaf node in turn........ Read answer

Can you explain how to convert oracle table data into excel sheet?

There are 2 ways to do so: 1. Simply use the migration wizard shipped with Oracle......... Read answer
When should we go for hash partitioning?

Scenarios for choosing hash partitioning: Not enough knowledge about how much data maps into a give range........... Read answer
What is Materialized view? What is a snapshot? What are the similarities and differences between Materialized views and snapshots?

A materialized view is a database object that contains the results of a query. A snapshot is similar to materialized view.......... Read answer
What are the advantages of running a database in NO archive log mode?

1. Less disk space is consumed 2. Causes database to freeze if disk gets full........ Read answer
What are the advantages of running a database in archive log mode?

It makes it possible to recover database even in case of disk failure............ Read answer
What is dba_segment in oracle?

DBA_SEGMENTS tells about the space allocated for all segments in the database for storage......... Read answer
Write a PL/SQL program for a function returning total tax collected from a particular place.

Latest answer: PL/SQL program Create of Replace Function Tax-Amt Place varchar2, Return Number is............ Read answer
What are the types PL/SQL code blocks?

Latest answer: Anonymous Block, Stored Program Unit, Trigger........... Read answer

Advantages of PL/SQL

Latest answer: Support SQL data manipulation, provide facilities like conditional checking, branching and looping............. Read answer
What is WebDB?

Latest answer: WebDB is a tool written in PL/SQL, used to develop HTML based application that can easily interact with Oracle data................... Read answer
What is Nested Table?

Latest answer: Nested Table is a table inside a table. It can have several rows for each row of its parent table............ Read answer
What is clusters?

Latest answer: Clusters group together tables that share common columns. These tables are often used together......... Read answer
Explain how to add a new column to an existing Table in Oracle.

Latest answer: Use the ALTER TABLE command to do this ALTER TABLE employee ADD (department VARCHAR2);......... Read answer
How many types of Tables supported by Oracle? Explain them

Latest answer: Ordinary (heap-organized) table, Clustered table, Index-organized table, Partitioned table........... Read answer
Explain how to view all columns in an Existing Table.

Latest answer: Use the command DESC and the table name to view the information about the columns.......... Read answer
Explain how to recover a dropped Table in Oracle.

Latest answer: select * from recyclebin where original_name = 'table_name';

Then u can use flashback table table_name to before drop;..................... Read answer
What is an Oracle Recycle Bin?

Latest answer: The tables that have been dropped can be retrieved back using the reycle bin feature of Oracle, they can be recovered back by the Flashback Drop action............ Read answer
What is an External Table?

Latest answer: A table with its data stored outside the database as an OS file is an external table........... Read answer
Describe how to load data through External Tables.

Latest answer: Create an external table with columns matching data fields in the external file........... Read answer
What is the role of Archiver [ARCn]?

ARCn is an oracle background process responsible for copying the entirely filled online redo log file to the archive log......... Read answer
Structural difference between bitmap and btree index in oracle.

Btree It is made of branch nodes and leaf nodes. Branch nodes holds prefix key value along with the link to the leaf node. The leaf node in turn........ Read answer
Can you explain how to convert oracle table data into excel sheet?

There are 2 ways to do so: 1. Simply use the migration wizard shipped with Oracle......... Read answer
When should we go for hash partitioning?

Scenarios for choosing hash partitioning: Not enough knowledge about how much data maps into a give range........... Read answer
What is Materialized view? What is a snapshot? What are the similarities and differences between Materialized views and snapshots?

A materialized view is a database object that contains the results of a query. A snapshot is similar to materialized view.......... Read answer
What are the advantages of running a database in NO archive log mode?

1. Less disk space is consumed 2. Causes database to freeze if disk gets full........ Read answer
What are the advantages of running a database in archive log mode?

It makes it possible to recover database even in case of disk failure............ Read answer
What is dba_segment in oracle?

DBA_SEGMENTS tells about the space allocated for all segments in the database for storage......... Read answer
What are the database objects in oracle?Explain them

Latest answer: Table: Composed of rows and column that stores data, View : Represents subset of data from one or more tables........... Read answer
Explain the difference between rowid and rownum.

Latest answer: RowId represents a row in a table internally. It can be used for fast access to the row. Rownum is a function of the result set........... Read answer.
What is a Tablespace?

Latest answer: Tablespaces is a logical storage unit. It is used to group related logical structures together........ Read answer
Components of logical database structure of Oracle database

Latest answer: Tablespaces, Database's schema objects.......... Read answer


What is the use of Data Dictionary in oracle?

Latest answer: Data Dictionary is used to store information about various physical and logical Oracle structures, e.g.Tables, Tablespaces, datafiles, etc......... Read answer

Explain how to assign a Tablespace to a user in Oracle. What are the Predefined Tablespaces in a database?

Latest answer: SYSTEM Tablespace, SYSAUX Tablespace, UNDO Tablespace, TEMP Tablespace......... Read answer
What are elements of database logical layers?

Latest answer: The logical layer of the database consists of the following elements:........... Read answer
What is Data-Dictionary Cache?

Latest answer: Data-Dictionary Cache keeps information about the logical and physical structure of the database.......... Read answer
Explain the characteristics of Data Files in oracle.

Latest answer: One or more data files form a logical unit of database storage called a tablespace........... Read answer
Define primary key and foreign key.

Latest answer: A column or combination of columns that identify a row of data in a table is Primary Key. A key in a table that identifies records in other table in called a foreign key........... Read answer
What are constraints?

Latest answer: It is the rules that prevent the invalid entry into the table. They are stored in the data dictionary. They can be defined either at column level or table level........... Read answer
Define referential integrity.

Latest answer: Referential integrity is the rules that governs the relationships between primary keys and foreign keys of the tables and ensure data consistency. It ensures the value of foreign key be............ Read answer
Purpose of using Nextval while creating the sequence.

NextVal gives you the available number in the sequence asked for.......... Read answer
What is forall Statement? Explain with an example

The FORALL binds input as a collection and sends them to the SQL engine for processing........... Read answer
What is flashback Query? Explain its uses with an example

Oracle Flashback Query allows users to see a consistent view of the database as it was at a point in the past.......... Read answer
What is the tablespace in Oracle? Purpose and significance

A tablespace is a logical container unit within an Oracle database. It does not exist physically on a filesystem,......... Read answer
How to use sequence and what use of sequence cache?

Seqences are often used to generate autonumber fields. A sequence is an object in Oracle used to create a number sequence,........... Read answer
Difference between formula column and place holder.

Difference between formula column and place holder.......... Read answer


How to create placeholder columns in oracle?

Steps to create placeholder columns: Click inside the container group at the position where you want the column to be placed............ Read answer
What is autonomous transaction?

Autonomous transactions have the ability to leave the context of calling transaction, then perform an independent transaction.......... Read answer
How to create LOV in Oracle forms?

List of Values(LOV) are used either when a selected list is too long and hence would not be appropriate for a drop down, but needs a search form to select the value........... Read answer
Which sql command to be used to get a print out from oracle?

PRINT: <variablename>....... Read answer


Explain how to DISABLE and ENABLE constraint.

Latest answer: Disable a constraint by using the DISABLE clause, Enable a constraint by using the ENABLE clause........... . Read answer
What are the different Levels of Auditing? Explain them

Latest answer: Statement Auditing, Privilege Auditing, and Object Auditing........... Read answer
Define Statement Auditing, Privilege Auditing and Object Auditing in oracle.

Latest answer: Statement auditing is the auditing of the powerful system privileges without regard to specifically named objects............. Read answer
What is a profile in oracle?

Latest answer: A profile is assigned to each database user that states its limitation on various system resources.......... Read answer
What dynamic data replication?

Latest answer: Dynamic data replication is the way in which updating or inserting records in remote database through database triggers............ Read answer
What is Two-Phase Commit?

Latest answer: Two-Phase Commit has two phases, a prepare phase and a commit phase.......... Read answer
Explain how to start a new transaction in Oracle.

Latest answer: Oracle server implicitly starts a new transaction with the following two conditions: The first executable statement of a new user session automatically starts a

new transaction............. Read answer


Explain how to end the current transaction in Oracle.

Latest answer: Following commands could be run to explicitly end the current transaction: COMMIT and ROLLBACK............ Read answer
Explain how save point works. Delete Vs TRUNCATE VS Drop

Latest answer: The DELETE command is used to remove some or all rows from a table. After performing a DELETE operation you need to COMMIT or ROLLBACK the transaction to make the............ Read answer
What is a READ WRITE transaction in Oracle?

Latest answer: The read consistency is set at the statement level in a READ WRITE transaction.............. Read answer
What are the system predefined user roles?

Latest answer: Oracle 10g XE comes with 3 predefined roles: CONNECT, RESOURCE, DBA............. Read answer
Explain the purpose of Rollback and commit statements.

Latest answer: Rollback and commit statement controls database transactions. Both statements ensure the data consistency. They allow users to preview the data before making permanent............ Read answer
What are internal user accounts in Oracle?

Latest answer: There are a few predefined accounts set by the System in Oracle........... Read answer
Describe how to revoke CREATE SESSION privilege from a user.

Latest answer: If a CREATE SESSION privilege has been taken from a user, then REVOKE can be used as follows:.......... Read answer

What is sql*loader parameters and where do we use it?

SQL Loader is used for the following: Load data across a network. Load data from multiple data files during a single load session......... Read answer
Explain how to see the report output in excel sheet in oracle applications.

It is a two step process: 1. Export Oracle Report to text file........... Read answer
Can we restore a Table that accidentally dropped? How?

An accidently dropped table can only be recovered from the backup. It is easier to recover tables in Oracle 10g........... Read answer
What is the use of Data Link in Reports?

Data links are used to establish parent-child relationships between queries.......... Read answer
What are the types of triggers available in Oracle Reports?

Types of triggers in Oracle reports: - 1 before parameter form 2 after parameter form............ Read answer
Describe the purpose of view in oracle

Latest answer: The purpose of views is defined below: Views hide data complexity, views add security by restricting access to the columns of a table........... Read answer
What is a dynamic performance view in Oracle?

Latest answer: The dynamic performance views are the views that get continuously updated even while the database is open or in use.......... Read answer
What are Group Functions in Oracle?

Latest answer: COUNT(), MIN(column_name), MAX(column_name), AVG(column_name)........ Read answer


WHERE clause vs HAVING clause.

Latest answer: HAVING clause is used with group function and it is written after GROUP BY clause. The WHERE clause is used when you want to specify a condition for columns........... Read answer
Function VS Procedure

Latest answer: A FUNCTION always returns a value using the return statement while a PROCEDURE may return one or more values through parameters or may not return at all........... Read answer
What is a union, intersect, minus?

Latest answer: UNION: Union operator is used to return all rows from multiple tables and eliminate duplicate rows. The number of columns and the datatypes of the columns must be identical in all............ Read answer
Explain the characteristics of function object in Oracle

Latest answer: A function can allow one or more or no parameter, a function must have explicit return statement, data type of the return value must be declared in the functions header.............. . Read answer
What are the triggers associated with image items? Explain them

There are 2 triggers associated with image items: When-Image-Activated: Triggered when image is double clicked......... Read answer
Explain how to view the status of the Rollback segment in oracle.

SELECT segment_name, status FROM sys.dba_rollback_segs;......... Read answer


What is the use of NOARCHIEVELOG parameter in oracle database?

On media failures while the database in NOARCHIVELOG mode, only database to the point of the most recent full database........... Read answer
What are the kinds of roles in oracle?

Latest answer: Connect: This role allows access to the table belonging to other users. It allows using Select, Insert, Update and Delete command......... Read answer
What are the privilege types?

Latest answer: The privileges can be of system or object level. SYSTEM level privileges can be assigned by the DBA and the object level privileges are assigned by the owner of the particular object.............. Read answer
Explain how to grant DML privilege on a table.

Latest answer: A system privilege is the right to perform an action on any schema objects of a particular type............... Read answer
What is the purpose of Indexes?

Latest answer: Oracle uses indexes to avoid the need for large-table, full-table scans and disk sorts, which are required when the SQL optimizer cannot find an efficient way to service the SQL......... Read answer
What is an initialization parameter file in Oracle?

Latest answer: The initialization parameter file contains a list of initialization parameters........ Read answer
What are layers in Oracle Architecture?

Latest answer: The Oracle database has a logical layer and a physical layer. The physical layer consists of the files that reside on the disk and logical layer map the data to these files of physical.......... Read answer
What is a static data dictionary in Oracle?

Latest answer: The information in data dictionary can be accessed through data dictionary views as they are not directly accessible............ Read answer
What is a database buffer cache?

Latest answer: Database buffer cache is a component of SGA. It has the responsibility to cache most recent accessed data. It keeps the transaction in the buffer cache till it is

written on the disk............ Read answer


Name the components of physical database structure of Oracle database. Explain them

Latest answer: Datafiles, Redo log files, Control files............. . . Read answer
What is pragma restrict_reference in oracle 9i? When do we use it?

Pragma restrict_reference is used to check for violations of any rules applied, at compile time. Its used in functions to obey some........ Read answer
Why can't we assign not null constraint as table level constraint in oracle?

Not NULL is a column level constraint to ensure that any value in that column is not null,........ Read answer
Explain the use of between page triggers in REPORTS.

The between-page trigger is used for creating conditional formatting, eg: retrieving information.......... Read answer
How to delete all duplicate records from a table using subquery?

Query: DELETE from table1 where rowid not in (select MAX(rowid) from table1 GROUP BY column_name);.......... Read answer
How many types of trigger can be used in a table at a time? What are they?

We can use maximum of 12 triggers on a table. BEFORE INSERT AFTER INSERT......... Read answer
What is partitioned table? What are its types? Explain its purpose and how to create.

Partitioning allows decomposing large tables and indexes into smaller manageable units called partitions......... Read answer
How the SMON process is used to write into LOG files?

The Shared Global Area is where SMON process runs. Once the redo log buffer is full........... Read answer
What are the types of calculated columns available? Explain them

In forms there are 2 types of calculated columns 1. formula column 2.summary column......... Read answer

When do you get a .PLL extension in oracle? Explain its importance


.PLL extension is created when we save a library module. It contains both source code and platform specific complied executable code.

What is the use of SYSTEM.EFFECTIVE.DATE variable in oracle?


It represents the effective database date.

Use of an integrity constraint is better to validate data. Explain


Use of an integrity constraint is better to validate data because it prevents invalid data entry at the basic level into the database tables.

Explain the function of optimizer in oracle.


The optimizer determines the most efficient way to execute a SQL statement based on the kind of data in the table and the statements fired to fetch that data like indexes, full table scans, loops, joins etc. Optimizers are also used to avoid excessive I/O resources.

What is meant by recursive hints in oracle?


Number of times a dictionary table is repeatedly called by various processes is known as recursive hint. It occurs because of the small size of data dictionary cache.

What are the limitations of a CHECK Constraint?


The limitation of CHECK is that the condition must be a Boolean expression evaluated using the values in the row being inserted or updated and can't contain sub queries.

Explain the use of ROWS option in IMP command.


It indicates whether or not the table rows should be imported.

Explain the use of INDEXES option in IMP command.


It determines whether indexes are imported.

Explain the use of GRANT option in IMP command.


GRANT specifies to import object grants.

Explain the use of IGNORE option in IMP command.


IGNORE defines how object creation errors should be handled.

Explain the use of SHOW option in IMP command.


When the value of show=y, the DDL within the export file is displayed.

What is the use of FILE option in IMP command?


FILE param defines the name of the export file to import. Multiple files can be listed, separated by commas.

Explain the use of LOG option in EXP command.


LOG specifies the log file to write messages.

What is hot backup and how it can be taken?


Hot backup is taking backup of archived log files when database is open. He ARCHIVELOG switch should be enabled for this to happen. Hot backup happens while the database is still being accessed by users and tables are being updated. It does not need the database to have a downtime.It includes the following:

Data files Archived log files Redo log files Control files

Steps to take a hot backup:


Enable ARCHIVE Log Change tablespace mode to begin backup Now create backup of your control file in Human Readable format Copy all your datafiles, redo logs and control file from your database server to backup location Copy database software $ORACLE_HOME from server to backup location

Copy Apps Middle tier all TOPs (APPL_TOP, COMMON_TOP, ORA_TOP)

What are the different kind of export backups?


Following are the different kinds of export backups:

Full/Complete backup: Backup of the whole database Incremental backup: Only backup the data that has been modified since last incremental backup Cumulative backup: Only affected tables from the last cumulative backup date

Difference between pre-select and pre-query


Pre-select This fires during the execute and count query processing after an oracle form builds the select statement to be executed, but before its execution Pre-query This fires before an oracle form issues the select statement. It executes before the preselect trigger.

Difference between open_form and call_form in oracle.


CALL_FORM: This runs a specified form while keeping the parent form active. This allows moving between the forms. Oracle forms run the new form with Run form preferences based on the parent form. When the called form exits, oracle forms resume the parent form along with its last state. Either of the forms can be hidden or displayed based on logic. OPEN_FORM: This executes the current form and executes the new specified form as a modal form. Oracle release the memory for the parent form and the new form is executed using the same Run form preferences as the parent form.

What are the different types of Record groups in oracle? Explain each of them
Record group is an internal oracle forms data structure having a similar column-row structure and relationship as a database table. They are logical groups and never displayed to the user as such. Various types of Record groups in oracle are:

Query record group: This record group is based on an attached SELECT query. Columns in this record group derive their default names, data types, length etc from the tables referred I the SELECT query. Static record group: This record group is not associated with any query. Their structure and values are defined at design time and thus remain fixed at run time. Non query record group: This record group also does not have an associated query. However, its structure and values can be defined during run time programmatically.

What is a trace file and how is it created in oracle?


Trace files are files used to store details of exceptions thrown by Oracle background processes i.e. dbwr, lgwr, pmon, smon etc. They are usually created for diagnostic dumps as well and help in debugging and solving exceptions in Oracle. To create a Trace file in oracle:

Set sql_trace=true with alter session command. This will generate a trace file for all sql commands issued by your user session. This is known as a level-1 trace file. One can also create super detailed level-4 trace files with additional details if the need be. These files are stored in the form $ORACLE_SID_ora_xxx.trc in the trace directory, where xxx is sequential number. To create a lelevl-4 detailed trace file, we need to know the SID and SERIAL# for the session to trace. Eg: to trace for session for SID 5: Connect system as sysdba; ORADEBUG SETOSPID 5; ORADEBUG EVENT 10046 TRACE NAME CONTEXT FOREVER, LEVEL 4

Explain the use of online redo log files in oracle.


Every Oracle database has a redo log, which records all changes that have been made in the data files. These files then enable us to replay the SQL Statements. Oracle writes all the changes to the redo log before making any changes in the data files. If something happens to any data file, a backed up data file is restored and the redo log helps in doing so. However, a database can only be recovered if it runs under Archive log mode.

Explain ENABLE NOVALIDATE constraint.


When a constraint has ENABLE NOVALIDATE state, all subsequent statements are checked for conformity to this constraint. A Table with this constraint can contain invalid data, however, it does not allow any further invalid data to be added to that table. Enabling this constraint is much faster than enabling and validating any other constraint. Also, it does not need any DML locks during validation with this constraint in place. Eg:

ALTER TABLE table1 ADD CONSTRAINT fk_table1_table2 FOREIGN KEY (table2_id) REFERENCES table2 (id) ENABLE NOVALIDATE;

Explain about data dictionary views with prefix USER_.


Data dictionary views with prefix USER_ :

Refer to users private environment in database i.e. including schema objects created by users, grants made by user, etc Display rows which are pertinent to the user only Have columns which are identical to other views but, column OWNER is implied Return a subset of information in the ALL VIEWS Can have abbreviated PUBLIC synonyms

How to create LOV dynamically at runtime & attach to text field?


Steps to create a dynamic LOV: 1. Create a record group, eg: RG 2. Create RG Sql query as Select col1,col2,col3 from dual; Keep in mind to adjust data types accordingly 3. Create an LOV and attach this RG to it Use SET_ITEM_PROPERTY to attach text field, dynamic LOV, and value, eg: SET_ITEM_PROPERTY(item_id, LOV_NAME, value);

How can we force the database to use the user specified rollback segment?
We can do so by using the following SQL statement SET TRANSACTION USE ROLLBACK SEGMENT User_Rollback_Segment_Name

Explain the use of CONSISTENT option in EXP command.


It specifies the read only statement for export to ensure data consistency.

Explain the use of ANALYSE option in EXP command.


It is a flag to indicate if the statistical information about the exported objects should be written to export dump file or not.

Explain the use of PARFILE option in EXP command.


It specifies the file that contains the export parameters.

Explain the use of PARFILE option in EXP command.


It specifies the file that contains the export parameters.

Explain the use of RECORD option in EXP command.


It is the flag that indicates if a record will be stored in data dictionary tables recording the export.

Explain the use of INCTYPE option in EXP command.


It specifies the type of export to be performed. It can be either COMPLETE, CUMULATIVE, INCREMENTAL.

Explain the use of RECORD LENGTH option in EXP command.


Specifies the length of the file record in bytes. This parameter affects the amount of data that accumulates before it is written to disk.

Explain the use of TABLES option in EXP command.


Indicates that the type of export is table-mode and lists the tables to be exported.

Explain the use of OWNER option in EXP command.


It tells that only the owners objects will be exported.

Explain the use of FULL option in EXP command.


It tells that the entire database is to be exported.

Explain the use of CONSTRAINTS option in EXP command.


It specifies whether table constraints should be exported with table data.

Explain the use of ROWS option in EXP command.


It is the condition to decide if the table rows should be exported or not.

Explain the use of INDEXES option in EXP command.


It determines whether index definitions are exported.

Explain the use of GRANT option in EXP command.


It specifies the object grants to export.

Explain the use of COMPRESS option in EXP command.


When Y, export will mark the table to be loaded as one extent for the import utility. If N, the current storage options defined for the table will be used.

Explain the use of FILE option in EXP command.


File parameter takes the name of the export file. Multiple files can be listed, separated by commas.

You might also like