By Lecturer / Aisha Dawood 1.  Dedicated and Shared Server Processes  Configuring Oracle Database for Shared Server  Oracle Database Background Processes.

Slides:



Advertisements
Similar presentations
Introduction to Oracle
Advertisements

Acknowledgments Byron Bush, Scott S. Hilpert and Lee, JeongKyu
3 Managing an Oracle Instance. Objectives Setting up operating system and password file authentication Creating the parameter file Starting up an instance.
Oracle Architecture. Instances and Databases (1/2)
Module 20 Troubleshooting Common SQL Server 2008 R2 Administrative Issues.
12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance.
Chapter 14 Chapter 14: Server Monitoring and Optimization.
Harvard University Oracle Database Administration Session 2 System Level.
Managing an Oracle Instance
9 Copyright © 2009, Oracle. All rights reserved. Managing Data Concurrency.
10 Copyright © 2009, Oracle. All rights reserved. Managing Undo Data.
RMAN Restore and Recovery
Backup and Recovery Part 1.
ITEC474 Redo Log Files.
9 Copyright © Oracle Corporation, All rights reserved. Oracle Recovery Manager Overview and Configuration.
Oracle Architecture. Database instance When a database is started the current state of the database is given by the data files, a set of background (BG)
Oracle9i Database Administrator: Implementation and Administration
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Introduction to Oracle Backup and Recovery
The Self-Managing Database : Automatic Health Monitoring and Alerting Daniela Hansell & Gaja Krishna Vaidyanatha Product Managers, Server Technologies,
Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried.
Module 8: Server Management. Overview Server-level and instance-level resources such as memory and processes Database-level resources such as logical.
PPOUG, 05-OCT-01 Agenda RMAN Architecture Why Use RMAN? Implementation Decisions RMAN Oracle9i New Features.
Managing the Oracle RDBMS Today you will look at the basics, including: –Setting up Enterprise Manager –Using Enterprise Manager –Using Server Manager.
12 Copyright © 2007, Oracle. All rights reserved. Database Maintenance.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
4 Copyright © 2006, Oracle. All rights reserved. Recovering from Noncritical Losses.
Database Systems Slide 1 Database Systems Lecture 5 Overview of Oracle Database Architecture - Concept Manual : Chapters 1,8 Lecturer : Dr Bela Stantic.
7202ICT – Database Administration
By Lecturer / Aisha Dawood 1.  Dedicated and Shared Server Processes  Configuring Oracle Database for Shared Server  Oracle Database Background Processes.
Administration and Monitoring the Database Oracle 10g.
Oracle Locking Michael Messina Principal Database Analyst Indiana University.
Copyright © Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
An Oracle server:  Is a database management system that provides an open, comprehensive, integrated approach to information management.  Consists.
Triggers A Quick Reference and Summary BIT 275. Triggers SQL code permits you to access only one table for an INSERT, UPDATE, or DELETE statement. The.
Backup and Recovery Overview Supinfo Oracle Lab. 6.
9 Copyright © 2007, Oracle. All rights reserved. Managing Data and Concurrency.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
Week 3 Lecture 1 The Redo Log Files and Diagnostic Files.
8 Copyright © 2005, Oracle. All rights reserved. Managing Data.
7 Copyright © 2005, Oracle. All rights reserved. Managing Undo Data.
11 Copyright © 2004, Oracle. All rights reserved. Dealing with Database Corruption.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
Nitin Singh,AAO/EDP,RTI Allahabad1 Troubleshooting.
Chapter 1Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 1 Backup and Recovery Overview MSCD642 Backup and Recovery.
Overview of Oracle Backup and Recovery Darl Kuhn, Regis University.
18 Copyright © 2004, Oracle. All rights reserved. Backup and Recovery Concepts.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager.
18 Copyright © 2004, Oracle. All rights reserved. Recovery Concepts.
7 Copyright © Oracle Corporation, All rights reserved. Instance and Media Recovery Structures.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
6 Copyright © Oracle Corporation, All rights reserved. Backup and Recovery Overview.
13 Copyright © 2007, Oracle. All rights reserved. Using the Data Recovery Advisor.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
 Database Administration Oracle Database Instance Management Starting Up and Shutting Down أ. ندى الغامدي, أ. ندى الطوالة.
