Sunteți pe pagina 1din 34

MAINTENANCE

ORACLE DATABASE
Oleh :
Maulana Abdul Azis
Pendahuluan
Database merupakan inti dari setiap
organisasi. Setelah mengembangkan database
yang solid, proses penting berikutnya adalah
pemeliharaan database yang dilakukan untuk
menjaga database update, dan aman.
Seorang Database Administrator memiliki
kompetensi dalam perancangan database secara fisik
termasuk didalamnya adalah menjaga keamanan
database, pemeliharaan, perbaikan kinerja database,
penyalinan dan pemulihan serta berbagai hal berkaitan
dengan maintenance database. Database dapat
diperbarui secara manual dan melakukan backup
secara teratur.
Mengapa Database Perlu
Maintenance?
Sebuah database perlu dikelola atau
maintenance agar database tersebut tertata dan
dapat dipantau dengan baik. Mengupayakan agar
data-data yg kita miliki tidak hilang serta dapat
kita atur setiap saat.
Maintenance on Oracle
Database
Maintenance Task
Maintenance Area Oracle

Database Integrity DBVERIFY and ANALYZE


VALIDATTE structure

History Cleanup Manage backups and logs

Indexes Rebuild indexes and reorganize


tables
Statistics Gather object and system statistics
Consistency Checks
Consistency checks validate database
blocks and look for corruption in the datafiles.
Consistency checks look at the physical integrity
of the data blocks and rows of objects. They can
also validate the structures of object, and that the
tables and indexes still have the corresponding
values.
Health Checks on Oracle
O Check password policies and DBA and
SYSDBA permissions
O Check disk space for software and datafiles
O Check version and patchsets
O Check backup are scheduled and running
O Check maintenance tasks (update statistics,
snapshots for performance, checks for any
reorganization of tables or indexes)
O Check for monitoring of tablespaces and free space
O Check usage of undo and temporary tablespaces
O In Windows, check autostart of Oracle service and
listener service. For unix, check if scripts are in place
to start up and shut down gracefully
Object Maintenance
O Index Rebuild
O Table Reorganization
O Invalid Objects (recompile all database objects
that are invalid, recompile objects at the
schema level, recompile individual objects)
File Maintenance
Datafiles, log files, error logs, history logs,
trace files. File maintenance is very important to the
health of the database and maintaining a stable
environment. Developing tasks and scripts will be
useful for managing the many different files.
Shrinking and Resizing Files
In Oracle, the logs are sized and remain
that same size, so shrinking the file is not the
issue. However, depending on how many times
the transactions are looping through the redo logs,
there might be a reason to adjust the size of the
logs.
Tablespace Monitoring
Oracle tablespaces are created with one or
more datafiles. As the database grows, the tablespaces
and datafiles need to be maintained to allow for the
growth. Planning the size of the system tablespaces is
recommended.
AWR, ADDM, and ASH Report
AWR (Automatic Workload
Repository) Report
Automatic Workload Repository gathers,
processes and maintains performance stats used for
problem detection and self-tuning the databases. This
collective information can be displayed as views and
reports (HTML/text) to better show the current database
performance status for further analysis.
AWR gathers the following data:
O Object Statistics (access / usage stats of DB segments)
O Time Model Statistics
O Some of the System and Session Statistics
O ASH (Active Session History) Statistics
O High load generating SQL Statements
Menghasilkan AWR Report
Running script: SQL> @$ORACLE_HOME/rdbms/admin/awrrpt
Setelah memilih report dalam bentuk html, selanjutnya
adalah input jumlah hari dan range snap_id yang di
perlukan.
Selanjutnya akan terbentuk file awr report.

Dari file tersebut, kita dapat melakukan analysis dan


