0% found this document useful (0 votes)
49 views

02 - Database Environment

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

02 - Database Environment

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 57

ADMINISTRASI BASIS DATA

Database Environment &


Architecture
Defining the organization’s DBMS Strategy

• The process of choosing and installing DBMS is one of the primary task of DBA
• Choosing a suitable DBMS for the Organizations
• Large Company
• Medium Company
• Small Company
• Start select product from tier 1 until lower-tier
• Consider following factor
• OS support - Scalability - Reference Customer
• Type of organization - Release schedule
• Technicians - Cost of ownership
• Benchmark - Availability of supporting software tools
Tier 1 vs Tier 2
• Open-source DBMS : PostgreSQL, MySQL
• Non relational DBMS : IMS, IDMS (CODASYL)
• NoSQL DBMS : CouchDB, MongoDB, Hadoop and Hbase, Cassandra
• Object-Oriented DBMS : ObjectDesign, Versant, Object Store, Ontos, Poet
• PC-Based DBMS : dBase, FileMaker, SQLite, Lotus, Microsoft Access, Paradox

• Need a strategy and a plan for selecting the appropriate DBMS for specific situation.

4
When choosing a DBMS, be sure to consider each of these factors:
• Operating system support
• Type of organization
• Benchmarks - Transaction Processing Performance Council (TPC) publishes official database
performance benchmarks that can be used as a guideline for the basic overall performance of many
different types of database processing
• Scalability
• Availability of supporting software tools
• Technicians
• Cost of ownership
• Release schedule
• Reference customers

5
DBMS Architectures

• The suitable DBMS architecture with environment is very critical


• Wrong choice can lead to
• Poor performance, downtime, or unstable application

• 4 levels of DBMS architecture


• Enterprise
• Departemental
• Personal
• mobile
enterprise DBMS
• designed for scalability and high performance
• must be capable of supporting very large databases, a large number of concurrent users, and multiple
types of applications
• runs on a large-scale machine, typically a mainframe or a high-end server running UNIX, Linux, or
Windows Server
• offers all the “bells and whistles” available from the DBMS vendor
• Multiprocessor support, support for parallel queries, and other advanced DBMS features are core
components of an enterprise DBMS

7
departmental DBMS
• sometimes referred to as a workgroup DBMS
• serves the middle ground
• supports small to medium-size workgroups within an organization
• Typically runs on a UNIX, Linux, or Windows server

8
personal DBMS
• designed for a single user
• typically on a low- to medium-powered PC platform
• suitable only for very small-scale projects and should never be deployed for multiuser applications

9
mobile DBMS
• specialized version of a departmental or enterprise DBMS for remote users who are not usually
connected to the network
• enables local database access and modification on a laptop or handheld device
• provides a mechanism for synchronizing remote database changes to a centralized enterprise or
departmental database server

10
Installing DBMS

• Read installation guide


• Hardware Requirement
• Storage Requirement
• Memory Requirement
• Configure the DBMS
• Connecting the DBMS to supporting infrastructure software
• Installation verification
• Update DBMS
Installing the DBMS

• The very first thing to do when you install a DBMS for the first time is to understand the prerequisites

• Hardware Requirements. Choose the correct DBMS for your needs and match your hardware to the
requirements of the DBMS
• Storage Requirements. DBMS will use disk storage for the following items: index, system catalog or
data dictionary, log files, start-up or control files, work files, default databases, temporary database
structures, system dump and error-processing files, DBA databases.
• Memory Requirements. A DBMS requires memory for basic functionality and will use it for most
internal processes such as maintaining the system global area and performing many DBMS tasks.
• A DBMS requires a significant amount of memory to cache data in memory structures in order to
avoid I/O. Reading data from a disk storage device is always more expensive and slower than moving
the data around in memory.

12
Configuring the DBMS

• Configuring the DBMS. Configuring the system parameters of the DBMS controls the manner in
which the DBMS functions and the resources made available to it.
• During the installation process, the input provided to the installation script will be used to establish
the initial settings of the system parameters.
• DBMS also provides a method to change the system parameters once the DBMS is operational.
• Example what system parameters control:
• authorization to the DBMS
• number of active database logs
• set the amount of memory used for data and program caching
• turn DBMS features on or off
• etc…

13
Connecting the DBMS

• Connecting the DBMS to Supporting Infrastructure Software. Connection the DBMS to other system
software components that must interact with the DBMS.
• Typical infrastructure software that may need to be configured to work with the DBMS includes:
• networks
• transaction processing monitors
• message queues
• other types of middleware
• programming languages
• systems management software
• operations and job control software
• Web servers
• application servers

14
Installation Verification

• Installation Verification. Tests to verify that the DBMS has been properly installed and configured.
• Example: Create a set of SQL code that comprises SELECT, INSERT, UPDATE, and DELETE statements
issued against sample databases. Running such a script after installation helps you to verify that the
DBMS is installed correctly and operating as expected.

