1 / 46

DATABASE ADMINISTRATION

DATABASE ADMINISTRATION. Pertemuan ke - 6. System Performance dan Database Performance source : Database Administration the complete guide to practices and procedures chapter 10-11 by. Craig S. Mullins. System performance. Performa sistem akan mempengaruhi performa db dan performa aplikasi

raven-good
Download Presentation

DATABASE ADMINISTRATION

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DATABASE ADMINISTRATION Pertemuanke-6

  2. System Performance dan Database Performancesource : Database Administrationthe complete guide to practices and procedureschapter 10-11by. Craig S. Mullins

  3. System performance • Performa sistem akan mempengaruhi performa db dan performa aplikasi • Performa db akan mempengaruhi performa aplikasi • ba harus mengatahui sistem dan environtment dari db • Dba mampu menangani perubahan sistem meski tidak harus bekerja sendiri

  4. Figure 10-1. The tuning boxes

  5. The Larger Environment

  6. The Larger Environment • DBMS bekerja dalam lingkungan yang besar yang meliputi software dan hardware lain • Setiap komponen harus terinstall, dikonfigurasi dengan efektif • DBA harus mengetahui bagaimana interaksi DBMS dengan hardware,OS dan software lain

  7. Interaksi ini meliputi : • Interaksi dengan OS • Allied agent • Hardware configuration • Disk storage dan I/O

  8. Componen DBMS • DBMS terdiri dari ribuan baris code aplikasi • DBMS sangat kompleks dan membutuhkan banyak program dalam menjalankan fungsinya • Setiap vendor memecah fungsi DBMS dalam beberapa komponen

  9. Arsitektur Oracle • Terdiri dari 5 basic komponen • file structures, • memory structures, • processes, • rollback segments, and • redo logs. • Sebuah database oracle terdiri dari phisical structure(data files) dan logical structure(table,index)

  10. Oracle Arch • Phisical structure ORACLE terdiri dari: • Control file • Redo log file • Database file • Memory Structure • System global Area (SGA) : data cache, redo log buffer, share pool • Program global Area (PGA) : user and background process,1 proses 1 PGA • Sort area : sort, order dan grup data

  11. Oracle Arch • Oracle Processes • user processes and : execute program • Oracle processes • Server process : relay user process dan SGA • Background process: data management dan proses fungsi oracle instance • Proses Monitor (PMON) background process • System Monitor (SMON) background process • Database writer (DBWR) • Log Writer (LGWR) • Recover (RECO)

  12. DBMS Installation and Configuration Issues

  13. Types of Configuration • DBMS dapat di konfigurasi pada saat instalasi atau pada saat beroperasi • Setiap instalasi memiliki nilai default • Parameter dalam konfigurasi DBMS dapat diganti secara : • Dinamis : tidak butuh restart • Nondinamis : harus direstart • Gabungan : terkadang perlu direstart

  14. Memory usage • Relational databases love memory • DBMS menggunakan RAM untuk cache data • Cost : data dari memory < data dari disk

  15. Memory cache : tipe cache • Data cache digunakan untuk menghindari I/O operation ketika data actual sedang dibaca dari database (buffer pool)

  16. Procedure cache : menyimpan SQL dan struktur program terkait • Sort cache : digunakan untuk menyimpan hasil sorting • Contoh operasi yang butuh sorting : grouping, ordering,UNION dan beberapa tipe join • Internal structure cache : unik untuk tiap DBMS : • Ex : database decriptor di DB2 • Database log cache (log write and log read) : untuk rollback dan recover operations

  17. others • Beberapa area yang menkonsumsimemori • User connections : maintain dan manage koneksi • Devices : untuk maintain danpenggunaan device • Open databases : jumlahdb yang dapatdigunakan • Open objects : jumlahobjek (tabel, index,dll) yang dapatdigunakan • Locks : setiap lock dalamdbbutuh memory • Caches : beberapamacam cache

  18. Database Logs • Disebut juga transaction log • Digunakan untuk ROLLBACK dan RECOVER

  19. Locking and Contention • Minimalkan : • Lock suspensions • Timeouts • Deadlocks

  20. The System Catalog • Gunakan disk terpisah untuk instalasi sistem katalog agar memudahkan manajemen

  21. System Monitoring

  22. System Monitoring • Environtment DBMS perludimonitorsecaracontinueuntukmencegahpenurunanperformadanterjadinyamasalah • Beberapa DBMS menyediakan built-in monitor. • Beberapaaplikasi monitoring performance seperti BMC Software's PATROL or Omegamondaro Candle Corporation dapatdigunakanuntukmemonitorperformadanmemberidinamicalerti • Performance monitor adatidakhanyauntuk DBMS tapiuntukseluruhsistem • DBA harusdapatmenggunakandanmengertiapamaksuddari monitoring yang ada • Performance monitor bertindaksepertijendelaterhadapefisiensi performance

  23. Database Performance :Technique for Optimizing Databases

  24. Fokus pada tuning dan optimasi desain, parameter dan phisical • Meliputi ; • Partitioning • Raw partitions versus file systems • Indexing • Denormalization • Clustering • Interleaving data • Free space • Compression • File placement and allocation • Page size • Reorganization • Setiap DBMS memiliki teknik untuk optimasi beberapa aspek tsb, dengan berbagai nama

  25. Partitioning • DBA menentukan bagaimana cara mapping tiap tabel • Single table to a single file (tidak terlalu efisien) • Single table to multiple files (paling banyak digunakan untuk data besar) • Multiple tables to a single file (digunakan untuk tabel kecil seperti lookup dan tabel kode) • Partioning berguna untuk parallelism

  26. Raw Partition vs. File System • Untuk unix-based DBMS dapat memilih antara raw partition dan file system untuk menyimpan data • Lebih efisien menggunakan raw partition daripada file system untuk menyimpan data di disk

  27. Indexing • Penggunaan index yang benar dapat meningkatkan performa db • Index digunakan antara lain untuk: • Locating rows by value(s) in column(s) • Making joins more efficient (when the index is defined on the join columns) • Correlating data across tables • Aggregating data • Sorting data to satisfy a query • Jika tabel kecil, hindari index

  28. Denormalization • Lawan dari normalisasi, beberap opsi : • Prejoined tables— when the cost of joining is prohibitive. • Report table— when specialized critical reports are too costly to generate. • Mirror table— when tables are required concurrently by two types of environments. • Split tables— when distinct groups use different parts of a table. • Combined tables— to consolidate one-to-one or one-to-many relationships into a single table. • Speed table— to support hierarchies like bill-of-materials or reporting structures. • Physical denormalization— to take advantage of specific DBMS characteristics.

  29. Clustering • Tabel yang tercluster akan menyimpan row phisycal secara terurut berdasar kolom tertentu atau beberapa kolom • Index yang tercluster akan membuat row tabel disimpan dalam susunan ascending berdasar index

  30. Page Splitting • Ketika DBMS harus melakukan proses insert dan tidak ada space tersedia, maka harus dibuat page baru untuk menyimpan data, ini disebut page splitting • Dua tipe splitting • Normal page split • Monotic page split

  31. Interleaving Data • Dapat disebut spesialisasi dari clustering • Jika ada dua tabel sering dijoin, maka lebih baik melakukan interleave data menjadi satu physical structure

  32. Free Space • Disebut juga fill factor • The specification of free space in a tablespace or index can reduce the frequency of reorganization, reduce contention, and increase the efficiency of insertion • Ensure a proper amount of free space for each database object.

  33. Compression • Untuk meminimalkan ukuran db • Dapat menggunakan internal tool atau thirtd party software • Memiliki efek positif dan negatif • Positif : ukuran disk kecil • Negatif : butuh tambahan proses untuk compress dan decompress

  34. File Placement and Allocation • DBA harus meminimalkan cost untuk write and write data pada phisical disk • Pastikan index terpisah dari data pada penyimpanannya

  35. Page Size (Block Size) • The page size is used to store table rows (or more accurately, records that contain the row contents plus any overhead) on disk

  36. Database Reorganization

  37. Database Reorganization • Semakin lama DB digunakan akan menyebabkan penurunan performa • Kecepatan query menurun termasuk efek menurunnya performa • Salah satu penyebab menurunnya performa : database disorganisation • Database disorganization occurs when a database's logical and physical storage allocations contain many scattered areas of storage that are too small, not physically contiguous, or too disorganized to be used productively

  38. Penyebab disorganisasi db • unclustered data • Fragmentation • Row chaining or row migration • Page splits • File extents

  39. Organized tablespace

  40. Disorganized tablespace

  41. Manual reorganization

  42. Otomatic reorganized • REORG TABLESPACE TSNAME

  43. Summary • If the environment where the DBMS must operate is not performing efficiently, it is impossible for the DBMS, and indeed any database access, to perform efficiently. • The DBA needs to understand every DBMS configuration value and the impact it can have on the overall performance of the system. • Furthermore, the DBA must control the integration of the DBMS with the hardware on which the DBMS runs and any allied agent software

  44. Summary • Applications and data are constantly changing. Users require instant response time and 24/7 availability. • The database structures that support these applications must be properly maintained to ensure optimal application performance. • Proper database design, appropriate choice of clustering, and reorganizing databases based on statistics help to deliver efficient databases. • Furthermore, DBAs can ensure database performance by automating these processes to reduce the risk and errors associated with manual database maintenance

  45. Terimakasih

More Related