performance tuning untuk meningkatkan performa system.
Reading the AWR Report
This section contains detailed guidance for
evaluating each section of an AWR report. The data in
an AWR report is the delta, or changes, between the
accumulated metrics within each snapshot. AWR report
was originally designed for Oracle support internal-use
only.
The main sections in an AWR report include:
O Report Summary: This gives an overall summary of
the instance during the snapshot period, and it
contains important aggregate summary information.
O Cache Sizes (end): This shows the size of each SGA
region after AMM has changed them. This
information can be compared to the original init.ora
parameters at the end of the AWR report.
O Load Profile: This important section shows
important rates expressed in units of per second and
transactions per second.
O Instance Efficiency Percentages: With a target of
100%, these are high-level ratios for activity in the
SGA.
O Shared Pool Statistics: This is a good summary of
changes to the shared pool during the snapshot
period.
O Top 5 Timed Events: This is the most important
section in the AWR report. It shows the top wait
events and can quickly show the overall database
bottleneck.
O Wait Events Statistics Section: This section shows a
breakdown of the main wait events in the database
including foreground and background database wait
events as well as time model, operating system,
service, and wait classes statistics.
O Wait Events: This AWR report section provides more
detailed wait event information for foreground user
processes which includes Top 5 wait events and many
other wait events that occurred during the snapshot
interval.
O Time Model Statistics: Time mode statistics report
how database-processing time is spent. This section
contains detailed timing information on particular
components participating in database processing.
O Operating System Statistics: The stress on the
Oracle server is important, and this section shows the
main external resources including I/O, CPU, memory,
and network usage.
O Service Statistics: The service statistics section gives
information about how particular services configured
in the database are operating.
O SQL Section: This section displays top SQL, ordered
by important SQL execution metrics.
O Instance Activity Stats: This section contains
statistical information describing how the database
operated during the snapshot period.
O I/O Section
O Advisory Section
O Buffer Wait Statistics
O Enqueue Activity
O Undo Segment Summary
O Undo Segment Stats
O Latch Activity
O Segment Section
O Dictionary Cache Stats
O Library Cache Activity
O SGA Memory Summary
O init.ora Parameters
Header AWR:
O Redo size – Indicates the amount of DML activity
happening in the database.
O Logical and physical reads – Represents number of
IO's (Physical and logical) that the
database is performing.
O User calls - Indicates how many user calls have
occurred during the snapshot period. This value can
give you some indication if usage has increased.
O Parses and hard parses - Provides an indication of
the efficiency of SQL re-usage.
O Sorts - Number of sorts occurring in the
database.
O Logons – Number of logins which occurred
in the database.
O Executes – Number of SQL statements
which were executed.
O Transactions - Indicates how many
transactions occurred during the snapshot
period.
ADDM (Automatic Database
Diagnostic Monitoring) Report
Automatic Database Diagnostic Monitoring
Report analyzes the AWR data on a regular basis, to give
you overview of the root cause of the problem which is
affecting your database's performance. It also provides
suggestions or recommendations for rectifying any
problem identified and lists the areas which are having
no issues.
ADDM recommends multiple solutions for the DBA to
choose from which includes:
O Database Configuration
O Hardware changes
O Schema changes
O Application changes
O CPU bottlenecks
O Undersized Memory Structures
O I/O capacity issues
O Beban (load) yang tinggi pada SQL statements
O Masalah pada cluster (RAC)
O Masalah concurrency (busy buffer)
O Masalah pada object-object database lainnya.
ADDM refines the report based on the key factor
DB time (cumulative time spent by database to process user
requests).
To generate ADDM:

@$ORACLE_HOME/rdbms/admin/addmrpt.sql
ASH (Active Session History)
Report
Active Session History Reports shows you the below
mentioned stats regarding your Oracle Database:
O Transient performace problems (usually not
captured in ADDM reports)
O Time / session / action /module / SQL_ID based
target performance analysis
To generate ASH report:

@$ORACLE_HOME/rdbms/admin/ashrpt.sql
Analisa dan Kesimpulan
Analisa
Melakukan proses penguraian dan penelaahan ketika
hasil report dari sebuah database dihasilkan.

Kesimpulan
Tindakan apa yang harus dilakukan setelah kita
menganalisa sebuah hasil report.

S-ar putea să vă placă și