0% found this document useful (0 votes)
35 views2 pages

Database Option From The DB2 First Steps Launchpad, or by Issuing

This document provides instructions for connecting to a sample database in DB2 and issuing SQL statements. It explains that you can create the sample database from the DB2 launchpad or with the db2sampl command. To connect to a database, you use the db2 CONNECT command specifying the database name, user ID, and optionally the password. Once connected, SQL statements can be issued against that database to retrieve or modify data.

Uploaded by

reddygj
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views2 pages

Database Option From The DB2 First Steps Launchpad, or by Issuing

This document provides instructions for connecting to a sample database in DB2 and issuing SQL statements. It explains that you can create the sample database from the DB2 launchpad or with the db2sampl command. To connect to a database, you use the db2 CONNECT command specifying the database name, user ID, and optionally the password. Once connected, SQL statements can be issued against that database to retrieve or modify data.

Uploaded by

reddygj
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

To create the sample database, you can either select the Create the SAMPLE database option from

the DB2 First Steps launchpad, or by issuing the db2sampl command from the command line. Before you can issue an SQL statement, you have to connect to a database. To connect to a database, enter the command:
db2 CONNECT TO database USER userID USING password

To connect to a database, and have DB2 prompt you for the password, issue the command:
db2 CONNECT TO database USER userID

To connect to a database using the default user ID, issue the command:
db2 CONNECT TO database

Once you have connected to a database, you can then issue SQL statements or DB2 commands against that database. For example, to select all of the rows from the EMPLOYEE table in the SAMPLE database, issue this command:
db2 "SELECT * FROM employee"

You can avoid typing db2 as the prefix for every SQL statement and DB2 command by issuing DB2 commands using the Command Line Processor (CLP). To start the CLP, issue the db2 command by itself from a Linux command line terminal. DB2 provides the following prompt:
1 ans
:\Documents and Settings\J>nslookup yumie.gidnetwork.com Server: cns3.tm.net.my Address: 202.188.0.133 Non-authoritative answer: Name: yumie.gidnetwork.com Address: 69.30.244.34 4 ans

15. Check the current value of the LOGSECOND db cfg parameter, and then change it to a value of 5 and verify the new value db2 connect to sample db2 get db cfg db2 update db cfg using LOGSECOND 5 db2 get db cfg 9 ans

11. Drop the instance newinst set db2instance=newinst db2stop db2idrop newinst set db2instance=db2 8 ans

You might also like