DB2 - SPLessons
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

DB2 Storage Group

DB2 Storage Groups

shape Description

Storage group is a named collection of repository path, where information can be saved. Storage groups are used to construct various classes of storage groups that are accessible  inside the system of  database. One can accredit a table spaces to the storage groups that out stands the information. And exclusive programmed stockpiling table spaces utilized the group of storage. The table space can be connected with stand out storage groups, yet the group of storage can have various table space organisations. To oversee the  objects  inside the storage group then one can utilize and initiate the create storage group, alter storage group, renamed storage  groups, comment and drop statements.At the point when characterizing the storage groups, ensuring that the aggregate group of storage paths as indicated by their aspects of administration attributes. The normal aspects of administration attributes for information take after a maturing design where the latest information is regularly achieved and desired the rapid access time while more seasoned information is often less achieved to and can endure superior accessed frame time. The need of the information depends on:

Creating a storage group

shape Description

Creating a storage group includes creating of path files and stored tables.

shape Syntax

The creating a storage group is as follows:
db2 create stogroup on ‘path’ Stogroup => Indicates the name of the storage group. Path => Indicates the location where data is stored.

shape Examples

By viewing the below example,the concept of creating a stored groups can be easily understands. [c] db2 => create stogroup stg1 on '/data1' DB20000I The SQL command completed successfully [/c] Here in the above example,the stogroup stg1 is stored on path '/data1'.

Altering a storage group

shape Description

Altering the storage group includes modifying the path files and stored tables.

shape Syntax

The altering a storage group is as follows:
db2 alter stogroup add ‘location’, ‘location’ Stogroup => Indicates the name of the storage group. Location => Moving from one location to another location where data is stored.

shape Examples

By viewing the below example,the concept of altering a stored groups can be easily understands. [c] db2 => alter stogroup stg1 add ‘/path/data1’, ‘/path/data3’ DB20000I The SQL command completed successfully [/c] Here in the above example,the stogroup stg1 is moved from one location to another location i.e., from /path/data1 to path/data3.

Dropping a storage group

shape Description

Dropping a storage group includes dropping the path files and stored tables.

shape Syntax

The dropping a storage group is as follows:
db2 drop stogorup Drop => Dropping the existing storage group. Stogorup => Actual data stored in the stored group.

shape Examples

By viewing the below example,the concept of dropping a stored groups can be easily understands. [c] db2 => db2 drop stogroup stg1 DB20000I The SQL command completed successfully [/c] Here in the above example,the stogroup stg1 has be drop from the stored groups.

Renaming a storage group

shape Description

Renaming a storage group will rename from old storage_name to new storage_name

shape Syntax

The syntax for renaming a storage group is as follows:
db2 rename stogroup to Stogroup => Indicates the name of the storage group. Stogorup => Actual data stored in the stored group.

shape Examples

By viewing the below example,the concept of renaming a stored groups can be easily understands. [c] db2 => rename stogroup sg1 to sgroup2 DB20000I The SQL command completed successfully [/c] Here in the above example,the stogroup stg1 has be renamed to sgroup2.

Summary

shape Points

  • DB2 Storage groups - Is a named collection of repository.
  • Creating a storage group - Creating path files and stored tables.
  • Altering a storage group - Modifing the existing storage groups.
  • Dropping a storage group - Dropping the existing storage groups.
  • Renaming a storage group - Changing the name of the storage groups.