基本命令:
1.db2cmd
2.db2fs
3.db2level
4.db2 connect to sample
5.db2 "select * from staff"
6.db2cc
Uninstalling DB2
Windows (AS ADMIN)
ADD/Remove Programs
Linux
Optional:Drop all databases.Databases files remain inact on your file systems when you drop an
instance without dropping databases first.
Stop the DB2 Administration Server.
Remove the Administration Server.
Stop DB2 instances.
Remove DB2 instances.
Remove DB2 products.
/opt/ibm/db2/V9.5/install>./db2_deinstall -a
(Cannot use rpm)
DB2实例
db2ilist
db2icrt myinst
db2 get instance
set db2instance=myinst
db2start
db2 create db testdb
db2 list db directory
db2 drop db testdb
db2stop
db2idrop myinst
db2ilist
set db2instance=db2
db2 get instance
Linux
/home/db2inst1/instance>./db2icrt -u db2fenc2 db2inst2
db2fenc2 and db2inst2 must exists before hand
To create an instance using the GUI
/home/db2inst1/instance.>/db2isetup
in this case,the user Ids are create for you
note if you run as non-root,you can only see the current configuration of existing instances
Note:Running from db2inst1 home directory,which has soft links to /opt/ibm/db2/V9.5(from which command could be run)
Switching instances
Windows(as Admin)
set DB2INSTNACE=<instance_name>
Linux
su -<instance name>
An instance maps to a Linux user
The db2profile file is normally added to the .profile or .login the files when the
instance was created.
The db2profile file has a line for DB2INSTANCE=<instance name>
db2start
db2stop [force]
Dropping an instance
Windows
db2stop
db2idrop myinst
Linux
db2stop (as the instance owner,eg:db2inst1)
/opt/ibm/db2/V9.5/instance>./db2idrop db2inst1 (as root)