Oracle Questions
Oracle Questions
Oracle Questions
As an Oracle DBA, you must understand the concepts of Oracle architecture clearly. It is a basic
step or main point that you need before you go to manage your database. By this article, I will try
to share my knowledge about it. Hope it can be useful for you.
What is An Oracle Database?
Basically, there are two main components of Oracle database instance and database itself. An
instance consists of some memory structures and the background processes, whereas a database
refers to the disk resources. Figure 1 will show you the relationship.
2
Page
SGA is the primary memory structures. When Oracle DBAs talk about memory, they usually mean
the SGA. This area is broken into a few of part memory Buffer Cache, Shared Pool, Redo Log
Buffer, Large Pool, and Java Pool.
Buffer Cache
Buffer cache is used to stores the copies of data block that retrieved from datafiles. That is, when
user retrieves data from database, the data will be stored in buffer cache. Its size can be
manipulated via DB_CACHE_SIZE parameter in init.ora initialization parameter file.
Shared Pool
Shared pool is broken into two small part memories Library Cache and Dictionary Cache. The
library cache is used to stores information about the commonly used SQL and PL/SQL statements;
and is managed by a Least Recently Used (LRU) algorithm. It is also enables the sharing those
statemens among users. In the other hand, dictionary cache is used to stores information about
object definitions in the database, such as columns, tables, indexes, users, privileges, etc.
The shared pool size can be set via SHARED_POOL_SIZE parameter in init.ora initialization
parameter file.
Redo Log Buffer
Each DML statement (insert, update, and delete) executed by users will generates the redo entry.
What is a redo entry? It is an information about all data changes made by users. That redo entry
is stored in redo log buffer before it is written into the redo log files. To manipulate the size of
redo log buffer, you can use the LOG_BUFFER parameter in init.ora initialization parameter file.
Large Pool
Large pool is an optional area of memory in the SGA. It is used to relieves the burden place on the
shared pool. It is also used for I/O processes. The large pool size can be set by
LARGE_POOL_SIZE parameter in init.ora initialization parameter file.
Java Pool
As its name, Java pool is used to services parsing of the Java commands. Its size can be set by
JAVA_POOL_SIZE parameter in init.ora initialization parameter file.
Program Global Area
Although the result of SQL statemen parsing is stored in library cache, but the value of binding
variable will be stored in PGA. Why? Because it must be private or not be shared among users.
The PGA is also used for sort area.
Software Area Code
Software area code is a location in memory where the Oracle application software resides.
Oracle Background Processes
Oracle background processes is the processes behind the scene that work together with the
memories.
DBWn
Database writer (DBWn) process is used to write data from buffer cache into the datafiles.
Historically, the database writer is named DBWR. But since some of Oracle version allows us to
have more than one database writer, the name is changed to DBWn, where n value is a number 0
to 9.
LGWR
Log writer (LGWR) process is similar to DBWn. It writes the redo entries from redo log buffer into
the redo log files.
Page
CKPT
Checkpoint (CKPT) is a process to give a signal to DBWn to writes data in the buffer cache into
datafiles. It will also updates datafiles and control files header when log file switch occurs.
SMON
System Monitor (SMON) process is used to recover the system crach or instance failure by
applying the entries in the redo log files to the datafiles.
PMON
Process Monitor (PMON) process is used to clean up work after failed processes by rolling back the
transactions and releasing other resources.
Database
The database refers to disk resources, and is broken into two main structures Logical
structures and Physical structures.
Logical Structures
Oracle database is divided into smaller logical units to manage, store, and retrieve data
effeciently. The logical units are tablespace, segment, extent, and data block. Figure 3 will
illustrate the relationships between those units.
4
Page
Data Block
A data block is the smallest unit of storage in the Oracle database. The data block size is a specific number of
bytes within tablespace and it has the same number of bytes.
Physical Structures
The physical structures are structures of an Oracle database (in this case the disk files) that are not directly
manipulated by users. The physical structure consists of datafiles, redo log files, and control files.
Datafiles
A datafile is a file that correspondens with a tablespace. One datafile can be used by one tablespace, but one
tablespace can has more than one datafiles.
Redo Log Files
Redo log files are the files that store the redo entries generated by DML statements. It can be used for
recovery processes.
Control Files
Control files are used to store information about physical structure of database, such as datafiles size and
location, redo log files location, etc.
Page
21. Where RMAN keeps information of backups if you are using RMAN without Catalog?
22. You have taken a manual backup of a datafile using o/s. How RMAN will know about it?
23. You want to retain only last 3 backups of datafiles. How do you go for it in RMAN?
24. Which is more efficient Incremental Backups using RMAN or Incremental Export?
25. Can you start and shutdown DB using RMAN?
26. How do you recover from the loss of datafile if the DB is running in NOARCHIVELOG mode?
27. You loss one datafile and it does not contain important objects. The important objects are there in other datafiles which
are intact. How do you proceed in this situation?
28. You lost some datafiles and you don't have any full backup and the database was running in NOARCHIVELOG mode.
What you can do now?
29. How do you recover from the loss of datafile if the DB is running in ARCHIVELOG mode?
30. You loss one datafile and DB is running in ARCHIVELOG mode. You have full database backup of 1 week old and
partial backup of this datafile which is just 1 day old. From which backup should you restore this file?
31. You loss controlfile how do you recover from this?
32. The current logfile gets damaged. What you can do now?
33. What is a Complete Recovery?
34. What is Cancel Based, Time based and Change Based Recovery?
35. Some user has accidentally dropped one table and you realize this after two days. Can you recover this table if the DB is
running in ARCHIVELOG mode?
36. Do you have to restore Datafiles manually from backups if you are doing recovery using RMAN?
37. A database is running in ARCHIVELOG mode since last one month. A datafile is added to the database last week. Many
objects are created in this datafile. After one week this datafile gets damaged before you can take any backup. Now can you
recover this datafile when you don't have any backups?
38. How do you recover from the loss of a controlfile if you have backup of controlfile?
39. Only some blocks are damaged in a datafile. Can you just recover these blocks if you are using RMAN?
40. Some datafiles were there on a secondary disk and that disk has become damaged and it will take some days to get a
new disk. How will you recover from this situation?
41. Have you faced any emergency situation. Tell us how you resolved it?
42. At one time you lost parameter file accidentally and you don't have any backup. How you will recreate a new parameter
file with the parameters set to previous values.
58.USEFUL SQL COMMANDS FOR DBA'S
SQL QUERIES TO EXTRACT INFORMATION
1.List Tablespace Fragmentation Information.
SELECT tablespace_name,COUNT(*) AS fragments,
SUM(bytes) AS total,
MAX(bytes) AS largest
FROM dba_free_space
GROUP BY tablespace_name;
2.List Free and used space in database.
6
Page
7
Page
SELECT SEGMENT_NAME,TABLESPACE_NAME,OWNER,STATUS
FROM DBA_ROLLBACK_SEGS;
/* General Rollback Segment Information */
SELECT t1.name , t2.extents, t2.rssize, t2.optsize, t2.hwmsize, t2.xacts, t2.status
FROM v$rollname t1, v$rollstat t2
WHERE t2.usn = t1.usn ;
/* Rollback Segment Information - Active Sessions */
select t2.username, t1.xidusn, t1.ubafil, t1.ubablk, t2.used_ublk
from v$session t2, v$transaction t1
where t2.saddr = t1.ses_addr
8
Page
Glossary:
gets = # of requests for the item
getmisses = # of requests for items in cache which missed
Goal:
get rcratio to be less than 1
Tuning parm:
adjust SHARED_POOL_SIZE in the initxx.ora file, increasing by small increments
SELECT SUM(GETS) HITS,
SUM(GETMISSES) LIBMISS,
SUM(GETMISSES)/SUM(GETS) RCRATIO
FROM V$ROWCACHE ;
18. Tuning: buffer cache
Calculation:
buffer cache hit ratio = 1 - (phy reads/(db_block_gets + consistent_gets))
Goal:
get hit ratio in the range 85 - 90%
Tuning parm:
adjust DB_BLOCK_BUFFERS in the initxx.ora file, increasing by small increments
SELECT NAME, VALUE
FROM V$SYSSTAT WHERE NAME IN
('DB BLOCK GETS','CONSISTENT GETS','PHYSICAL READS');
9
Page
SELECT CLASS,COUNT
FROM V$WAITSTAT
WHERE CLASS LIKE '%UNDO%' ;
22. Archive Log Mode Status
/* Status of Archive Log Subsystem */
ARCHIVE LOG LIST
/* log mode of databases */
SELECT name, log_mode FROM v$database;
/* log mode of instance */
SELECT archiver FROM v$instance;
23. List log file information
These queries list the status / locations of the redo log files.
10
Page
--=================================================
--- proc_ora_monitor
--- parm1: username to count
-- parm2: number of loops, 5 sec duration
-----=================================================
set serveroutput on ;
create or replace procedure
proc_ora_monitor ( user1 in varchar, reps1 in integer )is
i number ;
usercount1 number ;
memory1 number ;
date1 varchar(20) ;
msg varchar(99) ;
begin
i := 0 ;
while ( i <> ' || to_char(SYSDATE, 'HH:MM:SS PM');
select count(1)
into usercount1
from sys.v_$session
where username = user1 ;
msg := msg || ', ' || user1 || ': ' || usercount1 ;
select round(sum(bytes)/1024/1024 ,2)
into memory1
from sys.v_$sgastat
where pool = 'shared pool' and
name = 'free memory' ;
msg := msg || ', free mb = ' || memory1 ;
select round(sum(bytes)/1024/1024 ,2)
into memory1
from sys.v_$sgastat
where pool = 'shared pool' and
name = 'processes' ;
msg := msg || ', processes mb = ' || memory1 ;
dbms_output.put_line(msg) ;
dbms_lock.sleep(5) ;
i := i + 1 ;
end loop ;
end;
/
show errors ;
execute proc_ora_monitor('SILVERUSER',2) ;
exit
25. List Space Allocated by Table
11
Page
For partitioned tables, you may see more than one tablespace
assigned to the table name. Note that phantom usage will appear,
if the recycle bin (10g only) is not cleared.
12
Page
exit
/
6.DBA-BASIC QUESTIONS
4. What does a user need to be able to create objects such as tables, procedures, sequences
etc in the database.
A user must be granted the required system privileges by the DBA in order to create objects in the database. Without the privilege a user
will be displayed an "insufficient privileges" error.
7. For client-server connectivity to work, which process must be started on the server side for
a remote client connection such as " connect scott/tiger@sales " to work.
The process that must be started on the server side to listen for incoming client connection requests in the listener process. The listener
should be started and listening on behalf of certain databases.
8. When creating a user what does the DEFAULT TABLESPACE clause indicate?
The default tablespace for a user, is the tablespace in which all objects created by the user will reside in. That is, when a user creates say a
table without mentioning explicitly the tablespace in which it must be created, the table will automatically be in the default tablespace
assigned to the user.
13
Page
10. What command can you issue, to permanently delete the data from a table, without
having the ability to rollback the action.
The command that permanently deletes a table without giving you the ability to rollback is the TRUNCATE TABLE command. This is a
Data Definition Language command that cannot be undone.
12.Why is it necessary and important to analyze tables? How has analyzing become simpler
in Oracle 10g?
Analyzing is the process of generating statistics on objects of the database. Statistics help the optimizer in determining optimal execution
plans. In Oracle 10g, statistics gathering is automatically performed by Scheduler. A scheduled job is performed by the scheduler every
night and during the weekends.
Page
14
17.What is a segment?
A segment is an object of the database. A segment can be a data segment, undo segment, temporary segment, undo segment , LOB
segment etc. Segments are created in a tablespace and are part of a users schema.
18.What is the meant by tablespaces with a non-standard blocksize? Name one purpose for
this functionality.
A tablespace whose block size is different from the default blocksize for the database (defined by the DB_BLOCK_SIZE initialization
parameter) is called a tablespace of non-standard block size. To be able to create such a tablespace, you must configure a corresponding
buffer pool to hold the blocks that are read from the objects of this tablespace. The tablespace is created with a non-standard block size
using the BLOCKSIZE keyword. The feature was introduced to facilitate the transportable tablespace features that allows the movement
of tablespaces across databases.
Page
15
44.If you make a tablespace offline immediate and that particular redo log get corrupted, will it affect the procedure to make that
tablespace online?
45.Is it possible to make system and temporary tablespace with non-standard blocksize?
46.How will you list all the tablespaces and their status in a database?
47.If you are given a database,how will you know whether it is locally managed or dictionary managed?
48.If you are given a databse,how will you know how many datafiles each tablespace contain?
49.How will you know which temporaray tablepsace is allocated to which user?
50.Write two parameters you have to give to make OMF dadafiles and logfiles in a database?
51.What is the common column between dba_tablespaces and dba_datafiles?
16
Page
The speed of computing might be wasting valuable human time (users waiting for response);
Enable your system to keep-up with the speed business is conducted; and
Optimize hardware usage to save money (companies are spending millions on hardware).
Although this site is not overly concerned with hardware issues, one needs to remember than you cannot tune a Buick into a Ferrari.
Application Tuning:
Experience showed that approximately 80% of all Oracle system performance problems are resolved by coding optimal SQL. Also
consider proper scheduling of batch tasks after peak working hours.
Memory Tuning:
Properly size your database buffers (shared_pool, buffer cache, log buffer, etc) by looking at your wait events, buffer hit ratios, system
swapping and paging, etc. You may also want to pin large objects into memory to prevent frequent reloads.
17
Page
Tkprof
statspack
Which tables are currently analyzed? Were they previously analyzed? (ie. Was the query using RBO and now CBO?)
Have the tables been re-analyzed? Were the tables analyzed using estimate or compute? If estimate, what percentage was used?
Page
18
What do you think the plan should be? Run the query with hints to see if this produces the required performance.
It can also happen because of a very high high water mark. Typically when a table was big, but now only contains a couple of records.
Oracle still needs to scan through all the blocks to see it they contain data.
19
Page
To reset the values in the v$object_usage view, disable index monitoring and re-enable it:
ALTER INDEX indexname NOMONITORING USAGE;
ALTER INDEX indexname MONITORING USAGE;
USER_TAB_COLUMNS.NUM_DISTINCT - This column defines the number of distinct values the column holds.
USER_INDEXES.CLUSTERING_FACTOR - This defines how ordered the rows are in the index. If CLUSTERING_FACTOR
approaches the number of blocks in the table, the rows are ordered. If it approaches the number of rows in the table, the rows are
randomly ordered. In such a case, it is unlikely that index entries in the same leaf block will point to rows in the same data blocks.
Decrease the INIT.ORA parameter DB_FILE_MULTIBLOCK_READ_COUNT - A higher value will make the cost of a FULL
TABLE SCAN cheaper.
Remember that you MUST supply the leading column of an index, for the index to be used (unless you use a FAST FULL SCAN or SKIP
SCANNING).
There are many other factors that affect the cost, but sometimes the above can help to show why an index is not being used by the CBO. If
from checking the above you still feel that the query should be using an index, try specifying an index hint. Obtain an explain plan of the
query either using TKPROF with TIMED_STATISTICS, so that one can see the CPU utilization, or with AUTOTRACE to see the
statistics. Compare this to the explain plan when not using an index.
db file sequential read: Tune SQL to do less I/O. Make sure all objects are analyzed. Redistribute I/O across disks.
buffer busy waits: Increase DB_CACHE_SIZE (DB_BLOCK_BUFFERS prior to 9i)/ Analyze contention from SYS.V$BH
log buffer space: Increase LOG_BUFFER parameter or move log files to faster disks
log file sync: If this event is in the top 5, you are committing too often (talk to your developers)
Page
20
log file parallel write: deals with flushing out the redo log buffer to disk. Your disks may be too slow or you have an I/O
bottleneck.
Page
21
When a transaction is committed, info in the redo log buffer is written to a Redo Log File. In addition to this, the following conditions will
trigger LGWR to write the contents of the log buffer to disk:
Every 3 seconds; or
Statistic "REDO BUFFER ALLOCATION RETRIES" shows the number of times a user process waited for space in the redo log buffer.
This value is cumulative, so monitor it over a period of time while your application is running. If this value is continuously increasing,
consider increasing your LOG_BUFFER (but only if you do not see checkpointing and archiving problems).
"REDO LOG SPACE WAIT TIME" shows cumulative time (in 10s of milliseconds) waited by all processes waiting for space in the log
buffer. If this value is low, your log buffer size is most likely adequate.
22
Page
23
Page
8. From RMAN
9. Recreate the redo logs as before. See step 8: Do the following maintenance in the above. .
Page
24
13. mv - In the first synopsis form, the mv utility moves the file named by the source operand to the destination specified by the
"target_file". Source and "target_file" may not have the same name.
14. cp - The cp utility will copy the contents of source_file to the destination path named by "target_file".
15. rm - The rm utility removes the directory entry specified by each file argument.
16. rmdir - The rm utility removes the directory entry specified by each file argument.
17. chmod - change the permission of a file.
Ex: chmod +x tempfile (add execute permission)
chmod u+x tempfile (add execute for user only)
chmod 6755 oracle (set the setuid bit on)
18. grep - The grep utility searches files for a pattern and prints all lines that contain that pattern. It uses a compact nondeterministic algorithm.
19. find - search for files.
Ex: find . -name sqlplus -print (find the full pathname of sqlplus starting from the current directory)
find . -name '*sql*' -print (find the full pathname of file where 'sql' is in its name)
20. wc - The wc utility reads one or more input files and, by default, writes the number of newline characters, words and
bytes contained in each input file to the standard output.
21. ps - The ps command prints information about active processes.Without options, ps prints information about processes associated with
the controlling terminal.
22. kill - send a signal to terminate a process.
Ex: kill -9 (signal will always be caught)
23. id - If no user operand is provided, the id utility will write the user and group IDs and the corresponding user and group
names of the invoking process to standard output:
$ id
uid=1017(oracle7) gid=101(dba)
24. df - The df command displays the amount of disk space occupied by mounted or unmounted file systems, directories, or mounted
resources, the amount of used and available space, and how much of the file system's total capacity has been used.
$ df
/ (/dev/md/dsk/d0 ): 1816668 blocks 1683304 files
/proc (/proc ): 0 blocks 3721 files
25
Page
25. du - The du utility writes to standard output the size of the file space allocated to, and the size of the file space allocated to each
subdirectory of, the file hierarchy rooted in each of the specified files.
$ du
214 ./oravw/install
216 ./oravw
26. lpr - The lpr utility submits print requests to a destination.
lpr prints files (file) and associated information,collectively called a print request.
27. uname - The uname utility prints information about the current system on the standard output. When options are specified, symbols
representing one or more system characteristics will be written to the standard output.
Ex. uname -a (list all info) SunOS supsunm3 5.6 Generic_105181-08 sun4u sparc SUNW,Ultra-5_10
28. nm - The nm utility displays the symbol table of each ELF object file that is specified by file.
29. ar - The ar utility maintains groups of files combined into a single archive file. Its main use is to create and update library files.
/usr/ccs/bin/ar -d [ -Vv ] archive file...
/usr/ccs/bin/ar -m [ -abiVv ] [ posname ] archive file...
/usr/ccs/bin/ar -p [ -sVv ] archive [file...]
/usr/ccs/bin/ar -q [ -cVv ] archive file...
/usr/ccs/bin/ar -r [ -abciuVv ] [ posname ] archive file...
/usr/ccs/bin/ar -t [ -sVv ] archive [file...]
/usr/ccs/bin/ar -x [ -CsTVv ] archive [file...]
30. ipcs - The utility ipcs prints information about active interprocess communication facilities. The information that is displayed is
controlled by the options supplied.
-m Print information about active shared memory segments.
-q Print information about active message queues.
-s Print information about active semaphores.
31. ipcrm - ipcrm removes one or more messages, semaphores or shared memory identifiers.
-m shmid Remove the shared memory identifier shmid from the system. The shared memory segment and data structure associated with it
are destroyed after the last detach.
Page
26
-q msqid Remove the message queue identifier msqid from the system and destroy the message queue and data structure associated with
it.
-s semid Remove the semaphore identifier semid from the system and destroy the set of semaphores and data structure associated with it.
32. chown - The chown utility will set the user ID of the file named by each file to the user ID specified by owner and, optionally,
will set the group ID to that specified by group.
33. chgrp - The chgrp utility will set the group ID of the file named by each file operand to the group ID specified by the group
operand.
34. newgrp - The newgrp command logs a user into a new group by changing a user's real and effective group ID. The user remains
logged in and the current directory is unchanged.
Ex: newgrp dba (switch group to dba)
35. file - The file utility performs a series of tests on each file supplied by file and, optionally, on each file listed in ffile in an attempt to
classify it.
36. ln - the ln utility creates a new directory entry (link) for the file specified by source_file at the destination path specified by target. If
target is not specified, the link is made in the current directory.
37. su - su allows one to become another user without logging off. The default user name is root (super user).
38. dd - dd copies the specified input file to the specified output with possible conversions. The standard input and output are used by
default.
Ex: dd if=myfile of=newfile conv=ucase (converts to uppercase)
39. diff - The diff utility will compare the contents of file1 and
file2 and write to standard output a list of changes necessary to convert file1 into file2.
40. umask - The umask utility sets the file mode creation mask of the current shell execution environment to the value specified by the
mask operand. This mask affects the initial value of the file permission bits of subsequently created files. If umask is called in a subshell
or separate utility execution environment, such as one of the following:
(umask 002)
nohup umask ...
find . -exec umask ...
it does not affect the file mode creation mask of the caller's environment.
41. stty - The stty command sets certain terminal I/O options for the device that is the current standard input; without arguments, it reports
the settings of certain options.
Ex:
$ stty
speed 38400 baud; -parity
27
Page
swtch = ;
42. tty - The tty utility writes to the standard output the name of the terminal that is open as standard input. The name that is used is
equivalent to the string that would be returned by the ttyname(3C) function.
Ex: tty
/dev/pts/0
43. cpio - The cpio command copies files into and out from a cpio archive. The cpio archive may span multiple volumes. The
-i, -o, and -p options select the action to be performed.
Ex: cpio -icBdvmu < /dev/rmt0
44. tar - The tar command archives and extracts files to and from a single file called a tarfile. A tarfile is usually a magnetic tape, but it can
be any file. tar's actions are controlled by the key argument. The key is a string of characters containing exactly one function letter (c, r, t ,
u, or x) and zero or more function modifiers (letters or digits), depending on the function letter used.
Ex: tar xvt /dev/rmt0
45. telnet - telnet communicates with another host using the TELNET protocol. If telnet is invoked without arguments, it enters command
mode, indicated by its prompt telnet>. In this mode, it accepts and executes its associated commands.
46. rlogin - rlogin establishes a remote login session from your terminal to the remote machine named hostname.
47. echo - The echo utility writes its arguments, separated by BLANKs and terminated by a NEWLINE, to the standard output. If there
are no arguments, only the NEWLINE character will be written.
48. ulimit - (att) - The ulimit utility sets or reports the file-size writing limit imposed on files written by the shell and its child processes
(files of any size may be read). Only a process with appropriate privileges can increase the limit.
49. vmstat - vmstat delves into the system and reports certain statistics kept about process, virtual memory, disk, trap and CPU activity.
NOTE: vmstat statistics are only supported for certain devices.
50. make - this is a command generator. All executables used in ORACLE are generated from makefiles. The make utility executes a list
of shell commands associated with each target, typically to create or update a file of the same name. makefile contains entries that
describe how to bring a target up to date with respect to those on which it depends, which are called dependencies. Since each dependency
is a target, it may have dependencies of its own.
51. env - The env utility obtains the current environment, modifies it according to its arguments, then invokes the utility named by the
utility operand with the modified environment.
53. logname - The logname utility will write the user's login name to standard output.
54. swap -l swap provides a method of adding, deleting, and monitoring the system swap areas used by the memory manager. Use the
commands listed below for the associated operating system:
SUN Solaris #/usr/sbin/swap -l
HP 9000 Series HP-UX # /etc/swapinfo
28
Page
55. whatis (/usr/ucb/whatis) commands -> looks up one or more commands in the on-line man pages, and display a brief description. i.e
$ whatis man
man man (1) - find and display reference manual pages
man man (5) - macros to format Reference Manual pages
56. bfs [option] file -> big file scanner. Read a large file, using ed-like sysntax. Files can be up to 1024 KB.
57. hostname - The hostname command prints the name of the current host, as given before the login prompt. The superuser can set the
hostname by giving an argument.
58. hostid - The hostid command prints the identifier of the current host in hexadecimal. This numeric value is likely to differ when hostid
is run on a different machine.
59. nohup - The nohup utility invokes the named command with the arguments supplied. When the command is invoked, nohup arranges
for the SIGHUP signal to be ignored by the process. The nohup utility can be used when it is known that command will take a long time
to run and the user wants to logout of the terminal; when a shell exits, the system sends its children SIGHUP signals, which by default
cause them to be killed. All stopped, running, and background jobs will ignore SIGHUP and continue running, if their invocation is
preceded by the nohup command or if the process programmatically has chosen to ignore SIGHUP.
60. pg - The pg command is a filter that allows the examination of filenames one screenful at a time on a CRT. If the user types a
RETURN, another page is displayed; other possibilities are listed below.
61. printenv - printenv prints out the values of the variables in the environment. If a variable is specified, only its value is printed.
62. rwho - The rwho command produces output similar to who(1), but for all machines on your network. If no report has been received
from a machine for 5 minutes, rwho assumes the machine is down, and does not report users last known to be logged into that machine
63 sed - The sed utility is a stream editor that reads one or more text files, makes editing changes according to a script of editing
commands, and writes the results to standard output
-e script script is an edit command for sed. See USAGE below for more information on the format of script. If there is just one -e option
and no -f options, the flag -e may be omitted.
-f script_file Take the script from script_file.
script_file consists of editing commands, one per line.
-n Suppress the default output.
64. talk - The talk utility is a two-way, screen-oriented communication program. When first invoked, talk sends a message similar to:
Message from TalkDaemon@ her_machine at time...
talk: connection requested by your_address
talk: respond with: talk your_address to the specified address. At this point, the recipient of the message can reply by typing:
65. uptime - The uptime command prints the current time, the length of time the system has been up, and the average number of jobs in
the run queue over the last 1, 5 and 15 minutes.
29
Page
example% uptime
66. vi - vi (visual) is a display-oriented text editor based on an underlying line editor ex. It is possible to use the command mode of ex
from within vi and to use the command mode of vi from within ex.
67. which - which takes a list of names and looks for the files which would be executed had these names been given as commands.Each
argument is expanded if it is aliased, and searched for along the user's path. Both aliases and path are taken from the user's .cshrc file
Ex: $ which svrmgrl
/u01/app/oracle/product/7.3/bin/svrmgrl
68. shutdown - shutdown is executed by the super-user to change the state of the machine. In most cases, it is used to change from the
multi-user state (state 2) to another state. By default, shutdown brings the system to a state where only the console has access to the
operating system. This state is called single-user.
69. reboot - reboot restarts the kernel. The kernel is loaded into memory by the PROM monitor, which transfers control to the loaded
kernel. Although reboot can be run by the super-user at any time, shutdown(1M) is normally used first to warn all users logged in of the
impending loss of service.
70. init is a general process spawner. Its primary role is to create processes from information stored in the file /etc/inittab.
7.BACKUP-SCENARIOS
Page
30
Problem : The disk crashed and one of the datafiles was lost. In this case, the data file belonged to a
temporary tablespace.
Solution : The TEMPORARY tablespace is used by Oracle to do the intermediate work while executing
certain commands, that require sorting of data. If no permanent objects are stored in this datafile, it is okay
to drop the datafile and start up the database. To drop the datafile, you need to use the
'ALTER DATABASE DATAFILE datafilename OFFLINE DROP;
Note that after opening the database, the tablespace is online but the data file is offline. Any other data files
that belong to this tablespace are online and can be used. Oracle re-commends re-creating the tablespace.
Simulation :
SQL> connect internal
SQL> startup mount;
SQL> archive log list;
SQL> alter database noarchivelog;
SQL> alter database open;
SQL> alter system switch logfile;
SQL> alter system switch logfile;
SQL> shutdown abort;
SQL> host rm /home/oracle/orahome1/oradata/ora1/temp.dbf (deleting a file to simulate a loss)
SQL>startup mount;
SQL> alter database open;
ORA-01157 :cannot identify data file 6 : file not found
ORA-01110 :datafile 6 : '/home/oracle/orahome1/oradata/ora1/temp.dbf'
SQL> alter database datafile '/home/oracle/orahome1/oradata/ora1/temp.dbf' offline;
ORA-01145: offline immediate disallowed unless media recovery is enabled (this option can be used only
in ARCHIVELOG mode)
SQL> alter database datafile '/home/oracle/orahome1/oradata/ora1/temp.dbf' offline drop;
SQL> alter database open;
31
CASE 3:
Page
Scenario : Moe is the DBA of a real-time call-tracking system. He uses Oracle 8.1.7 on a VAX/VMS system
and takes an online backup of the database every night.
(Which mode of the database would he be running in ?) The total database size is 50GB and the real-time
call tracking system is a heavy OLTP system primarily with the maximum activity between 9 a.m and 9
p.m., everyday. At 9 p.m. a batch job runs a command procedure that puts the tablespaces in hot backup
mode, takes the backup of all the data files to tape at the operating system level, and then issues the alter
tablespace end backup command.
Problem: One afternoon a disk crashed, losing the SYSTEM tablespace residing on the disk. As this
happened at the peak processing time, Moe had to keep the down time to a minimum and open the database
as soon as possible. He wanted to start the database first and then restore the datafile that was lost, so he
took the SYSTEM data file offline. When he tried to open the database he got the following error:
ORA-01147 : SYSTEM tablespace file 1 is offline
How would you solve this problem.
Solution : The only solution here is to restore the SYSTEM datafile from the night's online backup, and then
perform database recovery. Note that if a disk crash has damaged several data files then all the damaged
data files need to be restored from the online backup. The database needs to be mounted and the RECOVER
DATABASE command issued before it could be opened.
CASE 4 :
Scenario : Use the same scenario for Case 3 again.
Problem : Let's assume that instead of a system data file, a non-system data file is lost due to the disk crash.
We also assume that this data file doesn't contain any active rollback segments.
Simulation:
SQL> connect internal
SQL> create table case4 ( c1 number) tablespace users;
SQL> insert into case4 values (3);
SQL> insert into case4 values(3);
SQL> commit;
SQL> alter system switch logfile;
SQL> host rm /home/oracle/orahome1/oradata/ora1/users01.dbf
SQL> shutdown abort;
Identify three ways in which you could solve this problem.
32
How do you determine when to use data file recovery versus tablespace recovery?
Page
Solution : When a non-system data file is lost, there are three methods by which the data file can be
recovered.
a) The RECOVER DATABASE command can be used. This requires the database to be mounted, but not
open, which means offline recovery needs to be recovered.
SQL> host cp /home/oracle/backup/users01.dbf /home/oracle/orahome1/oradata/ora1/users01.dbf
SQL>startup open
ORA-01113 file 4 needs media recovery
SQL> startup mount;
SQL> recover database;
SQL> alter database open;
SQL> select * from case4;
b) The second method, is to use the RECOVER DATABASE command.
Here the datafile needs to be offline but the database can be open ormounted.
SQL> host cp /home/oracle/backup/users01.dbf /home/oracle/orahome1/oradata/ora1/users01.dbf
SQL>startup open
ORA-01113 file 4 needs media recovery
SQL> startup mount;
SQL> alter database datafile '/home/oracle/orahome1/oradata/ora1/users01.dbf' offline;
SQL> alter database open;
SQL> recover datafile '/home/oracle/orahome1/oradata/ora1/users01.dbf' ;
SQL> alter database datafile '/home/oracle/orahome1/oradata/ora1/users01.dbf' online;
SQL> select * from case4;
c) The third method is to use the RECOVER TABLESPACE command which requires the tablespace to be
offline and the database to be open.
SQL> host cp /home/oracle/backup/users01.dbf /home/oracle/orahome1/oradata/ora1/users01.dbf
SQL>startup open
ORA-01113 file 4 needs media recovery
33
Page
34
Page
Page
35
Problem: A power surge caused the database to crash and also caused a media failure, losing all the online
log files. All the data files and the current control files are intact. Although the data files are OK, after the
crash they cannot be used because instance recovery cannot be performed (since all the log files are lost).If
any of the unarchived log files are lost, crash recovery cannot be performed and instead media recovery
needs to be performed.
Simulation:
SQL> shutdown abort;
SQL> host rm /home/oracle/orahome1/oradata/ora1/*.log
Solution to Case 6 :
You would need to perform a Cancel base Incomplete recovery Restore all the datafiles:
$cp /home/oracle/orahome1/backup/*.dbf /home/oracle/orahome1/oradata/ora1/
SQL>connect internal
SQL> startup mount;
SQL>recover database until cancel;
(Cancel the recovery when oracle asks to apply the redo logs that are lost)
SQL>alter database open resetlogs;
SQL>shutdown
SQL>exit
$ls
(The online redo logs will be automatically created by Oracle as part of the database open. This is required
for normal operation of the database).
CASE 7
Scenario : Kevin is one of the DBAs of a Fortune 500 Financial Company, and maintains one of the
company's most crucial databases. A UNIX machine is used to store a 500 gigabyte database using Oracle
8.1.6. The database operates 24*7 with 200 to 250 concurrent users on the system at any one time. There are
250 tablespaces and the backup procedure involves keeping the tablespaces in hot backup mode and taking
an online backup. Each log file is 10MB. Between issuing the BEGIN BACKUP and END BACKUP oracle
generates about 50 archive log files.
Problem : On Friday afternoon, while taking hot backups, the machine crashed bringing the database down.
As this is a mission critical workshop, Kevin needed to bring the database up as fast as possible. Once the
machine was booted, he tried to start the database and Oracle asked for media recovery starting from log
sequence number 2300. The current online log file has a sequence number 2335, which means 35 log files
needed to be applied before the database could be opened.
Simulation:
SQL>connect internal
36
Page
SQL>startup
/home/oracle/rbs01.dbf
37
/home/oracle/system01.dbf
Page
-------
/home/oracle/tools01.dbf
/home/oracle/users01.dbf
/home/oracle/test1.dbf
/home/oracle/temp.dbf
Status
---------SYSTEM
ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
Enabled
-------------------READ WRITE
READ WRITE
READ WRITE
READ WRITE
READ ONLY
READ WRITE
SQL> create table case8 (c1 number) tablespace users;
SQL> insert into case8 values (8);
SQL> commit;
SQL>alter system switch logfile;
SQL>shutdown abort;
38
Page
Page
39
manager takes an OS backup of the system. As part of this backup, all Oracle database files are copied from
DASD to tape. The Oracle database is shutdown before the backups are taken. Matt takes a full database
export every three months and incremental exports once a month.
Problem : One day, while doing space management, Matt added a small datafile to a tablespace, then
decided that he really needed more space. He didn't want to add another datafile, but instead decided to
replace the smaller datafile with a new, bigger datafile. Since a datafile cannot be dropped, he merely took
the new datafile offline and added a larger datafile to the same tablespace. He deleted the datafile at the OS
level, assuming Oracle would never need the file since he hadn't added any data to it, and also because it
was offline. Shortly after he started running an application, he got the error:
ORA-00376 : file 6 cannot be read at this time (file 6 is the same datafile that he had taken offline and
deleted earlier)
Solution : Identify three methods in which you could recover from this problem. What would have been the
most appropriate solution to the problem Matt had?
Solution to Case 9
When you take a datafile offline and open the database, you can apply one of the following three methods.
a) Restore the datafile that was taken offline from a backup and do a data file recovery.
b) If no backups exist, create a datafile using the 'alter database create datafile' command and then
recover it. In this method, you would require all the log files that were generated since the time the datafile
was created.
c) Rebuild the tablespace (This method involves dropping the tablespace to which the offline datafile
belongs and re-creating it) Write down the steps you would issue in all the three cases. Appropriate solution
to the problem Matt faced is;
SQL> connect internal;
SQL>startup mount;
SQL>archive log list;
SQL>alter database open;
SQL>alter tablespace users add datafile '/home/oracle/orahome1/oradata/ora1/users02.dbf' size 40k;
SQL> alter database datafile '/home/oracle/orahome1/oradata/ora1/users02.dbf' resize 1M;
CASE 10
Scenario :Nancy administers a large database of 150 GB at a factory. She uses Oracle 8.1.7 on a Unix server
and takes weekly offline backups of the database. She triple mirrors her disk drives, and once a week she
shuts the database down, unlinks one of the mirrors and starts up the database. At this point the database is
double mirrored. She then uses tape drives to copy the database files onto the tape. She also keeps a copy of
the database on a separate set of disk drives. Once the copying is done, she connects the third mirror to the
double mirror. Nancy runs the database in ARCHIVELOG mode. Every day, about 100 archive log files are
generated. An automated process copies the archived log files to tape at regular intervals, and one week's
worth of archived log files are kept online on disk. The control files and online log files are multiplexed.
Problem : On Sunday, an offline backup of the database was taken.
Page
40
Nancy observed that the current log sequence number was 100. Thursday morning, one of the tablespaces
(TS1) was taken offline and the current log sequence number was at that time was 450. On
Thursday
afternoon, due to a disk controller problem, some of the data files were lost. The current log sequence
number at the time of the failure was 500. Nancy decided to delete all the data files, restore the data files
from the offline backup from Sunday and roll forward. She restored all the data files from the cold backup
and used the current control file to do the database recovery. Nancy issued the recover database command
and applied around 400 archived log files. Since all the archived log
files were in the archive destination, Nancy issued the auto command
and Oracle automatically applied all 400 archived log files. The
recovery took about 13 hours and Nancy could finally bring the database to normal operation. Once the
database was open, she decided to bring tablespace TS1 online. Oracle asked for recovery for all the data
files that belong to the tablespace TS1. Nancy expected Oracle to ask for recovery starting at log sequence
number 450, since that's when the tablespace was taken offline. However when she issued the recover
tablespace command, she realized that Oracle asked for recovery starting from log sequence number 100,
all the way from when the backup was taken.
Simulation:
SQL>connect internal
SQL>startup open;
SQL>archive log list;
Database log mode
ARCHIVELOG
Automatic archival
ENABLED
Archival destination
/home/oracle/orahome1/archives
60
62
62
ARCHIVELOG
Automatic archival
ENABLED
/home/oracle/orahome1/archives
63
65
65
Page
41
Archival destination
SQL>shutdown abort
SQL>host rm /home/oracle/orahome1/oradata/ora1/*.dbf (Simulates a loss of all datafiles)
SQL>host cp /home/oracle/orahome1/backup/*.dbf /home/oracle/orahome1/oradata/ora1
(Restoring all the datafiles)
Solution : How would you recover from the above problem.
Solution to CASE 10
We present two recovery methods. The first method is the recovery procedure used by Nancy in this
example. The second method is a better way of doing recovery, and is recommended by Oracle since the log
file(s) need to be applied only once.
Method 1
SQL>startup mount;
SQL> recover database;
(Applying the logs)
SQL>alter database open;
SQL>alter tablespace users online;
ORA-01113 : file 4 needs media recovery
ORA-01110 : data file 4 : '/home/oracle/orahome1/oradata/ora1/users01.dbf'
SQL> recover tablespace users; (Reapplying all the logfiles)
SQL>alter tablespace users online;
Method 2
SQL> startup mount;
SQL>select * from v$datafile;
SQL> select name, status, enabled from v$datafile;
Name
/home/oracle/rbs01.dbf
42
/home/oracle/system01.dbf
Page
-------
/home/oracle/tools01.dbf
/home/oracle/users01.dbf
/home/oracle/test1.dbf
/home/oracle/temp.dbf
SQL> alter database datafile
Status
---------SYSTEM
ONLINE
ONLINE
OFFLINE
ONLINE
ONLINE
Enabled
-------------------READ WRITE
READ WRITE
READ WRITE
DISABLED
READ ONLY
READ WRITE
'/home/oracle/orahome1/oradata/ora1/users01.dbf' online;
SQL>recover database;
SQL> select name, status, enabled from v$datafile;
/home/oracle/system01.dbf
43
-------
Page
Name
/home/oracle/rbs01.dbf
/home/oracle/tools01.dbf
/home/oracle/users01.dbf
/home/oracle/test1.dbf
/home/oracle/temp.dbf
Datafile is online)
SQL> alter database open;
Status
---------SYSTEM
ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
Enabled
-------------------READ WRITE
READ WRITE
READ WRITE
DISABLED
READ ONLY
READ WRITE
SQL>select tablespace_name, status from dba_tablespaces;
SYSTEM
44
------------------------------
Page
TABLESPACE_NAME
RBS
TOOLS
USERS
TEST
TEMP
STATUS
----------ONLINE
ONLINE
ONLINE
OFFLINE
ONLINE
ONLINE
SQL>create table case10 (c1 number) tablespace users;
ORA-01542 : tablespace users is offline, cannot allocate space in it.
SQL> alter tablespace users online;
SQL>create table case10 (c1 number) tablespace users;
Table created.
Page
45
3) check database and client are running on the same network or not.(with the help of ping
4) ensure thar oracle listiner is up and running
5) connect to server using server protocal address
2) Create a User "TESTAPPS" identified by "TESTAPPS"
> create user identified by ;
3) Connect to DB using TESTAPPS from DB Node and MT Node
> first give grant options to the user....
grant connect,resource to ;
4)How do you identify remote connections on a DB Server
> ps -ef|grep -i local [where local=no it is a remote connection... in the os level]
5)How do you identify local connections on a DB Server
> ps -ef|grep -i local [where local=yes it is a local connection... in the os level]
6)Can you connect remotely as a user on DB Server. If so, how?
> /@ [with the help of connecting string]
7) Do you need to acess to DB Server to connect to a system schema?
> NO, just knowing the username&password u connect from the client...
8)What is the difference between "SYS" & "SYSTEM" Schema
> SYS is a super most user...
SYS has additional roles sysdba, sysoper
SYS can do only startup, shudown options
> SYSTEM schema has owns certain additional data dictonary tables..
SYSTEM donot use startup and shutdown options....
9)What are the roles/priviliges for a "SYS" Schema
>***ROLES***[select granted_role from dba_role_privs where grantee='SYS']
IMP_FULL_DATABASE, DELETE_CATALOG_ROLE, RECOVERY_CATALOG_OWNER, DBA, EXP_FULL_DATABASE,
HS_ADMIN_ROLE, AQ_ADMINISTRATOR_ROLE, OEM_MONITOR, RESOURCE, EXECUTE_CATALOG_ROLE,
LOGSTDBY_ADMINISTRATOR, AQ_USER_ROLE,
SCHEDULER_ADMIN, CONNECT, SELECT_CATALOG_ROLE, GATHER_SYSTEM_STATISTICS,
OEM_ADVISOR
***PRIVILAGES****[select privileges from dba_sys_privs where grantee='SYS';]
CREATE ANY RULE
CREATE ANY EVALUATION CONTEXT
MANAGE ANY QUEUE
EXECUTE ANY PROCEDURE
ALTER ANY RULE
CREATE RULE SET
EXECUTE ANY EVALUATION CONTEXT
INSERT ANY TABLE
SELECT ANY TABLE
LOCK ANY TABLE
UPDATE ANY TABLE
DROP ANY RULE SET
ENQUEUE ANY QUEUE
EXECUTE ANY TYPE
CREATE RULE
ALTER ANY EVALUATION CONTEXT
CREATE EVALUATION CONTEXT
ANALYZE ANY
EXECUTE ANY RULE
DROP ANY EVALUATION CONTEXT
46
Page
Page
47
48
Page
33)How do you mount a database after an instance is created. What are the messages recorded while changing to mount stage
> alter database mount
> Setting recovery target incarnation to 1
> Successful mount of redo thread 1, with mount id 4186671158
> Database mounted in Exclusive Mode
> Completed: alter database mount
34) What are the data dictionary objects that can be viewed in a mount stage.
35)How do you open a database after an instance is mounted. What are the messages recorded while changing to open stage
> alter database open
> opening redolog files.
> Successful open of redo files.
> MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
> SMON: enabling cache recovery
> Successfully onlined Undo Tablespace 1
> SMON: enabling tx recovery
> Database Characterset is US7ASCII
> Completed: alter database open
****************************************************************************
No answer qus: 13, 22, 29, 30, 34
49
Page
D.The database files will be placed in this location, if not specified explicitly.
E.The location will be considered for the base of Oracle Managed Files (OMF).
F.The location will be considered for the base of Optimal Flexible Architecture (OFA).
Answer: F
QUESTION NO:13
The operating system filecratabin the Linux platform gets updated whenever you create a new database on the same host machine. What
kind of information is stored is stored in this file?
A.OracleSIDsonly
B.Oracle homes only
C.Oracle install timestamp
D.Oracle inventory pointer files
E.Oracle database creation timestamp
F.OracleSIDsand Oracle homes only
G.OracleSIDs, Oracle homes and flag for auto startup
Answer: G
QUESTION NO:14
You work as a database administrator for Certkiller .com. Your database is configured for automatic undo management.
UNDO_RETENTION is set to 3 hours.You want to flash back a table that was created last year. How far back can the flashback query
go?
A.3 hours
B.6 months
C.until last year
D.until last commit
E.until the point when the undotablespacewas refreshed
F.until the database is shut down and the memory erased
Answer: A
QUESTION NO:15
In your Certkiller .com production database, you find that the database users are able to create and read files with unstructured data,
available in any location on the host machine from an application. You want to restrict the database users to access files in a specific
location on the host machine. What could do to achieve this?
50
A.Modify the value for the UTL_FILE_DIR parameter in the parameter file
Page
B.Grant read and write privilege on the operating system path to the database users
C.Modify the value for the LDAP_DIRECTORY_ACCESS parameter in the parameter
file
D.Modify the value for the PLSQL_NATIVE_LIBRARY_DIR parameter in the
parameter file
E.Create a directory object referring to the operating system path, and grant read and
write privilege on the directory object to the database users
Answer: A
QUESTION NO:16
Your boss at Certkiller .com wants you to clarify Oracle 10g. What statement about the Shared Server configuration is valid?
A.Program Global Area (PGA) is stored in Shared pool.
B.User session data and Cursor state are stored inLargepool and Stack space is stored
Shared pool.
C.User session data is stored in Shared pool and Stack space and Cursor state are stored
inLargepool.
D.User session data and Cursor state are stored inLargepool and Stack space is stored
outside the System Global (SGA).
E.User session data and Cursor state are stored outside the System Global Area (SGA)
and Stack space is stored inside the SGA.
Answer: D
QUESTION NO:17
You work as a database administrator for Certkiller .com. On a Monday morning, you find the database instance aborted. After inspecting
the alert log file, you execute the STARTUP command in SQL*Plus to bring the instance up. What statement is true?
A.PMON coordinates media recovery.
B.SMON coordinates instance recovery.
C.PMON coordinates instance recovery.
D.Undo Advisor would roll back all uncommitted transactions.
QUESTION NO:18
Page
Answer: B
51
E.SQL*PLUS reports an error with the message asking you to perform instance recovery.
Page
52
You work as a database administrator for Certkiller .com. While loading data into the Certkiller STAFF table using Oracle Enterprise
Manager 10g Database Control, you find the status of the job as failed. On further investigation, you find the following error message in
the output log: ORA-01653 unable to extend table HR. Certkiller STAFF by 8 intablespaceUSERS
Which task would you perform to load the data successfully without affecting the users who are accessing the table?
A.Restart the database instance and run the job
B.Truncate the Certkiller STAFF table and run the job
C.Delete all rows from the Certkiller STAFF table and run the job
D.Increase the size of the USERStablespacethe and run the job
E.Increase the size of the database default permanenttablespaceand run the job
Answer: D
QUESTION NO:21
Exhibit
Which statement regarding thedeptandemptables are true?
A.When you delete a row from theemptable, you would receive a constraint violation error.
B.When you delete a row from the dept table, you would receive a constraint violation error.
C.When you delete a row from theemptable, automatically the corresponding rows are deleted from the dept table.
D.When you delete a row from the dept table, automatically the corresponding rows are deleted from theemptable.
E.When you delete a row from the dept table, automatically the corresponding rows are updated with null values in theemptable.
F.When you delete a row from theemptable, automatically the corresponding rows are updated with null values in the dept table.
Answer: D
QUESTION NO:22
You work as a database administrator for Certkiller .com. Users in the Certkiller .com PROD database complain about the slow response
of transactions. While investigating the reason you find that the transactions are waiting for the undo segments to be available, and undo
retention has been set to zero.
What would you do to overcome this problem?
A.Increase the undo return
B.Create more undo segments
C.Create another undotablespace
D.Increase the size of the undotablespace
Answer: D
53
QUESTION NO:23
Page
You are working on a test database where instance recovery takes a considerable amount of time. How can reduce the recovery time?
Choose two.
A.By multiplexing the control files
B.By multiplexing the redo log files
C.By decreasing the size of redo log files
D.By configuring mean time to recover (MTTR) to a lower value
E.By setting the UNDO_RETENTION parameter to a higher value
Answer: C, D
QUESTION NO:24
Exhibit #1
Exhibit #2, command
Exhibit #3, error
You work as a database administrator for Certkiller .com. You have created a database link, devdb.uk. Certkiller .com, between the
database PRODDB and DEVDB.You want to import schema objects of the HR user using Oracle Data Pump from the development
database, DEVDB, to the productiondatagbase, PRODDB. View Exhibit #1 to see the source and targetdatabase.l You execute the code in
Exhibit #2. The codefailsandproduces the error displayed in Exhibit #3. What would you do to overcome the error?
A.Remove thedumpfileoption in the command
B.Remove theflashback_timeoption in the command
C.Add the user,SYSTEM, to the schemas option in the command
D.Add thenetwork_link= devdb.uk. Certkiller .comoption in the command
E.Remove the schemasoptions and add thenetwork_link= devdb.uk. Certkiller .comoption in the command
F.Remove thedumpfileoptions and add thenetwork_link= devdb.uk. Certkiller .comoption in the command
Answer: F
QUESTION NO:25
You work as a database administrator for Certkiller .com. The database is open. A media failure has occurred, resulting in loss of all the
control files in your database.Which statement regarding the database instance is true in this scenario?
A.The instance would hang.
B.The instance needs to be shut down.
C.The instance would be in the open state.
D.The instance would abort in such cases.
54
Answer: D
Page
F.The instance would in the open state, but all the background processes will be restarted.
QUESTION NO:26
You work as a database administrator for Certkiller .com. In a production environment, users complain about the slow response time when
accessing the database. You have not optimized the memory usage of the Oracle instance and you suspect the problem to be with the
memory.
To which type of object would you refer to determine the cause of the slow response?
A.The trace file
B.The fixed views
C.The data dictionary views
D.The operating system log fields
E.The dynamic performance views.
Answer: E
QUESTION NO:27
You are working on the Certkiller database.
What is the default name of the alert log file in this database?
A.alert_ Certkiller .log
B.alertlog_ Certkiller .log
C.alert_log_ Certkiller .log
D. Certkiller _alert_log.log
E.log_alert_: Certkiller .log
F.trace_alert_ Certkiller .log
Answer: A
QUESTION NO:28
You work as a database administrator for Certkiller .com. You have set the retention period for Automatic Repository (AWR) statistics to
four days and collection interval to 15 minutes. You want to view the statistics collected and stored in AWR snapshot. Which two methods
would you use to view the AWR statistics? Choose two
A.use enterprise manager
B.use DBMS_SQL package
55
Page
QUESTION NO:29
You work as a database administrator for Certkiller .com. As a result of performance analysis, you created an index on
theprod_namecolumn of the Certkiller prodtable, which contains about ten thousand rows. Later, you updated a product name in the table.
How does this change affect the index?
A.A leaf will be marked as invalid.
B.An update in a leaf row takes place.
C.The index will be updated automatically at commit.
D.A leaf row in the index will be deleted and inserted.
E.The index becomes invalid when you make any updates
Answer: D
QUESTION NO:30
Two database users, Jack and Bill, are accessing the Certkiller STAFF table of the Certkiller DB database. When Jack modifies a value in
the table, the new value is invisible to Bill. Which is the modified value invisible to Bill?
A.The modified data are not available on disk.
B.The modified data have been flushed out from memory.
C.The modified rows of the Certkiller STAFF table have been locked.
D.Jack has not committed the changes after modifying the value.
E.Both users are accessing the database from two different machines.
Answer: D
Page
56