IBM DB2
The version 10.5
documentation URI:
https://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.qb.server.doc/doc/t0006839.html
https://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.qb.server.doc/doc/t0006839.html
Use the following sql agains the repo
su - db2inst1
export PS1=" \u@\h [\d \t] [\w] $ \n\n "
# configure first your path
export PATH=$PATH:/opt/ibm/db2/V10.5/bin
export PATH=$PATH:/opt/ibm/db2/V10.5/adm/
Run the installer
# to the installer dir
cd /var/pckgs/ibm/db2/expc/
# run the installer script
sh db2setup -r /var/pckgs/ibm/db2/expc/db2/linuxamd64/samples/db2expc.rsp
how-to check which files are opened by the installer
script
lsof -a -p `pidof db2setup` | less
# or the db2 cmd
lsof -a -p `pidof db2` | less
Run the following command:
db2sampl --force --verbose
Use the following sql agains the repo
# Remember always to run as the db2 Linux user
su - db2inst1
export PS1=" \u@\h [\d \t] [\w] $ \n\n "
# configure first your path
export PATH=$PATH:/opt/ibm/db2/V10.5/bin
export PATH=$PATH:/opt/ibm/db2/V10.5/adm/
run the followign command as the db2inst1 ( the db2
Linux user )
db2 "connect to SAMPLE"
run the followign command as the db2inst1 ( the db2
Linux user )
db2 "connect to SAMPLE"
db2 "LIST TABLES "
run the followign command as the db2inst1 ( the db2
Linux user )
db2 list
db directory
run the followign command as the db2inst1 ( the db2
Linux user )
db2start
run the followign command as the db2inst1 ( the db2
Linux user )
db2stop
# Remember always to run as the db2 Linux user
su - db2inst1
run the followign command as the db2inst1 ( the db2
Linux user )
db2 -tvsf
/var/pckgs/ibm/db2/GS_DB/unix/drop_godb.sql
Run the following sql statemnts
CONNECT TO SAMPLE;
UNQUIESCE DATABASE;
QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS;
UNQUIESCE DATABASE;
CONNECT RESET;
deactivate db SAMPLE;
UNCATALOG DATABASE SAMPLE ;
DROP DATABASE SAMPLE;
how-to describe a table
db2 -x "DESCRIBE TABLE SYSIBM.TABLES"
how-to iterate over list of tables in db2
db2 -x "SELECT TABLE_NAME FROM
SYSIBM.TABLES" | { while read -r table ; do echo -e "start table:
$table \n" ; echo $table ; echo -e "stop table: $table " ; done
; }
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!