Oracle Database Interview Questions & Answers Set-3

1. What is a database instance?
Ans:  A database instance is a set of memory structure and background processes that access a set of database files. The processes can be shared by all of the users.

2. What are parameters?
Ans: Parameters provide a simple mechanism for defining and setting the valuesof inputs that are required by a form at startup. Form parameters are variables of type char,number,date that you define at design time.

3. What are the Different file extensions that are created by oracle reports?
Ans: Rep file and Rdf file.

4. What are Clusters?
Ans: Clusters are groups of one or more tables physically stores together to share common columns and are often used together.

5. What is difference between SUBSTR and INSTR?
Ans: INSTR function search string for sub-string and returns an integer indicating the position of the character in string that is the first character of this occurrence.SUBSTR function return a portion of string, beginning at character position, substring_length characters long SUBSTR calculates lengths using characters as defined by the input character set.

6. Define a view?
Ans: A view is a virtual table which is based on the one or more physical tables and views .

7. What is the difference between a view and a synonym?
Ans: Synonym is just a second name of table used for multiple link of database. View can be created with many tables, and with virtual columns and with conditions.But synonym can be on view.

8. What is the usage of SAVEPOINTS?
Ans: SAVEPOINTS are used to subdivide a transaction into smaller parts. It enables rolling back part of a transaction. Maximum of five save points are allowed.

Ans: A precompiler is a tool that allows programmers to embed SQL statements in high-level source programs like C, C++, COBOL, etc.The precompiler accepts the source program as input, translates the embedded SQL statements into standard Oracle runtime library calls, and generates a modified source program that one can compile, link and execute in the usual way.

10. When do you use WHERE clause and when do you use HAVING clause?
Ans: The WHERE condition lets you restrict the rows selected to those that satisfy one or more conditions.Use the HAVING clause to restrict the groups of returned rows to those groups for which the specified condition is TRUE.

11. What is the difference between rename and alias?
Ans: Rename is a permanent name given to a table or a column whereas Alias is a temporary name given to a table or column. Rename is nothing but replacement of name and Alias is an alternate name of the table or column.

12. How do we get field details of a table?
Ans: Describe <Table_Name> is used to get the field details of a specified table.

13. What is VArray?
Ans: VArray is an oracle data type used to have columns containing multivalued attributes and it can hold bounded array of values.

14. How do we create privileges in Oracle?
Ans: A privilege is nothing but right to execute an SQL query or to access another user object. Privilege can be given as system privilege or user privilege.

[sql]GRANT user1 TO user2 WITH MANAGER OPTION;[/sql]

15. What are temporal data types in Oracle?
Ans: Oracle provides following temporal data types:

  • Date Data Type – Different formats of Dates
  • TimeStamp Data Type – Different formats of Time Stamp
  • Interval Data Type – Interval between dates and tim