• DBMS Environments. To support database development, the DBA needs to create multiple DBMS
environments, for example, testing, quality assurance, integration, and production work.

15
Upgrading DBMS Versions and Releases

• Major DBMS products changes quite rapidly.


• A typical release cycle for DBMS software is 18 to 24 months for major releases, with constant bug
fixes and maintenance updates delivered between major releases.
• The DBA must develop an approach to upgrading DBMS software that conforms to the organization’s
needs and minimizes business disruptions due to outages and database unavailability.

• A new version of software is a major concern, with many changes and new features.
• A release is typically minor, with fewer changes and not as many new features.

16
Upgrading to a new DBMS offers both rewards and risks.

Benefits: Risks:
• new features and functionality • databases will not be available while the DBMS
is being upgraded (downtime)
• enhanced performance and availability
features that can optimize existing applications • The cost of an upgrade can be a significant
barrier
• DBMS vendors often provide better support
and respond to problems faster for a new • may cause features and syntax that are being
release of their software. used in existing applications to be deprecated

• An effective DBMS upgrade strategy must balance the benefits against the risks of upgrading.

17
Database Standards and Procedures

• Before a newly installed DBMS can be used effectively, standards and procedures must be developed
for database usage.
• Standards are common practices that ensure the consistency and effectiveness of the database
environment, such as database naming conventions.
• Procedures are defined, step-by-step instructions that direct the processes required for handling
specific events, such as a disaster recovery plan.
• The DBA should develop database standards and procedures as a component of corporate-wide IT
standards and procedures. They should be stored together in a central location as a printed
document, in an online format, or as both.

18
Standar Example:
• Database Naming Conventions
• Roles and Responsibilities
• Communication Standards
• Data Administration Standards
• Database Administration Standards
• System Administration Standards
• Database Application Development Standards
• Database Security Standards
• Application Migration and Turnover Procedures
• Design Review Guidelines
• Operational Support Standards

19
© 2018 // FILKOM UB // ALL RIGHTS
Database Support Roles and Responsibilities

p = primary responsibility
x = involved

20
Database Administration Standards example:
• how requests are made to create a new database or make changes to existing databases
• specify which types of database objects and DBMS features are favored and under which
circumstances they are to be avoided
• establish backup and recovery procedures (including disaster recovery plans)
• the methods used to transform a logical data model into a physical database implementation
• cover database performance monitoring and tuning

21
System Administration Standards example:
• DBMS installation and testing procedures
• Upgrade policies and procedures
• Bug fix and maintenance practices
• A checklist of departments to notify for impending changes
• Interface considerations
• DBMS storage, usage, and monitoring procedures

22
Database Application Development Standards example:
• A description of how database access differs from flat file access
• SQL coding standards
• SQL performance tips and techniques
• Program preparation procedures and guidance on how to embed SQL in an application program
• Interpretations of SQLSTATEs and error codes
• References to other useful programming materials for teleprocessing monitors, programming
languages, and general application development standard

23
Db2 Architecture

24
• Db2 Environment
• Db2 Environment - The Big Picture
• Db2 Environment - Instances
• Db2 Environment - Databases
• Db2 Process Model
• Db2 Memory Model
• Db2 Storage Model

25
Db2 Environment

26
The Big Picture

The Db2 environment comprises of various components that makes Db2 function.
These components control the behavior of database system.
Environment Variables

• Environment variables are a set of dynamic named values that can affect the way


running processes will behave on a computer.

• Example:
OS Environment Variable : TEMP
Db2 Environment Variable : Db2INSTANCE
Db2 Instance

• An instance provides an independent environment where databases can be created

• Instances act as managers to the databases inside them

• Administrators can create multiple instances on a system

• Instances can have multiple databases inside them


Instance Design Consideration

• You may want to have multiple instances per server for the following reasons :

• You want to separate your Production and Test environments but you cannot afford to have different
servers.

• For security reasons, you want to have different instances.

• You want to configure instances differently depending on your application.


DBM configuration file (dbm cfg)

 Db2 => get dbm cfg


The Db2 Profile Registry

• The Db2 registry variables provide a centralized location where some key variables influencing Db2's
behavior reside.

• The Db2 instance-level profile registry


• Variables set at this level apply only to a specific instance

• The Db2 global-level profile registry


• Variables set at this level apply globally to all instances

• To view the current Db2 registry variables, issue the following command from the CLP:
• Db2set -all
Connectivity and Directories

• In Db2, directories are used to store connectivity information about databases and the servers on
which they reside.

• Configuration Assistant graphical tool may be used very conveniently to set up database and server
connectivity.

• System Database Directory (list db directory)


• Node Directory (list node directory)
• DCS Directory (list dcs directory)
Databases

• A database is a collection of information organized into interrelated objects like table spaces, tables,
and indexes.

• Databases are closed and independent units associated to an instance. Because of this
independence, objects in two or more databases can have the same name.
DB configuration file (db cfg)

 Database Configuration (get db cfg)


