Tuesday, March 12, 2013

Some good question and answer from 10g OCP Certification Exam Guide part 1

Questions
1. The location of the alert log is controlled by a parameter. Which one? (Choose
the best answer.)
A. AUDIT_FILE_DEST
B. BACKGROUND_DUMP_DEST
C. CORE_DUMP_DEST
D. DB_CREATE_FILE_DEST
E. USER_DUMP_DEST

2. What will be written to a background trace file? (Choose the best answer.)
A. Critical errors
B. Informational messages about background process activity
C. User activity information
D. It will depend on whether the SQL_TRACE parameter has been set

3. If a “stateless,” or “nonthreshold,” alert condition is raised, where will it be
displayed? (Choose the best answer.)
A. In the alert log
B. In a background trace file, generated by the process that detected it
C. In a user trace file, generated by the session that detected it
D. In the DBA_OUTSTANDING_ALERTS view
E. In the DBA_ALERT_HISTORY view

4. To enable collection of metrics for all the server alerts, what should the
STATISTICS_LEVEL parameter be set to? (Choose the best answer.)
A. BASIC
B. TYPICAL
C. ALL
D. Either TYPICAL or ALL
E. Any of BASIC, TYPICAL, or ALL

5. When the server alert system raises an alert, what will it do? (Choose all
that apply.)
A. Write it out to the alert log.
B. E-mail the alert to registered alert recipients.
C. Record the alert in the Automatic Workload Repository.
D. Invoke the appropriate procedure in DBMS_SERVER_ALERT.

6. Which of the following commands will be written to the alert log? (Choose
four answers.)
A. ALTER SESSION SET SQL_TRACE=TRUE;
B. ALTER SYSTEM SET SHARED_POOL_SIZE=400M;
C. ALTER TABLESPACE USERS BEGIN BACKUP;
D. ALTER DATABASE DATAFILE 10 RESIZE 1000M;
E. DROP TABLESPACE EXAMPLE CASCADE;
F. DROP USER SCOTT CASCADE;
G. DROP TABLE HR.EMPLOYEES;
H. SET AUTOTRACE ON;

7. Your users are connecting to the database through the shared server
mechanism, and you want to trace one user’s session. How can this
be done? (Choose the best answer.)
A. Enable tracing for his user process.
B. Trace the dispatcher servicing his session.
C. You can trace his session if you can identify the session’s SID and SERIAL#.
D. You cannot trace individual sessions through shared server.

8. Which process is responsible for updating metrics? (Choose the best answer.)
A. MMON, the manageability monitor
B. SMON, the system monitor
C. PMON, the process monitor
D. The server processes

9. Under which of the following circumstances must you subscribe to the
ALERT_QUE queue? (Choose the best answer.)
A. To receive e-mail notifications of alerts
B. To view alerts in Database Control
C. To write your own alert handler
D. To clear alerts from the ALERT_QUE queue manually

10. A SHUTDOWN ABORT is issued. By default, where will this be recorded?
(Choose the best answer.)
A. As an alert in the ALERT_QUE queue
B. In the alert log
C. As a user trace file
D. As background trace file

Answers
1. B. The alert log is written to the BACKGROUND_DUMP_DEST.
2. A. Background trace files are generated when a background process
encounters a severe problem, critical to the running of the instance.
3. E. Stateless alerts are displayed in the DBA_ALERT_HISTORY view. They are
never in the DBA_OUTSTANDING_ALERTS view, because they are solved as
soon as they occur.
4. D. Either TYPICAL or ALL will enable collection of the metrics used by the
server alert system. BASIC will disable the server alert system.
5. B and C. Server alerts are recorded in the AWR and mailed to anyone
registered to receive them.
6. B, C, D, and E. All ALTER SYSTEM and ALTER DATABASE commands are
written out to the alert log, so B and D are correct. Tablespace operations are
also written out, so C and E are correct too.
7. C. A shared server session is still a session, so you enable tracing for the SID
and SERIAL# that uniquely identify the session.
8. A. It is the manageability monitor that updates the AWR with metrics.
9. C. Subscribing to the queue is only needed if you want to write your own
routines to capture alert.
10. B. All SHUTDOWN commands are recorded in the alert log, and nowhere else.

Note:- 
Alert log contains following information :
All start up and shutdown commands ,  alter database and alter system , tablespace operation such as drop and create , putting tablespace in hot backup mode ,  log switches and archives .
Also contains warning and errors like :

Checkpoint incomplete, Unable to open file , Corrupt block , Problems with archiving,Deadlocks etc . 

Server-Generated Alerts

The server-generated alert system is a completely configurable mechanism that monitors 
the database, the instance, and user’s sessions and issues warnings when certain limits 
are reached and when certain events occur.


The background process that does this is the manageability monitor (or MMON)
process, assisted by the manageability monitor light (or MMNL) process.In earlier releases of the database the conversion of statistics to useful metrics
usually had to be done by the DBA; now Oracle does it for you, storing the results in
the Automatic Workload Repository, or AWR, in the SYSAUX tablespace.

Alert Types
Alerts are classed as threshold and nonthreshold. For example Tablespace usage is a threshold alert. Nonthreshold alerts inform you of events that occurred unpredictably. Such an alert is the “ORA-1555: snapshot too old”, error that is signaled when a query fails because the undo data it needs has been overwritten.
Threshold  alerts are also referred to as “stateful” alerts because they persist for some time until cleared . the query—and the alert becomes a historical record. Nonthreshold
alerts are also referred to as “stateless” alerts, because they do not persist: they occur,
and are gone.

The metrics for which alerts can be configured are listed in the view V$ALERT_
TYPES; there are more than a hundred of them. Many of the more useful metrics are
“x per second”–type metrics; these all have names suffixed “_ps”. To list them,

SQL> select internal_metric_name from v$alert_types where
internal_metric_name like '%_ps';
INTERNAL_METRIC_NAME
-----------------------------transactions_ps
physreads_ps
physwrites_ps
physreadsdir_ps
physwritesdir_ps
physreadslob_ps
physwriteslob_ps
redosize_ps
logons_ps
<output truncated....>

Viewing Alert Information
Alert information can be viewed by querying two data dictionary views. DBA_
OUTSTANDING_ALERTS will list all stateful alerts that have been raised and not yet
dealt with. Once cleared, the alerts are removed from this view and entered into DBA_
ALERT_HISTORY. Stateless alerts go directly to DBA_ALERT_HISTORY. This query,

SQL> select reason,object_type type,object_name name from
dba_outstanding_alerts;

We can edit thresold  by the DBMS_SERVER_ALERT package, which includes a procedure SET_THRESHOLD that can be used to set the criteria for issuing warning and critical alerts.



1 comment:

  1. Did you know that you can make cash by locking selected areas of your blog / site?
    To begin just join AdWorkMedia and run their Content Locking plug-in.

    ReplyDelete