Creating Databases and Data Placement
Creating Databases and Data Placement
PLACEMENT
Presented By: Satrio Agung WIcaksono
specifics of creating a database Explore the System Catalog tables and views Compare table space management methods, including DMS, SMS and Automatic Storage table spaces Describe how to setup and manage database with Automatic Storage enabled Differentiate between table spaces, containers, extents, and pages
WHAT IS AN INSTANCE?
Databases are created within a Database Manager instance Table spaces are a logical layer created within a database Tables are created within table spaces
Database Path:
Includes Database Configuration file, Recovery History, Log Control files, Table space Control file, Bufferpool Control file and others
Initial location for database log files Default location is dftdbpathin DBM CFGNeeds to be a local file system Allows table space storage to be managed at the database level If Automatic storage is enabled there will be at least one path defined Initial Storage Paths defined when database is created
DB2 supports three types of storage management for table spaces All three types can be used in a single database Storage Management type set when a table space is created DMS Database Managed Storage:
Table space containers defined using the specified files or raw devices Disk space allocated is reserved for objects in that table space
Table space containers defined using the specified directories No defined initial size or limit DB2 creates files for each database object Disk space is freed when objects are dropped
Disk Storage Paths are assigned to the database Can be enabled when a database is created or added to an existing database Available space can be monitored at the database partition level DB2 defines the number and names for containers Uses SMS for temporary storage and DMS for other storage types
BUFFER POOLS
A buffer pool is an area of main memory that has been allocated by the database manager for the purpose of caching table and index data as it is read from disk Every DB2 database must have a buffer pool How buffer pools are used :
When a row of data in a table is first accessed, the database manager places the page that contains that data into a buffer pool. Pages stay in the buffer pool until the database is shut down or until the space occupied by the page is required by another page
TABLE SPACE
A table space is a storage structure containing tables, indexes, large objects, and long data. They are used to organize data in a database into logical storage groupings that relate to where data is stored on a system. Table spaces are stored in database partition groups
THE RELATIONSHIP BETWEEN TABLES AND TABLE SPACES WITHIN A DATABASE, AND THE CONTAINERS ASSOCIATED WITH THAT DATABASE
Administration is very easy, no need to define the number or names of the containers Disk space assigned and maintained at the database level Monitoring of available space at the database partition level instead of each table space Multiple containers will be created using all available storage paths for performance Automatic Storage can be enabled when the database is created oradded to an existing database
Storage paths can be added or removed using ALTER DATABASE Uses standard DMS and SMS under the covers:
DMS used for REGULAR and LARGE table spaces SMS used for SYSTEM and USER TEMPORARY table spaces INITIALSIZE: Defaults to 32 MB AUTORESIZE: Can be set to YES or NO INCREASESIZE: Can be set to amount or percent increase MAXSIZE: Can define growth limits