Tablespaces

• Table spaces are logical objects used as a layer between logical tables and physical containers. 

• Three Default Tablespaces:

• SYSCATSPACE
• TEMPSPACE1
• USERSPACE1
 Buffer Pools

• A buffer pool is an area in memory which is used to improve the performance of queries.

• Buffer pools are one of the most important objects to tune for database performance.

• Default buffer pool for databases : IBMDEFAULTBP


Log Files

• Logs are used by Db2 to record every operation against a database.


Db2 Process Model

39
Db2 Process Model - Highlight

Listing All EDUS: db2pd -edus


Understanding Processes & Threads

• A process is an executing instance of an application. It can contain multiple threads. A thread could
be considered as a light-weight version of a process

• Thus, the essential difference between a thread and a process is the work that each one is used to
accomplish. Threads are used for small tasks, whereas processes are used for more ‘heavyweight’
tasks – basically the execution of applications.

• Db2 is a multithreaded architecture.


Client Programs & Listeners

• A process is an executing instance of an application. It can contain multiple threads. A thread could
be considered as a light-weight version of a process

• Thus, the essential difference between a thread and a process is the work that each one is used to
accomplish. Threads are used for small tasks, whereas processes are used for more ‘heavyweight’
tasks – basically the execution of applications.

• Db2 is a multithreaded architecture.


Client Programs & Listeners

 Client Programs  Communication Listeners


 Client programs can be remote or local,  Communication listeners start when the Db2
running on the same machine as the database database server starts. There is a listener for each
server. Client programs make first contact configured communication protocol
with a database through a communication
listener.
 Db2ipccm (IPC – local clients)

 Db2tcpcm (tcpip – remote clients)

 Db2npcm (npipe protocol -windows)


EDUs / Agents

• An agent can be thought of as a 'worker' that performs all Database operations on behalf of an
application.

• The following list includes some of the important EDUs that are used by each database:

• Db2dlock : for deadlock detections


• Db2loggw : log file writer
• Db2pfchr : buffer pool prefetchers
• Db2pclnr : buffer pool page cleaners
Db2 Memory Model

45
Db2 Memory Model - Highlight

• Db2 manages memory at 4 different levels

46
Database Instance Memory (DIM)

• The memory allocated for each DBMS instance is Database Instance Memory or Instance Shared
Memory

• It is used for instance level tasks such as monitoring, auditing and inter-node communication

• It is allocated when the Db2 is started (db2start), and freed when it is stopped (db2stop)

47
Database Instance Memory cont..

• The memory pools in Database Instance Memory are:


• The Monitor Heap (mon_heap_sz) – for monitoring
• The Audit Buffer (audit_buf_sz) – for Db2audit facility and
• The FCM Buffer (fcm_num_buffers) – for partitioned systems

The Database Manager Configuration parameter INSTANCE_MEMORY


controls how much memory can be allocated to an instance

48
Database Global Memory (DGM)

• The memory allocated for each database is Database Global Memory

• It is used for backup and restore, locking, and SQL execution.

• It is allocated when you start or initially connect to a database and is released when you stop or
disconnect.

49
Database Global Memory cont..

• Within Database Global Memory, there are a number of memory pools. 

The amount of memory that is reserved for the database global memory for a
database is determined by the DATABASE_MEMORY configuration parameter
50
Db2 Application Global Memory (AGM)

• Application Global Memory is used for:


• coordinating and sending messages between the Db2 agents that are working on behalf of an application
• To store copies of currently executing sections of access plans
• For handling compilation of an SQL statements

In non-partitioned databases, use of


Application Global Memory is minimal.

APPL_MEMORY

51
Db2 Agent Private Memory (APM)

• Agents perform work for the applications, they are used for such things as:
• Building Query Plans
• Executing Query Plans
• Handling Cursors
• Sorting
• Gathering Statistics

52
Db2 Storage Model

53
Db2 Storage Model

• To understand the Db2 storage model, we need to understand the following architecture:
Instance – Db2

Database - MyDB Tablespace - tb2 Container – C3

P1 P2 P3 P4 P5
tb1 C1
P6 .. .. ..

C2
tb2

tb3 tb4 C3

.. .. Pn
Db2 Tablespaces : Characteristics

• Tablespaces are logical objects between the logical tables and physical container
• All tables, indexes, and other data are stored in a table space
• A tablespace is made up of containers
• Containers are made up of pages
• Page is the lowest unit of storage in Db2
• Page sizes are in denominations of
• 4K, 8K, 16K and 32K
Directory Hierarchy – OS File System
Required Tablespaces in Db2

• Each database must have a minimal set of table spaces that are used for storing system, user and
temporary data:

• SYSCATSPACE : contains the metadata


• TEMPSPACE : system temporary tablespace used for storing intermediate results of SQL operations
• USERSPACE1 : used to store user created data

You might also like