You are on page 1of 5

DB2

//
[root@localhost server]# ./db2_install
ERROR:
The required library file libaio.so.1 is not found on the system.
Check the following web site for the up-to-date system requirements
of IBM DB2 9.7
http://www.ibm.com/software/data/db2/udb/sysreqs.html
http://www.software.ibm.com/data/db2/linux/validate
Aborting the current installation ...
Run installation with the option "-f sysreq" parameter to force the installati
on.
//
[root@localhost server]# cd ..
[root@localhost /]# cd /home/chenweidan/Desktop/ftp/upload
[root@localhost upload]# ls
db2client
server
libaio-0.3.106-3.2.x86_64.rpm v9.7fp2_linuxx64_server.tar.gz
[root@localhost upload]# rpm -ivh libaio-0.3.106-3.2.x86_64.rpm
warning: libaio-0.3.106-3.2.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID a
83bd72e
Preparing...
########################################### [100%]
1:libaio
########################################### [100%]
[root@localhost upload]# cd server
[root@localhost server]# ./db2_install
Default directory for installation of products - /opt/ibm/db2/V9.7
***********************************************************
Do you want to choose a different directory to install [yes/no] ?
no
Specify one of the following keywords to install DB2 products.
ESE
CONSV
WSE
EXP
PE
CLIENT
RTCL
Enter "help" to redisplay product names.

Enter "quit" to exit.


***********************************************************
ESE
DB2 installation is being initialized.
***********
Total number of tasks to be performed: 47
Total estimated time for all tasks to be performed: 2078

Task #46 start


Description: Registering DB2 Update Service
Estimated time 30 second(s)
Task #46 end
Task #47 start
Description: Updating global profile registry
Estimated time 3 second(s)
Task #47 end
A minor error occurred while installing "DB2 Enterprise Server Edition " on
this computer. Some features may not function correctly.//
************
//
[root@localhost server]# cd
[root@localhost ~]# groupadd -g 999db2iadm1
bash: groupadd: command not found
[root@localhost ~]# useradd -u 1001 -g db2iadm1 -m -d /home/db2inst1 db2inst1
bash: useradd: command not found
//
[root@localhost ~]# echo $PATH
/
usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin:/usr/games:/home/chenweid
an/bin
[root@localhost ~]# whereis groupadd
groupadd: /usr/sbin/groupadd /usr/share/man/man8/groupadd.8.gz
[root@localhost ~]# ln -s /usr/sbin/groupadd /usr/kerberos/bin
[root@localhost ~]# ln -s /usr/sbin/useradd /usr/kerberos/bin
[root@localhost ~]# cd /usr/kerberos/bin
[root@localhost bin]# ls
ftp
gss-client kinit kpasswd krlogin ksu rcp rsh
telnet v4rcp
groupadd kdestroy klist krb524init krsh kvno rlogin sim_client uuclient
[root@localhost bin]# ll
total 748

-rwxr-xr-x 1 root root 109472 Apr 15 2009 ftp


