Creating the server instance

Create an IBM Storage Protect instance by issuing the db2icrt command.

About this task

You can have one or more server instances on one workstation.
Linux operating systemsAIX operating systemsImportant: Before you run the db2icrt command, verify the following items:
  • The home directory for the user (/home/tsminst1) exists. If there is no home directory, you must create it.
    The instance directory stores the following files that are generated by the IBM Storage Protect server:
    • The server options file, dsmserv.opt
    • The server key database file, cert.kdb, and the .arm files (used by clients and other servers to import the Secure Sockets Layer certificates of the server)
    • Device configuration file, if the DEVCONFIG server option does not specify a fully qualified name
    • Volume history file, if the VOLUMEHISTORY server option does not specify a fully qualified name
    • Volumes for DEVTYPE=FILE storage pools, if the directory for the device class is not fully specified, or not fully qualified
    • User exits
    • Trace output (if not fully qualified)
  • A backup copy of the following files must be saved to a safe and secure location:
    • Master encryption key files (dsmkeydb.*)
    • Server certificate and private key files (cert.*)
  • The root user and instance-user ID must have write permission to the shell configuration file. A shell configuration file (for example, .profile) exists in the home directory. For more information, see the Db2® product information. Search for Linux® and UNIX environment variable settings.
Linux operating systemsAIX operating systems
  1. Log in using the root user ID and create an IBM Storage Protect instance. The name of the instance must be the same name as the user that owns the instance. Use the db2icrt command and enter the command on one line:Linux operating systemsAIX operating systems
    /opt/tivoli/tsm/db2/instance/db2icrt -a server -u 
    instance_name instance_name
    For example, if your user ID for this instance is tsminst1, use the following command to create the instance. Enter the command on one line.Linux operating systemsAIX operating systems
    /opt/tivoli/tsm/db2/instance/db2icrt -a server -u 
    tsminst1 tsminst1
    Remember: From this point on, use this new user ID when you configure your IBM Storage Protect server. Log out of the root user ID and log in under the new instance-user ID.
  2. Change the default directory for the database to be the same as the instance directory for the server. If you have multiple servers, log in under the instance ID for each server. Issue this command:
    db2 update dbm cfg using dftdbpath instance_directory
    For example, where instance_directory is the instance user ID:
    db2 update dbm cfg using dftdbpath /tsminst1
  3. Modify the library path to include libraries that are required for server operations.
    Tip: In the following examples, here are the directories:
    • server_bin_directory is a subdirectory of the server installation directory. For example, /opt/tivoli/tsm/server/bin.
    • instance_users_home_directory is the home directory of the instance user. For example, /home/tsminst1.
    .
    • AIX operating systemsIssue the following command, on one line:
      
      export LIBPATH=server_bin_directory/dbbkapi:
      /usr/opt/ibm/gsk8_64/lib64:$LIBPATH
    • You must update one of the following files to set the library path when IBM Db2 or the server are started. Update per the shell that the instance user is configured to use.

      Bash or Korn shell:

      
      instance_users_home_directory/sqllib/userprofile

      C shell:

      
      instance_users_home_directory/sqllib/usercshrc
    • Update per the shell that the instance user is configured to use.

      Bash or Korn shell:

      Add the following entry to the instance_users_home_directory/sqllib/userprofile file, on one line:AIX operating systems
      export LIBPATH=server_bin_directory/
      dbbkapi:/usr/opt/ibm/gsk8_64/lib64:$LIBPATH
      
      Linux operating systems
      export LD_LIBRARY_PATH=server_bin_directory/
      dbbkapi:/usr/local/ibm/gsk8_64/lib64:
      /opt/ibm/lib:
      /opt/ibm/lib64:$LD_LIBRARY_PATH
      

      C shell:

      Add the following entry to the instance_users_home_directory/sqllib/usercshrc file, on one line:AIX operating systems
      
      setenv LIBPATH server_bin_directory/dbbkapi:
      /usr/opt/ibm/gsk8_64/lib64:$LIBPATH
      Linux operating systems
      
      setenv LD_LIBRARY_PATH server_bin_directory/dbbkapi:/
      usr/local/ibm/gsk8_64/lib64:/
      opt/ibm/lib:/opt/ibm/lib64:/usr/lib64:$LD_LIBRARY_PATH
      Remember: The following entries must be in the library path, preceding any other entries in the library path:
      • server_bin_directory/dbbkapi
      • /usr/local/ibm/gsk8_64/lib64
  4. Create a new server options file.
Windows operating systemsImportant: Before you run the db2icrt command, verify the following items:
  • Ensure that the user and the instance directory of the user exists. If there is no instance directory, you must create it.
    The instance directory stores the following files for the server instance:
    • The server options file, dsmserv.opt
    • The server key database file, cert.kdb, and the .arm files (used by clients and other servers to import the Secure Sockets Layer certificates of the server)
    • Device configuration file, if the DEVCONFIG server option does not specify a fully qualified name
    • Volume history file, if the VOLUMEHISTORY server option does not specify a fully qualified name
    • Volumes for DEVTYPE=FILE storage pools, if the directory for the device class is not fully specified, or not fully qualified
    • User exits
    • Trace output (if not fully qualified)
  • Save a backup copy of the following files to a safe and secure location:
    • Master encryption key files (dsmkeydb.*)
    • Server certificate and private key files (cert.*)
Windows operating systems
  1. Log in as an administrator and create an IBM Storage Protect instance, by using the db2icrt command. Enter the following command on one line. The user account that you specify becomes the user ID that owns the server (the instance user ID).
    db2icrt -u user_account instance_name
    For example, if the user account is tsminst1 and the server instance is Server1, enter the following command:
    db2icrt -u tsminst1 server1
    You are prompted for the password for user ID tsminst1. Later, when you create and format the database, you use the instance name that you specified with this command, with the -k option.
  2. Change the default path for the database to be the drive where the instance directory for the server is located. Complete the following steps:
    1. Click Start > Programs > IBM DB2 > DB2TSM1 > Command Line Tools > Command Line Processor.
    2. Enter quit to exit the command line processor.

      A window with a command prompt should now be open, with the environment properly set up to successfully issue the commands in the next steps.

    3. From the command prompt in that window, issue the following command to set the environment variable for the server instance that you are working with:
      set db2instance=instance_name
      The instance_name is the same as the instance name that you specified when you issued the db2icrt command. For example, to set the environment variable for the Server1 server instance, issue the following command:
      set db2instance=server1
    4. Issue the command to set the default drive:
      db2 update dbm cfg using dftdbpath instance_location
      For example, the instance directory is d:\tsm\server1 and the instance location is drive d:. Enter the command:
      db2 update dbm cfg using dftdbpath d:
  3. Create a new server options file.