Você está na página 1de 8

Administering Oracle on Linux

Database Architecture HN D4715 1



DATABASE ARSITEKTUR





1) Memory

Cek alokasi memory saat startup :


Jika database sudah up, cek dengan perintah :

Administering Oracle on Linux

Database Architecture HN D4715 2



Cek dari parameter file :



2) Background Process
Informasi disimpan pada v$bgprocess, cek background process yang up :


Administering Oracle on Linux

Database Architecture HN D4715 3



Pastikan 4 backgroud process sudah up : SMON, PMON, DBRR, LGWR



3) Storage
Data File -> v$datafile


Log File -> v$log


Control file -> v$controlfile
Administering Oracle on Linux

Database Architecture HN D4715 4



Parameter file


Alert dan Trace file


Contoh penggunaan alert untuk kepentingan analisa Query :
1) Hapus semua file trace yang ada di folder : /u01/app/oracle/diag/rdbms/orcl/orcl/trace,
2) Grant alter session ke scott

3) Aktifkan sql trace di sesi scot

4) Lakukan query dan non aktif kan sql trace


Administering Oracle on Linux

Database Architecture HN D4715 5

5) Cek file terbentuk di folder : /u01/app/oracle/diag/rdbms/orcl/orcl/trace



6) Buka file trace yang terakhir terbentuk : orcl_ora_10867.trc

7) Format file : orcl_ora_10867.trc dengan utilitsa TKPROOF

8) Buka file report.txt yang dihasilkan
TKPROF: Release 11.2.0.1.0 - Development on Sun Sep 29 09:28:05 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

Trace file: orcl_ora_10867.trc
Sort options: default

********************************************************************************
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
********************************************************************************
Administering Oracle on Linux

Database Architecture HN D4715 6


SQL ID: 4tk6t8tfsfqbf
Plan Hash: 0
alter session set sql_trace=true


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 0 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 1 0.00 0.00 0 0 0 0

Misses in library cache during parse: 0
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 84
********************************************************************************

SQL ID: 3qaqhaaz14wd0
Plan Hash: 2949544139
select deptno, ename, sal
from
emp where empno=7788


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 0.00 0.00 0 2 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 0.00 0.00 0 2 0 1

Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 84

Rows Row Source Operation
------- ---------------------------------------------------
1 TABLE ACCESS BY INDEX ROWID EMP (cr=2 pr=0 pw=0 time=0 us cost=2 size=46
card=1)
1 INDEX UNIQUE SCAN PK_EMP (cr=1 pr=0 pw=0 time=0 us cost=1 size=0
card=1)(object id 73182)

********************************************************************************

SQL ID: aam2chsgpj7mb
Plan Hash: 0
alter session set sql_trace=false


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 2 0.00 0.00 0 0 0 0

Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 84


********************************************************************************

Administering Oracle on Linux

Database Architecture HN D4715 7

OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 2 0.00 0.00 0 0 0 0
Execute 3 0.00 0.00 0 0 0 0
Fetch 2 0.00 0.00 0 2 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 7 0.00 0.00 0 2 0 1

Misses in library cache during parse: 1
Misses in library cache during execute: 1


OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 0 0.00 0.00 0 0 0 0
Execute 0 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 0 0.00 0.00 0 0 0 0

Misses in library cache during parse: 0

3 user SQL statements in session.
0 internal SQL statements in session.
3 SQL statements in session.
********************************************************************************
Trace file: orcl_ora_10867.trc
Trace file compatibility: 11.1.0.7
Sort options: default

1 session in tracefile.
3 user SQL statements in trace file.
0 internal SQL statements in trace file.
3 SQL statements in trace file.
3 unique SQL statements in trace file.
49 lines in trace file.
14 elapsed seconds in trace file.




Administering Oracle on Linux

Database Architecture HN D4715 8

Você também pode gostar