about db2 instance

来源:互联网 发布:淘宝买鞋子注意事项 编辑:程序博客网 时间:2024/05/01 13:41
查看实例端口号
db2 get dbm cfg
Look for SVCENAME. If it is a number, then it is the port number. If it is a
name, look for the name in the /etc/services file (or Windows equivilent if
using Windows). The default is 50000.

修改实例端口号
db2 update dbm cfg using SVCENAME 50001
(db2c_db2inst1)

更新实例:b2iupdt - Update Instances
db2iupdt - Update instances command

On Linux® and UNIX® operating systems, updates a specified DB2 instance. On Windows® operating systems, this command updates the instance release level. It can also be used to move an instance from one DB2® copy to another.

On Linux and UNIX operating systems, the db2iupdt command can be issued against instances of the same version that are associated with the same, or a different DB2 database installation directory. In all cases, it will update the instance so that it runs against the code located in the same directory as where you issued the db2iupdt command. You should issue this command:

    * whenever you install a new DB2 database product or fix pack to the installation directory related to the DB2 instance.
    * if you want to bring a DB2 instance from one installation path to the current one for the same version of DB2 database system.

On Linux and UNIX operating systems, it is located in the DB2DIR/instance directory, where DB2DIR is the location where the current version of the DB2 database product is installed.

On Windows operating systems, the instance is moved to the DB2 copy you execute db2iupdt from. To move your instance profile from its current location to another location, use the /p option and specify the instance profile path. Otherwise, the instance profile will stay in its original location after update. Use the db2imigr command instead to change from a major release to another. This utility is located in the DB2PATH/sqllib/bin directory, where DB2PATH is the location where the current version of the DB2 database product is installed.

To update an instance with db2iupdt, you must first stop all processes that are running for the instance.
Authorization

Root access on Linux and UNIX operating systems or Local Administrator on Windows operating systems.
Command syntax

For Linux and UNIX operating systems

Read syntax diagramSkip visual syntax diagram
>>-db2iupdt--+-----+--+-----+--+-----+--+-----+--+-----+-------->
             +- -h-+  '- -d-'  '- -k-'  '- -D-'  '- -s-'  
             '- -?-'                                      

>--+---------------+--+---------------+--+-InstName-+----------><
   '- -a--AuthType-'  '- -u--FencedID-'  '- -e------'  


For Windows operating systems

Read syntax diagramSkip visual syntax diagram
>>-db2iupdt--InstName--/u:--username,password------------------->

>--+----------------------------+--+-----------------------+---->
   '-/p:--instance-profile-path-'  '-/r:--baseport,endport-'  

>--+---------------+--+----+--+----+--+---------------+--------->
   '-/h:--hostname-'  '-/s-'  '-/q-'  '-/a:--authType-'  

>--+----+------------------------------------------------------><
   '-/?-'  


Command parameters

For Linux and UNIX operating systems

-h or -?
    Displays the usage information.
-d
    Turns debug mode on.
-k
    Keeps the current instance type during the update.
-D
    Moves an instance from a higher code level on one path to a lower code level installed on another path.
-s
    Ignores the existing SPM log directory.
-a AuthType
    Specifies the authentication type (SERVER, SERVER_ENCRYPT or CLIENT) for the instance. The default is SERVER.
-u Fenced ID
    Specifies the name of the user ID under which fenced user defined functions and fenced stored procedures will run. This option is only needed when converting an instance from a client instance to a non-client instance type. To determine the current instance type, refer to the node type parameter in the output from a GET DBM CFG command. If an instance is already a non-client instance, or if an instance is a client instance and is staying as a client instance (for example, by using the -k option), the -u option is not needed. The -u option cannot change the fenced user for an existing instance.
InstName
    Specifies the name of the instance.
-e
    Updates every instance.

For Windows operating systems

InstName
    Specifies the name of the instance.
/u:username,password
    Specifies the account name and password for the DB2 service.
/p:instance-profile-path
    Specifies the new instance profile path for the updated instance.
/r:baseport,endport
    Specifies the range of TCP/IP ports to be used by the partitioned database instance when running in MPP mode. When this option is specified, the services file on the local machine will be updated with the following entries:

       DB2_InstName       baseport/tcp
       DB2_InstName_END   endport/tcp

/h:hostname
    Overrides the default TCP/IP host name if there are more than one TCP/IP host names for the current machine.
/s
    Updates the instance to a partitioned instance.
/q
    Issues the db2iupdt command in quiet mode.
/a:authType
    Specifies authType, the authentication type (SERVER, CLIENT, or SERVER_ENCRYPT) for the instance.
/?
    Displays usage information for the db2iupdt command.

Examples (Linux and UNIX)

   1. If you have an instance db2inst1 related to the installation path DB2DIR and you applied a fix pack on top of the installation path, you may need to update the instance by running the following command:

         DB2DIR/instance/db2iupdt db2inst1

      This will bring up the instance to the highest type of instance. To keep the original instance type, you might need to use the -k option.
   2. An instance, db2inst2, is related to the installation path DB2DIR1. You have another installation of the DB2 database product on the same system at DB2DIR2 for the same version of the DB2 database product as that installed on DB2DIR1. To update the instance to use the installed DB2 database product from DB2DIR1 to DB2DIR2, issue the following command:

         DB2DIR2/instance/db2iupdt db2inst2

      If the DB2 database product installed at DB2DIR2 is at level lower than that at DB2DIR1, issue:

         DB2DIR2/instance/db2iupdt -D db2inst2

Usage notes

For Linux and UNIX operating systems

    * If you use the db2iupdt command to update a DB2 instance from another installation location to the current installation location, the DB2 Global Profile Variables defined in an old DB2 database installation path will not be updated over to the new installation location. The DB2 Instance Profile Variables specific to the instance to be updated will be carried over after the instance is updated.
    * On Linux and UNIX operating systems, if you are using the su command instead of the login command to become the root user, you must issue the su command with the - option to indicate that the process environment is to be set as if you had logged in to the system using the login command.
    * On Linux and UNIX operating systems, you must not source the DB2 instance environment for the root user. Running db2iupdt when you sourced the DB2 instance environment is not supported.

-----------------------------------------------------------------------------
原创粉丝点击