IBM Security Directory Server directory database and table spaces
You can use the database and table space to store data in IBM Security Verify Directory.
A table space is a storage structure where the actual data that is underlying the database objects can be stored. From DB2®, Version 10.1.0.1 onwards, the database managed spaces (DMS) and system managed spaces (SMS) table space types are deprecated for permanent table spaces that are defined by the user. Management of table spaces is simplified by introduction of automatic storage.
From Security Verify Directory, Version 10.0, a database with automatic storage table spaces is created during database configuration. A new command-line parameter to specify the storage space container is provided. For information about how to create a database with automatic storage table spaces and the default values for parameters, see idscfgdb in the IBM Security Verify Directory documentation.
- DB2 by
default creates four table spaces:
USERSPACE1,SYSCATSPACE,TEMPSPACE1, andSYSTOOLSPACE. - IBM Security Verify
Directory
creates an additional table space called
LDAPSPACE. USERSPACE1andLDAPSPACEtable spaces store the IBM Security Verify Directory data.
As all automatic storage table spaces are internally database-managed table spaces only, the list tablespaces command can no longer be used to verify whether a table space is using automatic storage.
Use the following command to verify whether the table spaces in the configured database are using automatic storage:
db2 "connect to db_name"
db2 "select substr(TBSP_NAME,1,50) as tablespacename, TBSP_USING_AUTO_STORAGE as
DOES_USE_AUTOSTORAGE from table (sysproc.MON_GET_TABLESPACE('',-1))"
TABLESPACENAME DOES_USE_AUTOSTORAGE
---------------------------------- --------------------------
SYSCATSPACE 1
TEMPSPACE1 1
USERSPACE1 1
LDAPSPACE 1
SYSTOOLSPACE 1
A value of 1 in the second column indicates that
the corresponding table space uses automatic storage.
The DB2 backup and restore can be done at the database level, the table space level, or both levels. Hence, you must understand the underlying structure so that you can determine the best backup and restore method for different IBM Security Verify Directory environments. In general, it is advisable that you do not use DB2 backup and restore at the table space level for the listed reasons.
In the examples, ldapdb2 is used as the database
name. You can use the db2 list database directory and db2
list tablespace show detail commands to find the database
and table space information for your environment.
You can view the table spaces by running the following DB2 commands under the context of the DB2 instance owner.
ldapdb2 is used:db2 "list tablespaces"Tablespaces for Current Database
Tablespace ID= 0
Name= SYSCATSPACE
Type= Database managed space
Contents= All permanent data. Regular tablespace.
State= 0x0000
Detailed explanation:
Normal
Tablespace ID= 1
Name= TEMPSPACE1
Type= System managed space
Contents= System Temporary data
State= 0x0000
Detailed explanation:
Normal
Tablespace ID= 2
Name= USERSPACE1
Type= Database managed space
Contents= All permanent data. Large table space.
State= 0x0000
Detailed explanation:
Normal
Tablespace ID= 3
Name= LDAPSPACE
Type= Database managed space
Contents= All permanent data. Large table space.
State= 0x0000
Detailed explanation:
Normal
Tablespace ID= 4
Name= SYSTOOLSPACE
Type= Database managed space
Contents= All permanent data. Large table space.
State= 0x0000
Detailed explanation:
NormalUSERSPACE1 and LDAPSPACE.
By default, there is only one container or directory for each table
space. To view the details about the USERSPACE1 table
space, run the following DB2 command: db2 "list tablespace containers for 2"ldapdb2: Container ID = 0
Name = /home/ldapdb2/ldapdb2/NODE0000/ldapdb2/T0000002/C0000000.LRG
Type = FileThe default container or directory that DB2 uses for
table space 2 (USERSPACE1) is /home/ldapdb2/ldapdb2/NODE0000/SQL00001/USPACE.
The USERSPACE1 table space contains all of the ldapdb2 database
tables, which have rows that fit in a 4 K page size. These tables
include the attribute tables that are used for fast DB2 lookups.
Table space 3 (LDAPSPACE) contains the remainder
of the database tables that require a 32 K page size. These tables
include the ldap_entry table, which contains most
of the IBM Security Directory
Server directory data and the replication tables.
LDAPSPACE table
space, run the following DB2 command:db2 "list tablespace containers for 3"The data in IBM Security Verify Directory is spread between table space 2 and table space 3. Both table spaces need to be accessed for most of the single IBM Security Verify Directory operations. In a search operation, the attribute tables in table space 2 are used to find the entries that match the specified criteria. However, the entry information is returned from the ldap_entry table in table space 3. For an update operation, the attribute tables in table space 2 and the ldap_entry (and possibly the replication tables) in table space 3 must be updated. For this reason, users must back up and restore only at the database level, so that the related sets of data are kept together. If the related sets of data are not kept together, recovering to a point in time where all of the data is consistent would be unlikely.