Our DB2 server is running on rack40.cs.duke.edu. Use your account on rack40 to login:
ssh rack40.cs.duke.edu -l <user>If this is your first-time login, type the password you received in email. Then, use the command passwd to change your password.
If you are using bash (which is the default shell), type:
. /home/dbcourse/profileIf you want the above line to be executed automatically when a shell starts up, add this line to your .bashrc file, and uncomment the following lines (i.e., removing the leading # characters) from your .bash_profile file:
#if [ -f ~/.bashrc ]; then # . ~/.bashrc #fi
Otherwise, if you are using csh or tcsh, type:
source /home/dbcourse/cshrcYou might want to add the above line into your .cshrc to be executed automatically when a shell starts up.
Start the DB2 command-line processor by typing the following in shell:
db2 -tRemember the "-t" option, which allows you to use semicolon (";") to terminate SQL commands.
When you are inside the command-line processor, you will get a prompt that looks like the following:
db2 =>
To connect to our database, type:
connect to dbcourse;
You can now use any SQL commands (CREATE, DROP, SELECT, INSERT, DELETE) to manipulate the database. Another useful DB2 command is list tables;, which prints out a list of all tables you have created.
When you are done, type the following to disconnect from our database:
disconnect dbcourse;Finally, exit the DB2 command-line processor by typing:
quit;
Send email to Jun (junyang@cs.duke.edu).