Oracle Exam
Oracle Exam
Answer: A, C
Explanation:
Monitoring Index Usage
Oracle provides a means of monitoring indexes to determine if they are being used or not
used. If it is determined that an index is not being used, then it can be dropped, thus
eliminating unnecessary statement overhead.
To start monitoring an index's usage, issue this statement:
ALTER INDEX index MONITORING USAGE;
Later, issue the following statement to stop the monitoring:
ALTER INDEX index NOMONITORING USAGE;
The view V$OBJECT_USAGE can be queried for the index being monitored to see if the
index has been used. The view contains a USED column whose value is YES or NO,
depending upon if the index has been used within the time period being monitored. The
view also contains the start and stop times of the monitoring period, and a
MONITORING column (YES/NO) to indicate if usage monitoring is currently active.
Each time that you specify MONITORING USAGE, the V$OBJECT_USAGE view is
reset for the specified index. The previous usage information is cleared or reset, and a
new start time is recorded. When you specify NOMONITORING USAGE, no further
monitoring is performed, and the end time is recorded for the monitoring period. Until the
next ALTER INDEX ... MONITORING USAGE statement is issued, the view
information is left unchanged.
2. You need to create an index on the SALES table, which is 10 GB in size. You want
your index to be spread across many tablespaces, decreasing contention for index lookup,
and increasing scalability and manageability.
Which type of index would be best for this table?
A. bitmap
B. unique
C. partitioned
D. reverse key
E. single column
F. function-based
Answer: C
Explanation:
I suggest that you read chapters 10 & 11 in Oracle9i Database Concepts Release 2 (9.2)
March 2002 Part No. A96524-01 (a96524.pdf)
Oracle9i Database Concepts Release 2 (9.2) March 2002 Part No. A96524-01
(a96524.pdf) ch 10 Bitmap Indexes
The purpose of an index is to provide pointers to the rows in a table that contain a given
key value. In a regular index, this is achieved by storing a list of rowids for each key
corresponding to the rows with that key value. Oracle stores each key valuerepeatedly
with each storedrowid.In abitmap index,abitmapfor eachkey value is used instead of a list
of rowids.
Each bit in the bitmap corresponds to a possible rowid. If the bit is set, then it means that
the row with the corresponding rowid contains the key value. A mapping function
converts the bit position to an actual rowid, so the bitmap index provides the same
functionality as a regular index even though it uses a different
representation internally. If the number of different key values is small, then bitmap
indexes are very space efficient.
Bitmap indexing efficiently merges indexes that correspond to several conditions in a
WHERE clause. Rows that satisfy some, but not all, conditions are filtered out before the
table itself is accessed. This improves response time, often dramatically.
Note: Bitmap indexes are available only if you have purchased the Oracle9i Enterprise
Edition.
See Oracle9i Database New Features for more information about the features available in
Oracle9i and the Oracle9i Enterprise Edition.
Oracle9i Database Concepts Release 2 (9.2) March 2002 Part No. A96524-01
(a96524.pdf) ch 11
Partitioned Indexes
Just like partitioned tables, partitioned indexes improve manageability, availability,
performance, and scalability. They can either be partitioned independently (global
indexes) or automatically linked to a table's partitioning method (local indexes).
Local Partitioned Indexes
Local partitioned indexes are easier to manage than other types of partitioned indexes.
They also offer greater availability and are common in DSS environments. The reason for
this is equipartitioning: each partition of a local index is associated with exactly one
partition of the table. This enables Oracle to automatically keep the index partitions in
sync with the table partitions, and makes each table-index pair independent. Any actions
that make one partition's data invalid or unavailable only affect a single partition.
You cannot explicitly add a partition to a local index. Instead, new partitions are added to
local indexes only when you add a partition to the underlying table. Likewise, you cannot
explicitly drop a partition from a local index. Instead, local index partitions are dropped
only when you drop a partition from the underlying table.
A local index can be unique. However, in order for a local index to be unique, the
partitioning key of the table must be part of the index's key columns. Unique localindexes
are useful for OLTP environments.
See Also: Oracle9i Data Warehousing Guide for more information about partitioned
indexesname, and stores the index partition in the same tablespace as the table partition.
Global Partitioned Indexes
Global partitioned indexes are flexible in that the degree of partitioning and the
partitioning key are independent from the table's partitioning method. They are
commonly used for OLTP environments and offer efficient access to any individual
record.
The highest partition of a global index must have a partition bound, all of whose values
are MAXVALUE. This ensures that all rows in the underlying table can be represented in
the index. Global prefixed indexes can be unique or nonunique. You cannot add a
partition to a global index because the highest partition always has a partition bound of
MAXVALUE. If you wish to add a new highest partition, use the ALTER INDEX SPLIT
PARTITION statement. If a global index partition is empty, you can explicitly drop it by
issuing the ALTER INDEX DROP PARTITION statement. If a global index partition
contains data, dropping the partition causes the next highest partition to be marked
unusable. You cannot drop the highest partition in a global index.
Oracle9i Database Concepts Release 2 (9.2) March 2002 Part No. A96524-01
(a96524.pdf) ch 10
Unique and Nonunique Indexes
Indexes canbeunique or nonunique.Unique indexesguaranteethat notworows of a table
have duplicate values in the key column (or columns). Nonunique indexes do not impose
this restriction on the column values. Oracle recommends that unique indexes be created
explicitly, and not through
enabling a unique constraint on a table.
Alternatively, you can define UNIQUE integrity constraints on the desired columns.
Oracle enforces UNIQUE integrity constraints by automatically defining a unique index
on the unique key. However, it is advisable that any index that exists for query
performance, including unique indexes, be created explicitly.
TABLESPACE indx;
A. bitmap
B. B-Tree
C. partitioned
D. reverse key
Answer: B
Explanation:
Oracle provides several indexing schemes that provide complementary performance
functionality. These are:
1 B-tree indexes-the default and the most common.
2 B-tree cluster indexes-defined specifically for cluster.
3 Hash cluster indexes-defined specifically for a hash cluster.
4 Global and local indexes-relate to partitioned tables and indexes.
5 Reverse key indexes-most useful for Oracle Real Application Cluster applications.
6 Bitmap indexes-compact; work best for columns with a small set of values.
7 Function-based indexes-contain the precomputed value of a function/expression.
8 Domain indexes-specific to an application or cartridge.
4. The credit controller for your organization has complained that the report she runs to
show customers with bad credit ratings takes too long to run. You look at the query that
the report runs and determine that the report would run faster if there were an index on
the CREDIT_RATING column of the CUSTOMERS table.<br />
The CUSTOMERS table has about 5 million rows and around 100 new rows are added
every month. Old records are not deleted from the table.<br />
The CREDIT_RATING column is defined as a VARCHAR2(5) field. There are only 10
possible credit ratings and a customer's credit rating changes infrequently. Customers
with bad credit ratings have a value in the CREDIT_RATINGS column of 'BAD' or
'F'.<br />
Which type of index would be best for this column?
A. B-Tree
B. bitmap
C. reverse key
D. function-based
Answer: B
Explanation:
Ad A: Why B-tree is not good for this problem:
(1) B-trees provide excellent retrieval performance for a wide range of queries, including
exact match and range searches.
(2) Inserts, updates, and deletes are efficient, maintaining key order for fast retrieval.
Since, we will not update this column, and no records are deleted, also we don't have a
wide range of queries for this column so B-tree is not a good solution.
Ad C: Creating a reverse key index, compared to a standard index, reverses the bytes of
each column indexed (except the rowid) while keeping the column order. Such an
arrangement can help avoid performance degradation with Oracle9i Real Application
Clusters where modifications to the index are concentrated on a small set of leaf blocks.
By reversing the keys of the index, the insertions become distributed across all leaf keys
in the index.
Using the reverse key arrangement eliminates the ability to run an index range scanning
query on the index. Because lexically adjacent keys are not stored next to each other in a
reverse-key index, only fetch-by-key or full-index (table) scans can be performed. Full
index (table) scan for 1 million records???? NO WAY!!!!
5. Your developers asked you to create an index on the PROD_ID column of the
SALES_HISTORY table, which has 100 million rows.
The table has approximately 2 million rows of new data loaded on the first day of every
month. For the remainder of the month, the table is only queried. Most reports are
generated according to the PROD_ID, which has 96 distinct values.
A. bitmap
B. reverse key
C. unique B-Tree
D. normal B-Tree
E. function based
F. non-unique concatenated
Answer: A
Explanation:
Regular B*-tree indexes work best when each key or key range references only a few
records, such as employee names. Bitmap indexes, by contrast, work best when each key
references many records, such as employee gender.
Bitmap indexes can substantially improve performance of queries with the following
characteristics:
(a) The WHERE clause contains multiple predicates on low- or medium-cardinality
columns.
(b) The individual predicates on these low- or medium-cardinality columns select a large
number of rows.
(c) Bitmap indexes have been created on some or all of these low- or medium-cardinality
columns.
(d) The tables being queried contain many rows.
You can use multiple bitmap indexes to evaluate the conditions on a single table. Bitmap
indexes are thus highly advantageous for complex ad hoc queries that contain lengthy
WHERE clauses. Bitmap indexes can also provide optimal performance for aggregate
queries. 96<<100 million low cardinality ==> bitmap indexes, lot of rows ==> bitmap
indexes.
See Oracle8 Tuning Release 8.0 December, 1997 Part No. A58246-01 (a58246.pdf) pg.
181. (10-13)
A. bitmap
B. unique
C. partitioned
D. reverse key
E. single column
F. function-based
Answer: A
Explanation:
Bitmap indexes can substantially improve performance of queries with the following
characteristics:
(a) The WHERE clause contains multiple predicates on low- or medium-cardinality
columns.
(b) The individual predicates on these low- or medium-cardinality columns select a large
number of rows.
(c) Bitmap indexes have been created on some or all of these low- or medium-cardinality
columns.
(d) The tables being queried contain many rows.
You can use multiple bitmap indexes to evaluate the conditions on a single table. Bitmap
indexes are thus highly advantageous for complex ad hoc queries that contain lengthy
WHERE clauses. Bitmap indexes can also provide optimal performance for aggregate
queries.
Ad A: True. low cardinality ==> bitmap indexes, lot of rows ==> bitmap indexes. See
Oracle8 Tuning Release 8.0 December, 1997 Part No. A58246-01 (a58246.pdf) pg. 181.
(10-13)
7. The user Smith created the SALES HISTORY table. Smith wants to find out the
following information about the SALES HISTORY table:<br />
<br />
- The size of the initial extent allocated to the sales history data segment<br />
- The total number of extents allocated to the sales history data segment<br />
<br />
Which data dictionary view(s) should Smith query for the required information?
A. USER_EXTENTS
B. USER_SEGMENTS
C. USER_OBJECT_SIZE
D. USER_OBJECT_SIZE and USER_EXTENTS
E. USER_OBJECT_SIZE and USER_SEGMENTS
Answer: B
Explanation:
SQL> desc user_segments
SEGMENT_NAME VARCHAR2(81)
PARTITION_NAME VARCHAR2(30)
SEGMENT_TYPE VARCHAR2(18)
TABLESPACE_NAME VARCHAR2(30)
BYTES NUMBER
BLOCKS NUMBER
EXTENTS NUMBER
INITIAL_EXTENT NUMBER
NEXT_EXTENT NUMBER
MIN_EXTENTS NUMBER
MAX_EXTENTS NUMBER
PCT_INCREASE NUMBER
FREELISTS NUMBER
FREELIST_GROUPS NUMBER
BUFFER_POOL VARCHAR2(7)
8. Which password management feature ensures a user cannot reuse a password for a
specified time interval?
A. Account Locking
B. Password History
C. Password Verification
D. Password Expiration and Aging
Answer: B
Explanation:
Oracle9i Database Concepts Release 2 (9.2) March 2002 Part No. A96524-01
(a96524.pdf) 22-8
Account Locking
Oracle can lock a user's account if the user fails to login to the system within a specified
number of attempts. Depending on how the account is configured, it can be unlocked
automatically after a specified time interval or it must be unlocked by the database
administrator.
Password Complexity Verification
Complexity verification checks that each password is complex enough to provide
reasonable protection against intruders who try to break into the system by guessing
passwords.
Password History
The password history option checks each newly specified password to ensure that a
password is not reused for the specified amount of time or for the specified number of
password changes. The database administrator can configure the rules for password reuse
with CREATE PROFILE statements.
9. Which view provides the names of all the data dictionary views?
A. DBA_NAMES
B. DBA_TABLES
C. DICTIONARY
D. DBA_DICTIONARY
Answer: C
Explanation:
http://docs.rinet.ru:8080/O8/ch02/ch02.htm
All the data dictionary tables and views are owned by SYS. You can query the
DICTIONARY table to obtain the list of all dictionary views.
10. The control file defines the current state of the physical database.
Which three dynamic performance views obtain information from the control file?
(Choose three.)
A. V$LOG
B. V$SGA
C. V$THREAD
D. V$VERSION
E. V$DATAFILE
F. V$PARAMETER
Answer: A, C, E
Explanation:
V$LOG: This view contains log file information from the control files.
V$SGA: This view contains summary information on the system global area (SGA).
V$THREAD: This view contains thread information from the control file.
V$VERSION: Version numbers of core library components in the Oracle server. There is
one row for each component.
V$DATAFILE: This view contains datafile information from the control file.
V$PARAMETER: displays information about the initialization parameters that are
currently in effect for the session. A new session inherits parameter values from the
instance-wide values displayed by the V$SYSTEM_PARAMETER view.
11. Which data dictionary view shows the available free space in a certain tablespace?
A. DBA_EXTENTS
B. V$FREESPACE
C. DBA_FREE_SPACE
D. DBA_TABLESPACFS
E. DBA_FREE_EXTENTS
Answer: C
12. Which data dictionary view would you use to get a list of object privileges for all
database users?
A. DBA_TAB_PRIVS
B. ALL_TAB_PRIVS
C. USER_TAB_PRIVS
D. ALL_TAB_PRIVS_MADE
Answer: A
Explanation:
Ad A: True. DBA_TAB_PRIVS This view lists all grants on objects in the database.
(a58242.pdf) Pg. 261. (2-91).
Ad B: False. ALL_TAB_PRIVS This view lists the grants on objects for which the user
or PUBLIC is the grantee. (a58242.pdf) Pg. 203. (2-33).
Ad C: False. USER_TAB_PRIVS This view contains information on grants on objects
for which the user is the owner, grantor, or grantee. (a58242.pdf) Pg. 333. (2-163).
Ad D: False. ALL_TAB_PRIVS_MADE This view lists the user's grants and grants on
the user's objects. (a58242.pdf) Pg. 204. (2-34).
13. User Smith created indexes on some tables owned by user John. You need to display
the following:
<br />
index names<br />
index types<br />
<br />
Which data dictionary view(s) would you need to query?
A. DBA_INDEXES only
B. DBA_IND_COLUMNS only
C. DBA_INDEXES and DBA_USERS
D. DBA_IND COLUMNS and DBA_USERS
E. DBA_INDEXES and DBA_IND_EXPRESSIONS
F. DBA_INDEXES, DBA_TABLES, and DBA_USERS
Answer: A
Explanation:
Ad A: DBA_INDEXES. This view contains descriptions for all indexes in the database.
To gather statistics for this view, use the SQL command ANALYZE. This view supports
parallel partitioned index scans. (a58242.pdf) Pg. 230. (2-60).
Ad B: DBA_IND_COLUMNS. This view contains descriptions of the columns
comprising the indexes on all tables and clusters. (a58242.pdf) Pg. 232. (2-62).
Ad C: DBA_USERS. This view lists information about all users of the database.
(a58242.pdf) Pg. 267. (2-97).
Ad E: DBA_IND_EXPRESSIONS does not exist.
Ad F: DBA_TABLES. This view contains descriptions of all relational tables in the
database. To gather statistics for this view, use the SQL command ANALYZE.
(a58242.pdf) Pg. 262. (2-92).
14. You need to know how many data files were specified as the maximum for the
database when it was created. You did not create the database and do not have the script
used to create the database. How could you find this information?
Answer: D
Explanation:
Ad A: False. DBA_DATA_FILES contains information about database files. We need
information about max number of datafiles. See (a58242.pdf) Pg. 225. (2-55)
Ad B: V$DATAFILE ontains datafile information from the control file. (a58242.pdf) Pg.
363. (3-23)
Ad C: This command just shows the locations of the current control files.
Ad D: V$CONTROLFILE_RECORD_SECTION displays information about the
controlfile record sections. (a58242.pdf) Pg. 360. (3-20)
15. Examine the command:
<br />
CREATE TABLE employee<br />
( employee_id NUMBER <br />
CONSTRAINT employee_empid_pk PRIMARY KEY,<br />
employee_name VARCNAR2(30),<br />
manager_id NUMBER <br />
CONSTRAINT employee_mgrid_fk REFERENCES
employee(employee_id));<br />
The EMP table contains self referential integrity requiring all NOT NULL values inserted
in the MANAGER_ID column to exist in the EMPLOYEE_ID column. Which view or
combination of views is required to return the name of the foreign key constraint and the
referenced primary key?
A. DBA_TABLES only
B. DBA_CONSTRAINTS only
C. DBA_TAB_COLUMNS only
D. DBA_CONS_COLUMNS only
E. DBA_TABLES and DBA_CONSTRAINTS
F. DBA_TABLES and DBA_CONS_COLUMNS
Answer: B
Explanation:
Ad A: False. DBA_TABLES contains descriptions of all relational tables in the database.
To gather statistics for this view, use the SQL command ANALYZE. No constraint
information See (a58242.pdf) pg. 262 (2-92).
Ad B: True. DBA_CONSTRAINTS contains constraint definitions on all tables. See
(a58242.pdf) pg. 253 (2-83).
Ad C: False. DBA_TAB_COLUMNS contains information which describes columns of
all tables, views, and clusters. No constraint name information. See (a58242.pdf) pg. 259
(2-89).
Ad D: False. DBA_CONS_COLUMNS contains information about accessible columns in
constraint definitions. See (a58242.pdf) pg. 224 (2-54).
Ad E: False. We don't need the DBA_TABLES.
Ad F: False.
16. Which data dictionary view(s) do you need to query to find the following information
about a user?<br />
- Whether the user's account has expired<br />
- The user's default tablespace name<br />
- The user's profile name<br />
A. DBA_USERS only
B. DBA_USERS and DBA_PROFILES
C. DBA_USERS and DBA_TABLESPACES
D. DBA_USERS, DBA_TS_QUOTAS, and DBA_PROFILES
E. DBA_USERS, DBA_TABLESPACES, and DBA_PROFILES
Answer: A
Explanation:
SQL> desc dba_users
17. You need to determine the location of all the tables and indexes owned by one user. In
which DBA view would you look?
A. DBA_TABLES
B. DBA_INDEXES
C. DBA_SEGMENTS
D. DBA_TABLESPACES
Answer: C
Explanation:
Ad A: False. DBA_TABLES contains descriptions of all relational tables in the database.
To gather statistics for this view, use the SQL command ANALYZE. No index
information See (a58242.pdf) pg. 262 (2-92).
Ad B: False. DBA_INDEXES contains descriptions for all indexes in the database. To
gather statistics for this view, use the SQL command ANALYZE. This view supports
parallel partitioned index scans. No table information. See (a58242.pdf) pg. 230 (2-60).
Ad C: True. DBA_SEGMENTS contains information about storage allocated for all
database segments. Username of the segment owner, Type of segment: ... TABLE,
INDEX .... See (a58242.pdf) pg. 254 (2-84).
Ad D: False. DBA_TABLESPACES contains descriptions of all tablespaces. No table
and Index information. See (a58242.pdf) pg. 264 (2-94).
18. Which data dictionary view would you use to get a list of all database users and their
default settings?
A. ALL_USERS
B. USER_USERS
C. DBA_USERS
D. V$SESSION
Answer: C
Explanation:
Ad A: False. ALL_USERS This view contains information about all users of the
database: Name of the user, ID number of the user, User creation date, but No default
settings. See (a58242.pdf) pg. 209 (2-39).
Ad B: False. USER_USERS This view contains information about the current user. not
all user. See (a58242.pdf) pg. 339 (2-169).
Ad C: True. DBA_USERS This view lists information about all users of the database.
Default tablespace for data, Default tablespace for temporary table See (a58242.pdf) pg.
267 (2-97).
Ad D: False. V$SESSION This view lists session information for each current session.
See (a58242.pdf) pg. 417 (3-77).
19. You want to limit the number of transactions that can simultaneously make changes to
data in a block, and increase the frequency with which Oracle returns a block back on the
free list.
Answer: D
Explanation:
http://perun.si.umich.edu/~radev/654/resources/oracledefs.html
PCTFREE
specifies the percentage of space in each of the table's data blocks reserved for future
updates to the table's rows. The value of PCTFREE must be a positive integer from 1 to
99. A value of 0 allows the entire block to be filled by inserts of new rows. The default
value is 10. This value reserves 10% of each block for updates to existing rows and
allows inserts of new rows to fill a maximum of 90% of each block. PCTFREE has the
same function in the commands that create and alter clusters, indexes, snapshots, and
snapshot logs. The combination of PCTFREE and PCTUSED determines whether
inserted rows will go into existing data blocks or into new blocks.
PCTUSED
specifies the minimum percentage of used space that ORACLE maintains for each data
block of the table. A block becomes a candidate for row insertion when its used space
falls below PCTUSED. PCTUSED is specified as a positive integer from 1 to 99 and
defaults to 40. PCTUSED has the same function in the commands that create and alter
clusters, snapshots, and snapshot logs. The sum of PCTFREE and PCTUSED must be
less than 100. You can use PCTFREE and PCTUSED together use space within a table
more efficiently.
INITRANS
specifies the initial number of transaction entries allocated within each data block
allocated to the table. This value can range from 1 to 255 and defaults to 1. In general,
you should not change the INITRANS value from its default. Each transaction that
updates a block requires a transaction entry in the block. The size of a transaction entry
depends on your operating system. This parameter ensures that a minimum number of
concurrent transactions can update the block and helps avoid the overhead of dynamically
allocating a transaction entry. The INITRANS parameter serves the same purpose in
clusters, indexes, snapshots, and snapshot logs as in tables. The minimum and default
INITRANS value for a cluster or index is 2, rather than 1.
MAXTRANS
specifies the maximum number of concurrent transactions that can update a data block
allocated to the table. This limit does not apply to queries. This value can range from 1 to
255 and the default is a function of the data block size. You should not change the
MAXTRANS value from its default. If the number concurrent transactions updating a
block exceeds the INITRANS value, ORACLE dynamically allocates transaction entries
in the block until either the MAXTRANS value is exceeded or the block has no more free
space. The MAXTRANS parameter serves the same purpose in clusters, snapshots, and
snapshot logs as in tables.
20. Which steps should you take to gather information about checkpoints?
Answer: A
Explanation:
Testking said B.<br /><br />
http://download-
west.oracle.com/docs/cd/B10501_01/server.920/a96536/ch1103.htm#1019186
LOG_CHECKPOINTS_TO_ALERT lets you log your checkpoints to the alert file.
Doing so is useful for determining whether checkpoints are occurring at the desired
frequency.
FAST_START_MTTR_TARGET: Lets you specify in seconds the expected mean time to
recover (MTTR), which is the expected amount of time Oracle takes to perform recovery
and startup the instance.
LOG_CHECKPOINT_TIMEOUT: Limits the number of seconds between the most
recent redo record and the checkpoint.
LOG_CHECKPOINT_INTERVAL: Limits the number of redo blocks generated between
the most recent redo record and the checkpoint.
21. You decided to use Oracle Managed Files (OMF) for the control files in your
database. Which initialization parameter do you need to set to specify the default location
for control files if you want to multiplex the files in different directories?
A. DB_FILES
B. DB_CREATE_FILE_DEST
C. DB_FILE_NAME_CONVERT
D. DB_CREATE_ONLINE_LOG_DEST_n
Answer: D
Explanation:
http://www.orafaq.net/parms/>
http://www.orafaq.net/archive/oracle-l/2002/07/08/102823.htm:
DB_FILE_NAME_CONVERT converts the db file name:
db_file_name_convert=('/vobs/oracle/dbs','/fs2/oracle/stdby')
http://www.oracle-base.com/Articles/9i/OracleManagedFiles.asp:
Managing Redo Log Files Using OMF
When using OMF for redo logs the DB_CREAT_ONLINE_LOG_DEST_n parameters in
the init.ora file decide on the locations and numbers of logfile members. For exmple:
DB_CREATE_ONLINE_LOG_DEST_1 = c:\Oracle\Oradata\TSH1
DB_CREATE_ONLINE_LOG_DEST_2 = d:\Oracle\Oradata\TSH1
22. Which command can you use to display the date and time <br />
in the form 17:45:01 JUL-12-2000 using the default US7ASCII character set?
Answer: C
Explanation:
http://www.idera.com/support/documentation/Oracle_Date_Format.htm<br />
ALTER SESSION SET NLS_DATE_FORMAT = <date_format>
23. Which initialization parameter determines the location of the alert log file?
A. USER_DUMP_DEST
B. DB_CREATE_FILE_DEST
C. BACKGROUND_DUMP_DEST
D. DB_CREATE_ONLINE_LOG_DEST_n
Answer: C
http://www.experts-exchange.com/Databases/Oracle/Q_20308350.html
There is one alert log per db instance and normally named as alert_<sid>.log. Trace
files, on the other hand, are generated by the oracle background processes or other
connected net8 processes when oracle internal errors occur and they dump all information
about the error into the trace files. You can also set the level of tracing for Net8
connections as per your requirement.
The alert log is a special trace file. The alert log of a database is a chronological log of
messages and errors, which includes the following:
(a) All internal errors (ORA-600), block corruption errors (ORA-1578), and deadlock
errors (ORA-60) that occur.
(b) Administrative operations, such as CREATE/ALTER/DROP
DATABASE/TABLESPACE/ROLLBACK SEGMENT SQL statements and STARTUP,
SHUTDOWN, and ARCHIVE LOG.
(c) Several messages and errors relating to the functions of shared server and dispatcher
processes.
(d) Errors occurring during the automatic refresh of a snapshot.
(e) The values of all initialization parameters at the time the database and instance start.
Location:
All trace files for background processes and the alert log are written to the destination
specified by the initialization parameter BACKGROUND_DUMP_DEST. All trace files
for server processes are written to the destination specified by the initialization parameter
USER_DUMP_DEST. The names of trace files are operating system specific, but usually
include the name of the process writing the file (such as LGWR and RECO).
24. Which two environment variables should be set before creating a database? (Choose
two.)
A. DB_NAME
B. ORACLE_SID
C. ORACLE_HOME
D. SERVICE_NAME
E. INSTANCE_NAME
Answer: B, C
Explanation:
Check out: In this question we deal with environment variables, not parameters!
INSTANCE_NAME
Represents the name of the instance and is used to uniquely identify a specific instance
when clusters share common services names. The instance name is identified by the
INSTANCE_NAME parameter in the instance initialization file, initsid.ora. The instance
name is the same as the Oracle system identifier (sid).
ORACLE_HOME
Corresponds to the environment in which Oracle products run. This environment includes
location of installed product files, PATH variable pointing to products' binary files,
registry entries, net service name, and program groups.
If you install an OFA-compliant database, using Oracle Universal Installer defaults,
Oracle home (known as \ORACLE_HOME in this guide) is located beneath
X:\ORACLE_BASE. It contains subdirectories for Oracle software executables and
network files.
Oracle Corporation recommends that you never set the ORACLE_HOME environment
variable, because it is not required for Oracle products to function properly. If you set the
ORACLE_HOME environment variable, then Oracle Universal Installer will unset it for
you.
SERVICE_NAME
A logical representation of a database. This is the way a database is presented to clients. A
database can be presented as multiple services and a service can be implemented as
multiple database instances. The service name is a string that includes:
(a) The global database name
(b) A name comprised of the database name (DB_NAME)
(c) Domain name (DB_DOMAIN)
(d) The service name is entered during installation or database creation.
If you are not sure what the global database name is, you can obtain it from the combined
values of the SERVICE_NAMES parameter in the common database initialization file,
initdbname.ora.
A. LOG_CHECKPOINT_TARGET
B. FAST_START_MTTR_TARGET
C. LOG_CHECKPOINT_IO_TARGET
D. FAST_START_CHECKPOINT_TARGET
Answer: B
Explanation:
Ad A: False. There is no LOG_CHECKPOINT_TARGET parameter in Oracle.
Ad B: True. FAST_START_MTTR_TARGET parameter determines the number of
buffers being written by DBWn. Parameter FAST_START_MTTR_TARGET has been
introduced in Oracle9i and it replaces FAST_START_IO_TARGET and
LOG_CHECKPOINT_INTERVAL in Oracle8i, although the old parameters can still be
set if required in Oracle9i. FAST_START_MTTR_TARGET enables you to specify the
number of seconds the database takes to perform crash recovery of a single instance.
Ad C: False. There is no LOG_CHECKPOINT_IO_TARGET parameter in Oracle.
Ad D: False. There is no FAST_START_CHECKPOINT_TARGET parameter in Oracle.
26. The ORDERS table has a constant transaction load 24 hours a day, so down time is
not allowed. The indexes become fragmented. Which statement is true?
Answer: C
Explanation:
http://www.dbatoolbox.com/WP2001/spacemgmt/reorg_defrag_in_o8i_fo.pdf>
Oracle8i can create an index online; users can continue to update and query the base table
while the index is being created. No table or row locks are held during the creation
operation. Changes to the base table and index during the build are recorded in a journal
table and merged into the new index at the completion of the operation, as illustrated in
Figure 1. These online operations also support parallel index creation and can act on
some or all of the partitions of a partitioned index. Online index creation improves
database availability by providing users full access to data in the base table during an
index build.
27. You set the value of the OS_AUTHENT_PREFIX initialization parameter to OPS$
and created a user account by issuing this SQL statement:<br />
Answer: A, E
Explanation:
With external authentication, your database relies on the underlying operating system or
network authentication service to restrict access to database accounts. A database
password is not used for this type of login. If your operating system or network service
permits, you can have it authenticate users. If you do so, set the parameter
OS_AUTHENT_PREFIX, and use this prefix in Oracle usernames. This parameter
defines a prefix that Oracle adds to the beginning of every user's operating system
account name. Oracle compares the prefixed username with the Oracle usernames in the
database when a user attempts to connect. If a user with an operating system account
named TSMITH" is to connect to an Oracle database and be authenticated by the
operating system, Oracle checks that there is a corresponding database user
"OPS$TSMITH" and, if so, allows the user to connect.
See: (a58397.pdf) Pg. 377. (20-9)<br /><br />
Ad A: True. PROFILE reassigns the profile named to the user. The profile limits the
amount of database resources the user can use. If you omit this clause, Oracle assigns the
DEFAULT profile to the user. See (a58225.pdf) Pg. 541. (4-357).
Ad B: When you choose external authentication for a user, the user account is maintained
by Oracle, but password administration and user authentication is performed by an
external service. This external service can be the operating system or a network service,
such as Oracle Net.
Ad C: False.
Ad D: False.
Ad E: When you choose external authentication for a user, the user account is maintained
by Oracle, but password administration and user authentication is performed by an
external service. This external service can be the operating system or a network service,
such as Oracle Net.
A. index
B. table
C. temporary
D. boot strap
Answer: A
Explanation:
http://vsbabu.org/oracle/sect16.html
There is a SEGMENT_TYPE = 'index' condition -> index IS a segment. And it also helps
queries to be faster.
29. Which three are the physical structures that constitute the Oracle database? (Choose
three)
A. table
B. extent
c. segment
D. data file
E. log file
F. tablespace
G. control file
Answer: D, E, G
Explanation:
http://www.adp-gmbh.ch/ora/notes.html
Control Files
An Oracle Database must at least have one control file, but usually (for Backup und
Recovery http://www.adp-gmbh.ch/ora/concepts/backup_recovery/index.html reasons) it
has more than one (all of which are exact copies of one control file). The Control File
contains a number of important information that the instance needs to operate the
database. The following pieces of information are held in a control file: The name (os
path) of all datafiles that the database consists of, the name of the database, the timestamp
of when the database was created, the checkpoint (all database changes prior to that
checkpoint are saved in the datafiles) and information for RMAN.
When a database is mounted, its control file is used to find the datafiles and redo log files
for that database. Because the control file is so important, it is imperative to back up the
control file whenever a structural change was made in the database. Redo Log
Whenever something is changed on a Datafile, oracle records it in a redo log. The name
redo log indicates its purpose: When the database crashes, oracle can redo all changes on
datafiles which will take the database data back to the state it was when the last redo
record was written. Use v$log http://www.adp-
gmbh.ch/ora/misc/dynamic_performance_views.html, v$logfile http://www.adp-
gmbh.ch/ora/misc/dynamic_performance_views.html, v$log_history http://www.adp-
gmbh.ch/ora/misc/dynamic_performance_views> and v$thread http://www.adp-
gmbh.ch/ora/misc/dynamic_performance_views.html to find information about the redo
log of your database.
Each redo log file belongs to exactly on group (of which at least two must exist). Exactly
one of these groups is the CURRENT group (can be queried using the column status of
v$log http://www.adp-gmbh.ch/ora/misc/dynamic_performance_views>). Oracle uses
that current group to write the redo log entries. When the group is full, a log switch
occurs, making another group the current one. Each log switch causes checkpoint,
however, the converse is not true: a checkpoint does not cause a redo log switch.
I believe the website - files are usually said physical, and these are basic ones -> D E G
30. Which three statements about the Oracle database storage structure are true? (Choose
three)
Answer: A, C, E
Explanation:
A is OK, see Q29.
B is false (Oracle7 documentation, Server Concepts, 4-10): A tablespace in an Oracle
database consists of one or more physical datafiles. A datafile can be associated with only
one tablespace, and only one database.
C is OK (Oracle7 documentation, Server Concepts, 3-10): An extent is a logical unit of
database storage space allocation made up of a number of contiguous data blocks. Each
segment is composed of one or more extents.
D is false (Oracle7 documentation, Server Concepts, 3-3): Oracle allocates space for
segments in extents. Therefore, when the existing extents of a segment are full, Oracle
allocates another extent for that segment. Because extents are allocated as needed, the
extents of a segment may or may not be contiguous on disk. The segments also can span
files, but the individual extents cannot.
E is OK (Oracle7 documentation, Server Concepts, 4-3): Each tablespace in an Oracle
database is comprised of one or more operating system files called datafiles. A
tablespace's datafiles physically store the associated database data on disk.
F is false - see ans for D
A. extent
B. segment
C. Oracle block
D. operating system block
Answer: A
Explanation:
The extent_management_clause lets you specify how the extents of the tablespace will be
managed.
(a) Specify LOCAL if you want the tablespace to be locally managed. Locally managed
tablespaces have some part of the tablespace set aside for a bitmap. This is the default.
(b) AUTOALLOCATE specifies that the tablespace is system managed. Users cannot
specify an extent size. This is the default if the COMPATIBLE initialization parameter is
set to 9.0.0 or higher.
(c) UNIFORM specifies that the tablespace is managed with uniform extents of SIZE
bytes. Use K or M to specify the extent size in kilobytes or megabytes. The default SIZE
is 1 megabyte.
Note: Once you have specified extent management with this clause, you can change
extent management only by migrating the tablespace.
32. Which is a complete list of the logical components of the Oracle database?
Answer: B
See Q29
33. Which option lists the correct hierarchy of storage structures, from largest to the
smallest?
Answer: D
Explanation:
Logical Database Structures: The logical structures of an Oracle database include schema
objects, data blocks, extents, segments, and tablespaces.
Oracle Data Blocks: At the finest level of granularity, Oracle database data is stored in
data blocks. One data block corresponds to a specific number of bytes of physical
database space on disk.
Extents: The next level of logical database space is an extent. An extent is a specific
number of contiguous data blocks, obtained in a single allocation, used to store a specific
type of information.
Segments: Above extents, the level of logical database storage is a segment. A segment is
a set of extents allocated for a certain logical structure. The following table describes the
different types of segments.
Tablespaces: A database is divided into logical storage units called tablespaces, which
group related logical structures together.
A. segments
B. database blocks
C. tablespaces
D. operating system blocks
Answer: B
Explanation:
An extent is a specific number of contiguous data blocks, obtained in a single allocation,
and used to store a specific type of information.
35. Which two statements about segments are true? (Choose two.)
Answer: B, C
Explanation:
A single data segment in an Oracle database holds all of the data for one of the following:
(a) A table that is not partitioned or clustered.
(b) A partition of a partitioned table.
(c) A cluster of tables.
A table or materialized view can contain LOB, varray, or nested table column types.
These entities can be stored in their own segments.
Ad A: False. Each table in a cluster does not have its own segment. Clustered tables
contain some blocks as a common part for two or more tables. Clusters enable you to
store data from several tables inside a single segment so users can retrieve data from
those two tables together very quickly.
Ad D: False. For each index, Oracle allocates one or more extents to form its index
segment.
Ad E: False. Oracle creates this data segment when you create the nonclustered table or
cluster with the CREATE command.
Ad F: False. A nested table of a column within a table does not use the parent table
segment: it has its own.
Oracle databases use four types of segments:
(a) Data Segments
(b) Index Segments
(c) Temporary Segments
(d) Rollback Segments
See: (a58227.pdf) Pg. 107. (2-15)
36. Which type of table is usually created to enable the building of scalable applications,
and is useful for large tables that can be queried or manipulated using several processes
concurrently?
A. regular table
B. clustered table
C. partitioned table
D. index-organized table
Answer: C
What is Scalability?
In the case of web applications, scalability is the capacity to serve additional users or
transactions without fundamentally altering the application's architecture or program
design. If an application is scalable, you can maintain steady performance as the load
increases simply by adding additional resources such as servers, processors or memory.
Cluster
A cluster is an oracle http://infoboerse.doag.de/mirror/frank/glossary/faqgloso.htm object
that allows one to store related rows from different tables in the same data
http://infoboerse.doag.de/mirror/frank/glossary/faqglosd.htm block
http://infoboerse.doag.de/mirror/frank/glossary/faqglosb.htm. Table
http://infoboerse.doag.de/mirror/frank/glossary/faqglost.htm clustering is very seldomly
used by Oracle http://infoboerse.doag.de/mirror/frank/glossary/faqgloso.htm DBA
http://infoboerse.doag.de/mirror/frank/glossary/faqglosd.htm's and Developers.
Ans is c -> multiprocess access is better, if the 2 processes access different files.
Answer: A
Explanation:
SQL 18-47
SET ROLE
Purpose: Use the SET ROLE statement to enable and disable roles for your current
session.
In the IDENTIFIED BY password clause, specify the password for a role. If the role has
a password, then you must specify the password to enable the role.
D is out of question, bad syntax. I would go for A, if the role does not have a password,
this command is ok.
38. Your database is currently configured with the database character set to
WE8ISO8859P1 and national character set to AF16UTF16.
Business requirements dictate the need to expand language requirements beyond the
current character set, for Asian and additional Western European languages, in the form
of customer names and addresses.
Which solution saves space storing Asian characters and maintains consistent character
manipulation performance?
A. Use SQL CHAR data types and change the database character set to UTF8.
B. Use SQL NCHAR data types and change the national character set to UTF8.
C. Use SQL CHAR data types and change the database character set to AF32UTF8.
D. Use SQL NCHAR data types and keep the national character set to AF16UTF16.
Answer: D
Explanation:
SQL NCHAR
Supporting multilingual data often means using Unicode. Unicode is a universal character
encoding scheme that allows you to store information from any major language using a
single character set. Unicode provides a unique code value for every character, regardless
of the platform, program, or language. For many companies with legacy systems making
the commitment to migrating their entire database to support Unicode is not practical. An
alternative to storing all data in the database as Unicode is to use the SQL NCHAR
datatypes. Unicode characters can be stored in columns of these datatypes regardless of
the setting of the database character set. The NCHAR datatype has been redefined in
Oracle9i to be a Unicode datatype exclusively. In other words, it stores data in the
Unicode encoding only. The National Character Set supports UTF-16 and UTF-8 in the
following encodings:
(a) AL16UTF16 (default)
(b) UTF8
SQL NCHAR datatypes (NCHAR, NVARCHAR2, and NCLOB) can be used in the same
way as the SQL CHAR datatypes. This allows the inclusion of Unicode data in a non
Unicode database. Some of the key benefits for using the NCHAR datatype versus
having the entire database as Unicode include:
You only need to support multilingual data in a limited number of columns - You can add
columns of the SQL NCHAR datatypes to existing tables or new tables to support
multiple languages incrementally. Or you can migrate specific columns from SQL CHAR
datatypes to SQL NCHAR datatypes easily using the ALTER TABLE MODIFY
COLUMN command.
Example: ALTER TABLE emp MODIFY (ename NVARCHAR2(10));
You are building a packaged application that will be sold to customers, then you may
want to build the application using SQL NCHAR datatypes - This is because with the
SQL NCHAR datatype the data is always stored in Unicode, and the length of the data is
always specified in UTF-16 code units. As a result, you need only test the application
once, and your application will run on your customer databases regardless of the database
character set.
You want the best possible performance - If your existing database character set is
single-byte then extending it with SQL NCHAR datatypes may offer better performance
then migrating the entire database to Unicode.
Your applications native environment is UCS-2 or UTF-16 - A Unicode database must
run as UTF-8. This means there will be conversion between the client and database. By
using the NCHAR encoding AL16UTF16, you can eliminate this conversion.
39. You have just accepted the position of DBA with a new company. One of the first
things you want to do is examine the performance of the database. Which tool will help
you to do this?
A. Recovery Manager
B. Oracle Enterprise Manager
C. Oracle Universal Installer
D. Oracle Database Configuration Assistant
Answer: B
Explanation:
http://www.orafaq.com/faqoem.htm
What is OEM (Oracle Enterprise Manager)?
OEM is a set of system management tools provided by Oracle for managing the Oracle
environment. It provides tools to automate tasks (both one-time and repetitive in nature)
to take database administration a step closer to "Lights Out" management.
What are the components of OEM?
Oracle Enterprise Manager (OEM) has the following components:
Management Server (OMS): Middle tier server that handles communication with the
intelligent agents. The OEM Console connects to the management server to monitor and
configure the Oracle enterprise.
Console: This is a graphical interface from where one can schedule jobs, events, and
monitor the database. The console can be opened from a Windows workstation, Unix
XTerm (oemapp command) or Web browser session (oem_webstage).
Intelligent Agent (OIA): The OIA runs on the target database and takes care of the
execution of jobs and events scheduled through the Console.
Data Gatherer (DG): The DG runs on the target database and takes care of the gathering
database statistics over time.
40. You have a database with the DB_NAME set to PROD and ORACLE_SID set to
PROD.
These files are in the default location for the initialization files:
- init.ora
- initPROD.ora
- spfile.ora
- spfilePROD.ora<br />
Which initialization files does the Oracle Server attempt to read, and in which order?
Answer: C
Explanation:
http://www.trivadis.ch/publikationen/E/spfile_and_initora.en.pdf http://www.adp-
gmbh.ch/ora/notes.html
Up to version 8i, Oracle traditionally stored initialization parameters in a text file
INIT.ORA (PFILE). With Oracle9i, server parameter files (SPFILE) can also be used. An
SPFILE can be regarded as a repository for initialization parameters which is located on
the database server. SPFILEs are small binary files that cannot be edited. Editing
SPFILEs corrupts the file and either the instance fails to start or an active instance may
crash.
41. You are in the planning stages of creating a database. How should you plan to
influence the size of the control file?
Answer: C
Explanation:
CONTROL_FILES
is a string -> name of the files -> does not influence the size
SQL 13-15
CREATE CONTROLFILE
Use the CREATE CONTROLFILE statement to re-create a control file in one of the
following cases:
(a) All copies of your existing control files have been lost through media failure.
(b) You want to change the name of the database.
(c) You want to change the maximum number of redo log file groups, redo log file
members, archived redo log files, datafiles, or instances that can concurrently have the
database mounted and open.
http://coffee.kennesaw.edu/tests/Oracle/ch3.doc:
CREATE DATABASE
Question 19. Which clauses in the CREATE DATABASE command specify limits for the
database?
The control file size depends on the following limits (MAXLOGFILES,
MAXLOGMEMBERS, MAXLOGHISTORY, MAXDATAFILES, MAXINSTANCES),
because Oracle pre-allocates space in the control file.
MAXLOGFILES: specifies the maximum number of redo log groups that can ever be
created in the database.
MAXLOGMEMBERS: specifies the maximum number of redo log members (copies of
the redo logs) for each redo log group.
MAXLOGHISTORY: is used only with Parallel Server configuration. It specifies the
maximum number of archived redo log files for automatic media recovery.
MAXDATAFILES: specifies the maximum number of data files that can be created in
this database. Data files are created when you create a tablespace, or add more space to a
tablespace by adding a data file.
MAXINSTANCES: specifies the maximum number of instances that can simultaneously
mount and open this database.
If you want to change any of these limits after the database is created, you must re-create
the control file.
Answer: B
Explanation:
http://www.dbaoncall.net/references/ht_startup_shutdown_db.html
1. No two rows of a table can have duplicate values in the specified column.
2. A column cannot contain null values.<br />
Which type of constraint ensures that both of the above rules are true?
A. check
B. unique
C. not null
D. primary key
E. foreign key
Answer: D
No comment
44. Your company hired Joe, a DBA who will be working from home. Joe needs to have
the ability to start the database remotely.
You created a password file for your database and set
REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE in the parameter file. Which
command adds Joe to the password file, allowing him remote DBA access?
Answer: B
Explanation:
Oracle9i Database Administrator's Guide Release 2 (9.2) March 2002 Part No. A96521-
01 (a96521.pdf) 1-20.
Using ORAPWD
When you invoke the password file creation utility without supplying any parameters,
you receive a message indicating the proper use of the command as shown in the
following sample output:
orapwd
Usage: orapwd file=<fname> password=<password> entries=<users>
where
file - name of password file (mand).
password - password for SYS (mand).
entries - maximum number of distinct DBAs and OPERs (opt).
45. You need to drop two columns from a table. Which sequence of SQL statements
should be used to drop the columns and limit the number of times the rows are
updated?<br />
Answer: D
Explanation:
http://certcities.com/certs/oracle/columns/story.asp?EditorialsID=36:
Reorganizing Columns
While it has been possible to add new columns to an existing table in Oracle for quite a
while now, until Oracle 8i it was not possible to drop or remove a column from a table
without dropping the table first and then re-creating it without the column you wanted to
drop. With this method, you needed to perform an EXPORT before dropping the table
and then an IMPORT after creating it without the column, or issue a CREATE TABLE ...
AS SELECT statement with all of its associated headaches (see above).
In Oracle 8i, we now have a way of marking columns UNUSED and then dropping them
at a later date. Oracle is a little behind the times here compared to SQL Server, which
does not require a complete rebuild of the table after dropping the column, but I'm just
happy that I have the feature and hope that they'll improve it in Oracle 9i.
To get rid of columns with this new method, the first step is to issue the ALTER TABLE
<tablename> SET UNUSED COLUMN <columnname>, which sets the column to
no longer be used within the table but does not change the physical structure of the table.
All rows physically have the column's data stored, and a physical place is kept for the
column on disk, but the column cannot be queried and, for all intents and purposes, does
not exist. In essence, the column is flagged to be dropped, though you cannot reverse
setting the column to UNUSED.
It is possible to set a number of columns UNUSED in a table before actually dropping
them. The overhead of setting columns UNUSED is fairly minimal and allows you to
continue to operate normally, except that any actions on the UNUSED columns will
result in an error. The next step, when you have configured all the columns you want to
get rid of as UNUSED, is to actually physically reorganize the table so that the data for
the UNUSED columns is no longer on disk and the columns are really gone. This is done
by issuing the command ALTER TABLE ... DROP COLUMN.
Physically dropping a column in an Oracle table is a process that will prevent anyone
from accessing the table while the removal of the column(s) is processed. The commands
that will affect an actual removal of a column are:
ALTER TABLE <tablename> DROP COLUMN <columnname>
ALTER TABLE <tablename> DROP UNUSED COLUMNS
The commands will always do the same thing. This means that if you mark two or three
columns as UNUSED in a table, if you decide you want to drop one of them using the
ALTER TABLE ... DROP COLUMN command, you will drop ALL columns marked as
UNUSED whether you want to or not. The ALTER TABLE ... DROP COLUMN can also
be used when a column has not previously been marked as UNUSED but you simply
want to drop it right away, but you will also drop any UNUSED columns because that's
the way it works.
If constraints depend on the column being dropped, you can use the CASCADE
CONSTRAINTS option to deal with them; if you also want to explicitly mark views,
triggers, stored procedures or other stored program units referencing the parent table and
force them to be recompiled the next time they are used, you can also specify the
INVALIDATE option.
A problem could arise if you issue the DROP COLUMN command and the instance
crashes during the rebuild of the table. In this case, the table will be marked as INVALID
and will not be available to anyone. Oracle forces you to complete the DROP COLUMN
operation before the table can be used again. To get out of this situation, issue the
command ALTER TABLE ... DROP COLUMNS CONTINUE. This will complete the
process and mark the table as VALID upon completion.
http://whizlabs.com/ocp/ocp-1Z0-007-tips.html
Tip 34: Oracle allows columns to be dropped with the 'Alter Table Drop Columns'
command. Dropping of columns generally takes a lot of time, so an alternative (faster)
option would be to mark the column as unused with the 'Set Unused Column' clause and
later drop the unused column.
46. When an Oracle instance is started, background processes are started. Background
processes perform which two functions? (choose two)
A. perform I/O
B. lock rows that are not data dictionary rows
C. monitor other Oracle processes
D. connect users to the Oracle instance
E. execute SQL statements issued through an application
Answer: A, C
Explanation:
Oracle9i Database Administrator's Guide Release 2 (9.2) March 2002 Part No. A96521-
01 (a96521.pdf) 5-11.
To maximize performance and accommodate many users, a multiprocess Oracle system
uses some additional processes called background processes. Background processes
consolidate functions that would otherwise be handled by multiple Oracle programs
running for each user process. Background processes asynchronously perform I/O and
monitor other Oracle processes to provide increased parallelism for better performance
and reliability.
47. You omit the UNDO tablespace clause in your CREATE DATABASE statement. The
UNDO_MANAGEMENT parameter is set to AUTO.
Answer: C
Explanation:
http://www.oracle-
base.com/Articles/9i/AutomaticUndoManagement.asp#EnablingAutomaticUndoManage
ment
Oracle recommends that instead of using rollback segments in your database, you use an
undo tablespace. This requires the use of a different set of initialization parameters, and
optionally, the inclusion of the UNDO TABLESPACE clause in your CREATE
DATABASE statement.
You must include the following initialization parameter if you want to operate your
database in automatic undo management mode:
UNDO_MANAGEMENT=AUTO
In this mode, rollback information, referred to as undo, is stored in an undo tablespace
rather than rollback segments and is managed by Oracle. If you want to create and name
a specific tablespace for the undo tablespace, you can include the UNDO TABLESPACE
clause at database creation time. If you omit this clause, and automatic undo management
is specified, Oracle creates a default undo tablespace named SYS_UNDOTBS.
Which two columns are required from DBA_TABLES to determine the size of the extent
when it extends? (Choose two)
A. BLOCKS
B. PCT_FREE
C. NEXT_EXTENT
D. PCT_INCREASE
E. INITIAL_EXTENT
Answer: C, D
Explanation:
The SIZE parameter of the ALLOCATE EXTENT clause is the extent size in bytes,
rounded up to a multiple of the block size. If you do not specify SIZE, then Oracle
calculates the extent size according to the values of the NEXT and PCTINCREASE
storage parameters.
Oracle does not use the value of SIZE as a basis for calculating subsequent extent
allocations, which are determined by the values set for the NEXT and PCTINCREASE
parameters.
49. Bob is an administrator who has FULL DBA privileges. When he attempts to drop the
DEFAULT profile as shown below, he receives the error message shown. Which option
best explains this error?<br /><br />
SQL> drop profile SYS.DEFAULT;<br />
drop profile SYS.DEFAULT<br />
*<br />
ERROR at line 1:<br />
ORA-00950: invalid DROP option<br />
Answer: A
Explanation:
SQL 16-94
Restriction on dropping profiles: You cannot drop the DEFAULT profile.
50. You are in the process of dropping the BUILDING_LOCATION column from the
HR.EMPLOYEES table. The table has been marked INVALID until the operation
completes. Suddenly the instance fails. Upon startup, the table remains INVALID.
Which step(s) should you follow to complete the operation?
Answer: A
Testking said D.
Explanation:
DROP UNUSED COLUMNS Clause: Specify DROP UNUSED COLUMNS to remove
from the table all columns currently marked as unused. Use this statement when you want
to reclaim the extra disk space from unused columns in the table. If the table contains no
unused columns, then the statement returns with no errors.
column Specify one or more columns to be set as unused or dropped. Use the COLUMN
keyword only if you are specifying only one column. If you specify a column list, then it
cannot contain duplicates.
CASCADE CONSTRAINTS: Specify CASCADE CONSTRAINTS if you want to drop
all foreign key constraints that refer to the primary and unique keys defined on the
dropped columns, and drop all multicolumn constraints defined on the dropped columns.
If any constraint is referenced by columns from other tables or remaining columns in the
target table, then you must specify CASCADE CONSTRAINTS. Otherwise, the
statement aborts and an error is returned..ALTER TABLE
INVALIDATE: The INVALIDATE keyword is optional. Oracle automatically invalidates
all dependent objects, such as views, triggers, and stored program units. Object
invalidation is a recursive process. Therefore, all directly dependent and indirectly
dependent objects are invalidated. However, only local dependencies are invalidated,
because Oracle manages remote dependencies differently from local dependencies. An
object invalidated by this statement is automatically revalidated when next referenced.
You must then correct any errors that exist in that object before referencing it.
CHECKPOINT: Specify CHECKPOINT if you want Oracle to apply a checkpoint for the
DROP COLUMN operation after processing integer rows; integer is optional and must be
greater than zero. If integeris greater than the number of rows in the table, then Oracle
applies a checkpoint after all the rows have been processed. If you do not specify integer,
then Oracle sets the default of 512. Checkpointing cuts down the amount of undo logs
accumulated during the DROP COLUMN operation to avoid running out of rollback
segment space. However, if this statement is interrupted after a checkpoint has been
applied, then the table remains in an unusable state. While the table is unusable, the only
operations allowed on it are DROP TABLE, TRUNCATE TABLE, and ALTER TABLE
DROP COLUMNS CONTINUE (described in sections that follow). You cannot use this
clause with SET UNUSED, because that clause does not remove column data.
DROP COLUMNS CONTINUE Clause: Specify DROP COLUMNS CONTINUE to
continue the drop column operation from the point at which it was interrupted.
Submitting this statement while the table is in a valid state results in an error. See
http://download-
west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_32a.htm#2103766.
51. As SYSDBA you created the PAYCLERK role and granted the role to Bob. Bob in
turn attempts to modify the authentication method of the PAYCLERK role from
SALARY to NOT IDENTIFIED, but when doing so he receives the insufficient privilege
error shown below.<br />
SQL> connect bob/crusader<br />
Connected.<br />
<br />
SQL> alter role payclerk not identified;<br />
alter role payclerk not identified<br />
*<br />
ERROR at line 1:<br />
ORA-01031: insufficient privileges<br />
Which privilege does Bob require to modify the authentication method of the
PAYCLERK role?
Answer: A
Wrong: B, C, D - MANAGE ANY ROLE, UPDATE ANY ROLE, MODIFY ANY ROLE
don't exist.
52. You are going to re-create your database and want to reuse all of your existing
database files.
You issue the following SQL statement:
Answer: B
Explanation:
Ad B: The initial control files of an Oracle database are created when you issue the
CREATE DATABASE statement. The names of the control files are specified by the
CONTROL_FILES parameter in the initialization parameter file used during database
creation. The filenames specified in CONTROL_FILES should be fully specified and are
operating system specific. If control files with the specified names currently exist at the
time of database creation, you must specify the CONTROLFILE REUSE clause in the
CREATE DATABASE statement, or else an error occurs.
Ad A: MAXLOGILE min and max value is operating system dependent. But I think the
min value is 1.
Ad C: You can reuse a online redo log file.
Ad D: DATAFILE Clause specify one or more files to be used as datafiles. All these files
become part of the SYSTEM tablespace.
Which three statements correctly describe what user OE can or cannot do? (Choose
three.)
Answer: B, C, E
Explanation:
Granting Multiple Object Privileges on Individual Columns: Example To grant to user oe
the REFERENCES privilege on the employee_id column and the UPDATE privilege on
the employee_id, salary, and commission_pct columns of the employees table in the
schema hr, issue the following statement:
GRANT REFERENCES (employee_id),
UPDATE (employee_id, salary, commission_pct)
ON hr.employees
TO oe;
The constraint in_emp ensures that all dependents in the dependent table correspond to an
employee in the employees table in the schema hr.
A. Checkpoint occurs.
B. A fast commit occurs.
C. RECO performs the session recovery.
D. PMON rolls back the user's current transaction.
E. SMON rolls back the user's current transaction.
F. SMON frees the system resources reserved for the user session.
G. PMON releases the table and row locks held by the user session.
Answer: D, G
Explanation:
SMON: The system monitor performs crash recovery when a failed instance starts up
again. In a cluster database (Oracle9i Real Application Clusters), the SMON process of
one instance can perform instance recovery for other instances that have failed. SMON
also cleans up temporary segments that are no longer in use and recovers dead
transactions skipped during crash and instance recovery because of file-read or offline
errors. These transactions are eventually recovered by SMON when the tablespace or file
is brought back online.
PMON: The process monitor performs process recovery when a user process fails.
PMON is responsible for cleaning up the cache and freeing resources that the process was
using. PMON also checks on the dispatcher processes (see below) and server processes
and restarts them if they have failed.
The process monitor process (PMON) cleans up failed user processes and frees up all the
resources used by the failed process. It resets the status of the active transaction table and
removes the process ID from the list of active processes. It reclaims all resources held by
the user and releases all locks on tables and rows held by the user. PMON wakes up
periodically to check whether it is needed.
RECO: The recoverer process is used to resolve distributed transactions that are pending
due to a network or system failure in a distributed database. At timed intervals, the local
RECO attempts to connect to remote databases and automatically complete the commit or
rollback of the local portion of any pending distributed transactions.
Checkpoint (CKPT): At specific times, all modified database buffers in the SGA are
written to the datafiles by DBWn. This event is called a checkpoint. The checkpoint
process is responsible for signaling DBWn at checkpoints and updating all the datafiles
and control files of the database to indicate the most recent checkpoint.
Answer: D
Explanation:
PCTINCREASE
Specify the percent by which the third and subsequent extents grow over the preceding
extent. The default value is 50, meaning that each subsequent extent is 50% larger than
the preceding extent. The minimum value is 0, meaning all extents after the first are the
same size. The maximum value depends on your operating system.
Specify the size of the file in bytes. Use K or M to specify the size in kilobytes or
megabytes. No minimum size for DATAFILE. No Max size either. It can be unlimited.
Operating system dependent. If you omit this clause when creating an Oracle-managed
file, then Oracle creates a 100M file.
DEFAULT storage_clause
Specify the default storage parameters for all objects created in the tablespace.
For a dictionary-managed temporary tablespace, Oracle considers only the NEXT
parameter of the storage_clause. Restriction on default storage: You cannot specify this
clause for a locally managed tablespace.
segment_management_clause
The segment_management_clause is relevant only for permanent, locally managed
tablespaces. It lets you specify whether Oracle should track the used and free space in the
segments in the tablespace using free lists or bitmaps.
INITIAL
Specify in bytes the size of the object's first extent. Oracle allocates space for this extent
when you create the schema object. Use K or M to specify this size in kilobytes or
megabytes.
The default value is the size of 5 data blocks. In tablespaces with manual segmentspace
management, the minimum value is the size of 2 data blocks plus one data block for each
free list group you specify. In tablespaces with automatic segmentspace management, the
minimum value is 5 data blocks. The maximum value depends on your operating system.
In dictionary-managed tablespaces, if MINIMUM EXTENT was specified for the
tablespace when it was created, then Oracle rounds the value of INITIAL up to the
specified MINIMUM EXTENT size if necessary. If MINIMUM EXTENT was not
specified, then Oracle rounds the INITIAL extent size for segments created in that
tablespace up to the minimum value (see preceding paragraph), or to multiples of 5
blocks if the requested size is greater than 5 blocks.
In locally managed tablespaces, Oracle uses the value of INITIAL in conjunction with the
size of extents specified for the tablespace to determine the object's first extent. For
example, in a uniform locally managed tablespace with 5M extents, if you specify an
INITIAL value of 1M, then Oracle creates five 1M extents.
Restriction on INITIAL: You cannot specify INITIAL in an ALTER statement.
NEXT
Specify in bytes the size of the next extent to be allocated to the object. Use K or M to
specify the size in kilobytes or megabytes. The default value is the size of 5 data blocks.
The minimum value is the size of 1 data block. The maximum value depends on your
operating system. Oracle rounds values up to the next multiple of the data block size for
values less than 5 data blocks. For values greater than 5 data blocks, Oracle rounds up to
a value that minimizes fragmentation, as described in Oracle9i Database Administrator's
Guide.
If you change the value of the NEXT parameter (that is, if you specify it in an ALTER
statement), then the next allocated extent will have the specified size, regardless of the
size of the most recently allocated extent and the value of the PCTINCREASE parameter.
TEMPORARY
Specify TEMPORARY if the tablespace will be used only to hold temporary objects, for
example, segments used by implicit sorts to handle ORDER BY clauses.
Temporary tablespaces created with this clause are always dictionary managed, so you
cannot specify the EXTENT MANAGEMENT LOCAL clause. To create a locally
managed temporary tablespace, use the CREATE TEMPORARY TABLESPACE
statement.
Answer: B, D, E
Explanation:
Ad D, E, F: See http://download-
west.oracle.com/docs/cd/B10501_01/server.920/a96524/c04space.htm#10136
When a Tablespace Goes Offline
When a tablespace goes offline or comes back online, this is recorded in the data
dictionary in the SYSTEM tablespace. If a tablespace is offline when you shut down a
database, the tablespace remains offline when the database is subsequently mounted and
reopened.
You can drop a tablespace regardless of whether it is online or offline (-> This makes A
wrong). Oracle recommends that you take the tablespace offline before dropping it to
ensure that no SQL statements in currently running transactions access any of the objects
in the tablespace.
Restriction on the OFFLINE clause: You cannot take a temporary tablespace offline.
NORMAL
Specify NORMAL to flush all blocks in all datafiles in the tablespace out of the SGA.
You need not perform media recovery on this tablespace before bringing it back online.
This is the default. -> B is true.
TEMPORARY
If you specify TEMPORARY, then Oracle performs a checkpoint for all online datafiles
in the tablespace but does not ensure that all files can be written.
Any offline files may require media recovery before you bring the tablespace back
online.
Specify OFFLINE to take the tablespace offline and prevent further access to its
segments. When you take a tablespace offline, all of its datafiles are also offline.
Which three statements are true about dropping a table? (Choose three.)
Answer: B, C, E
Explanation:
Ad A: In general, the extents of a segment do not return to the tablespace until you drop
the schema object whose data is stored in the segment (using a DROP TABLE or DROP
CLUSTER statement).
Ad B: Dropping a table removes the table definition from the data dictionary. All rows of
the table are no longer accessible.
Ad C: All indexes and triggers associated with a table are dropped.
Ad D: False. All synonyms for a dropped table remain, but return an error when used.
Ad E: If the table to be dropped contains any primary or unique keys referenced by
foreign keys of other tables and you intend to drop the FOREIGN KEY constraints of the
child tables, include the CASCADE clause in the DROP TABLE statement
Answer: B, C, D, E
Explanation:
To remove all rows from a table or cluster and reset the STORAGE parameters to the
values when the table or cluster was created.
You can use the TRUNCATE command to quickly remove all rows from a table or
cluster. Removing rows with the TRUNCATE command is faster than removing them
with the DELETE command for the following reasons:
The TRUNCATE command is a data definition language (DDL) command and generates
no rollback information.
Truncating a table does not fire the table's DELETE triggers.
The TRUNCATE command allows you to optionally deallocate the space freed by the
deleted rows. The DROP STORAGE option deallocates all but the space specified by the
table's MINEXTENTS parameter. Deleting rows with the TRUNCATE command is also
more convenient than dropping and re-creating a table because dropping and re-creating:
invalidates the table's dependent objects, while truncating does not requires you to regrant
object privileges on the table, while truncating does not requires you to re-create the
table's indexes, integrity constraints, and triggers and respecify its STORAGE
parameters.
See: Oracle8 SQL Reference Release 8.0 December 1997 Part No. A58225-01
(a58225.pdf) pg.722. (4-538)
59. Tom was allocated 10 MB of quota in the USERS tablespace. He created database
objects in the USERS tablespace. The total space allocated for the objects owned by Tom
is 5 MB. You need to revoke Tom's quota from the USERS tablespace. You issue this
command: ALTER USER Tom QUOTA 0 ON users; <br />
What is the result?
Answer: D
Explanation:
Use the ALTER USER statement to change the authentication or database resource
characteristics of a database user.
Tom quota on the USERS tablespace is revoked with this statement. The objects are not
deleted from the tablespace.
After you have set the quota to zero, you still can insert and delete records from the table
which was created in the users tablespace. So I guess, it will use the SYSTEM tablespace
for the new results.
60. Which background process performs a checkpoint in the database by writing modified
blocks from the database buffer cache in the SGA to the data files?
A. LGWR
B. SMON
C. DBWn
D. CKPT
E. PMON
Answer: C
Explanation:
Refer to question 54 for the explanation of some of the words used in the answer.
Database Writer (DBW n)
The database writer writes modified blocks from the database buffer cache to the
datafiles. Although one database writer process (DBW0) is sufficient for most systems,
you can configure additional processes (DBW1 through DBW9 and DBWa through
DBWj) to improve write performance for a system that modifies data heavily. The
initialization parameter DB_WRITER_PROCESSES specifies the number of DBWn
processes.
Checkpoint (CKPT)
At specific times, all modified database buffers in the SGA are written to the datafiles by
DBWn. This event is called a checkpoint. The checkpoint process is responsible for
signaling DBWn at checkpoints and updating all the datafiles and control files of the
database to indicate the most recent checkpoint.
61. Which command would revoke the ROLE_EMP role from all users?
Answer: B
Explanation:
Privileges and roles can also be granted to and revoked from the user group PUBLIC.
Because PUBLIC is accessible to every database user, all privileges and roles granted to
PUBLIC are accessible to every database user.
Errors given by the answers:
Answer A: ORA-00987: missing or invalid username(s).
Answer B: (It's ok as long as the role was granted to PUBLIC).
Answer C: ORA-00987: missing or invalid username(s).
Answer D: ORA-01917: user or role 'ALL_USERS' does not exist.
62. You are experiencing intermittent hardware problems with the disk drive on which
your control file is located. You decide to multiplex your control file.<br />
While your database is open, you perform these steps:<br />
1. Make a copy of your control file using an operating system command.<br />
2. Add the new file name to the list of files for the CONTROL FILES parameter in your
text intialization parameter file using an editor.<br />
3. Shut down the instance.<br />
4. Issue the STARTUP command to restart the instance, mount, and open the
database.<br />
A. You copied the control file before shutting down the instance.
B. You used an operating system command to copy the control file.
C. The Oracle server does not know the name of the new control file.
D. You added the new control file name to the CONTROL_FILES parameter before
shutting down the instance.
Answer: A
Explanation:
To Multiplex or Move Additional Copies of the Current Control File:
1. Shutdown the database.
2. Exit Server Manager.
3. Copy an existing control file to a different location, using operating system commands.
4. Edit the CONTROL_FILES parameter in the database's parameter file to add the new
control file's name, or to change the existing control filename.
5. Restart Server Manager.
6. Restart the database.
For more information refer to Steps for Creating New Control Files in Administrator's
guide on page 6-7
Answer: E
Explanation:
MINIMUM EXTENT Clause
Specify the minimum size of an extent in the tablespace. This clause lets you control free
space fragmentation in the tablespace by ensuring that every used or free extent size in a
tablespace is at least as large as, and is a multiple of, integer.
The storage_clause is interpreted differently for locally managed tablespaces. At creation,
Oracle ignores MAXEXTENTS and uses the remaining parameter values to calculate the
initial size of the segment.
64. You are going to create a new database. You will NOT use operating system
authentication.
Which two files do you need to create before creating the database? (Choose two.)
A. control file
B. password file
C. redo log file
D. alert log file
E. initialization parameter file
Answer: B, E
Explanation:
I guess answer A is stupid. First of all, creating control files is the purpose of the whole
create database procedure. Other proof:
Oracle9i SQL Reference Release 2 (9.2) March 2002 Part No. A96540-01 (a96540.pdf)
13-26
CONTROLFILE REUSE Clause
Specify CONTROLFILE REUSE to reuse existing control files identified by the
initialization parameter CONTROL_FILES, thus ignoring and overwriting any
information they currently contain. Normally you use this clause only when you are re-
creating a database, rather than creating one for the first time. You cannot use this clause
if you also specify a parameter value that requires that the control file be larger than the
existing files. These parameters are MAXLOGFILES, MAXLOGMEMBERS,
MAXLOGHISTORY, MAXDATAFILES, and MAXINSTANCES. If you omit this clause
and any of the files specified by CONTROL_FILES already exist, Oracle returns an
error.
Password file
But since no OS authentication is used, the other choice can only be password-file
authentication. For this purpose a password file is needed.
Redo log file
Redo log file is used for the transactions within a database, not for database creation.
Alert log file
See question 11 ("Trace files, on the other hand, are generated by the oracle background
processes or other connected net8 processes when oracle internal errors occur and they
dump all information about the error into the trace files.").
Initialization parameter file
We need one, this file contains the description of the created database.
So the answer is B, E.
Remark: It would be logical, that if Oracle wants to read from a file, the file needs to be
there. If Oracle wants to write to a file, it will create one.
65. Based on the following profile limits, if a user attempts to log in and fails after five
tries, how long must the user wait before attempting to log in again?<br />
A. 1 minute
B. 5 minutes
C. 10 minutes
D. 14 minutes
E. 18 minutes
F. 60 minutes
Answer: A
Explanation:
PASSWORD_LOCK_TIME is the interesting parameter: PASSWORD_LOCK_TIME
specifies the number of days an account will be locked after the specified number of
consecutive failed login attempts.
Now we have 1/1440 days = 24/1440 hours = 24*60/1440 minutes = 1 minute.
password_parameters
FAILED_LOGIN_ATTEMPTS: Specify the number of failed attempts to log in to the
user account before the account is locked.
PASSWORD_LIFE_TIME: Specify the number of days the same password can be used
for authentication. The password expires if it is not changed within this period, and
further connections are rejected.
PASSWORD_REUSE_TIME: Specify the number of days before which a password
cannot be reused. If you set PASSWORD_REUSE_TIME to an integer value, then you
must set PASSWORD_REUSE_MAX to UNLIMITED.
PASSWORD_REUSE_MAX: Specify the number of password changes required before
the current password can be reused. If you set PASSWORD_REUSE_MAX to an integer
value, then you must set PASSWORD_REUSE_TIME to UNLIMITED.
PASSWORD_LOCK_TIME: Specify the number of days an account will be locked after
the specified number of consecutive failed login attempts.
PASSWORD_GRACE_TIME: Specify the number of days after the grace period begins
during which a warning is issued and login is allowed. If the password is not changed
during the grace period, the password expires.
PASSWORD_VERIFY_FUNCTION: The PASSWORD_VERIFY_FUNCTION clause
lets a PL/SQL password complexity verification script be passed as an argument to the
CREATE PROFILE statement. Oracle provides a default script, but you can create your
own routine or use third-party software instead. For function, specify the name of the
password complexity verification routine, specify NULL to indicate that no password
verification is performed.
Answer: B, D, E
Explanation:
CREATE ANY MATERIALIZED VIEW: Create materialized views in any schema.
CREATE ANY DIMENSION: Create dimensions in any schema.
DROP ANY DIMENSION: Drop dimensions in any schema.
QUERY REWRITE: Enable rewrite using a materialized view, or create a functionbased
index, when that materialized view or index references tables and views that are in the
grantee's own schema.
GLOBAL QUERY REWRITE: Enable rewrite using a materialized view, or create a
functionbased index, when that materialized view or index references tables or views in
any schema.
WITH ADMIN OPTION: Specify WITH ADMIN OPTION to enable the grantee to:
(a) Grant the role to another user or role, unless the role is a GLOBAL role.
(b) Revoke the role from another user or role.
(c) Alter the role to change the authorization needed to access it.
(d) Drop the role.
67. Which constraint state prevents new data that violates the constraint from being
entered, but allows invalid data to exist in the table?
A. ENABLE VALIDATE
B. DISABLE VALIDATE
C. ENABLE NOVALIDATE
D. DISABLE NOVALIDATE
Answer: C
Explanation:
ENABLE VALIDATE specifies that all old and new data also complies with the
constraint. An enabled validated constraint guarantees that all data is and will continue to
be valid.
ENABLE NOVALIDATE ensures that all new DML operations on the constrained data
comply with the constraint. This clause does not ensure that existing data in the table
complies with the constraint and therefore does not require a table lock.
DISABLE VALIDATE disables the constraint and drops the index on the constraint, but
keeps the constraint valid. This feature is most useful in data warehousing situations,
because it lets you load large amounts of data while also saving space by not having an
index. This setting lets you load data from a nonpartitioned table into a partitioned table
using the exchange_partition_clause of the ALTER TABLE statement or using
SQL*Loader. All other modifications to the table (inserts, updates, and deletes) by other
SQL statements are disallowed.
DISABLE NOVALIDATE signifies that Oracle makes no effort to maintain the constraint
(because it is disabled) and cannot guarantee that the constraint is true (because it is not
being validated).
For more info look at page 7-20 of Oracle9 i SQL Reference document.
68. Which storage structure provides a way to physically store rows from more than one
table in the same data block?
A. cluster table
B. partitioned table
C. unclustered table
D. index-organized table
Answer: A
Explanation:
Clusters:
(a) Group of one or more tables physically stored together because they share common
columns and are often used together.
(b) Since related rows are stored together, disk access time improves.
(c) Clusters do not affect application design.
(d) Data stored in a clustered table is accessed by SQL in the same way as data stored in a
non-clustered table.
Partitioning addresses key issues in supporting very large tables and indexes by letting
you decompose them into smaller and more manageable pieces called partitions. SQL
queries and DML statements do not need to be modified in order to access partitioned
tables. However, after partitions are defined, DDL statements can access and manipulate
individuals partitions rather than entire tables or indexes.
This is how partitioning can simplify the manageability of large database objects. Also,
partitioning is entirely transparent to applications.
More info look at page 10-64 Oracle9 iDatabase Concepts (nice diagram of Cluster and
Non-cluster)
A. only LOBS
B. only nested tables
C. only index-organized tables
D. only LOBS and index-organized tables
E. only nested tables and index-organized tables
F. only LOBS, nested tables, and index-organized tables
G. nested tables, LOBS, index-organized tables, and boot straps
Answer: G
Explanation:
2-12 Oracle9i Database Concepts:
A single data segment in an Oracle database holds all of the data for one of the following:
(a) A table that is not partitioned or clustered.
(b) A partition of a partitioned table Segments Overview.
(c) A cluster of tables.
Look at Segment Overview on Page 2-12 in the Oracle 9i Concepts pdf file. By the way,
we use segments to store data, so everything is stored in segments.
70. Select the memory structure(s) that would be used to store the parse information and
actual value of the bind variable id for the following set of commands:
VARIABLE id NUMBER;
BEGIN
:id:=1;
END;
/
A. PGA only
B. Row cache and PGA
C. PGA and library cache
D. Shared pool only
E. Library cache and buffer cache
Answer: C
Explanation:
Reason for C instead of B:
http://download-
west.oracle.com/docs/cd/B10501_01/server.920/a96524/c16sqlpl.htm#CNCPT416:
Parsing is one stage in the processing of a SQL statement. When an application issues a
SQL statement, the application makes a parse call to Oracle. During the parse call,
Oracle:
(a) Checks the statement for syntactic and semantic validity.
(b) Determines whether the process issuing the statement has privileges to run it.
(c) Allocates a private SQL area for the statement.
Oracle also determines whether there is an existing shared SQL area containing the
parsed representation of the statement in the library cache. If so, the user process uses this
parsed representation and runs the statement immediately. If not, Oracle generates the
parsed representation of the statement, and the user process allocates a shared SQL area
for the statement in the library cache and stores its parsed representation there.
(2) Program Global Areas (PGA), which is private to each server and background
process; there is one PGA for each process. The PGA holds the following:
(a) Stack areas.
(b) Data areas.
71. The new Human Resources Application will be used to manage employee data in the
EMPLOYEES table. You are developing a strategy to manage user privileges. Your
strategy should allow for privileges to be granted or revoked from individual users or
groups of users with minimal administrative effort.<br /><br />
The users of the Human Resources application have these requirements:<br />
A Manager should be able to view the personal information of the employees in his/her
group and make changes to their Title and Salary.<br /><br />
What should you grant to the manager user?
Answer: D
72. An INSERT statement failed and is rolled back. What does this demonstrate?
A. insert recovery
B. read consistency
C. transaction recovery
D. transaction rollback
Answer: D
Explanation:
If at any time during execution a SQL statement causes an error, all effects of the
statement are rolled back. The effect of the rollback is as if that statement had never been
run. This operation is a statement-level rollback.
Errors discovered during SQL statement execution cause statement-level rollbacks.
An example of such an error is attempting to insert a duplicate value in a primary key.
73. The database currently has one control file. You decide that three control files will
provide better protection against a single point of failure. To accomplish this, you modify
the SPFILE to point to the locations of the three control files. The message "system
altered" was received after execution of the statement.
You shut down the database and copy the control file to the new names and locations. On
startup you receive the error ORA-00205: error in identifying control file. You look in the
alert log and determine that you specified the incorrect path for the for control file.
Which steps are required to resolve the problem and start the database?<br />
A.<br />
1. Connect as SYSDBA.<br />
2. Shut down the database.<br />
3. Start the database in NOMOUNT mode.<br />
4. Use the ALTER SYSTEM SET CONTROL_FILES command to correct the error.<br
/>
5. Shut down the database.<br />
6. Start the database.<br /><br />
B.<br />
1. Connect as SYSDBA.<br />
2. Shut down the database.<br />
3. Start the database in MOUNT mode.<br />
4. Remove the SPFILE by using a UNIX command.<br />
5. Recreate the SPFILE from the PFILE.<br />
6. Use the ALTER SYSTEM SET CONTROL_FILES command to correct the error.<br
/>
7. Start the database.<br />
C.<br />
1. Connect as SYSDBA.<br />
2. Shut down the database.<br />
3. Remove the control files using the OS command.<br />
4. Start the database in NOMOUNT mode.<br />
5. Remove the SPFILE by using an OS command.<br />
6. Re-create the SPFILE from the PFILE.<br />
7. Use the ALTER SYSTEM SET CONTROL_FILES command to define the control
files.<br />
8. Shut down the database.<br />
9. Start the database.<br />
Answer: A
Explanation:
Some parameters can be changed dynamically by using the ALTER SESSION or ALTER
SYSTEM statement while the instance is running. Unless you are using a Instance and
Database Startup server parameter file, changes made using the ALTER SYSTEM
statement are only in effect for the current instance. You must manually update the text
initialization parameter file for the changes to be known the next time you start up an
instance.
When you use a server parameter file, you can update the parameters on disk, so that
changes persist across database shutdown and startup.
See question number 62: You do not need to create the SPFILE again. Use ALTER
SYSTEM to update the CONTROL_FILES parameter value.
74. Which process is started when a user connects to the Oracle server in a dedicated
server mode?
A. DBWn
B. PMON
C. SMON
D. Server
Answer: D
Explanation:
SMON: The system monitor performs crash recovery when a failed instance starts up
again. In a cluster database (Oracle9i Real Application Clusters), the SMON process of
one instance can perform instance recovery for other instances that have failed. SMON
also cleans up temporary segments that are no longer in use and recovers dead
transactions skipped during crash and instance recovery because of file-read or offline
errors. These transactions are eventually recovered by SMON when the tablespace or file
is brought back online.
PMON: The process monitor performs process recovery when a user process fails.
PMON is responsible for cleaning up the cache and freeing resources that the process was
using. PMON also checks on the dispatcher processes (see below) and server processes
and restarts them if they have failed.
Checkpoint (CKPT): At specific times, all modified database buffers in the SGA are
written to the datafiles by DBWn. This event is called a checkpoint. The checkpoint
process is responsible for signaling DBWn at checkpoints and updating all the datafiles
and control files of the database to indicate the most recent checkpoint.
75. You are creating a new database. You do NOT want users to use the SYSTEM
tablespace for sorting operations.
What should you do when you issue the CREATE DATABASE statement to prevent this?
Answer: B
Explanation:
You can manage space for sort operations more efficiently by designating temporary
tablespaces exclusively for sorts. Doing so effectively eliminates serialization of space
management operations involved in the allocation and deallocation of sort space.
All operations that use sorts, including joins, index builds, ordering, computing
aggregates (GROUP BY), and collecting optimizer statistics, benefit from temporary
tablespaces. The performance gains are significant with Real Application Clusters.
Specify a default temporary tablespace when you create a database, using the DEFAULT
TEMPORARY TABLESPACE extension to the CREATE DATABASE statement.
When a transaction begins, Oracle assigns the transaction to an available undo tablespace
or rollback segment to record the rollback entries for the new transaction.
A database administrator creates undo tablespaces individually, using the CREATE
UNDO TABLESPACE statement. It can also be created when the database is created,
using the CREATE DATABASE statement.
To improve the concurrence of multiple sort operations, reduce their overhead, or avoid
Oracle space management operations altogether, create temporary tablespaces. A
temporary tablespace can be shared by multiple users and can be assigned to users with
the CREATE USER statement when you create users in the database.
Within a temporary tablespace, all sort operations for a given instance and tablespace
share a single sort segment. Sort segments exist for every instance that performs sort
operations within a given tablespace. The sort segment is created by the first statement
that uses a temporary tablespace for sorting, after startup, and is released only at
shutdown. An extent cannot be shared by multiple transactions.
76. Which four statements are true about profiles? (Choose four.)
Answer: A, B, C, E
Explanation:
It's true that profiles can control the use of passwords. This feature protects the integrity
of assigned usernames as well as the overall data integrity of the Oracle database. All
limits of the DEFAULT profile are initially unlimited. The DEFAULT profile isn't very
restrictive of host system resources; in fact, DEFAULT profile gives users unlimited use
of all resources definable in the database. Any option in any profile can be changed at any
time; however, the change will not take effect for users assigned to that profile until the
user logs out and logs back in. Also profiles can ensure that users log off the database
when they have left their session idle for a period of time.
Different profiles can be created and assigned individually to each user of the database. A
default profile is present for all users not explicitly assigned a profile.
The resource limit feature prevents excessive consumption of global database system
resources.
To allow for greater control over database security, Oracle's password management policy
is controlled by DBAs and security officers through user profiles.
To alter the enforcement of resource limitation while the database remains open, you
must have the ALTER SYSTEM system privilege.
All unspecified resource limits for a new profile take the limit set by a DEFAULT profile.
Initially, all limits of the DEFAULT profile are set to UNLIMITED.
77. The Database Writer (DBWn) background process writes the dirty buffers from the
database buffer cache into the _______.
Answer: A
Explanation:
Database writer (DBWn)
The database writer writes modified blocks from the database buffer cache to the
datafiles. Oracle allows a maximum of 20 database writer processes (DBW0-DBW9 and
DBWa-DBWj). The initialization parameter DB_WRITER_PROCESSES specifies the
number of DBWn processes. Oracle selects an appropriate default setting for this
initialization parameter (or might adjust a user specified setting) based upon the number
of CPUs and the number of processor groups.
78. You used the password file utility to create a password file as follows:<br />
$orapwd file=$ORACLE_HOME/dbs/orapwDB01<br />
You created a user and granted only the SYSDBA privilege to that user as follows:<br />
CREATE USER dba_user IDENTIFIED BY dba_pass;<br />
GRANT sysdba TO dba_user;<br /><br />
Answer: C
Explanation:
When prompted, connect as SYS (or other administrative user) with the SYSDBA system
privilege:
CONNECT SYS/password AS SYSDBA
Where password is the password of the user created. In this example, it is dba_user.
79. You intend to use only password authentication and have used the password file
utility to create a password file as follows:<br />
You created a user and granted only the SYSDBA privilege to that user as follows:<br />
CREATE USER dba_user<br />
IDENTIFIED BY dba_pass<br />
GRANT sysdba TO dba_user<br /><br />
Answer: B
80. For which two constraints are indexes created when the constraintis added? (Choose
two.)
A. check
B. unique
C. not null
D. primary key
E. foreign key
Answer: B, D
Explanation:
Oracle enforces all PRIMARY KEY constraints using indexes.
Oracle enforces unique integrity constraints with indexes.
81. You check the alert log for your database and discover that there are many lines that
say "Checkpoint Not Complete". What are two ways to solve this problem? (Choose
two.)
Answer: B, D
Explanation:
Checkpoint not complete" means that a checkpoint started, but before it could finish
another higher priority checkpoint was issued (usually from a log switch), so the first
checkpoint was essentially rolled-back.
I found these answers from newsgroups and they sound quite good to me:
Increasing the number of redo logs seems to be most effective. Normally, checkpoints
occur for 1 of 3 reasons:
1) The log_checkpoint_interval was reached.
2) A log switch occurred.
3) The log_checkpoint_timeout was reached.
The archiver copies the online redo log files to archival storage after a log switch has
occurred. Although a single ARCn process (ARC0) is sufficient for most systems, you
can specify up to 10 ARCn processes by using the dynamic initialization parameter
LOG_ARCHIVE_MAX_PROCESSES. If the workload becomes too great for the current
number of ARCn processes, then LGWR automatically starts another ARCn process up to
the maximum of 10 processes. ARCn is active only when a database is in ARCHIVELOG
mode and automatic archiving is enabled.
There is no Archive log file as far as I know. It is called Redo log file.
82. The database needs to be shut down for hardware maintenance. All users sessions
except one have either voluntarily logged off or have been forcibly killed. The one
remaining user session is running a business critical data manipulation language (DML)
statement and it must complete prior to shutting down the database.
Which shutdown statement prevents new user connections, logs off the remaining user,
and shuts down the database after the DML statement completes?
A. SHUTDOWN
B. SHUTDOWN ABORT
C. SHUTDOWN NORMAL
D. SHUTDOWN IMMEDIATE
E. SHUTDOWN TRANSACTIONAL
Answer: E
Explanation:
From a newsgroup:
There are four ways to shut down a database:
(a) Shutdown waits for everyone to finish & log out before it shuts down. The database is
cleanly shutdown.
(b) Shutdown immediate rolls back all uncommitted transactions before it shuts down.
The database is cleanly shutdown.
(c) Shutdown transactional waits for all current transactions to commit or rollback before
it shuts down. The database is cleanly shutdown.
(d) Shutdown abort quickly shuts down - the next restart will require instance recovery.
The database is technically crashed.
The key reason for an immediate shutdown not being immediate is because of the need to
rollback all current transactions. If a user has just started a transaction to update emp set
sal = sal * 2 where emp_id = 1000; then this will be rolled back almost instantaneously.
However, if another user has been running a huge update for the last four hours, and has
not yet committed, then four hours of updates have to be rolled back and this takes time.
So, if you really want to shutdown right now, then the advised route is: shutdown abort -
startup restrict - shutdown
When you shutdown abort, Oracle kills everything immediately. Startup restrict will
allow only dba users to get in but, more importantly, will carry out instance recovery and
recover back to a consistent state using the current on-line redo logs. The final shutdown
will perform a clean shutdown. Any cold backups taken now will be of a consistent
database.
There has been much discussion on this very subject on the Oracle Server newsgroups.
Some people are happy to backup the database after a shutdown abort, others are not. I
prefer to use the above method prior to taking a cold backup - if I have been unable to
shutdown or shutdown immediate that is.
83. When preparing to create a database, you should be sure that you have sufficient disk
space for your database files. When calculating the space requirements you need to
consider that some of the files may be multiplexed.
Which two types of files should you plan to multiplex? (Choose two.)
A. data files
B. control file
C. password file
D. online redo log files
E. initialization parameter file
Answer: B, D
Explanation:
Multiplex: files are stored at more than one location.
Oracle9i Database Concepts Release 2 (9.2) March 2002 Part No. A96524-01
(a96524.pdf) 3-22
Multiplexed Control Files: As with online redo log files, Oracle enables multiple,
identical control files to be open concurrently and written for the same database.
By storing multiple control files for a single database on different disks, you can
safeguard against a single point of failure with respect to control files. If a single disk that
contained a control file crashes, then the current instance fails when Oracle attempts to
access the damaged control file. However, when other copies of the current control file
are available on different disks, an instance can be restarted
easily without the need for database recovery.
If all control files of a database are permanently lost during operation, then the instance is
aborted and media recovery is required. Media recovery is not straightforward if an older
backup of a control file must be used because a current copy is not available. Therefore, it
is strongly recommended that you adhere to the following practices:
(a) Use multiplexed control files with each database
(b) Store each copy on a different physical disk
(c) Use operating system mirroring
(d) Monitor backups
Oracle9i Database Concepts Release 2 (9.2) March 2002 Part No. A96524-01
(a96524.pdf) 1-7
Redo Log Files: To protect against a failure involving the redo log itself, Oracle allows a
multiplexed redo log so that two or more copies of the redo log can be maintained on
different disks.
The information in a redo log file is used only to recover the database from a system or
media failure that prevents database data from being written to the datafiles. For.Database
Structure and Space Management Overview example, if an unexpected power outage
terminates database operation, then data in memory cannot be written to the datafiles, and
the data is lost. However, lost data can be recovered when the database is opened, after
power is restored. By applying the information in the most recent redo log files to the
database datafiles, Oracle restores the database to the time at which the power failure
occurred.
Answer: A, D
Explanation:
Setting the DB_CREATE_ONLINE_LOG_DEST_ n Initialization Parameter:
You specify the name of a file system directory that becomes the default location for the
creation of the operating system files for these entities. You can specify up to five
multiplexed locations.
As a conclusion, the directories must exist, but it doesn't matter what is inside. Also, it
can be anywhere since you specify the location of it. And must give permission to oracle
to read and write to those directories.
85. In which two situations does the Log Writer (LGWR) process write the redo entries
from the redo log buffer to the current online redo log group? (Choose two.)
Answer: A, D
Explanation:
See OCP Oracle 9i Database: Fundamentals I, p. 19.:
The redo log buffer writes to the redo logfile under the following situations:
(a) When a transaction commits.
(b) When the redo log buffer is one-third full.
(c) When there is more than one megabyte of changes recorded in the redo log buffer.
(d) Before the DBWn writes modified blocks in the database buffer cache to the datafiles.
86. Examine the syntax below, which creates a DEPARTMENTS table:<br />
A. 200 K
B. 300 K
C. 450 K
D. 675 K
E. not defined
Answer: D
Explanation:
The size of the first and the second extent is 200K, PCTINCREASE is set to 50%, so we
have the following calculation:
200 * 1,5 * 1,5 * 1,5 = 675.
87. After running the ANALYZE INDEX orders cust_idx VALIDATE STRUCTURE
command, you query the INDEX_STATS view and discover that there is a high ratio of
DEL_LF_ROWS to LF_ROWS values for this index.
You decide to reorganize the index to free up the extra space, but the space should remain
allocated to the ORDERS_CUST_IDX index so that it can be reused by new entries
inserted into the index.
Which command(s) allows you to perform this task with the minimum impact to any
users who run queries that need to access this index while the index is reorganized?
Answer: B
Explanation:
When you rebuild an index, you use an existing index as the data source. Creating an
index in this manner enables you to change storage characteristics or move to a new
tablespace. Rebuilding an index based on an existing data source removes intra-block
fragmentation. Compared to dropping the index and using the CREATE INDEX
statement, re-creating an existing index offers better performance.
Coalescing an index online vs. rebuilding an index online. Online index coalesce is an in-
place data reorganization operation, hence does not require additional disk space like
index rebuild does. Index rebuild requires temporary disk space equal to the size of the
index plus sort space during the operation. Index coalesce does not reduce the height of
the B-tree. It only tries to reduce the number of leaf blocks. The coalesce operation does
not free up space for users but does improve index scan performance.
While your database is open, you issue this command to start the Archiver process:<br />
ALTER SYSTEM ARCHIVE LOG START;<br /><br />
You shut down your database to take a back up and restart it using the
initSAMPLEDB.ora parameter file again. When you check the status of the Archiver, you
find that it is disabled.<br />
Answer: C
Explanation:
If an instance is shut down and restarted after automatic archiving is enabled using the
ALTER SYSTEM statement, the instance is reinitialized using the settings of the
initialization parameter file. Those settings may or may not enable automatic archiving. If
your intent is to always archive redo log files automatically, then you should include
LOG_ARCHIVE_START = TRUE in your initialization parameters.
Answer D is correct, since every time the database is started, the init value of the
LOG_ARCHIVE_START=false
89. What provides for recovery of data that has not been written to the data files prior to a
failure?
A. redo log
B. undo segment
C. rollback segment
D. system tablespace
Answer: A
Explanation:
Oracle9i Database Administrator's Guide Release 2 (9.2) March 2002 Part No. A96521-
01 (a96521.pdf) 13-2
Undo and rollback segments
Every Oracle database must have a method of maintaining information that is used to roll
back, or undo, changes to the database. Such information consists of records of the
actions of transactions, primarily before they are committed. Oracle refers to these
records collectively as undo.
Undo records are used to:
(a) Roll back transactions when a ROLLBACK statement is issued.
(b) Recover the database.
(c) Provide read consistency.
When a rollback statement is issued, undo records are used to undo changes that were
made to the database by the uncommitted transaction. During database recovery, undo
records are used to undo any uncommitted changes applied from the redo log to the
datafiles. Undo records provide read consistency by maintaining the before image of the
data for users who are accessing the data at the same time that another user is changing it.
Historically, Oracle has used rollback segments to store undo. Space management for
these rollback segments has proven to be quite complex. Oracle now offers another
method of storing undo that eliminates the complexities of managing rollback segment
space, and enables DBAs to exert control over how long undo is retained before being
overwritten. This method uses an undo tablespace.
90. There are three ways to specify National Language Support parameters:<br /><br />
1. initialization parameters<br />
2. environment variables<br />
3. ALTER SESSION parameters<br /><br />
A.
1) Parameters on the client side to specify locale-dependent behavior overriding the
defaults set for the server<br />
2) Parameters on the server side to specify the default server environment<br />
3) Parameters override the default set for the session or the server<br />
B.
1) Parameters on the server side to specify the default server environment<br />
2) Parameters on the client side to specify locale-dependent behavior overriding the
defaults set for the server<br />
3) Parameters override the default set for the session or the server<br />
C.
1) Parameters on the server side to specify the default server environment<br />
2) Parameters override the default set for the session or the server<br />
3) Parameters on the client side to specify locale-dependent behavior overriding the
defaults set for the server<br />
D.
1) Parameters on the client side to specify locale-dependent behavior overriding the
defaults set for the server<br />
2) Parameters override the default set for the session or the server<br />
3) Parameters on the server side to specify the default server environment<br />
Answer: B
Explanation:
Oracle has attempted to provide appropriate values in the starter initialization parameter
file provided with your database software, or as created for you by the Database
Configuration Assistant. You can edit these Oracle-supplied initialization parameters and
add others, depending upon your configuration and options and how you plan to tune the
database.
91. Which graphical DBA administration tool would you use to tune an Oracle database?
A. SQL*Plus
B. Oracle Enterprise Manager
C. Oracle Universal Installer
D. Oracle Database Configuration Assistant
Answer: B
Explanation:
If you think SQL*Plus is a GRAPHICAL tool, then I call Microsoft Windows an Artistic
Tool ;-)
You can more easily administer the Database Resource Manager through the Oracle
Enterprise Manager (OEM). It provides an easy to use graphical interface for
administering the Database Resource Manager. You can choose to use the Oracle
Enterprise Manager for administering your database, including starting it up and shutting
it down. The Oracle Enterprise Manager is a separate Oracle product, that combines a
graphical console, agents, common services, and tools to provide an integrated and
comprehensive systems management platform for managing Oracle products. It enables
you to perform the functions discussed in this book using a GUI interface, rather than
command lines.
The Database Configuration Assistant (DBCA) an Oracle supplied tool that enables you
to create an Oracle database, configure database options for an existing Oracle database,
delete an Oracle database, or manage database templates. DBCA islaunched
automatically by the Oracle Universal Installer, but it can be invoked standalone from the
Windows operating system start menu (under Configuration Assistants)
A. STARTUP
B. STARTUP OPEN
C. STARTUP MOUNT
D. STARTUP NOMOUNT
Answer: D
Explanation:
Start an instance without mounting a database. Typically, you do this only during
93. You just created five roles using the statements shown:<br />
Which statement indicates that a user must be authorized to use the role by the enterprise
directory service before the role is enabled?
Answer: B
Explanation:
Creating a Global User - The following statement illustrates the creation of a global user,
who is authenticated by SSL and authorized by the enterprise directory service:
CREATE USER scott
IDENTIFIED GLOBALLY AS 'CN=scott,OU=division1,O=oracle,C=US';
The string provided in the AS clause provides an identifier (distinguished name, or DN)
meaningful to the enterprise directory.
In this case, scott is truly a global user. But, the disadvantage here is that user scott must
then be created in every database that he must access, plus the directory.
94. Examine the list of steps to rename the data file of a non-SYSTEM tablespace
HR_TBS. The steps are arranged in random order.<br />
Answer: D
Explanation:
Renaming Datafiles in a Single Tablespace: To rename datafiles from a single tablespace,
complete the following steps:
(1) Take the non-SYSTEM tablespace that contains the datafiles offline.
For example: ALTER TABLESPACE users OFFLINE NORMAL;
(2) Rename the datafiles using the operating system.
(3) Use the ALTER TABLESPACE statement with the RENAME DATAFILE clause to
change the filenames within the database. The new files must already exist; this statement
does not create the files. Also, always provide complete filenames (including their paths)
to properly identify the old and new datafiles. In particular, specify the old datafile name
exactly as it appears in the DBA_DATA_FILES view of the data dictionary.
(4) Back up the database. After making any structural changes to a database, always
perform an immediate and complete backup.
(5) Bring the datafile online (this was added by me, I couldn't find it in the documents).
To use this clause for datafiles and tempfiles, the database must be mounted. The
database can also be open, but the datafile or tempfile being renamed must be offline.
So first make the tablespace offline (Step 5) => Answers A and B are out.
The Alter renames the file, but only on the oracle. The statement does not actually change
the name of the file 'disk. You must perform this operation through your operating
system. => Use the step 4 to copy the new file to the specified location.
Then execute the alter database.
You don't need to shut down and start the database.
95. For a tablespace created with automatic segment-space management, where is free
space managed?
A. in the extent
B. in the control file
C. in the data dictionary
D. in the undo tablespace
Answer: A
Explanation:
When you create a table in a locally managed tablespace for which automatic segment-
space management is enabled, the need to specify the PCTFREE (or FREELISTS)
parameter is eliminated. Automatic segment-space management is specified at the
tablespace level. The Oracle database server automatically and efficiently manages free
and used space within objects created in such tablespaces.
In my opinion, the free space is managed in the table space itself. A table space consists
of extents. Therefore, extents are the actual spaces. So, I recommend answer A. Also in
answer D, UNDO table space is used for UNDO purpose only and not for space
management.
96. Which is true when considering the number of indexes to create on a table?
Answer: C
No comment
97. More stringent user access requirements have been issued. You need to do these tasks
for the user pward:
Answer: C
Explanation:
Creating a User Who is Authenticated Externally:
CREATE USER scott IDENTIFIED EXTERNALLY; Or Use Alter instead of Create. The
important keyword is the IDENTIFIED EXTERNALLY.
Check the picture to see how the DEFAULT AND TEMPORARY table spaces are set.
Also the QUOTA keyword is shown on the picture.
Since the ALTER USER also has a profile keyword, then PROFILE can also be used.
Therefore answer C is correct.
98. You create a new table named DEPARTMENTS by issuing this statement:<br />
You realize that you failed to specify a tablespace for the table. You issue these
queries:<br />
A. TEMP
B. SYSTEM
C. SAMPLE
D. USER_DATA
Answer: C
A: TEMP tablespace is set as temporary tablespace for the user, so it will not be used to
store the DEPARTMENTS table. The default tablespace SAMPLE will be used for this
purpose.
B: User have SAMPLE as default tablespace, so it will be used, not SYSTEM tablespace,
to store the DEPARTMENTS table.
D: USER_DATE is not defined as default tablespace for theuser, so it will not be used to
store the DEPARTMENTS table.
99. You should back up the control file when which two commands are executed?
(Choose two.)
A. CREATE USER
B. CREATE TABLE
C. CREATE INDEX
D. CREATE TABLESPACE
E. ALTER TABLESPACE <tablespace name> ADD DATAFILE
Answer: D, E
Explanation:
Back Up Control Files
It is very important that you back up your control files. This is true initially, and at any
time after you change the physical structure of your database. Such structural changes
include:
(a) Adding, dropping, or renaming datafiles.
(b) Adding or dropping a tablespace, or altering the read-write state of the tablespace.
(c) Adding or dropping redo log files or groups.
100. You have two undo tablespaces defined for your database. The instance is currently
using the undo tablespace named UNDOTBS_1. You issue this command to switch to
UNDOTBS_2 while there are still transactions using UNDOTBS_1:<br /><br />
Explanation:
See http://download-
west.oracle.com/docs/cd/B10501_01/server.920/a96521/undo.htm#9117:
Switching Undo Tablespaces
Switching Undo Tablespaces
You can switch from using one undo tablespace to another. Because the
UNDO_TABLESPACE initialization parameter is a dynamic parameter, the ALTER
SYSTEM SET statement can be used to assign a new undo tablespace.
The database is online while the switch operation is performed, and user transactions can
be executed while this command is being executed. When the switch operation completes
successfully, all transactions started after the switch operation began are assigned to
transaction tables in the new undo tablespace.
The switch operation does not wait for transactions in the old undo tablespace to commit.
If there are any pending transactions in the old undo tablespace, the old undo tablespace
enters into a PENDING OFFLINE mode (status). In this mode, existing transactions can
continue to execute, but undo records for new user transactions cannot be stored in this
undo tablespace.
An undo tablespace can exist in this PENDING OFFLINE mode, even after the switch
operation completes successfully. A PENDING OFFLINE undo tablespace cannot used
by another instance, nor can it be dropped. Eventually, after all active transactions have
committed, the undo tablespace automatically goes from the PENDING OFFLINE mode
to the OFFLINE mode. From then on, the undo tablespace is available for other instances
(in an Oracle Real Application Cluster environment).
101. Which two statements grant an object privilege to the user Smith? (Choose two.)
Answer: E, G
Ad D: ALTER: Permits the grantee of this object privilege to alter the definition of a table
or sequence only. The ALTER privilege on all other database objects are considered
system privileges.
102. Which memory structure contains the information used by the server process to
validate the user privileges?
A. buffer cache
B. library cache
C. data dictionary cache
D. redo log buffer cache
Answer: C
Explanation:
Ad A: False. The database buffer cache is the portion of the SGA that holds copies of data
blocks read from datafiles. All user processes concurrently connected to the instance
share access to the database buffer cache. See (a58227.pdf) Pg 155. (6-3).
Ad B: False. Library Cache The library cache includes the shared SQL areas, private SQL
areas, PL/SQL proce-dures and packages, and control structures such as locks and library
cache handles.
Ad C: True. One of the most important parts of an Oracle database is its data dictionary,
which is a read-only set of tables that provides information about its associated database.
A data dictionary contains:
(a) the definitions of all schema objects in the database (tables, views, indexes, clusters,
synonyms, sequences, procedures, functions, packages, triggers, and so on).
(b) how much space has been allocated for, and is currently used by, the schema objects.
(c) default values for columns.
(d) integrity constraint information.
(e) the names of Oracle users.
(f) privileges and roles each user has been granted.
(g) auditing information, such as who has accessed or updated various schema objects.
(h) in Trusted Oracle, the labels of all schema objects and users (see your TrustedOracle
documentation).
(i) other general database information.
See (a58227.pdf) Pg. 134. (4-2).
Ad D: False. The information in a redo log file is used only to recover the database from
a system or media failure that prevents database data from being written to a database's
datafiles. See (a58227.pdf) Pg. 46. (1-12)
Which three tablespaces can be created in the CREATE DATABASE statement? (Choose
three.)
A. TEMP
B. USERS
C. SYSTEM
D. APP_NDX
E. UNDOTBS
F. APP_DATA
Answer: A, C, E
Incorrect Answers:
1) MOUNT mounts the database for certain DBA activities but does not provide user
access to the database.<br />
2) The NOMOUNT command creates only the Data Buffer but does not provide access to
the database.<br />
3) The OPEN command enables users to access the database.<br />
4) The STARTUP command starts an instance.<br />
Which option correctly describes whether some or all of the statements are TRUE or
FALSE?
Answer: B
Explanation:
(1) is true:
Mounted database: A database associated with an Oracle instance. The database can be
opened or closed. A database must be both mounted and opened to be accessed by users.
A database that has been mounted but not opened can be accessed by DBAs for some
maintenance purposes. See Oracle8(tm) Enterprise Edition Getting Started Release 8.0.5
for Windows NT June 19, 1998 Part No. A64416-01 pg. 446.
(2) is false:
After selecting the Startup Nomount, the instance starts. At this point, there is no
database. Only an SGA (System Global Area is a shared memory region that contains
data and control information for one Oracle instance) and background processes are
started in preparation for the creation of a new database. See Oracle8 Administrator's
Guide Release 8.0 December, 1997 Part No. A58397-01 pg. 60. (a58397.pdf).
(3) is true:
Opening a mounted database makes it available for normal database operations. Any
valid user can connect to an open database and access its information. When you open the
database, Oracle opens the online datafiles and online redo log files. If a tablespace was
offline when the database was previously shut down, the tablespace and its corresponding
datafiles will still be offline when you reopen the database. If any of the datafiles or redo
log files are not present when you attempt to open the database, Oracle returns an error.
See Oracle8 Concepts Release 8.0 December, 1997 Part No. A58227-01 pg. 149.
(a58227.pdf).
(4) is true:
STARTUP: Purpose Start an Oracle instance with several options, including mounting
and opening a database. Prerequisites You must be connected to a database as
INTERNAL, SYSOPER, or SYSDBA. You cannot be connected via a multi-threaded
server. See Oracle (r) Enterprise Manager Administrator's Guide Release 1.6.0 June, 1998
Part No. A63731-01 (oemug.pdf) pg. 503. (B-31).
User Jenny has unlimited quota on the USER_TBS tablespace. Which value will the
query return?<br />
A. 0
B. 1
C. -1
D. NULL
E. 'UNLIMITED'
Answer: C
Explanation:
Ad A: False. Value -1, not 0, shows that user Jenny has unlimited quota on the
USER_TBS tablespace.
Ad B: False. Value -1, not 1, shows that user Jenny has unlimited quota on the
USER_TBS tablespace.
Ad C: True. A value of -1 in MAX_BYTES or MAX_BLOCKS means that the user has
an unlimited space quota for the tablespace.
Ad D: False. Value NULL can be used to set the quota on the tablespace.
Ad E: False. Quota value must be numeric. It cannot be defined as string.
OCA Oracle 9i Associate DBA Certification Exam Guide, Jason Couchman, p. 815-817,
Chapter 15: Managing Database Users
106. Which two statements are true about rebuilding an index? (Choose two.)
Answer: B, D
Explanation:
(A) False. The resulting index will not contain deleted entries. It's the main reason to
rebuild the index.
(B) True. You can create an index using an existing index as the data source. Creating an
index in this manner allows you to change storage characteristics or move to a new
tablespace. Re-creating an index based on an existing data source also removes intra-
block fragmentation. In fact, compared to dropping the index and using the CREATE
INDEX command, re-creating an existing index offers better performance. (58246.pdf)
Pg. 178. (10-10).
(C) False. A further advantage of this approach is that the old index is still available for
queries (58246.pdf) Pg. 178. (10-10).
(D) True.
What happens when a user issues the COMMIT in the above SQL statement?
A. Dirty buffers in the database buffer cache are flushed.
B. The server process places the commit record in the redo log buffer.
C. Log Writer (LGWR) writes the redo log buffer entries to the redo log files and data
files.
D. The user process notifies the server process that the transaction is complete.
E. The user process notifies the server process that the resource locks can be released.
Answer: E
Testking said B.
Explanation:
See OCP Oracle 9i Database: Fundamentals I, p. 19.:
What exactly does processing a commit statement consist of?
(1) Release table/row locks acquired by transaction.
(2) Release undo segement locks acquired by transaction.
(3) Generate redo for commited transaction.
108. A new user, psmith, has just joined the organization. You need to create psmith as a
valid user in the database. You have the following requirements:<br /><br />
A.
CREATE USER psmith<br />
IDENTIFIED EXTERNALLY<br />
DEFAULT TABLESPACE data_ts<br />
QUOTA 100M ON data_ts<br />
QUOTA 500K ON temp_ts<br />
TEMPORARY TABLESPACE temp_ts;<br />
REVOKE DROP_TABLE, CREATE_USER from psmith;<br />
B.
CREATE USER psmith<br />
IDENTIFIED EXTERNALLY<br />
DEFAULT TABLESPACE data_ts<br />
QUOTA 500K ON temp_ts<br />
QUOTA 100M ON data_ts<br />
TEMPORARY TABLESPACE temp_ts;<br />
GRANT connect, resource TO psmith;<br />
C.
CREATE USER psmith<br />
IDENTIFIED EXTERNALLY<br />
DEFAULT TABLESPACE data_ts<br />
QUOTA 100M ON data_ts<br />
QUOTA 500K ON temp_ts<br />
TEMPORARY TABLESPACE temp_ts;<br />
GRANT connect TO psmith;<br />
D.
CREATE USER psmith<br />
INDENTIFIED GLOBALLY AS ''<br />
DEFAULT TABLESPACE data_ts<br />
QUOTA 500K ON temp_ts<br />
QUOTA 100M ON data_ts<br />
TEMPORARY TABLESPACE temp_ts;<br />
GRANT connect, resource TO psmith;<br />
REVOKE DROP_TABLE, CREATE_USER from psmith;<br />
Answer: B
Explanation:
(D) is false, because the user must be identified by the operating system, while
GLOBALLY AS 'external_name' indicates that a user must be authenticated by the Oracle
Security Service.
(A) and (C) has no connect and resource privileges.
CREATE USER:
Purpose To create a database user, or an account through which you can log in to the
database and establish the means by which Oracle permits access by the user. You can
assign the following optional properties to the user:
(a) default tablespace.
(b) temporary tablespace.
(c) quotas for allocating space in tablespaces.
Answer: B
Explanation:
Local Database Administration:
Do you want to use OS authentication?
Yes: Use OS authentication.
No: Use a password file.
See: Oracle8 Administrator's Guide Release 8.0 December, 1997 Part No. A58397-01 pg.
37. (a58397.pdf)
A. control file
B. password file
C. parameter files
D. archived log files
Answer: A
Explanation:
Control file is an administrative file required to start and run the database. The control
file records the physical structure of the database. For example, a control file contains the
database name, and the names and locations of the database's data files and redo log
files. See: Oracle8(tm) Enterprise Edition Getting Started Release 8.0.5 for Windows NT
June 19, 1998 Part No. A64416-01 (a55928.pdf) pg. 109. (5-9).
111. You issue these queries to obtain information about the REGIONS table:<br />
You then issue this command to move the REGIONS table:<br />
What else must you do to complete the move of the REGIONS table?
Answer: A
Explanation:
Each table's data is stored in its own data segment, while each index's data is stored in its
own index segment. So after move indexes must be rebuilt.
A. Check
B. Unique
C. Not null
D. Primary key
E. Foreign key
Answer: C
Explanation:
See OCP Oracle 9i Database: Fundamentals I, p. 313.:
CONSTRAINT_TYPE: Displays p for primary key, r for foreign key (referential integrity
constraint), c for check constraints (including checks to see if data is not null), and u for
unique constraints.
Because of this, options A and C remain. Because of the name of the constraint,
EMP_JOB_NN, I would go for C, because NN usually stands for NOT NULL.
113. Temporary tablespaces should be locally managed and the uniform size should be a
multiple of the ________.
A. DB_BLOCK_SIZE
B. DB_CACHE_SIZE
C. SORT_AREA_SIZE
D. operating system block size
Answer: C
Explanation:
http://www.interealm.com/technotes/roby/temp_ts.html
Today, depending on your RDBMS version, Oracle offers three varieties of temporary
tablespaces to choose from. These spaces are used for disk based sorts, large index
rebuilds, global temporary tables, etc. To ensure that your disk-based sorting is optimal, it
is critical to understand the different types, caveats, and benefits of these temporary
tablespace options:
(a) Permanent Tablespaces with Temporary Segments.
(b) Tablespaces of Type "Temporary".
(c) Temporary Tablespaces.
Temporary Tablespaces</br>
This new class of temporary tablespace was introduced in Oracle 8i and provides the
most robust and efficient means of disk-based sorting in Oracle today. Temporary
tablespaces are created using the SQL syntax CREATE TEMPORARY TABLEPSPACE
xyz TEMPFILE .... There are a number of performance benefits of this tablespace option
over permanent and tablespaces of type temporary in the areas of:
Extent Management: Extents in this tablespace are allocated via a locally-managed
bitmap. Therefore use of the ST-Enqueue and recursive SQL for this activity is
eliminated.
Segment Reuse: Sorts assigned to a tablespaces of type temporary use a single sort
segment (multiple segments in an OPS environment) that is only dropped at instance start
up and is created during the first disk-based sort.
Extent Reuse: Sorts using this type of tablespace have the ability to reuse extents that are
no longer active. This added level of reuse reduces the amount of resources necessary to
manage individual segments and allocate / deallocate extents.
Note: If the extent management clause is not specified for Temporary tablespaces, the
database will automatically set the tablespace with a uniform extent size of 1 MB.
Which Do I Choose?
Whether you are on an existing database application migrating to a newer Oracle version
or a new application in the initial development phase, for optimal performance you
should use the most recent temporary tablespace option available to your database
version:
- For Oracle versions 7.3.4 and below, use Permanent tablespaces with temporary
segments
- For Oracle versions 8.0.3 - 8.0.6 use tablespaces of type "temporary"
- For Oracle versions 8.1.5 - 9.x use Temporary tablespaces
Which two must be true before the Log Writer (LGWR) can reuse a filled online redo log
file? (Choose two).
Answer: A, E
Explanation:
ARCHIVELOG: The filled online redo log files are archived before they are reused in the
cycle.
NOARCHIVELOG: The filled online redo log files are not archived.
(a58227.pdf) Pg. 72. (1-38).
When you run a database in ARCHIVELOG mode, the archiving of the online redo log is
enabled. Information in a database control file indicates that a group of filled online redo
log files cannot be used by LGWR until the group is archived (A true). A filled group is
immediately available to the process performing the archiving after a log switch occurs
(when a group becomes inactive). The process performing the archiving does not have to
wait for the checkpoint of a log switch to complete before it can access the inactive group
for archiving (C false).
See: Oracle8 Administrator's Guide Release 8.0 December, 1997 Part No. A58397-01
(a58397.pdf) pg. 454. (23-2)
115. Which two statements are true about the control file? (Choose two.)
Answer: A, D
Explanation:
Ad A: True. CONTROL_FILES indicates one or more names of control files separated by
commas. The instance startup procedure recognizes and opens all the listed files. The
instance maintains all listed control files during database operation. See: Oracle8
Administrator's Guide Release 8.0 December, 1997 Part No. A58397-01 (a58397.pdf) pg.
126. (6-2).
Ad B: False. After mounting the database, the instance finds the database control files and
opens them. (Control files are specified in the CONTROL_FILES initialization parameter
in the parameter file used to start the instance.) Oracle then reads the control files to get
the names of the database's datafiles and redo log files. (a58227.pdf) pg. 148. (5-6).
Ad C: False. The control file of a database is a small binary file necessary for the
database to start and operate successfully. A control file is updated continuously by
Oracle during database use, so it must be available for writing whenever the database is
open. If for some reason the control file is not accessible, the database will not function
properly. (a58227.pdf) pg. 693. (28-19).
Ad D: True. see previous.
Answer: A, B
Explanation:
Resource limitation can be enabled or disabled by the RESOURCE_LIMIT initialization
parameter in the database's initialization parameter file. Valid values for the parameter are
TRUE (enables enforcement) and FALSE. By default, this parameter's value is set to
FALSE. Once the initialization parameter file has been edited, the database instance must
be restarted to take effect. Every time an instance is started, the new parameter value
enables or disables the enforcement of resource limitation.
Resource limitation feature must be altered temporarily, you can enable or disable the
enforcement of resource limitation using the SQL statement ALTER SYSTEM. After an
instance is started, an ALTER SYSTEM statement overrides the value set by the
RESOURCE_LIMIT initialization parameter.
117. The server parameter file (SPFILE) provides which three advantages when
managing initialization parameters? (Choose three.)
Answer: A, C, D
Testking said B, C, D.
Explanation:
Sources:
http://download-
west.oracle.com/docs/cd/B10501_01/rac.920/a96596/glossary.htm#436831.
See OCP Oracle 9i Database: Fundamentals I, p. 70/71.
Ad B: False. The server parameter file must initially be created from a traditional text
initialization parameter file. It must be created prior to its use in the STARTUP command.
The CREATE SPFILE statement is used to create a server parameter file
(http://download-
west.oracle.com/docs/cd/B10501_01/server.920/a96521/create.htm#1012659).
Ad C: True. Use the SET clause of the ALTER SYSTEM statement to set or change
initialization parameter values. Additionally, the SCOPE clause specifies the scope of a
change as described in the following table:
(1) SCOPE = SPFILE: The change is applied in the server parameter file only. The effect
is as follows:
(a) For dynamic parameters, the change is effective at the next startup and is persistent.
(b) For static parameters, the behavior is the same as for dynamic parameters. This is the
only SCOPE specification allowed for static parameters.
(2) SCOPE = MEMORY: The change is applied in memory only. The effect is as follows:
(a) For dynamic parameters, the effect is immediate, but it is not persistent because the
server parameter file is not updated.
(b) For static parameters, this specification is not allowed.
(3) SCOPE = BOTH: The change is applied in both the server parameter file and
memory. The effect is as follows:
(a) For dynamic parameters, the effect is immediate and persistent.
(b) For static parameters, this specification is not allowed.
Ad D: True. If you are using a server parameter file, initialization parameter file changes
made by the ALTER SYSTEM statement can persist across shutdown and startup. This is
discussed in "Managing Initialization Parameters Using a Server Parameter File"
(http://download-
west.oracle.com/docs/cd/B10501_01/server.920/a96521/create.htm#999226).
Ad E: False. If you are using a traditional text initialization parameter file, your changes
are only for the current instance. To make them permanent, you must update them
manually in the initialization parameter file, otherwise they will be lost over the next
shutdown and startup of the database (http://download-
west.oracle.com/docs/cd/B10501_01/server.920/a96521/create.htm#999226).
118. You examine the alert log file and notice that errors are being generated from a
SQL*Plus session. Which files are best for providing you with more information about
the nature of the problem?
A. control file
B. user trace files
C. background trace files
D. initialization parameter files
Answer: B
Explanation:
Ad A: False The control file of a database is a small binary file necessary for the database
to start and operate successfully. A control file is updated continuously by Oracle during
database use, so it must be available for writing whenever the database is open. If for
some reason the control file is not accessible, the database will not function properly.
(a58227.pdf) pg. 693. (28-19).
A trace file is created each time an Oracle instance starts or an unexpected event occurs in
a user process or background process. The name of the trace file includes the instance
name, the process name, and the Oracle process number. The file extension or file type is
usually TRC, and, if different, is noted in your operating system-specific Oracle
documentation. The contents of the trace file may include dumps of the system global
area, process global area, supervisor stack, and registers. Two initialization parameters
specify where the trace files are stored:
Ad B: False BACKGROUND_DUMP_DES Specifies the location for trace files created
by the Oracle background processes PMON, DBWR, LGWR, and SMON.
Ad C: True USER_DUMP_DEST Specifies the location for trace files created by user
processes such as SQL*DBA, SQL*Plus, or Pro*C.
See: Oracle8(tm) Error Messages Release 8.0.4 December 1997 Part No. A58312-01
(a58312.pdf) pg. 27. (1-5).
Ad D: False Parameter file contains initialization parameters. These parameters specify
the name of the database, the amount of memory to allocate, the names of control files,
and various limits and other system parameters. (a58227.pdf) pg. 61. (1-27)
119. You can use the Database Configuration Assistant to create a template using an
existing database structure.
A. data files
B. tablespaces
C. user defined schemas
D. user defined schema data
E. initialization parameters
Answer: A, B, E
Explanation:
http://download-
west.oracle.com/docs/cd/B10501_01/server.920/a96521/create.htm#1026131.
Creating Templates Using DBCA
From an existing template: Using an existing template, you can create a new template
based on the pre-defined template settings. You can add or change any template settings
such as initialization parameters, storage parameters, or use custom scripts.
From an existing database (structure only): You can create a new template that contains
structural information about an existing database, including database options, tablespaces,
datafiles, and initialization parameters specified in the source database. User defined
schema and their data will not be part of the created template. The source database can be
either local or remote.
From an existing database (structure as well as data--a seed database): You can create a
new template that has both the structural information and physical datafiles of an existing
database. Databases created using such a template are identical to the source database.
User defined schema and their data will be part of the created template. The source
database must be local.
120. The users pward and psmith have left the company. You no longer want them to
have access to the database. You need to make sure that the objects they created in the
database remain. What do you need to do?
Answer: A
Explanation:
Ad A: True CREATE SESSION Right: Connect to the database.
Ad B: If the user's schema contains any schema objects, use the CASCADE option to
drop the user and all associated objects and foreign keys that depend on the tables of the
user successfully. If you do not specify CASCADE and the user's schema contains
objects, an error message is returned and the user is not dropped. Before dropping a user
whose schema contains objects, thoroughly investigate which objects the user's schema
contains and the implications of dropping them before the user is dropped. Pay attention
to any unknown cascading effects. For example, if you intend to drop a user who owns a
table, check whether any views or procedures depend on that particular table. See:
Oracle8 Administrator's Guide Release 8.0 December, 1997 Part No. A58397-01
(a58397.pdf) Pg. 385. (20-17).
Ad C: False After deleted one can not revoke privilege.
Ad D: When a user is dropped, the user and associated schema is removed from the data
dictionary and all schema objects contained in the user's schema, if any, are immediately
dropped. See: Oracle8 Administrator's Guide Release 8.0 December, 1997 Part No.
A58397-01 (a58397.pdf) Pg. 385. (20-17).
121. You need to create an index on the CUSTOMER_ID column of the CUSTOMERS
table. The index has these requirements:
Which command creates the index and meets all the requirements?
A.
CREATE UNIQUE INDEX cust_pk ON customers(customer_id)<br />
TABLESPACE index0l<br />
Answer: B
Explanation:
PCTFREE is the percentage of space to leave free for updates and insertions within each
of the index's data blocks.
TABLESPACE is the name of the tablespace to hold the index or index partition. If you
omit this option, Oracle creates the index in the default tablespace of the owner of the
schema containing the index.
LOGGING / NOLOGGING specifies that the creation of the index will be logged
(LOGGING) or not logged (NOLOGGING) in the redo log file.
STORAGE PCTINCREASE specifies the percent by which the third and subsequent
extents grow over the preceding extent. The default value is 50, meaning that each
subsequent extent is 50% larger than the preceding extent.
NEXT specifies the size in bytes of the next extent to be allocated to the object. You can
use K or M to specify the size in kilobytes or megabytes.
INITIAL specifies the size in bytes of the object's first extent. Oracle allocates space for
this extent when you create the schema object. You can use K or M to specify this size in
kilobytes or megabytes.
ASC / DESC are allowed for DB2 syntax compatibility, although indexes are always
created in ascending order.
(a58225.pdf) Pg. 421. (4-237).
122. John has issued the following SQL statement to create a new user account:
Answer: A
Explanation:
It is not possible to assign a role to a user within a CREATE USER statement: you can
use GRANT role_name TO user_name command to do that.
A. A transaction completes.
B. The instance is started.
C. The instance is shut down
D. The current online redo log group is filled
E. The ALTER SYSTEM SWITCH LOGFILE command is issued.
Answer: D, E
Explanation:
A log switch, by default, takes place automatically when the current online redo log file
group fills. See: Oracle8 Administrator's Guide Release 8.0 December, 1997 Part No.
A58397-01 (a58397.pdf) Pg. 118. (5-10).
To force a log switch, you must have the Alter System privilege. To force a log switch,
use either the Switch Logfile menu item of Enterprise Manager or the SQL command
ALTER SYSTEM with the SWITCH LOGFILE option. The following statement forces a
log switch: ALTER SYSTEM SWITCH LOGFILE; See: Oracle8 Administrator's Guide
Release 8.0 December, 1997 Part No. A58397-01 (a58397.pdf) Pg. 121. (5-13)
Which two statements are true about the TEMP_TBS tablespace? (Choose two.)
Answer: A, D
Testking said B, D.
Explanation:<br />
Ad A: True. Use the CREATE TEMPORARY TABLESPACE statement to create a
locally managed temporary tablespace, which is an allocation of space in the database
that can contain schema objects for the duration of a session.<br /><br /> If you
subsequently assign this temporary tablespace to a particular user, then Oracle will also
use this tablespace for sorting operations in transactions initiated by that user.
(a96540.pdf) Pg. 1258. (15-92)<br /><br />
Ad B: False. Because of previous. Starting with Oracle 9i, Oracle creates non-SYSTEM
tablespaces to be localley managed by default. See OCP Oracle 9i Database:
Fundamentals I, p. 153.<br /><br />
Ad C: Renaming is not possible.<br /><br />
Ad D: ?<br /><br />
Ad E: ?<br />
Answer: D
Explanation:
Constraint States
Table constraints can be enabled and disabled using the CREATE TABLE or ALTER
TABLE statement. In addition the VALIDATE or NOVALIDATE keywords can be used
to alter the action of the state:
(1) ENABLE VALIDATE is the same as ENABLE. The constraint is checked and is
guaranteed to hold for all rows.
(2) ENABLE NOVALIDATE means the constraint is checked for new or modified rows,
but existing data may violate the constraint.
(3) DISABLE NOVALIDATE is the same as DISABLE. The constraint is not checked so
data may violate the constraint.
(4) DISABLE VALIDATE means the constraint is not checked but disallows any
modification of the constrained columns.
Answer: D
Explanation:
Ad C: False. The shared pool portion of the SGA contains three major areas: library
cache, dictionary cache, and control structures.
Ad D: True. In general, any item (shared SQL area or dictionary row) in the shared pool
remains until it is flushed according to a modified LRU algorithm. The memory for items
that are not being used regularly is freed if space is required for new items that must be
allocated some space in the shared pool.
(a58227.pdf) Pg. 158. (6-6)
127. As a DBA, one of your tasks is to periodically monitor the alert log file and the
background trace files. In doing so, you notice repeated messages indicating that Log
Writer (LGWR) frequently has to wait for a redo log group because a checkpoint has not
completed or a redo log group has not been archived.
What should you do to eliminate the wait LGWR frequently encounters?
A. Increase the number of redo log groups to guarantee that the groups are always
available to LGWR.
B. Increase the size of the log buffer to guarantee that LGWR always has information to
write.
C. Decrease the size of the redo buffer cache to guarantee that LGWR always has
information to write.
D. Decrease the number of redo log groups to guarantee that checkpoints are completed
prior to LGWR writing.
Answer: A
Explanation:
You need to increase the number of redo log groups to guarantee that the groups are
always available to LGWR. Log Writer (LGWR) frequently has to wait for a redo log
group because a checkpoint has not completed or a redo log group has not been archived
if there are not enough redo log groups or they are too small.
Ad B: Increasing the size of the log buffer will not affect the checkpoint frequency. You
can increase the redo log file size to eliminate the wait LGWR frequently encounters.
Ad C: Decreasing the size of the redo buffer cache will not affect the checkpoint
frequency.
Ad D: Decreasing the number of redo log groups you will just make LGWR wait for a
redo log group more frequently because a checkpoint has not completed or a redo log
group has not been archived.
A. DBA
B. SYSDBA
C. SYSOPER
D. RESOURCE
Answer: B
Explanation:
You must have the OSDBA role enabled.
The roles CONNECT, RESOURCE, DBA, EXP_FULL_DATABASE, and
IMP_FULL_DATABASE are defined automatically for Oracle databases. These roles are
provided for backward compatibility to earlier versions of Oracle and can be modified in
the same manner as any other role in an Oracle database. See (a58227.pdf) Pg. 622. (26-
16).
Ad C: False. SYSOPER permits you to perform STARTUP, SHUTDOWN, ALTER
DATABASE OPEN/MOUNT, ALTER DATABASE BACKUP, ARCHIVE LOG, and
RECOVER, and includes the RESTRICTED SESSION privilege.
Ad B: True. SYSDBA contains all system privileges with ADMIN OPTION, and the
SYSOPER system privilege; permits CREATE DATABASE and time-based recovery.
See (a58227.pdf) Pg. 637. (25-7).
A. undo segments
B. redo log files
C. data dictionary tables
Answer: A
Explanation:
Oracle7 Server Concepts 10-6
Statement Level Read Consistency
Oracle always enforces statement-level read consistency. This guarantees that the data
returned by a single query is consistent with respect to the time that the query began.
Therefore, a query never sees dirty data nor any of the changes made by transactions that
commit during query execution. As query execution proceeds, only data committed
before the query began is visible to the query. The query does not see changes committed
after statement execution begins. A consistent result set is provided for every query,
guaranteeing data consistency, with no action on the user's part.
The SQL statements SELECT, INSERT with a query, UPDATE, and DELETE all query
data, either explicitly or implicitly, and all return consistent data. Each of these statements
uses a query to determine which data it will affect (SELECT, INSERT, UPDATE, or
DELETE, respectively). A SELECT statement is an explicit query and may have nested
queries or a join operation. An INSERT statement can use nested queries. UPDATE and
DELETE statement can use WHERE clauses or subqueries to affect only some rows in a
table rather than all rows.
While queries used in INSERT, UPDATE, and DELETE statements are guaranteed a
consistent set of results, they do not see the changes made by the DML statement itself.
In other words, the data the query in these operations sees reflects the state of the data
before the operation began to make changes.
For this purpose only the undo segments are necessary from the possible answers.
130. You just issued the STARTUP command. Which file is checked to determine the
state of the database?
Answer: A
Explanation:
Oracle9i Database Administrator's Guide Release 2 (9.2) March 2002 Part No. A96521-
01 (a96521.pdf) 4-16
Quiescing a Database
There are times when there is a need to put a database into a state where only DBA
transactions, queries, fetches, or PL/SQL statements are allowed. This is called a quiesced
state, in the sense that there are no ongoing non-DBA transactions, queries, fetches, or
PL/SQL statements in the system. This quiesced state allows you or other administrators
to perform actions that cannot safely be done otherwise.
ACTIVE_STATE Description
NORMAL Normal unquiesced state
QUIESCING Being quiesced, but there are still active non-DBA sessions
running
QUIESCED Quiesced, no active non-DBA sessions are active or allowed
Since the state can be queried, I believe it's really in a control file.
131. Which two are true about the data dictionary views with prefix USER_? (Choose
two.)
Answer: A, F
Explanation:
Ad A: True. Views with the prefix USER usually exclude the column OWNER. This
column is implied in the USER views to be the user issuing the query. See (a58227.pdf)
Pg. 137. (4-5) have columns identical to the other views, except that the column OWNER
is implied the current user. See (a58227.pdf) Pg. 138. (4-6).
Ad B: False. The data dictionary views accessible to all users of an Oracle Server. Most
views can be accessed by any user with the CREATE_SESSION privilege. The data
dictionary views that begin with DBA_ are restricted. These views can be accessed only
by users with the SELECT_ANY_TABLE privilege. This privilege is assigned to the
DBA role when the system is initially installed. See (a58242.pdf) pg. 171 (2-1).
Ad C: False. The data dictionary is always available when the database is open. It resides
in the SYSTEM tablespace, which is always online. See (a58227.pdf) Pg. 137. (4-5).
Ad D: False. These views do not return information about all objects to which the user
has access. The data
dictionary views with prefix ALL_ provide this access.
Ad E: False. Any Oracle user can use the data dictionary as a read-only reference for
information about the database. See (a58227.pdf) Pg. 135. (4-3).
Ad F: True.
A. PMON
B. SMON
C. RECO
D. ARCn
E. CKPT
Answer: B
Explanation:
SMON (Oracle System MONitor)
SMON is an Oracle background process created when you start a database
http://www.orafaq.com/glossary/faqglosd.htm instance
http://www.orafaq.com/glossary/faqglosi.htm. The SMON process performs instance
http://www.orafaq.com/glossary/faqglosi.htm recovery, cleans up after dirty shutdowns
and coalesces adjacent free extents into larger free extents.
PMON (Oracle Process MONitor)
PMON is an Oracle background process created when you start a database
http://www.orafaq.com/glossary/faqglosd.htm instance
http://www.orafaq.com/glossary/faqglosi.htm. The PMON process will free up resources
if a user http://www.orafaq.com/glossary/faqglosu.htm process fails (eg. release database
http://www.orafaq.com/glossary/faqglosd.htm locks).
RECO (Oracle RECOverer Process)
RECO is an Oracle background process created when you start an instance
http://www.orafaq.com/glossary/faqglosi.htm with DISTRIBUTED_TRANSACTIONS=
in the INIT.ORA http://www.orafaq.com/glossary/faqglosi.htm file
http://www.orafaq.com/glossary/faqglosf.htm. The RECO process will try to resolve in-
doubt transactions across Oracle distributed databases.
ARCH (Oracle ARCHiver Process)
ARCH is an Oracle background process created when you start an instance
http://www.orafaq.com/glossary/faqglosi.htm in ARCHIVE LOG MODE. The ARCH
process will archive on-line redo log http://www.orafaq.com/glossary/faqglosr.htm files
to some backup http://www.orafaq.com/glossary/faqglosb.htm media.
CKPT
CKPT (Oracle http://www.orafaq.com/glossary/faqgloso.htm Checkpoint
http://www.orafaq.com/glossary/faqglosc.htm Process) is the Oracle
http://www.orafaq.com/glossary/faqgloso.htm background process that timestams all
datafiles and control files to indicate that a checkpoint
http://www.orafaq.com/glossary/faqglosc.htm has occurred
133. Your database contains a locally managed uniform sized tablespace with automatic
segment-space management, which contains only tables. Currently, the uniform size for
the tablespace is 512 K.
Because the tables have become so large, your configuration must change to improve
performance. Now the tables must reside in a tablespace that is locally managed, with
uniform size of 5 MB and automatic segment-space management.
Answer: D
Explanation:
Ad A: False. The new requirements can be met by creating a new tablespace with correct
settings and by moving the tables into the new tablespace.
Ad B: False. It's wrong way to recreate control files. You will need that when you will
create new tablespace with new uniform size to save changes in the control files. But
changing the control files themselves will not fix the issue.
Ad C: False. You cannot dynamically change the uniform size.
134. You created a tablespace SH_TBS. The tablespace consists of two data files:
sh_tbs_datal .dbf and sh_tbs_data2.dbf. You created a nonpartitioned table SALES_DET
in the SH_TBS tablespace.
Which two statements are true? (Choose two.)
Answer: A, D
Explanation:
Ad A: True. Every nonclustered table or partition and every cluster in an Oracle database
has a single data segment to hold all of its data. Oracle creates this data segment when
you create the nonclustered table or cluster with the CREATE command. If the table or
index is partitioned, each partition is stored in its own segment. See: Oracle8 Concepts
Release 8.0 December, 1997 Part No. A58227-01 (a58227.pdf) pg. 107. (2-15).
Ad B: False. because of the previous.
Ad C: False.
Ad D: True. For maintenance purposes, the header block of each segment contains a
directory of the extents in that segment. See: Oracle8 Concepts Release 8.0 December,
1997 Part No. A58227-01 (a58227.pdf) pg. 103. (2-11).
135. The DBA can structure an Oracle database to maintain copies of online redo log files
to avoid losing database information.
Which three are true regarding the structure of online redo log files? (Choose three.)
Answer: A, C, E
Explanation:
http://www.siue.edu/~dbock/cmis565/ch7-redo_log.htm
Each Redo Log Group has identical Redo Log Files. The LGWR concurrently writes
identical information to each Redo Log File in a Group. The Oracle Server needs a
minimum of two online Redo Log Groups for normal database operation. Thus, if Disk 1
crashes as shown in the figure above, none of the Redo Log Files are truly lost because
there are duplicates. If the group has more members, you need more disk drives!
If possible, you should separate the Online Redo Log Files from the Archive Log Files as
this reduces contention for the I/O buss path between the ARCn and LGWR background
processes. You should also separate Datafiles from the Online Redo Log Files as this
reduces LGWR and DBWn contention. It also reduces the risk of losing both Datafiles
and Redo Log Files if a disk crash occurs.
Redo Log Files in a Group are called Members. Each Group Member has identical log
sequence numbers and is the same size - they cannot be different sizes. The log sequence
number is assigned by the Oracle Server as it writes to a log group and the current log
sequence number is stored in the control files and in the header information of all
Datafiles - this enables synchronization between Datafiles and Redo Log Files.
136. Which three statements are true about the use of online redo log files? (Choose
three.)
Answer: A, B, F
Explanation:
Ad A: True. The information in a redo log file is used only to recover the database from a
system or media failure that prevents database data from being written to a database's
datafiles. See (a58227.pdf) Pg. 46. (1-12)
Ad C: False. Every Oracle database has a set of two or more redo log files. 2 files can not
be organized to 3 groups See (a58227.pdf) Pg. 46. (1-12)
Ad D: False. There is requirement to have at least TWO, not three redo log groups in
Oracle.
Ad E: False. Every database contains one or more rollback segments, which are portions
of the database that record the actions of transactions in the event that a transaction is
rolled back. You use rollback segments to provide read consistency, rollback transactions,
and recover the database. (a58227.pdf) Pg. 109. (2-17)
137. Which steps should you follow to increase the size of the online redo log groups?
A. Use the ALTER DATABASE RESIZE LOGFILE GROUP command for each group to
be resized.
B. Use the ALTER DATABASE RESIZE LOGFILE MEMBER command for each
member within the group being resized.
C. Add new redo log groups using the ALTER DATABASE ADD LOGFILE GROUP
command with the new size.
Drop the old redo log files using the ALTER DATABASE DROP LOGFILE GROUP
command.
D. Use the ALTER DATBASE RESIZE LOGFILE GROUP command for each group to
be resized.
Use the ALTER DATABASE RESIZE LOGFILE MEMBER command for each member
within the group.
Answer: C
Explanation:
Ad A: There is no ALTER DATABASE RESIZE LOGFILE GROUP command in Oracle.
Ad B: There is no ALTER DATABASE RESIZE LOGFILE MEMBER command in
Oracle.
Ad C: To increase the size of the online redo log groups you need first to add new redo
log groups using the ALTER DATABASE ADD LOGFILE GROUP with increased size
of redo log group members. After that you can change status of redo log group with small
size of file by using command ALTER SYSTEM SWITCH LOGFILE and than drop the
old redo log files using the ALTER DATABASE DROP LOGFILE GROUP command.
Ad D: There are no ALTER DATABASE RESIZE LOGFILE GROUP and ALTER
DATABASE RESIZE LOGFILE MEMBER commands in Oracle.
138. Oracle guarantees read-consistency for queries against tables. What provides read-
consistency?
A. redo logs
B. control file
C. undo segments
D. data dictionary
Answer: C
Explanation:
Ad A: False. The information in a redo log file is used only to recover the database from a
system or media failure that prevents database data from being written to a database's
datafiles. See (a58227.pdf) Pg. 46. (1-12).
Ad B: False. The control file of a database is a small binary file necessary for the
database to start and operate successfully. (a58227.pdf) pg. 693. (28-19).
Ad C: True. Every database contains one or more rollback segments, which are portions
of the database that record the actions of transactions in the event that a transaction is
rolled back. You use rollback segments to provide read consistency, rollback transactions,
and recover the database. (a58227.pdf) Pg. 109. (2-17).
Ad D: False. Each Oracle database has a data dictionary. An Oracle data dictionary is a
set of tables and views that are used as a read-only reference about the database. For
example, a data dictionary stores information about both the logical and physical
structure of the database. (a58227.pdf) Pg. 81, 134 (1-47, 4-1).
139. You need to shut down your database. You want all of the users who are connected
to be able to complete any current transactions. Which shutdown mode should you
specify in the SHUTDOWN command?
A. ABORT
B. NORMAL
C. IMMEDIATE
D. TRANSACTIONAL
Answer: D
Explanation:
Ad A: False. This option of the SHUTDOWN command is used for emergency database
shutdown.
Ad B: False. Normal database shutdown proceeds with the following conditions:
(a) No new connections are allowed after the statement is issued.
(b) Before the database is shut down, Oracle waits for all currently connected users to
disconnect from the database.
(c) The next startup of the database will not require any instance recovery proce-dures.
Ad C: False. Immediate database shutdown proceeds with the following conditions:
(a) Current client SQL statements being processed by Oracle are terminated immediately.
(b) Any uncommitted transactions are rolled back. If long uncommitted transactions exist,
this method of shutdown might not complete quickly, despite its name.
(c) Oracle does not wait for users currently connected to the database to disconnect.
(d) Oracle implicitly rolls back active transactions and disconnects all connected users.
Ad D: True. After submitting this statement, no client can start a new transaction on this
particular instance. If a client attempts to start a new transaction, they are disconnected.
After all transactions have either committed or aborted, any client still connected to the
instance is disconnected. At this point, the instance shuts down just as it would when a
SHUTDOWN IMMEDIATE statement is submitted. A transactional shutdown prevents
clients from losing work, and at the same time, does not require all users to log off.
140. You decided to use multiple buffer pools in the database buffer cache of your
database. You set the sizes of the buffer pools with the DB_KEEP_CACHE_SIZE and
DB_RECYCLE_CACHE_SIZE parameters and restarted your instance.
What else must you do to enable the use of the buffer pools?
A. Re-create the schema objects and assign them to the appropriate buffer pool.
B. List each object with the appropriate buffer pool initialization parameter.
C. Shut down the database to change the buffer pool assignments for each schema object.
D. Issue the ALTER statement and specify the buffer pool in the BUFFER_POOL clause
for the schema objects you want to assign to each buffer pool.
Answer: D
Explanation:
Ad A: False. It is not required to recreate the schema objects to assign them to the
appropriate buffer pool. You can do that with ALTER TABLE command.
Ad B: False. You don't need to list each object with the appropriate buffer pool
initialization parameter. By default object is stored in the DEFAULT buffer pool.
Ad C: False. To change the buffer assignments for each schema object from DEFAULT to
KEEP or RECYCLE you need just use ALTER TABLE command. You don't need to
restart database to enforce these changes.
Ad D: True. Unlike DB_BLOCK_BUFFERS, which specifies the number of data block-
sized buffers that can be stored in SGA, Oracle9i introduces a new parameter,
DB_CACHE_SIZE, which can be used to specify the size of the buffer cache in the
Oracle SGA. There are two other parameters used to set KEEP and RECYCLE parts of
the buffer pools: DB_KEEP_CACHE_SIZE and DB_RECYCLE_CACHE_SIZE. To
enable the use of the buffer pools you need to issue the ALTER statement and specify the
buffer pool (or exact part of buffer pool, DEFAULT, KEEP or RECYCLE) in the
BUFFER_POOL clause for the schema objects you want to assign to each buffer pool.
Syntax of these statements: ALTER TABLE table_name STORAGE (BUFFER_POOL
DEFAULT), ALTER TABLE table_name STORAGE (BUFFER_POOL KEEP) or
ALTER TABLE table_name STORAGE (BUFFER_POOL RECYCLE).
OCA Oracle 9i Associate DBA Certification Exam Guide, Jason Couchman, p. 544-547,
Chapter 10: Basics of the Oracle Database Architecture
141. A user calls and informs you that a 'failure to extend tablespace' error was received
while inserting into a table. The tablespace is locally managed.
Which three solutions can resolve this problem? (Choose three.)
Answer: A, C, D
Explanation:
Ad A, C, D: You can add a data file to the tablespace, alter a data file belonging to the
tablespace to extend automatically, resize a data file belonging to the tablespace to be
larger.
Ad B: False. Changing the default storage of the tablespace will not solve the problem.
Ad E: False. If you alter the next extent size to be smaller and insert data into a table, but
it's just temporary decision of problem: error will be generated again when the size of
next extents will grow to fit the segment.
OCA Oracle 9i Associate DBA Certification Exam Guide, Jason Couchman, p. 637-640,
Chapter 12: Managing Tablespaces and Datafiles
142. Which table type should you use to provide fast key-based access to table data for
queries involving exact matches and range searches?
A. regular table
B. clustered table
C. partitioned table
D. index-organized table
Answer: D
Explanation:
Ad A: Regular table will require indexes to provide fast key-based access to table data for
queries involving exact matches and range searches.
Ad B: False. Clusters are an optional method of storing table data. Clusters are groups of
one or more tables physically stored together because they share common columns and
are often used together. Because related rows are physically stored together, disk access
time improves. (a58227.pdf) Pg. 79. (1-45).
Ad C: False. Partitioning addresses the key problem of supporting very large tables and
indexes by allowing you to decompose them into smaller and more manageable pieces
called partitions. Once partitions are defined, SQL statements can access and manipulate
the partitions rather than entire tables or indexes. Partitions are especially useful in data
warehouse applications, which commonly store and analyze large amounts of historical
data. All partitions of a table or index have the same logical attributes, although their
physical attributes can be different.
For example, all partitions in a table share the same column and constraint definitions;
and all partitions in an index share the same index columns. However, storage
specifications and other physical attributes such as PCTFREE, PCTUSED, INITRANS,
and MAXTRANS can vary for different partitions of the same table or index. Each
partition is stored in a separate segment. Optionally, you can store each partition in a
separate tablespace. See (a58227.pdf) Pg. 244. (9-2).
Ad D: True. An index-organized table differs from a regular table in that the data for the
table is held in its associated index. Changes to the table data, such as adding new rows,
updating rows, or deleting rows, result only in updating the index. The index-organized
table is like a regular table with an index on one or more of its columns, but instead of
maintaining two separate storages for the table and the B*-tree index, the database system
only maintains a single B*-tree index which contains both the encoded key value and the
associated column values for the corresponding row. Benefits of Index-Organized Tables
Because rows are stored in the index, index-organized tables provide a faster key-based
access to table data for queries involving exact match and/or range search. (a58227.pdf)
Pg. 229. (8-29).
143. You issue the following queries to obtain information about the redo log files:<br />
A. Each online redo log file group must have two members.
B. You cannot delete any members of online redo log file groups.
C. You cannot delete any members of the current online redo log file group
D. You must delete the online redo log file in the operating system before issuing the
ALTER DATABASE command.
Answer: C
Explanation:
Oracle9i Database Concepts Release 2 (9.2) March 2002 Part No. A96524-01
(a96524.pdf) 9-41
DROP LOGFILE Clause
Use the DROP LOGFILE clause to drop all members of a redo log file group. Specify a
redo log file group as indicated for the ADD LOGFILE MEMBER clause.
(a) To drop the current log file group, you must first issue an ALTER SYSTEM SWITCH
LOGFILE statement.
(b) You cannot drop a redo log file group if it needs archiving.
(c) You cannot drop a redo log file group if doing so would cause the redo thread to
contain less than two redo log file groups.
See Also: ALTER SYSTEM on page 10-22 and "Dropping Log File Members: Example"
on page 9-54
If you execute switch logfile, then the current logfile will be different, so answer C is ok.
A. The redo log buffer is NOT part of the shared memory area of an Oracle instance.
B. Multiple instances can execute on the same computer, each accessing its own physical
database.
C. An Oracle instance is a combination of memory structures, background processes, and
user processes.
D. In a shared server environment, the memory structure component of an instance
consists of a single SGA and a single PGA.
Answer: B
Explanation:
http://download-
west.oracle.com/docs/cd/B10501_01/server.920/a96524/c06start.htm#8106.
Multiple instances can run concurrently on the same computer, each accessing its own
physical database. In clustered and massively parallel systems (MPS), Real Application
Clusters enables multiple instances to mount a single database.
Ad A: False. The redo log buffer is a circular buffer in the SGA that holds information
about changes made to the database. See (a58227.pdf) Pg. 158, 144. (6-6, 5-2).
Ad C: False. Oracle allocates a memory area called the System Global Area (SGA) and
starts one or more Oracle processes. This combination of the SGA and the Oracle
processes is called an Oracle instance. See (a58227.pdf) Pg. 144. (5-2).
Ad D: True/False. ??? A PGA is nonshared memory area to which a process can write.
One PGA is allocated for each server process; the PGA is exclusive to that server process
and is read and written only by Oracle code acting on behalf of that process. A PGA is
allocated by Oracle when a user connects to an Oracle database and a session is created,
though this varies by operating system and configuration. The basic memory structures
associated with Oracle include:
(a) Software Code Areas
(b) System Global Area (SGA): the database buffer cache, the redo log buffer, the shared
pool
(c) Program Global Areas (PGA): the stack areas, the data areas, Sort Areas
145. The current password file allows for five entries. New DBAs have been hired and
five more entries need to be added to the file, for a total of ten. How can you increase the
allowed number of entries in the password file?
A. Manually edit the password file and add the new entries.
B. Alter the current password file and resize if to be larger.
C. Add the new entries; the password file will automatically grow.
D. Drop the current password file, recreate it with the appropriate number of entries and
add everyone again.
Answer: D
Explanation:
You can create a password file using the password file creation utility, ORAPWD or, for
selected operating systems, you can create this file as part of your standard installation.
ENTRIES: This parameter sets the maximum number of entries allowed in the password
file. This corresponds to the maximum number of distinct users allowed to connect to the
database as SYSDBA or SYSOPER. If you ever need to exceed this limit, you must
create a new password file. It is safest to select a number larger than you think you will
ever need. See (a58397.pdf) Pg. 39, 41. (1-9, 1-11).
146. ABC Company consolidated into one office building, so the very large
EMPLOYEES table no longer requires the OFFICE_LOCATION column. The DBA
decided to drop the column using the syntax below:<br />
Dropping this column has turned out to be very time consuming and is requiring a large
amount of undo space.
What could the DBA have done to minimize the problem regarding time and undo space
consumption?
Answer: E
Testking said B.
Explanation:
http://download-
west.oracle.com/docs/cd/B10501_01/server.920/a96521/tables.htm#5508.
Removing Unused Columns
The ALTER TABLE ... DROP UNUSED COLUMNS statement is the only action
allowed on unused columns. It physically removes unused columns from the table and
reclaims disk space.
In the example that follows the optional keyword CHECKPOINT is specified. This
option causes a checkpoint to be applied after processing the specified number of rows, in
this case 250. Checkpointing cuts down on the amount of undo logs accumulated during
the drop column operation to avoid a potential exhaustion of undo space.
ALTER TABLE hr.admin_emp DROP UNUSED COLUMNS CHECKPOINT 250;
User B informs you that the UPDATE statement seems to be hung. How can you resolve
the problem so user B can continue working?
A. no action is required
B. ask user B to abort the statement
C. ask user A to commit the transaction
D. ask user B to commit the transaction
Answer: C
Explanation:
Because of the consistency, while a transaction not committed no one else can modify the
same columns.
Ad A: False. This situation requires DBA intervention if session of user A keeps EMP
table locked for other users updates during a long time.
Ad B: False. User A needs to commit UPDATE command to resolve this issue. User B
does not need to abort the transaction.
Ad D: False. User B cannot commit his/her transaction before user A commits his/her
transaction.
148. Anne issued this SQL statement to grant Bill access to the CUSTOMERS table in
Anne's schema:<br /><br />
Bill issued this SQL statement to grant Claire access to the CUSTOMERS table in Anne's
schema:<br /><br />
Later, Anne decides to revoke the select privilege on the CUSTOMERS table from
Bill.<br />
Which statement correctly describes both what Anne can do to revoke the privilege, and
the effect of the REVOKE command?
A. Anne can run the REVOKE SELECT ON customers FROM bill statement. Both Bill
and Claire lose their access to the customers table.
B. Anne can run the REVOKE SELECT ON customers FROM bill statement. Bill loses
access to the CUSTOMERS table, but Claire will keep her access.
C. Anne cannot run the REVOKE SELECT ON customers from BILL statement unless
Bill first revokes Claire's access to the CUSTOMERS table.
D. Anne must run the REVOKE SELECT ON customers FROM bill CASCADE
statement. Both Bill and Claire lose their access to the ri ISTOMERS table.
Answer: A
Explanation:
Anne can run the REVOKE SELECT ON customers FROM bill statement. Both Bill and
Claire lose their access to the CUSTOMERS table because of cascade revoking of
privilege.
Ad A: True. Anne can run the REVOKE SELECT ON customers FROM bill statement.
Both Bill and Claire lose their access to the CUSTOMERS table because of cascade
revoking of privilege.
Ad B: False. Both Bill and Claire lose their access to the CUSTOMERS table, not only
Bill.
Ad C: False. Anne can run the REVOKE SELECT ON customers FROM bill statement.
There is no limitation in Oracle that Bill needs first to revoke Claire's access to the
CUSTOMERS table if Anne granted this privilege to Bill WITH GRANT OPTION.
Ad D: False. Anne can revoke the privilege from the Bill and Claire just with REVOKE
command. There is no CASCADE clause in the REVOKE command. But the CASCADE
CONSTRAINTS optional clause requires if you are revoking the REFERENCES
privilege. In our case it is not required.
149. John has created a procedure named SALARY_CALC. Which SQL query allows
him to view the text of the procedure?
A. SELECT text FROM user_source WHERE name = 'SALARY_CALC';
B. SELECT * FROM user_source WHERE source_name = 'SALARY_CALC';
C. SELECT * FROM user_objects WHERE object_name = 'SALARY_CALC';
D. SELECT * FROM user_procedures WHERE object_name = 'SALARY_CALC';
E. SELECT text FROM user_source WHERE name = 'SALARY_CALC' AND owner =
'JOHN';
Answer: A
Explanation:
SQL> desc user_source
150. Which statement should you use to obtain information about the number, names,
status, and location of the control files?
Explanation:
Ad A: False. V$PARAMETER This view lists information about initialization
parameters. See (a58242.pdf) Pg. 402.
Ad B: True. V$CONTROLFILE This view lists the names of the control files. See
(a58242.pdf) Pg. 360.
Ad C: False. v$control_files does not exist. See (a58242.pdf).
Ad D: False. V$PARAMETER This view lists information about initialization
parameters, it has no parameter column. See (a58242.pdf) Pg. 402.
151. You need to make one of the data file of the PROD_TBS tablespace auto
extensible.<br />
Answer: D
Explanation:
Try it!
Answer: A, B, C
Explanation:
See OCP Oracle 9i Database: Fundamentals I, p. 56.:
A and C already occur with NOMOUNT option.
B also occurs with the MOUNT option. With this option, the control file is read (!) to
obtain the names and status of the datafiles and the redo log files.
Ad D, E: datafiles and redo log files are opened (and therefore checked) with the OPEN
option.
153. You are creating a data base manually and you need to limit the number of initial
online redo log groups and members. Which two keywords should you use within the
create database command to define the maximum number of online redo log files?
(Choose two).
Answer: A, C
Explanation:
See OCP Oracle 9i Database: Fundamentals I, p. 77f.:
The MAXLOGFILES option defines the maximum number of redo log file groups and
the MAXLOGMEMBERS option defines the maximum number of members for a redo
log file group that can be created in the database.
The other options (MAXREDOLOGS, MAXLOGGROUPS) do not exist.
154. Which four do you find in the alert log file ? (Choose four)
Answer: C, D, E, F
Explanation:
CREATE USER and CREATE TABLE do not produce an entry in the alert log file.
155. You need to determine the amount of space currently used in each tablespace.
You can retrieve this information in a single SQL statment using only one DBA view in
the FROM clause providing you use either the _______ or _______ DBA view.
A.DBA_EXTENTS.
B.DBA_SEGMENTS.
C.DBA_DATA_FILES.
D.DBA_TABLESPACES.
Answer: A, C
Explanation:
See OCP Oracle 9i Database: Fundamentals I, p. 211