📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText

20. Using DB2

This section gives you the basic information you need to start working with DB2 Express-C 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. For more information about general DB2 usage, please investigate the DB2 manuals and Information Center. .:: securityheaders.com ::.

20.1. DB2 Control Center

To start the DB2 Control Center:

  1. Ensure you are logged on to your Linux workstation using either the DB2 Administration Server user ID (dasusr1 by default) or the DB2 instance user ID (db2inst1 by default). If you use the su command to change to one of those users, ensure you include the -l parameter to initialize the proper user environment.

  2. Start the X server, if it is not already started.

  3. Start a terminal session, or type Alt + F2 to bring up the Linux "Run Command" dialog.

  4. Type db2cc to start the DB2 Control Center.

The left side of the DB2 Control Center provides an object based view of the database objects that you have catalogued, including DB2 instances and databases on other DB2 servers. .:: www.kzntreasury.gov.za ::.

One way to add, edit, or drop database objects is to right-click on the object to bring up a context menu.

20.2. DB2 Information Center

As mentioned above, the new DB2 Information Center is a revamped documentation display system that now encapsulates the task, concept and reference information required to properly run DB2 . It can be installed locally, on an intranet server, or accessed directly from the ibm.com hosting service.

To start the DB2 Information Center:

  1. Ensure you are logged on to your Linux workstation using either the DB2 Administration Server user ID (dasusr1 by default) or the DB2 instance user ID (db2inst1 by default). If you use the su command to change to one of those users, ensure you include the -l parameter to initialize the proper user environment.

  2. Ensure that the X server is started, as the Information Center requires a Web browser.

  3. Issue one of the launch commands:

    • db2icdocs
    • db2help
    • db2ic
    • db2cc -ic
Alternatively, you can launch the Information Center from within the Control Center (or any of the other GUI tools), by clicking an item under the "Help" menu, or by clicking on the "?" (question mark) icon.

If you did not install the DB2 Information Center, or have not configured your tools to use a different server, then these commands will launch a detected browser, and take you directly to the IBM hosted DB2 Information Center at http://publib.boulder.ibm.com/infocenter/db2help/.

20.3. DB2 command line processor (CLP)

If 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. [Firewall Study]

If this is your first time using DB2 , I would suggest creating the DB2 sample database. The sample database is used throughout the DB2 documentation and is required by most of the sample applications. .:: telegra.ph ::.

To create the sample database, you can either select the [NumPy Repositories] 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: .:: forums.servethehome.com ::.

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:

You can issue database manager commands and SQL statements
from the command prompt. For example:
  db2 => connect to sample
  db2 => bind sample.bnd

For general help, type: ?. 
For command help, type: ? command, where command can be 
the first few keywords of a database manager command. For example: 
? CATALOG DATABASE for help on the CATALOG DATABASE command
? CATALOG          for help on all of the CATALOG commands. 

To exit db2 interactive mode, type QUIT at the command prompt. Outside 
interactive mode, all commands must be prefixed with 'db2'. 
To list the current command option settings, type LIST COMMAND OPTIONS. 

For more detailed help, refer to the Online Reference Manual. 

db2 =>

Some users prefer to avoid the CLP because it prevents using the command line history features of the shell.

Some users claim that running the CLP within an Emacs shell gives them the best of both worlds: they get command line history, and they don't have to escape commands that contain lots of quotation marks and brackets, but your mileage may vary.

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this