lrwxrwxrwx 1 root root 18 Oct 20 05:35 groupadd -> /usr/sbin/groupadd
-rwxr-xr-x 1 root root 19568 Apr 15 2009 gss-client
-rwxr-xr-x 1 root root 8744 Apr 15 2009 kdestroy
-rwxr-xr-x 1 root root 23904 Apr 15 2009 kinit
-rwxr-xr-x 1 root root 20424 Apr 15 2009 klist
-rwxr-xr-x 1 root root 9008 Apr 15 2009 kpasswd
-rwxr-xr-x 1 root root 8544 Apr 15 2009 krb524init
-rwxr-xr-x 1 root root 43 Apr 15 2009 krlogin
-rwxr-xr-x 1 root root 40 Apr 15 2009 krsh
-rwsr-xr-x 1 root root 48736 Apr 15 2009 ksu
-rwxr-xr-x 1 root root 11880 Apr 15 2009 kvno
-rwxr-xr-x 1 root root 45016 Apr 15 2009 rcp
-rwxr-xr-x 1 root root 40648 Apr 15 2009 rlogin
-rwxr-xr-x 1 root root 32816 Apr 15 2009 rsh
-rwxr-xr-x 1 root root 11216 Apr 15 2009 sim_client
-rwxr-xr-x 1 root root 226408 Apr 15 2009 telnet
-rwxr-xr-x 1 root root 11240 Apr 15 2009 uuclient
-rwxr-xr-x 1 root root 20896 Apr 15 2009 v4rcp
[root@localhost bin]# cd
[root@localhost ~]# groupadd -g 999 db2iadm1
[root@localhost ~]# groupadd -g 998 db2fadm1
[root@localhost ~]# groupadd -g 997 dasadm1
[root@localhost ~]# useradd -u 1001 -g db2iadm1 -m -d /home/db2inst1 db2inst1
[root@localhost ~]# useradd -u 1002 -g db2fadm1 -m -d /home/db2fenc1 db2fenc1
[root@localhost ~]# useradd -u 1003 -g dasadm1 -m -d /home/dasusr1 dasusr1
//
[root@localhost ~]# cd /opt/ibm/db2/V9.7/instance
[root@localhost instance]# dascrt -u dasusr1
bash: dascrt: command not found
//
[root@localhost instance]# ./dascrt -u dasusr1
SQL4409W The DB2 Administration Server is already active.
DBI1070I Program dascrt completed successfully.
[root@localhost instance]# ./db2icrt -a SERVER -u db2fenc1 db2inst1
DBI1766W Cannot change the secondary group list of db2inst1.
Explanation:
A code, 127, is returned when attempting to change the secondary

group list of the given user ID. One of the following situations has
occurred:
* NIS is running.
* One or more processes are currently being executed under the given
user ID.
User response:
You must add the group ID, dasadm1, to the secondary group list of
the user ID, db2inst1, so that the Adminstration Server can function
properly.
* If there happens to be any process run under the given user ID,
terminate all of these processes and follow the instructions above to
setup the secondary group list of this user ID.
* If you are running this command on an NIS client, try the above
instructions to setup the secondary group list of this user ID on
your NIS server.
DBI1070I Program db2icrt completed successfully.
[root@localhost ~]# su -l db2inst1
[db2inst1@localhost ~]$ db2start
10/20/2013 08:19:37 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.
[db2inst1@localhost ~]$ db2set DB2_SKIPDELETED=ON
[db2inst1@localhost ~]$ db2set DB2_HASH_JOIN=YES
[db2inst1@localhost ~]$ db2set DB2_RR_TO_RS=YES
[db2inst1@localhost ~]$ db2set DB2CODEPAGE=1386
[db2inst1@localhost ~]$ DB2COMM=TCPIP
[db2inst1@localhost ~]$ db2set DB2CODEPAGE=1386DB2COMM=TCPIP
[db2inst1@localhost ~]$ db2set DB2COMM=TCPIP
[db2inst1@localhost ~]$ db2set DB2_PARALLEL_IO=*
[db2inst1@localhost ~]$ db2set update dbm cfg using svcename 50000
DBI1302E Invalid parameter detected.
[db2inst1@localhost ~]$ db2 update dbm cfg using svcename 50000
DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed
successfully.
[db2inst1@localhost ~]$ db2start
10/20/2013 08:30:29 0 0 SQL1026N The database manager is already active.
SQL1026N The database manager is already active.
[db2inst1@localhost ~]$ db2sampl

Creating database "SAMPLE"...


Connecting to database "SAMPLE"...
Creating tables and data in schema "DB2INST1"...
Creating tables with XML columns and XML data in schema "DB2INST1"...
'db2sampl' processing complete.
[db2inst1@localhost ~]$ db2 connect to sample
Database Connection Information
Database server
= DB2/LINUXX8664 9.7.2
SQL authorization ID = DB2INST1
Local database alias = SAMPLE
[db2inst1@localhost ~]$ db2 "select *from staff where dept=20"
ID NAME
DEPT JOB YEARS SALARY COMM
------ --------- ------ ----- ------ --------- --------10 Sanders
20 Mgr
7 98357.50
20 Pernal
20 Sales 8 78171.25 612.45
80 James
20 Clerk
- 43504.60 128.20
190 Sneider
20 Clerk
8 34252.75 126.50
4 record(s) selected.
[root@localhost db2inst1]# passwd db2inst1
Changing password for user db2inst1.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.