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:
. ~cps116/db2profileYou might want to add the above line into your .bashrc to be executed automatically when a shell starts up.
Otherwise, if you are using csh or tcsh, type:
source ~cps116/db2cshrcYou 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 cps116;
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 from cps116;Finally, exit the DB2 command-line processor by typing:
quit;
Send email to Jun (junyang@cs.duke.edu).