3 Copyright © Oracle Corporation, All rights reserved. 管理数据库事例.
SQL Trace and TKPROF.
Maintaining Online Redo Log Files
Is 221: Database Administration
SQL Server Monitoring Overview
Oracle9i Database Administrator: Implementation and Administration
Recovering from Noncritical Losses
Performing Database Recovery
Chapter 5 The Redo Log Files.
Presentation transcript:

By Lecturer / Aisha Dawood 1

 Dedicated and Shared Server Processes  Configuring Oracle Database for Shared Server  Oracle Database Background Processes  Managing Processes for Parallel SQL Execution  Managing Processes for External Procedures  Terminating Sessions  Monitoring the Operation of Your Database 2

 For example, you might want to perform an administrative operation and need to terminate all non-administrative sessions. This section describes the various aspects of terminating sessions, and contains the following topics:  ■ Identifying Which Session to Terminate  ■ Terminating an Active Session  ■ Terminating an Inactive Session  When a session is terminated, any active transactions of the session are rolled back, and resources held by the session (such as locks and memory areas) are immediately released and available to other sessions.  Example:  You terminate a current session using the SQL statement ALTER SYSTEM KILL SESSION. The following statement terminates the session whose system identifier is 7 and serial number is 15: ALTER SYSTEM KILL SESSION '7,15'; 3

 Identifying Which Session to Terminate:  To identify which session to terminate, specify the session index number and serial number. To identify the system identifier (SID) and serial number of a session, query the V$SESSION dynamic performance view. For example, the following query identifies all sessions for the user jward:  A session is ACTIVE when it is making a SQL call to Oracle Database. A session is INACTIVE if it is not making a SQL call to the database. 4

 Terminating an Active Session:  If a user session is processing a transaction (ACTIVE status) when you terminate the session, the transaction is rolled back and the user immediately receives the following message: ORA-00028: your session has been killed  If, after receiving the ORA message, a user submits additional statements before reconnecting to the database, Oracle Database returns the following message: ORA-01012: not logged on 5

 Terminating an Active Session Scenario:  An active session cannot be interrupted when it is performing network I/O or rolling back a transaction. Such a session cannot be terminated until the operation completes.  In this case, the session holds all resources until it is terminated. Additionally, the session that issues the ALTER SYSTEM statement to terminate a session waits up to 60 seconds for the session to be terminated.  If the operation that cannot be interrupted continues past one minute, the issuer of the ALTER SYSTEM statement receives a message indicating that the session has been marked to be terminated.  A session marked to be terminated is indicated in V$SESSION with a status of KILLED and a server that is something other than PSEUDO. 6

 Terminating an Inactive Session:  If the session is not making a SQL call to Oracle Database (is INACTIVE) when it is terminated, the ORA message is not returned immediately. The message is not returned until the user subsequently attempts to use the terminated session.  When an inactive session has been terminated, the STATUS of the session in the V$SESSION view is KILLED. The row for the terminated session is removed from V$SESSION after the user attempts to use the session again and receives the ORA message. 7

 Terminating an Inactive Session:  In the following example, an inactive session is terminated. First, V$SESSION is queried to identify the SID and SERIAL# of the session, and then the session is terminated. 8

 It is important that you monitor the operation of your database on a regular basis. Doing so not only informs you about errors that have not yet come to your attention but also gives you a better understanding of the normal operation of your database.  Being familiar with normal behavior in turn helps you recognize when something is wrong. 9

 Server-Generated Alerts  A server-generated alert is a notification from the Oracle Database server of an impending problem. The notification may contain suggestions for correcting the problem. Notifications are also provided when the problem condition has been cleared.  Alerts are automatically generated when a problem occurs or when data does not match expected values for metrics, such as the following:  ■ Physical Reads Per Second  ■ User Commits Per Second  ■ SQL Service Response Time 10

 Server-generated alerts can be based on threshold levels or can issue simply because an event has occurred.  Threshold-based alerts can be triggered at both threshold warning and critical levels. The value of these levels can be customer-defined or internal values, and some alerts have default threshold levels which you can change if appropriate. 11

 For example, by default a server-generated alert is generated for tablespace space usage when the percentage of space usage exceeds either the 85% warning or 97% critical threshold level.  Examples of alerts not based on threshold levels are:  ■ Snapshot Too Old  ■ Resumable Session Suspended  ■ Recovery Area Space Usage  An alert message is sent to the predefined persistent queue ALERT_QUE owned by the user SYS. Oracle Enterprise Manager reads this queue and provides notifications about outstanding server alerts, and sometimes suggests actions for correcting the problem. 12

 Using APIs to Administer Server-Generated Alerts  You can view and change threshold settings for the server alert metrics using the SET_THRESHOLD and GET_THRESHOLD procedures of the DBMS_SERVER_ALERTS PL/SQL package. The DBMS_AQ and DBMS_AQADM packages provide procedure for accessing and reading alert messages in the alert queue. 13

 Setting Threshold Levels  The following example shows how to set thresholds with the SET_THRESHOLD procedure for CPU time for each user call for an instance: DBMS_SERVER_ALERT.SET_THRESHOLD( DBMS_SERVER_ALERT.CPU_TIME_PER_CALL, DBMS_SERVER_ALERT.OPERATOR_GE, '8000', DBMS_SERVER_ALERT.OPERATOR_GE, '10000', 1, 2, 'inst1', DBMS_SERVER_ALERT.OBJECT_TYPE_SERVICE, 'main.regress.rdbms.dev.us.oracle.com');  In this example, a warning alert is issued when CPU time exceeds 8000 microseconds for each user call and a critical alert is issued when CPU time exceeds 10,000 microseconds for each user call.  The observation period is set to 1 minute. This period specifies the number of minutes that the condition must deviate from the threshold value before the alert is issued.  The number of consecutive occurrences is set to 2. This number specifies how many times the metric value must violate the threshold values before the alert is generated. 14

 Retrieving Threshold Information  To retrieve threshold values, use the GET_THRESHOLD procedure. For example: 15

 You can also check specific threshold settings with the DBA_THRESHOLDS view. For example: SELECT metrics_name, warning_value, critical_value, consecutive_occurrences FROM DBA_THRESHOLDS WHERE metrics_name LIKE '%CPU Time%';  If you use your own tool rather than Enterprise Manager to display alerts return to the section “Additional APIs to Manage Server-Generated Alerts” in chapter 4. 16

 Viewing Alert Data  The following dictionary views provide information about server alerts: ■ DBA_THRESHOLDS lists the threshold settings defined for the instance. ■ DBA_OUTSTANDING_ALERTS describes the outstanding alerts in the database. ■ DBA_ALERT_HISTORY lists a history of alerts that have been cleared. ■ V$ALERT_TYPES provides information such as group and type for each alert. ■ V$METRICNAME contains the names, identifiers, and other information about the system metrics. ■ V$METRIC and V$METRIC_HISTORY views contain system-level metric values in memory. 17

 Monitoring the Database Using Trace Files and the Alert Log  Each server and background process can write to an associated trace file. When an internal error is detected by a process, it dumps information about the error to its trace file. Some of the information written to a trace file is intended for the database administrator, and other information is for Oracle Support Services. Trace file information is also used to tune applications and instances. 18

 The alert log is a special trace file. The alert log of a database is a chronological log of messages and errors, and includes the following items:  ■ All internal errors (ORA-600), block corruption errors (ORA-1578), and deadlock errors (ORA-60) that occur  ■ Administrative operations, such as CREATE, ALTER, and DROP statements and STARTUP, SHUTDOWN, and ARCHIVELOG statements  ■ Messages and errors relating to the functions of shared server and dispatcher processes  ■ Errors occurring during the automatic refresh of a materialized view  ■ The values of all initialization parameters that had nondefault values at the time the database and instance start 19

 Initialization parameters controlling the location and size of trace files are:  ■ BACKGROUND_DUMP_DEST  ■ USER_DUMP_DEST  ■ MAX_DUMP_FILE_SIZE  Using the Trace Files  Check the alert log and other trace files of an instance periodically to learn whether the background processes have encountered errors. For example, when the log writer process (LGWR) cannot write to a member of a log group, an error message indicating the nature of the problem is written to the LGWR trace file and the database alert log. Such an error message means that a media or I/O problem has occurred and should be corrected immediately.  Specifying the Location of Trace Files  All trace files for background processes and the alert log are written to the directory specified by the initialization parameter BACKGROUND_DUMP_DEST. All trace files for server processes are written to the directory specified by the initialization parameter USER_DUMP_DEST. The names of trace files are operating system specific, but each file usually includes the name of the process writing the file (such as LGWR and RECO). 20

 Controlling the Size of Trace Files  You can control the maximum size of all trace files (excluding the alert log) using the initialization parameter MAX_DUMP_FILE_SIZE, which limits the file to the specified number of operating system blocks.  To control the size of an alert log, you must manually delete the file when you no longer need it. Otherwise the database continues to append to the file.  You can safely delete the alert log while the instance is running, although you should consider making an archived copy of it first. This archived copy could prove valuable if you should have a future problem that requires investigating the history of an instance. 21

 Controlling When Oracle Database Writes to Trace Files  Background processes always write to a trace file when appropriate. In the case of the ARCn background process, it is possible, through an initialization parameter, to control the amount and type of trace information that is produced.  Trace files are written on behalf of server processes whenever internal errors occur. Additionally, setting the initialization parameter SQL_TRACE = TRUE causes the SQL trace facility to generate performance statistics for the processing of all SQL statements for an instance and write them to the USER_DUMP_DEST directory.  by using the SQL statement ALTER SESSION SET SQL_TRACE. This example enables the SQL trace facility for a specific session: ALTER SESSION SET SQL_TRACE TRUE; 22

 Monitoring Locks  Locks are mechanisms that prevent destructive interaction between transactions accessing the same resource.  A deadlock can occur when two or more users are waiting for data locked by each other. Deadlocks prevent some transactions from continuing to work. Oracle Database automatically detects deadlock situations and resolves them by rolling back one of the statements involved in the deadlock  Oracle provides some scripts and views that enable you to monitor locks. The utllockt.sql script displays, in a tree fashion, the sessions in the system that are waiting for locks and the locks that they are waiting for. The location of this script file is operating system dependent.  A second script, catblock.sql, creates the lock views that utllockt.sql needs, so you must run it before running utllockt.sql. 23

 The following views can help you to monitor locks: 24

 Monitoring Wait Events  Wait events are statistics that are incremented by a server process to indicate that it had to wait for an event to complete before being able to continue processing.  A session could wait for a variety of reasons including waiting for more input, waiting for the operating system to complete a service such as a disk write, or it could wait for a lock or latch. 25

 Process and Session Views  some of the data dictionary views that you can use to monitor an Oracle Database instance. 26

 Monitoring Wait Events  Wait events are statistics that are incremented by a server process to indicate that it had to wait for an event to complete before being able to continue processing.  A session could wait for a variety of reasons including waiting for more input, waiting for the operating system to complete a service such as a disk write, or it could wait for a lock or latch. 27