Professional Documents
Culture Documents
Inderpal S. Johal
Manager, DBA Group
Agenda
AWR ASH ADDM ADVISORY ASMM ASM Q&A - Automatic Shared Memory Management - Automatic Storage Management - Automatic Workload Repository - Active Session History - Automatic database Diagnostic Monitor
PR Newswire
BASIC
TYPICAL
ALL
PR Newswire
PR Newswire
WR
SGA
MMON
60 Min
In-Memory Statistics
V$
DBA_
S C H E M A
WORKLOAD REPOSITORY
ADDM Advisory
EM SQL*Plus
rd 3rd Party Tool
. Internal Clients
Auto SQLTuning
. External Clients
PR Newswire
SGA
In-Memory Statistics
V$
MMNL
Session Activity Wait Event Object
Every Second
MMNL
WR
In-Memory Statistics
ASH AWR Statistics
1 sec sample 1 sec sample 1 sec sample 1 sec sample 1 sec sample
MMON
Every 60 Min.
S C H E M A
WORKLOAD REPOSITORY
- Only Records ACTIVE Sessions means NON-IDLE Sessions - Rolling buffer and previous information is overwritten when required - Writes 1 out of 10 Samples to AWR
PR Newswire
ASH Sampling
Wait 1 Wait 2 Active Session 2 Active Session 3 Active Session 4
1s
1s
ASH
Session 1 Wait 1 Session 1 Wait 4 Session 1 Wait 7 .... Session 2 Wait 1 ....
Active Session 5
Active Session 1
V$ACTIVE_SESSION_HISTORY
INACTIVE SESSIONS
PR Newswire
ASH Buffers are filled with 1 Sec Samples from Active Session-state information Hidden parameter _ASH_SAMPLING_INTERVAL Please Dont change it Hidden parameter _ASH_SAMPLE_ALL Please Dont change it
PR Newswire
Recommended option
PR Newswire
10
You can Dump ASH content to File SQL> oradebug setmypid SQL> oradebug dump ashdump 5
PR Newswire
11
SGA
In-Memory Statistics
V$
Oracle support Metrics for following statistics System Sessions Files Wait events MMON periodically updates the Metrics data from corresponding Base Statistics
PR Newswire
13
Metrics Views
METRICS GENERAL INFORMATION V$METRICNAME V$METRICGROUP V$METRIC V$METRIC_HISTORY DBA_HIST_METRIC_NAME V$SYSMETRIC V$SYSMETRIC_HISTORY V$SYSMETRIC_SUMMARY DBA_HIST_SYSMETRIC_HISTORY DBA_HIST_SYSMETRIC_SUMMARY V$SESSMETRIC DBA_HIST_SESSMETRIC_HISTORY V$FILEMETRIC V$FILEMETRIC_HISTORY DBA_HIST_FILEMETRIC_HISTORY V$EVENTMETRIC V$WAITCLASSMETRIC V$WAITCLASSMETRIC_HISTORY
Oracle 10g As : AWR, ADDM, ASH, ASM .. A 14
SYSTEM METRICS
Benefit of Metrics
Snapshot
Snapshot
DBA
OLD NEW
PR Newswire
15
SGA
In-Memory Statistics
MMON V$ DBA_
. External Clients
PR Newswire
16
9:00 am 10:00 am
SGA
In-Memory Statistics Every 60 Minutes
Seven days
PR Newswire
17
PR Newswire
18
SGA
In-Memory Statistics
SYSAUX Tablespace
WR SCHEMA
SGA
In-Memory Statistics
MMON
PR Newswire Oracle 10g As : AWR, ADDM, ASH, ASM .. A 19
AWR WR Schema
METADATA Tables WRM$_xx DBA_HIST_xx
WR Schema
DBA_HIST_xx
PR Newswire
20
AWR- Reports
Different types of AWR report
awrrpt.sql awrddrpt.sql awrinfo.sql AWR Workload Report Side by Side AWR comparision AWR Information like current Usage and Data Distribution Load AWR Dump from one DB to another Create AWR report for specific SQL statement
awrload.sql awrsqrpt.sql
PR Newswire
21
ADDM
Automatic Database Diagnostic Monitor
AWR
SGA
SNAPSHOT
In-Memory Statistics
MMON
60 Min
ADDM Results
ADDM
DBA
Reactive Monitoring
PR Newswire Oracle 10g As : AWR, ADDM, ASH, ASM .. A 22
Proactive Monitoring
ADDM
1. Snapshot i Report and Advise on - High Load SQL and PL/SQL statements - System Resources like CPU bottleneck - Space Management - Storage Management - Backup and Recovery Management Create on-demand report using script Named addmrpt.sql present in $ORACLE_HOME/rdbms/admin directory Use EM for analysis
ADDM
Snapshot i+1 2. 3.
PR Newswire
23
ADDM
It is also called Advisor for the Database Instance It helps in identifying the problem and their causes It also provides recommendation for each problem It can potentially call all other 10g new advisors In Short ADDM main objective is 1. Reduce Bottlenecks 2. Improve Performance
AWR
SNAPSHOT EM
PGA Advisor
PGA SGA
ADDM Results
ADDM
PR Newswire
24
ADDM
PR Newswire
25
PR Newswire
26
PR Newswire
27
PR Newswire
28
10g
PR Newswire
29
PR Newswire
30
PR Newswire
31
PR Newswire
32
PR Newswire
33
Advisor ASMM
SGA = 20G
SGA_TARGET = 20G SGA_MAX_SIZE = 20G Redolog Buffer Fixed SGA STATISTICS_LEVEL = TYPICAL LOG_BUFFER DB_KEEP_CACHE_SIZE DB_RECYCLE_CACHE_SIZE DB_nK_CACHE_SIZE Manually Tuned Parameters DB Buffer Cache Shared Pool Java Pool Large Pool Streams Pool Auto Tuned
Set STATISTICS_LEVEL = TYPICAL | ALL to use ASMM Set SGA_TARGET > 0 [Default =0 means ASMM is disabled]
DB_CACHE_SIZE/SHARED_POOL_SIZE/JAVA_POOL_SIZE/LARGE_POOL_SIZE/STREAMS_POOL_SIZE =0
when SGA_TARGET is set to non Zero value If you specify any value to above Auto Tuned variable in initialization parameter file, they will become Lower bound value
e.g. if SGA_TARGET=20G and SHARED_POOL_SIZE=5G, then SHARED POOL never shrink below 5G
ASMM uses new Background process MMAN [Memory Manager] MMAN coordinates the sizing of Memory components
Oracle 10g As : AWR, ADDM, ASH, ASM .. A 34
PR Newswire
Advisor ASMM
PR Newswire
35
Advisor ASMM
PR Newswire
36
PR Newswire
37
What is ASM
ASM stands for Automatic Storage Management It is Oracle Cluster File System and Volume Manager Designed for Oracle Database Related Files Provide Storage management capabilities like striping as well as mirroring
Data files Log files Archived files Control Files DataGuard Change Tracking File
Not Certified for Trace Files ORACLE_HOME Voting Disk OCR Files Alert Log Password File Binary File (BFILE)
PR Newswire
38
ASM
Tables Tablespaces Automatic Storage Management
Disk Groups
Physical Volumes
39
Triple Mirroring
Double Mirroring
No Mirroring
PR Newswire
40
PR Newswire
41
PR Newswire
42
ASM Architecture
Node 1 DB Instance
PMON RBAL DBWR SMON LGWR ASMB LGWR DBWR SMON PMON GMON RBAL Group Services +ASM1-->DG1 +ASM1 -->DG2
O C S S D O C S S D
Node 2
Group Services +ASM2-->DG1 +ASM2 -->DG2 +ASM2 -->DG3 ARB0 ARBa LGWR DBWR GMON RBAL SMON PMON
DB Instance
SMON LGWR ASMB PMON RBAL DBWR
FG
ARB0 ARBa
FG FG
DB Instance
ASMB SMON LGWR PMON RBAL DBWR
ASM Components
ASM Instance ASM Disk Disk Group Failure Group ASM Files
PR Newswire
44
PR Newswire
46
PR Newswire
47
ASM Components
ASM Instance ASM Disk Disk Group Failure Group ASM Files
PR Newswire
48
In 10g Rel 2, Disk names are unique within Disk Group while in Rel 1 it is unique within ASM instance.
SQL> CREATE DISKGROUP data_dg1 EXTERNAL REDUNDANCY DISK /dev/dsk/sdc4,/dev/dsk/sdd4; SQL> SELECT name FROM v$asm_disk; Name DATA_DG1_0000 DATA_DG1_0001
PR Newswire
49
Means Disk is of Oracle Object but can only be added to disk group with FORCE keyword Means Disk is available to be added to any disk group Same as CANDIDATE except that Disk is configured using ASMLIB Means Disk was formerly part of some disk group Means Disk is already part of existing disk group Oracle 10g As : AWR, ADDM, ASH, ASM .. A 50
Enterprise Manager
PR Newswire
51
PR Newswire
52
cd
du lsct lsdg
$ export ORACLE_SID=+ASM $ asmcmd ASMCMD> ls -ltr State Type Rebal Unbal Name MOUNTED EXTERN N N DG_DATA/
PR Newswire
53
PR Newswire
54
PR Newswire
55
DBMS_FILE_TRANSFER
ASM Disk
10g R2
DBMS_FILE_TRANSFER
File System
DBMS_FILE_TRANSFER
ASM Disk
Read Local File and copy it to new location on local system Contact Remote DB to read Remote file and copy it to Local system Read Local File and contact Remote DB to copy it to remote system
This operation can be performed directly without having to convert the datafile It will only be used for Database files like Datafile, tempfiles,controlfiles etc Oracle 10g As : AWR, ADDM, ASH, ASM .. A 56
PR Newswire
DBMS_FILE_TRANSFER Example
SQL> CREATE DIRECTORY NonASM AS '/export/home/oracle/data' ; Directory created. SQL> CREATE DIRECTORY ASM_D AS as '+DATAD_G1/DEVPROF' ; Directory created. SQL> begin 2 DBMS_FILE_TRANSFER.COPY_FILE( 3 source_directory_object => ASM_D' , 4 source_file_name => 'spfiledevprof.ora' , 5 destination_directory_object => NonASM' , 6 destination_file_name => 'spfileDEV.ora'); 7 end ; 8 / PL/SQL procedure successfully completed.
PR Newswire
57
PR Newswire
58
QUESTIONS ANSWERS
THANKS
PR Newswire Oracle 10g As : AWR, ADDM, ASH, ASM .. A 60