Q61
Q61 What is a savepoint in Oracle Database?
A checkpoint for committing transactions
A mechanism to partially rollback transactions
A lock on a row
A data consistency tool
Q62
Q62 What is the difference between pessimistic and optimistic locking?
Pessimistic locking assumes no conflicts; optimistic assumes conflicts
Pessimistic locks data preemptively; optimistic locks on conflict detection
Both are the same
Neither use locks
Q63
Q63 Write a query to set a savepoint named "SP1" in a transaction.
SAVEPOINT SP1;
SET SAVEPOINT SP1;
BEGIN SAVEPOINT SP1;
CREATE SAVEPOINT SP1;
Q64
Q64 Write a query to roll back a transaction to savepoint "SP1."
ROLLBACK TO SP1;
ROLLBACK SAVEPOINT SP1;
ROLLBACK TRANSACTION SP1;
ROLLBACK SP1 TO SAVEPOINT;
Q65
Q65 Write a query to lock a specific table named "employees" for updates.
LOCK TABLE employees IN EXCLUSIVE MODE;
LOCK employees FOR UPDATE;
UPDATE employees LOCK MODE;
LOCK employees EXCLUSIVELY;
Q66
Q66 A transaction fails with "ORA-00060: deadlock detected." What could be the issue?
Missing COMMIT statement
Concurrent transactions causing circular dependency
Insufficient privileges
Incorrect syntax
Q67
Q67 A transaction does not commit changes. What is a possible reason?
Missing COMMIT statement
Database is in read-only mode
Transaction timeout
All of the above
Q68
Q68 A savepoint does not work during a transaction rollback. Why?
Savepoint was not created
Transaction already committed
Savepoint is not supported in the environment
Savepoint name is incorrect
Q69
Q69 What is the purpose of a database backup?
To optimize queries
To recover data in case of failure
To update tables
To generate reports
Q70
Q70 Which type of backup includes only the changes made since the last backup?
Incremental
Full
Differential
Cumulative
Q71
Q71 What is RMAN in Oracle?
A backup tool
A database monitoring tool
A query optimizer
A log analyzer
Q72
Q72 What is an archived redo log in Oracle?
A log of completed transactions
A backup of a table
A temporary file
A deleted log
Q73
Q73 What is the difference between hot and cold backups?
Hot backups require downtime; cold backups do not
Hot backups can be taken while the database is running; cold backups require the database to be offline
Cold backups are faster
Hot backups only work on full backups
Q74
Q74 Write an RMAN command to take a full database backup.
BACKUP DATABASE;
BACKUP DATABASE FULL;
BACKUP FULL DATABASE;
RMAN FULL BACKUP DATABASE;
Q75
Q75 Write an RMAN command to list all backups.
LIST BACKUPS;
SHOW BACKUPS;
DISPLAY BACKUPS;
LIST ALL BACKUPS;
Q76
Q76 Write a query to recover the database using RMAN.
RECOVER DATABASE;
RESTORE DATABASE;
RMAN DATABASE RECOVER;
START RECOVERY;
Q77
Q77 Write an RMAN command to restore a specific datafile.
RESTORE DATAFILE '/path/to/datafile';
RECOVER DATAFILE '/path/to/datafile';
RMAN RESTORE DATAFILE '/path/to/datafile';
RESTORE FILE '/path/to/datafile';
Q78
Q78 An RMAN backup fails with "ORA-19809: limit exceeded for recovery files." What is the probable cause?
Insufficient privileges
Backup location full
Incorrect syntax
Database is offline
Q79
Q79 A restore operation fails with "ORA-19573: cannot obtain exclusive enqueue for datafile." What could be the issue?
Datafile is online
Backup is corrupted
Database is in restricted mode
Log file is missing
Q80
Q80 A database recovery fails with "ORA-01547: error during recovery." What could be the cause?
Missing archived logs
Insufficient privileges
Corrupted backup
Incorrect recovery command
Q81
Q81 What is the purpose of performance tuning in Oracle Database?
To ensure data security
To optimize database performance
To back up data
To monitor user activity
Q82
Q82 Which component stores the execution plan for SQL statements in Oracle?
SGA
PGA
Library Cache
Data Buffer Cache
Q83
Q83 What is the function of the Oracle Optimizer?
To compile SQL code
To determine the most efficient execution plan
To allocate memory
To lock database resources
Q84
Q84 What is a SQL execution plan in Oracle?
A log of completed transactions
A set of steps to execute a SQL query
A storage mechanism
A backup process
Q85
Q85 What is the difference between a rule-based and a cost-based optimizer?
Rule-based uses heuristics; cost-based uses statistics
Rule-based uses indexes only; cost-based uses all resources
Both are the same
Cost-based ignores statistics
Q86
Q86 Write a query to gather statistics for the "employees" table.
EXEC DBMS_STATS.GATHER_TABLE_STATS('HR', 'employees');
ANALYZE TABLE employees COMPUTE STATISTICS;
UPDATE STATISTICS FOR employees;
GATHER STATISTICS FOR TABLE employees;
Q87
Q87 Write a query to display the execution plan for a SQL statement.
EXPLAIN PLAN FOR SELECT * FROM employees;
SHOW PLAN FOR SELECT * FROM employees;
EXECUTION PLAN FOR SELECT * FROM employees;
PLAN EXPLAIN SELECT * FROM employees;
Q88
Q88 Write a query to check the size of the buffer cache.
SELECT * FROM V$DB_CACHE_ADVICE;
SELECT * FROM V$BUFFER_SIZE;
SELECT SIZE FROM BUFFER_CACHE;
SELECT CACHE_SIZE FROM V$CACHE_INFO;
Q89
Q89 Write a query to enable tracing for a specific session.
EXEC DBMS_SESSION.SET_SQL_TRACE(TRUE);
ALTER SESSION TRACE ON;
ENABLE TRACE FOR SESSION;
SET TRACE FOR SESSION;
Q90
Q90 A query runs slower than expected. What could be the first step in debugging?
Check the execution plan
Rebuild indexes
Increase buffer cache size
Optimize the database schema