|
||||||||
|
|
8. Using DB2This section gives you the basic information you need to start working with DB2 on Linux. It includes instructions on issuing DB2 commands and SQL statements from the command line, as well as the commands you need to start the DB2 Control Center and the DB2 Information Center.
8.1. DB2 Control CenterThe left side of the DB2 Control Center provides an object-oriented view of the database objects that you have catalogued, including DB2 instances and databases on other DB2 servers. One way to add, edit, or drop database objects is to right-click on an object to bring up a menu. To start the DB2 Control Center
8.2. DB2 Information CenterThe DB2 Information Center provides tree views of the information about DB2 that is installed on your system, as well as a number of links to web sites with further information. If you did not install the DB2 documentation, the tree views contain fewer links. To start the DB2 Information Center
8.3. The DB2 command lineIf you are logged on to your Linux workstation using either the DB2 Administration Server user ID or the DB2 instance user ID, you can issue DB2 commands and SQL statements from the command line. If this is your first time using DB2, I would suggest creating the sample database that ships with DB2. The sample database is used throughout the DB2 documentation and is required by most of the sample applications. To create the sample database, you can either select the Create the sample database option when you create a DB2 instance, or issue the db2sampl command from the DB2 command line. Before you can issue an SQL statement, you have to connect to a database. To connect to a database:
To connect to a database, and have DB2 prompt you for the password:
To connect to a database using the default user ID:
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 columns from the EMPLOYEE table in the SAMPLE database, issue the following command:
| |||||||
|
|
|
Home :: Copyright :: Privacy :: Credits :: Get a free Linuxinfor Email Account Document on this page is part of "DB2 Version 7.1 for Linux HOWTO". See Index Page for more info about Authorship and Copyright. 1999-2008 Linuxinfor.com. No rights reserved. |