- Posted on
- admin
- No Comments
Top 40 Oracle Database Interview Questions and Answers
1. What is Oracle Database?
Answer: Oracle Database is a relational database management system (RDBMS) developed by Oracle Corporation. It is widely used for storing, managing, and retrieving structured data efficiently.
2. What is the difference between Oracle Database and SQL?
Answer: SQL (Structured Query Language) is a language used to interact with databases, while Oracle Database is an RDBMS that supports SQL to manage data.
3. What are the key features of Oracle Database?
Answer:
Data Security
Scalability
High Availability
Data Integrity
Backup and Recovery
Performance Tuning
4. What is the difference between VARCHAR and VARCHAR2?
Answer:
VARCHAR: Stores variable-length character data with a maximum length of 2000 bytes.
VARCHAR2: Stores variable-length character data with a maximum length of 4000 bytes and is more efficient as it releases unused memory space.
5. What is an Oracle Tablespace?
Answer: Tablespace is a logical storage unit in Oracle Database that groups related logical structures like tables, indexes, and partitions.
6. What is the difference between Primary Key and Unique Key?
Answer:
Primary Key: Uniquely identifies each row in a table and cannot have NULL values.
Unique Key: Ensures all values in a column are unique but can have a single NULL value.
7. What is an Index in Oracle?
Answer: An index is a database object that improves the speed of data retrieval by creating a pointer to data in a table.
8. What is a View in Oracle?
Answer: A view is a virtual table based on the result of a SQL query that displays data from one or more tables.
9. What is a Synonym in Oracle?
Answer: A synonym is an alias for a table, view, sequence, or another database object to simplify SQL statements.
10. What is the difference between Delete, Truncate, and Drop commands?
Answer:
Delete: Removes specific rows from a table with the ability to rollback.
Truncate: Removes all rows from a table without the ability to rollback.
Drop: Removes the entire table along with its structure.
11. What is a Cursor in Oracle?
Answer: A cursor is a pointer that holds the result set of a query and allows row-by-row processing.
12. What is the difference between Implicit and Explicit Cursors?
Answer:
Implicit Cursor: Automatically created by Oracle for DML statements.
Explicit Cursor: Defined by the programmer to fetch data row-by-row from a query.
13. What is PL/SQL?
Answer: PL/SQL (Procedural Language for SQL) is Oracle’s procedural extension to SQL, allowing the creation of blocks, functions, and stored procedures.
14. What is a Trigger in Oracle?
Answer: A trigger is a stored procedure that automatically executes in response to certain events on a table or view.
15. What are the types of Triggers?
Answer:
Before Trigger
After Trigger
Instead of Trigger
Compound Trigger
16. What is the difference between Procedure and Function in PL/SQL?
Answer:
Procedure: Does not return a value but can return multiple OUT parameters.
Function: Returns a single value and can be used in SQL expressions.
17. What is a Package in Oracle?
Answer: A package is a collection of related PL/SQL procedures, functions, variables, and cursors grouped together.
18. What is Normalization?
Answer: Normalization is the process of organizing data to reduce redundancy and improve data integrity.
19. What is the difference between Char and Varchar2 data types?
Answer:
Char: Fixed-length data type (up to 2000 bytes).
Varchar2: Variable-length data type (up to 4000 bytes).
20. What is the difference between Commit, Rollback, and Savepoint?
Answer:
Commit: Saves all transactions permanently.
Rollback: Undoes all uncommitted transactions.
Savepoint: Sets a point to which a transaction can be rolled back.
21. What is a Sequence in Oracle?
Answer: A sequence is a database object used to generate unique numeric values automatically.
22. What is the difference between UNION and UNION ALL?
Answer:
UNION: Combines result sets and removes duplicates.
UNION ALL: Combines result sets without removing duplicates.
23. What is the difference between ROWNUM and ROW_NUMBER()?
Answer:
ROWNUM: Assigns a unique number to each row before sorting.
ROW_NUMBER(): Assigns a unique number to each row after sorting based on specified columns.
24. What is the difference between IN and EXISTS?
Answer:
IN: Checks if a value exists in a list of values.
EXISTS: Checks if a subquery returns any rows.
25. What is Partitioning in Oracle?
Answer: Partitioning divides a large table into smaller, manageable pieces to improve performance and manageability.
26. What is Oracle RAC?
Answer: Oracle Real Application Clusters (RAC) allows multiple servers to access a single database, providing high availability and scalability.
27. What is Data Guard in Oracle?
Answer: Oracle Data Guard provides disaster recovery and data protection by maintaining standby databases.
28. What is RMAN in Oracle?
Answer: Recovery Manager (RMAN) is a tool used for backup, restore, and recovery operations in Oracle Database.
29. What is the difference between Hot Backup and Cold Backup?
Answer:
Hot Backup: Performed while the database is running.
Cold Backup: Performed when the database is shut down.
30. What is Oracle ASM?
Answer: Oracle Automatic Storage Management (ASM) simplifies storage management by distributing data across disks.
31. What is Materialized View?
Answer: A materialized view stores the result of a query physically and updates periodically.
32. What is a Deadlock in Oracle?
Answer: A deadlock occurs when two or more transactions hold locks and each waits for the other to release the lock.
33. What is the difference between Grant and Revoke?
Answer:
Grant: Provides privileges to users.
Revoke: Removes previously granted privileges.
34. What is Oracle Grid Architecture?
Answer: Oracle Grid Architecture enables pooling of resources for better scalability and availability.
35. What is Oracle Data Pump?
Answer: Oracle Data Pump is a tool for fast data export and import.
36. What is Flashback Technology in Oracle?
Answer: Flashback technology allows users to view past states of database objects or recover data from accidental changes.
37. What is Oracle Audit Vault?
Answer: Oracle Audit Vault collects and monitors audit data to ensure data security and compliance.
38. What is the difference between Outer Join and Inner Join?
Answer:
Inner Join: Returns only matching rows.
Outer Join: Returns matching rows along with unmatched rows from one or both tables.
39. What is Oracle Multitenant Architecture?
Answer: Oracle Multitenant allows multiple pluggable databases (PDBs) to share a common container database (CDB), improving resource utilization and management.
40. What is Oracle GoldenGate?
Answer: Oracle GoldenGate is a replication tool for real-time data integration and migration.
Popular Courses