Examples on Linux Systems
The user can place the mount in maintenance mode by using the db2cm command. This command must be run as the System Administrator (root).
About this task
There are two types of mount resources in the resource model:
- Instance-level mount resource: maps to the instance shared directory (sqllib_shared).
- Database-level mount resource: maps to the database container's mount points.
Note: Instance-level mount resources cannot be placed into maintenance mode, and these mount
resources are defined on all hosts in the cluster. Database-level mount resources can be placed into
maintenance mode, and these mount resources are only defined on the member hosts.
Restrictions
- If a mount point is placed in host-level maintenance, it cannot be placed in cluster-wide level mount maintenance by using the -all option.
- A mount point can be in single host mount maintenance as many times as the number of hosts that exist in the cluster at one time. (no quorum issue)
- If multiple hosts have the same mount point in mount maintenance, the order of exiting mount maintenance from each host is irrelevant.
- If a mount point is in host-level maintenance on all hosts, the user can exit mount maintenance on all hosts by using the -all option.
- The user can exit host-level mount maintenance on a mount point as long as the mount is in maintenance mode on the current host (entered through host-level maintenance or cluster-wide maintenance).
- Single host mount maintenance commands (enter and exit) must be executed on the same host.
- Host-level mount maintenance operations (enter and exit) and cluster-wide mount maintenance operations (enter -all and exit -all cannot be issued on a caching facility CF-only host.
- The mount maintenance verification operation (verify) can be issued on any member or CF host in the cluster.
Examples
- Example 1: A DBA determines that the specific mount point (/db2data) needs to be taken offline on a specific host. Entering mount maintenance (/db2data) on member 0 home host
-
Environment setup:
- Two Members and one CF : M0, M1 and CF128.
- Three shared file systems:
- /db2fs1 - Instance-level mount resource. sqllib_shared resides on this file system.
- /db2data - File system that holds database container files.
- /db2logs - File system that holds log files.
Action: The DBA plans to take '/db2data' offline on member M0 for maintenance activity.
Steps:- Force all applications off on member M0 using any databases that reside on /db2data. Applications that are actively connecting to the database through this member must be routed to other members.
- Deactivate the database on /db2data from the member M0 home
host:
db2 deactivate db <dbname> -member 0 -force
- As root user on the member M0’s host, enter mount maintenance on
/db2data:
db2cm -enter -maintenance -mount /db2data
- Verify that the mount point is in maintenance mode on the member M0
host:
db2cm -verify -maintenance -mount /db2data
- Perform the necessary maintenance work.
- As root user on the member M0’s host, exit mount
maintenance:
db2cm -exit -maintenance -mount /db2data
Note: In highly active environments, connections may re-establish before the force operation completes. For information on how to prevent incoming connections to a database on a specific member, see Preventing applications from connecting to a database on a specific member above. - Example 2: A DBA determines a specific mount point (/data) to be taken offline on all hosts. Entering mount maintenance (/data) on all hosts
-
Environment setup:
- Two Members and one CF : M0, M1 and CF128.
- Three shared file systems:
- /db2fs1 - Instance-level mount resource. sqllib_shared resides on this file system.
- /data - File system that holds database container files.
- /logfiles - File system that holds log files.
Action: The DBA plans to take '/data' offline on all members for maintenance activity.
Steps:- Force all applications on all members using any DBs on /data.
- Quiesce database that resides on /data:
db2 connect to <dbname> db2 quiesce db immediate
- Deactivate database on /data:
db2 deactivate db <dbname> -force
- As root user on any host, enter mount maintenance on /data for all hosts:
db2cm -enter -maintenance -mount /data -all
- Verify that mount is in maintenance mode on all host:
db2cm -verify -maintenance -mount /data
- Perform the necessary maintenance work.
- As root user on any host, exit mount maintenance from all hosts:
db2cm -exit -maintenance -mount /data -all
- Unquiesce database on /data:
db2 connect to <dbname> db2 unquiesce db