Oracle Database Interview Questions & Answers Set-7

«« Previous
Next »»

1. Difference between varchar and varchar2 data types?
Ans: Varchar can store upto 2000 bytes and varchar2 can store upto 4000 bytes. Varchar will occupy space for NULL values and Varchar2 will not occupy any space. Both are differed with respect to space.

2. In which language Oracle has been developed?
Ans: Oracle has been developed using C Language.

3. What is RAW datatype?
Ans: RAW datatype is used to store values in binary data format. The maximum size for a raw in a table in 32767 bytes.

4. What is the use of NVL function?
Ans: The NVL function is used to replace NULL values with another or given value. Example is –
NVL(Value, replace value)

5. Whether any commands are used for Months calculation? If so, What are they?
Ans: In Oracle, months_between function is used to find number of months between the given dates. Example is –

Months_between(Date 1, Date 2)

6. What are nested tables?
Ans: Nested table is a data type in Oracle which is used to support columns containing multi valued attributes. It also hold entire sub table.

7. What is COALESCE function?
Ans: COALESCE function is used to return the value which is set to be not null in the list. If all values in the list are null, then the coalesce function will return NULL.

Coalesce(value1, value2,value3,…)

8. What is BLOB datatype?
Ans: A BLOB data type is a varying length binary string which is used to store two gigabytes memory. Length should be specified in Bytes for BLOB.

9. How do we represent comments in Oracle?
Ans: Comments in Oracle can be represented in two ways –

  • Two dashes(–) before beginning of the line – Single statement
  • /*—— */ is used to represent it as comments for block of statement

10. What is DML?
Ans: Data Manipulation Language (DML) is used to access and manipulate data in the existing objects. DML statements are insert, select, update and delete and it won’t implicitly commit the current transaction.

11. In the Oracle version, what does each number shows?
Ans: Oracle version number refers:

  • 9 - Major database release number
  • 3 - Database maintenance release number
  • 0 - Application server release number
  • 5 - Component Specific release number
  • 0 - Platform Specific release number

12. What is bulk copy or BCP in Oracle?
Ans: Bulk copy or BCP in Oracle, is used to import or export data from tables and views but it does not copy structure of same data.

The main advantage of BCP is fast mechanism for coping data and you can also take the backup of data easily.

13. What is the relationship among database, tablespace and data file?
Ans: An Oracle database contains one or more logical storage units called tablespaces. These tablespaces collectively store whole data of databases and each tablespace in Oracle database consists of one or more files called datafiles. These datafiles are physical structure that confirm with the operating system in which Oracle is running.

14. What is a snapshot in Oracle database?
Ans: A snapshot is a replica of a target master table from a single point-in-time. In simple words you can say, snapshot is a copy of a table on a remote database.

15. What is the difference between hot backup and cold backup in Oracle? Tell about their benefits also.
1. Hot backup (Online Backup): A hot backup is also known as online backup because it is done while the database is active. Some sites can not shut down their database while making a backup copy, they are used for 24 hour a day, 7 days a week.

2. Cold backup (Offline Backup): A cold backup is also known as offline backup because it is done while the database has been shutdown using the SHUTDOWN normal command. If the database is suddenly shutdown with a uncertain condition it should be restarted with RESTRICT mode and then shutdown with NORMAL option.

For a complete cold backup the following files must be backed up.

All datafiles, All control files, All online redo log files(optional) and the init.ora file (you can recreate it manually).

«« Previous
Next »»