Oracle Database MCQ Banner

Oracle Database Multiple Choice Questions (MCQs) and Answers

Master Oracle Database with Practice MCQs. Explore our curated collection of Multiple Choice Questions. Ideal for placement and interview preparation, our questions range from basic to advanced, ensuring comprehensive coverage of Oracle Database concepts. Begin your placement preparation journey now!

Q61

Q61 What is a savepoint in Oracle Database?

A

A checkpoint for committing transactions

B

A mechanism to partially rollback transactions

C

A lock on a row

D

A data consistency tool

Q62

Q62 What is the difference between pessimistic and optimistic locking?

A

Pessimistic locking assumes no conflicts; optimistic assumes conflicts

B

Pessimistic locks data preemptively; optimistic locks on conflict detection

C

Both are the same

D

Neither use locks

Q63

Q63 Write a query to set a savepoint named "SP1" in a transaction.

A

SAVEPOINT SP1;

B

SET SAVEPOINT SP1;

C

BEGIN SAVEPOINT SP1;

D

CREATE SAVEPOINT SP1;

Q64

Q64 Write a query to roll back a transaction to savepoint "SP1."

A

ROLLBACK TO SP1;

B

ROLLBACK SAVEPOINT SP1;

C

ROLLBACK TRANSACTION SP1;

D

ROLLBACK SP1 TO SAVEPOINT;

Q65

Q65 Write a query to lock a specific table named "employees" for updates.

A

LOCK TABLE employees IN EXCLUSIVE MODE;

B

LOCK employees FOR UPDATE;

C

UPDATE employees LOCK MODE;

D

LOCK employees EXCLUSIVELY;

Q66

Q66 A transaction fails with "ORA-00060: deadlock detected." What could be the issue?

A

Missing COMMIT statement

B

Concurrent transactions causing circular dependency

C

Insufficient privileges

D

Incorrect syntax

Q67

Q67 A transaction does not commit changes. What is a possible reason?

A

Missing COMMIT statement

B

Database is in read-only mode

C

Transaction timeout

D

All of the above

Q68

Q68 A savepoint does not work during a transaction rollback. Why?

A

Savepoint was not created

B

Transaction already committed

C

Savepoint is not supported in the environment

D

Savepoint name is incorrect

Q69

Q69 What is the purpose of a database backup?

A

To optimize queries

B

To recover data in case of failure

C

To update tables

D

To generate reports

Q70

Q70 Which type of backup includes only the changes made since the last backup?

A

Incremental

B

Full

C

Differential

D

Cumulative

Q71

Q71 What is RMAN in Oracle?

A

A backup tool

B

A database monitoring tool

C

A query optimizer

D

A log analyzer

Q72

Q72 What is an archived redo log in Oracle?

A

A log of completed transactions

B

A backup of a table

C

A temporary file

D

A deleted log

Q73

Q73 What is the difference between hot and cold backups?

A

Hot backups require downtime; cold backups do not

B

Hot backups can be taken while the database is running; cold backups require the database to be offline

C

Cold backups are faster

D

Hot backups only work on full backups

Q74

Q74 Write an RMAN command to take a full database backup.

A

BACKUP DATABASE;

B

BACKUP DATABASE FULL;

C

BACKUP FULL DATABASE;

D

RMAN FULL BACKUP DATABASE;

Q75

Q75 Write an RMAN command to list all backups.

A

LIST BACKUPS;

B

SHOW BACKUPS;

C

DISPLAY BACKUPS;

D

LIST ALL BACKUPS;

Q76

Q76 Write a query to recover the database using RMAN.

A

RECOVER DATABASE;

B

RESTORE DATABASE;

C

RMAN DATABASE RECOVER;

D

START RECOVERY;

Q77

Q77 Write an RMAN command to restore a specific datafile.

A

RESTORE DATAFILE '/path/to/datafile';

B

RECOVER DATAFILE '/path/to/datafile';

C

RMAN RESTORE DATAFILE '/path/to/datafile';

D

RESTORE FILE '/path/to/datafile';

Q78

Q78 An RMAN backup fails with "ORA-19809: limit exceeded for recovery files." What is the probable cause?

A

Insufficient privileges

B

Backup location full

C

Incorrect syntax

D

Database is offline

Q79

Q79 A restore operation fails with "ORA-19573: cannot obtain exclusive enqueue for datafile." What could be the issue?

A

Datafile is online

B

Backup is corrupted

C

Database is in restricted mode

D

Log file is missing

Q80

Q80 A database recovery fails with "ORA-01547: error during recovery." What could be the cause?

A

Missing archived logs

B

Insufficient privileges

C

Corrupted backup

D

Incorrect recovery command

Q81

Q81 What is the purpose of performance tuning in Oracle Database?

A

To ensure data security

B

To optimize database performance

C

To back up data

D

To monitor user activity

Q82

Q82 Which component stores the execution plan for SQL statements in Oracle?

A

SGA

B

PGA

C

Library Cache

D

Data Buffer Cache

Q83

Q83 What is the function of the Oracle Optimizer?

A

To compile SQL code

B

To determine the most efficient execution plan

C

To allocate memory

D

To lock database resources

Q84

Q84 What is a SQL execution plan in Oracle?

A

A log of completed transactions

B

A set of steps to execute a SQL query

C

A storage mechanism

D

A backup process

Q85

Q85 What is the difference between a rule-based and a cost-based optimizer?

A

Rule-based uses heuristics; cost-based uses statistics

B

Rule-based uses indexes only; cost-based uses all resources

C

Both are the same

D

Cost-based ignores statistics

Q86

Q86 Write a query to gather statistics for the "employees" table.

A

EXEC DBMS_STATS.GATHER_TABLE_STATS('HR', 'employees');

B

ANALYZE TABLE employees COMPUTE STATISTICS;

C

UPDATE STATISTICS FOR employees;

D

GATHER STATISTICS FOR TABLE employees;

Q87

Q87 Write a query to display the execution plan for a SQL statement.

A

EXPLAIN PLAN FOR SELECT * FROM employees;

B

SHOW PLAN FOR SELECT * FROM employees;

C

EXECUTION PLAN FOR SELECT * FROM employees;

D

PLAN EXPLAIN SELECT * FROM employees;

Q88

Q88 Write a query to check the size of the buffer cache.

A

SELECT * FROM V$DB_CACHE_ADVICE;

B

SELECT * FROM V$BUFFER_SIZE;

C

SELECT SIZE FROM BUFFER_CACHE;

D

SELECT CACHE_SIZE FROM V$CACHE_INFO;

Q89

Q89 Write a query to enable tracing for a specific session.

A

EXEC DBMS_SESSION.SET_SQL_TRACE(TRUE);

B

ALTER SESSION TRACE ON;

C

ENABLE TRACE FOR SESSION;

D

SET TRACE FOR SESSION;

Q90

Q90 A query runs slower than expected. What could be the first step in debugging?

A

Check the execution plan

B

Rebuild indexes

C

Increase buffer cache size

D

Optimize the database schema

ad verticalad vertical
ad