Mid term & final- preparation- student-review(Oracle)
1. 1 ថនសារិ
Student Name :
I. Multiple Choice Question ( Please choose the correct answers. Ex: 1 a,...) (20pt)
1. Two structures make up an Oracle server: an instance and a database. Which of the following best
describes the difference between an Oracle instance and a database?
a. An instance consists of memory structures and processes, whereas a database is composed of
physical files.
b. An instance is used only during database creation; after that, the database is all that is needed.
c. An instance is started whenever the demands on the database are high, but the database is
used all the time.
d. An instance is configured using a pfile, whereas a database is configured using an spfile.
2. Which data dictionary view is used to view the current values of parameters?
a. V$DATABASE
b. V$SPPARAMETER
c. V$PARAMETER
d. V$SYSPARAMETER
3. Your database is not responding and is in a hung state. You want to shut down and start the
database to release all resources. Which statements would you use?
a. STARTUP AFTER SHUTDOWN
b. STARTUP FORCE
c. SHUTDOWN FORCE
d. SHUTDOWN ABORT and STARTUP
4. Which parameter is used to enable Automatic Memory Management?
a. AMM_TARGET
b. MEMORY_TARGET
c. SGA_TARGET
d. All of the above
5. Which statement about an index with the status UNUSABLE in DBA_INDEXES is true?
a. The index will be automatically fixed the next time it is used.
b. The Oracle optimizer throws an error when it tries to use the index.
c. The index must be recompiled using the ALTER INDEX…RECOMPILE statement.
d. The index must be reorganized using the ALTER INDEX…REBUILD statement before it can
be used again.
6. Suppose you have used EM Database Control to drill down into ADDM findings and have found
that a single SQL statement is causing the majority of I/O on your system. Which of the following
advisors is best suited to troubleshoot this SQL statement?
a. SQL Tuning Advisor
b. SQL Access Advisor
c. Both A and B
d. Neither A nor B
7. To enable the flashback database option, the database must be in which of the following modes?
a. NOARCHIVELOG mode
b. ARCHIVELOG mode
c. FLASHBACK LOG mode
d. BEGIN BACKUP mode
2. 2 ថនសារិ
8. When the database is in ARCHIVELOG mode, database recovery is possible up to which event or
time?
a. The last redo log file switch
b. The last checkpoint position
c. The last commit
d. The last incremental backup using RMAN
9. When should the DBA make a trace copy of the control file using ALTER DATABASE
BACKUP
CONTROLFILE TO TRACE?
a. After every backup
b. After multiplexing the control files
c. Whenever restarting the instance
d. Whenever the physical structure of the database changes
10. Which of the following statements enables the role user_admin in the current session?
a. alter session enable role user_admin;
b. alter session set role user_admin;
c. alter role user_admin enable;
d. set role user_admin;
11. Initialization parameter in an ASM instance specifies the disk groups to be automatically mounted
at instance startup
a. ASM_DISKMOUNT c. ASM_DISKSTRING
b. ASM_DISKGROUP d. ASM_MOUNTGROUP
12. Which background process coordinates the rebalance activity for disk groups?
a. ORBn c. RBAL
b. OSMB d. ASMn
13. Which type of database file is spread across all disks in a disk group?
a. All types of files are spread across all disks in the disk group.
b. Datafiles
c. Redo log files
d. Archived redo log files
e. Control files
14. You want to put a specific tablespace called MY_DATA in hot backup mode so you can back it
up. What command would you use?
a. alter tablespace MY_DATA begin backup;
b. alter tablespace MY_DATA start backup;
c. alter tablespace MY_DATA backup begin;
d. alter MY_DATA begin backup;
e. You cannot back up individual tablespaces.
15. What is the proper procedure to recover a lost tempfile?
a. Restore the backup copy of the tempfile from the backup media.
b. Re-create the tempfile with the create tempfile command.
c. Copy an existing tempfile from another database.
d. Re-create the tempfile with the create tablespace command.
e. Re-create the tempfile with the alter tablespace command.
16. Which is the correct command to back up the database, back up the archived redo logs, and then
remove the backed-up archived redo logs?
a. backup database
b. backup database and archivelogs
3. 3 ថនសារិ
c. backup database plus archivelogs
d. backup database plus archivelog delete input
e. backup database and archivelog delete input
17. Which type of backup backs up only data blocks modified since the most recent backup at the
same level or lower?
a. Differential incremental backup
b. Different incremental backup
c. Cumulative backup
d. Cumulative incremental backup
18. Which of the following Oracle features utilize the undo tablespace? (Choose all that apply)
a. Flashback Query d. Flashback Database
b. Flashback Drop e. Transaction Processing
c. Flashback Table f. Recycle Bin
19. Given the following steps, which would be the correct order to create a backup of an Oracle
database in ARCHIVELOG mode with control-file autobackups enabled?
a. backup archivelog all;
b. backup database all;
c. backup controlfile;
d. backup archivelog, database, controlfile delete input;
e. backup database plus archivelog delete input
20. Which command is used to configure RMAN to perform a compressed backup for every backup
executed.
a. Backup as compressed backupset database
b. Backup as compressed copy of database
c. Configure device type disk backup type to compressed backupset
d. Configure device type disk backup type compress
e. Backup database compress
II. Fill in the Gap (Please fill in the blank box with correct word. Ex: 1 IP address,..) (20pt)
1. Fill in the following SQL statements results in a disconnection after a session is idle for 45
minutes for profile name DBA_profile?
SQL > ALTER PROFIL DBA_Profile LIMIT idle_Reuse_Time 45;
2. Fill in the following SQL statements to multiplex control files using an spfile?
SQL > ALTER SYSTEM set CONTROL_FILES = ‘/u01/oradata/PRD/cntrl01.ctl’,
‘/u01/oradata/PRD/cntrl02.ctl’ scope=spfile;
3. Fill in following SQL statements limits attempts to guess passwords by locking an account after 5
failed logon attempts?
SQL> ALTER PROFILE DEFAULT LIMIT IDLE_TIME 5;
4. Fill in following SQL statement to increase undo_retention to 1 Day (24hour)
SQL > ALTER SYSTEM set undo_retention =1440;
5. Fill in following SQL statement to change the read/write tablespace INVENTORY to read only.
SQL > ALTER TABLESPACE Flights Read ONLY;
6. Configure RMAN to automatic backup controlfile.
RMAN> Configure controlfile AUTOBACKUP ON;
7. Using SQL*Plus to create PFILE parameter from SPFILE parameter.
SQL> Create pfile from spfile;
8. Using SQL*Plus to switch Redo Log (The current Redo log sequence number will be archived)
4. 4 ថនសារិ
SQL> Alter system SWITCH LOGFILE;
9. Using RMAN command to backup a database, archive log and still keep all the archivelog.
RMAN> Backup database PLUS ARCHIVELOG;
10. Using RMAN command to perform a level-1 incremental backup (include archivelog)
RMAN> Backup INCREMENTAL LEVEL 1 database plus archivelog delete input;
III. Problem Solving (30pt)
1. Your production database has some memory insufficent assigment to SGA portion and your
manager instruct you to dynamic memory allocation between SGA and PGA size. What database
parameter you should check and consider to make it change and which SQL statment you will
execute for the change request?
A. check SGA_Target and PGA_Aggreation parameter and combine together then compare with
its memory max size.
Ex:Memory max size is 6GB and SGA+PGA is 5GB then set memory target to 6GB=memory max
size
SQL>alter system set memory target=6GB scope=both;
2. Your database is up and running and then one of control files is accidentally deleted? What should
you do to bring up the database with both control files in ASM Diskgroups (+DATA & +FRA)
environment?
A. If control file are auto red in ASM disk groups, recovery options are as:
-Perform guided recovery using Enterprise Manager
-Put database in NOMOUNT mod and use an RMAN command to restore control file from
existing control file.
Ex:
3. If a data file is lost or corrupted, and if that file belongs to the SYSTEM or UNDO tablespace,
what activity need to perform to bring up the database?
A. The activity need to perform to bring up the database are:
-Mount the database
SQL>startup mount;
-Restore and recovery the missing data file
RMAN>restore database 1;
RMAN>recovery datafile 1;
-Open the database
RMAN>alter database open;
4. Please describe the procedure of instance recovery phase.
A. -Startup instance
-Roll forward(redo)
-Committed and uncommitted data in files
-Database opend
-Roll back(Undo)
-committed data in files
A. Oracle performs instance recovery when the database is restarted due to instance failure or shutdown
the database with ABORT option(shutdown abort) or startup the database with FORCE option(startup
force). Instance recovery is taken care by SMON oracle background process automatically. Instance
recovery consists of two steps. One is Roll forward, next is Roll backward.
Roll forward: Changes being made to the database are recorded in the database buffer cache and buffer
cache will be written into data files. At the same time, the changes are recorded in redo log buffer and
redo log buffer will be written to redo log file. Oracle writes the data from database buffer cache to data
5. 5 ថនសារិ
file only when there is enough data in data buffer cache. It is not necessary that, every commit, oracle
writes the data buffer cache into data file. When instance fails before committed data are written into
data files, Oracle uses the data recorded in the online redo log files to recover the lost data when the
associated database is re-started. This process is called Roll forward or cache recovery.
Roll backward: When we make any changes in the database, the old image will be written into undo
segment. Later undo segment will be used to roll back the data when we rollback the transaction. DBWR
writes the buffer cache content into data file under different circumstances. It might be possible to write
the uncommitted data from database buffer cache into data file. When instance fails and associated
database is restarted, it rollback the uncommitted transaction in data file by using undo segment to
maintain the read consistency. This is called Roll backward or transaction recovery.
5. Please Explain Undo Data Versus Redo Data?
Answer:
Undo Redo
Record of How to undo a change How to reproduce a change
Used for Rollback, Read-Consistency Rolling forward DB Changes
Stored in Undo segments Redo log files
Protects against Inconsistent reads in
multiuser systems
Data loss
IV.Answer the Question (30pt)
1. You have just been informed of suspicious activities in the HR.JOBS table in your production
database. The highest salaries seem to fluctuate in a strange way. You decide to enable standard
database auditing and monitor data manipulation language (DML) activities in this table and store
the audit_trail log in XML format.
What SQL statement you need to enable for database auditing (audit_trail) to XML log?
A. AUDIT_TRAIL = XML
What SQL statement you need to enable audit on table HR.JOBS for DML activities (delete, insert
& update)
2. Online backups known as inconsistent backups or hot backup and which database mode can the
online backup performs database backup?
A. NOARCHIVELOG mode
6. 6 ថនសារិ
3. What does Instance Failure referring to? Please explain in detail of instance failure means as soon
as it fails. If manual intervention is required then there may be a more serious problem that
prevents the instance from restarting, such as a memory CPU failure.
A. Instance Failure referring to error with your SQL Server. occurring when the instance shuts
down without synchronizing all the database files to the same system change number
(SCN),requiring a recovery operation the next time the instance is started. Many of the reasons
for an instance failure are out of your direct control, in these situation you can minimize the
impact of these failures by tuning instance recovery.
4. Your production database has crashed due to data file #1 belonging to the SYSTEM Tablespace is
media failure or data file #1 not found and your job as DBA is to restore back from last good
backup. What command (SQL and RMAN) need to be execute to bring up the database in open
mode?
A. command
SQL
SQL> STARTUP
RMAN
STARTUP FORCE MOUNT DBA PFILE=/tmp/initTRGT.ora;
5. What RMAN command use to backup database online with database archivelog file?
A. RMAN> BACKUP AS BACKUPSET DATABASE PLUS ARCHIVELOG;