본문 바로가기

IT/DB

[IBM DB2] DB2 명령어

### db2 database name 확인

[db2inst1@redhat5 ~]$ db2 list db directory

 System Database Directory

 Number of entries in the directory = 1

Database 1 entry:

 Database alias                       = TLMA
 Database name                        = TLMA
 Local database directory             = /home/db2inst1
 Database release level               = d.00
 Comment                              = IBM TLM Administration Server
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =


### 번들 라이센스 카피 추가

L:\Software\Tivoli\IBM_Tivoli_Asset_Discovery_for_Distributed\DB2_ESE_Restricted_QS_Activation_97\ese_o\db2\license\db2ese_o.lic

 

[root@redhat5 adm]# ./db2licm -a /opt/db2ese_o.lic

LIC1402I  License added successfully.


LIC1426I  This product is now licensed for use as outlined in your License Agreement.  USE OF THE PRODUCT CONSTITUTES ACCEPTANCE OF THE TERMS OF THE IBM LICENSE AGREEMENT, LOCATED IN THE FOLLOWING DIRECTORY: "/opt/ibm/db2/V9.7/license/en_US.iso88591"

 

# db2start

[db2inst1@redhat5 ~]$ db2start
07/23/2012 18:40:46     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.

[db2inst1@redhat5 ~]$ db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 9.7.0

You can issue database manager commands and SQL statements from the command
prompt. For example:
    db2 => connect to sample
    db2 => bind sample.bnd

For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
 ? CATALOG DATABASE for help on the CATALOG DATABASE command
 ? CATALOG          for help on all of the CATALOG commands.

To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND OPTIONS.

For more detailed help, refer to the Online Reference Manual.

db2 => connect to TLMA

   Database Connection Information

 Database server        = DB2/LINUXX8664 9.7.0
 SQL authorization ID   = DB2INST1
 Local database alias   = TLMA

db2 => quit         
DB20000I  The QUIT command completed successfully.
[db2inst1@redhat5 ~]$