Configuring
a
database
connection
Configuring
a
database
connection
manually
using
the
Configuration
Assistant
Ifyouhavetheinformationforthedatabaseyouwantto connecttoand theserver uponwhichitresides,youcanmanuallyenterall oftheconfigurationinformation. Thismethodisanalogoustoenteringcommandsusingthecommandline
processor,however,theparametersare presentedgraphically. Prerequisites:
Before youconfigurea connectiontoadatabase manuallyusingtheConfiguration Assistant(CA):
v EnsurethatyouhaveavalidDB2user IDforthedatabaseyouwanttoconnect to.
v Ifyouareconfiguringaconnection fromasystemthathasaDB2serverorDB2 Connectserverproductinstalled,ensurethatyouhaveauser IDwith SYSADM orSYSCTRLauthorityfor thedatabasemanager instance.
Procedure:
Toconfigurea connectiontoa databasemanuallyusingtheCA: 1. Logontothesystemwitha validDB2userID.
2. StarttheCA.TheCAcanbe startedfromtheStartmenuonWindows or usingthedb2cacommand.
3. On theCAmenubar,underSelected,choose AddDatabaseUsingWizard. 4. Select theManuallyconfigurea connectiontoadatabaseradiobuttonand
click Next.
5. IfyouareusingLightweightDirectoryAccessProtocol(LDAP),selectthe radiobuttonthatcorresponds tothelocationwhereyouwantDB2 directories tobe maintained.ClickNext.
6. Select theradiobuttonthatcorrespondstotheprotocolthatyouwanttouse fromtheProtocollist.(Note: WhileAPPC,APPN,orNetBIOSmight still appearasoptions, theyarenolongersupported.)
IfDB2 Connectisinstalledonyoursystem andyouselectTCP/IP,youhave theoptiontoselectThedatabasephysicallyresideson ahostorOS/400® system.Ifyouselectthischeckbox,youhavetheoption ofselectingthetype of connectionthatyouwanttomaketothehostorOS/400database:
v Tomakeaconnectionthrough aDB2Connectgateway, selecttheConnect totheserverviathegatewayradiobutton.
v Tomakeadirectconnection,selecttheConnectdirectlytotheserverradio button.
Click Next.
8. Type thedatabasealiasnameoftheremotedatabase thatyouwanttoaddin theDatabasename fieldanda localdatabasealiasnameintheDatabasealias field.
Ifyouareaddinga hostorOS/400database,typethelocationnameforan OS/390 orz/OSdatabase,theRDBnameforanOS/400database,orthe DBNAME foraVSEorVMdatabaseintheDatabasenamefield.Optionally, youcanaddacommentthatdescribesthis databaseintheComment. Click Next.
9. IfyouareplanningtouseODBC,registerthisdatabase asan ODBCdata source.EnsurethatODBCisinstalledbeforeperformingthisoperation.Click Next.
10. IntheSpecifythenodeoptionswindow,selecttheoperatingsystem,and type theremoteinstancenameforthedatabase systemyouwanttoconnect to.
11. IntheSpecifythesystemoptionswindow,ensurethatsystemname,host name, andoperatingsystemare correct.Theinformationonthispanelisused toconfiguretheadministrationnode.Youcanoptionallyenteracomment. Click Next.
12. IntheSpecifythesecurityoptionswindow,specifythesecurityoption that willbeusedforauthentication.
13. Click Finish.Youcannowusethisdatabase.SelecttheExitmenuactionto closetheCA.
Related concepts:
v “Client-to-servercommunicationsconfigurationoverview”onpage39 Related tasks:
v “Testingadatabaseconnection usingtheConfigurationAssistant” onpage49
Configuring
a
database
connection
by
searching
the
network
using
the
Configuration
Assistant
YoucanusetheConfigurationAssistant(CA) tosearchanetworkfordatabases. Prerequisites:
Before youconfigurea databaseconnectionbysearchingthenetwork: v EnsurethatyouhaveavalidDB2user ID.
v Ifyouareconfiguringaconnection fromasystemthathasaDB2Server orDB2 Connectserverproductinstalled,ensure thatyouhaveauser IDwith SYSADM orSYSCTRLauthorityfor theinstance.
Restrictions:
The searchmethod featuremaybe unabletodetecta remotesystemif: v TheDB2AdministrationServer (DAS)isnotrunningontheremotesystem. v Thesearchtimesout.By default,thesearchwillscanthenetworkfor1 second;
thismaynotbelongenoughtodetecttheremote system.Youcansetthe DB2DISCOVERYTIMEregistryvariabletospecifyalongerperiodoftime. v Thenetworkthatthesearchisrunningonisconfiguredsothatthesearchdoes
Thefollowingpoints applytocaseswhereyouwanttoexplicitlyconfigureanIPv6 address onanetworkthatsupportsIPv6:
v Thesystemmustbe listedunderKnownSystems.
v OnlytheConfigurationAssistantAdvancedViewsupportsexplicitlyconfigure anIPv6connection.
Procedure:
Toconfigurea databaseconnectionbysearchingthenetwork: 1. Logontothesystem witha validDB2user ID.
2. StarttheCA.TheCAcanbe startedfromtheStartmenuonWindowsorusing thedb2cacommandonbothWindows andUNIXsystems.
3. On theCAmenubar,underSelected,chooseAddDatabaseUsingWizard. TheAddDatabaseWizardopens.
4. SelecttheSearchthenetwork radiobuttonandclickNext.
5. Double-clickonthefolderbeside KnownSystemstolistallthesystemsknown toyour clientordouble-clickonthefolderbeside OtherSystemstolistallthe systemsonthenetwork.
Ifnosystemsarelisted,youcanclickAddSystemtospecifyone.Onceyou addasystem,it willappearintheKnownSystemslist.
6. Expandtheentriesforthesystem youareinterested inuntilyouseethe databaseyouwanttoadd.Selectthedatabase.ClickNext.
7. Typea localdatabasealiasnameintheDatabase aliasfieldand optionallytype a commentthatdescribesthisdatabaseintheCommentfield.
8. IfyouareplanningtouseODBC,registerthisdatabaseasanODBCdata source.ODBCmustbe installedtoperformthisoperation.
9. ClickFinish.Youcannowusethedatabase youadded.ClickClosetoexitthe CA.
Related concepts:
v “Client-to-servercommunicationsconfigurationoverview”onpage39 Related tasks:
v “ConfiguringadatabaseconnectionmanuallyusingtheConfigurationAssistant” onpage45
v “Testingadatabaseconnection usingtheConfigurationAssistant” onpage49
Creating
and
using
a
client
profile
to
configure
database
connections
Creating
a
client
profile
using
the
Configuration
Assistant
Thistaskinvolvesexportingsettingsfromanexistingclientintoa clientprofile usingtheConfigurationAssistant(CA).Thistaskispartof alargertaskofsetting uponeor moreclientsusingthesettingsfromanexistingclient.
Procedure:
Tocreatea clientprofileusingtheCA:
1. Logontothesystem witha validDB2user ID.
2. StarttheCA.TheCAcanbe startedfromtheStartmenuonWindowsorusing thedb2cacommand.
3. From theConfiguremenu,selectExportProfile. 4. Selectoneofthefollowingoptions:
All Ifyouwanttocreatea profilethatcontainsall ofthedatabases catalogedonyoursystem,andallof theconfigurationinformationfor thisclient.Typea namefor yourclientprofileandclickSave.
DatabaseConnections
Ifyouwanttocreatea profilethatcontainsall ofthedatabases catalogedonyoursystemwithout anyoftheconfigurationinformation forthisclient.Type anameforyourclientprofileandclickSave. Customize
Ifyouwanttoselectasubsetofthedatabasesthatarecatalogedon yoursystem,or asubsetoftheconfigurationinformationforthisclient. IntheCustomizeExportProfilewindow:
a. Typea nameforyour clientprofile.
b. SelecttheDatabaseconnectionscheckboxtoincludedatabase connectionsintheclientprofile.
c. FromtheAvailabledatabasealiasesbox,selectthedatabasestobe exportedandclick >toaddthemto theSelected databasealiases box.ToaddalloftheavailabledatabasestotheSelected database aliasesbox,click >>.
d. Selectthecheckboxesthatcorrespondtotheoptionsthatyouwant tosetupforthetargetclient.Databasemanagerconfiguration parameterscanbe updatedand customizedfora targetmachine. e. ClickExporttocompletethistask.
f. Checkyourresultsdisplayedin theResultstab.
Once youhavecompletedthistask,youcanconfigureotherclientsusingtheclient profileyouhavecreated.
Related concepts:
v “Client-to-servercommunicationsconfigurationoverview”onpage39 Related tasks:
v “Configuringdatabaseconnectionsusinga clientprofilewith theConfiguration Assistant”onpage48
Configuring
database
connections
using
a
client
profile
with
the
Configuration
Assistant
Thistaskinvolvesconfiguringaclientbyusinga clientprofilethatyouhave created orobtainedpreviously.Thistaskispartofa largertaskofsettingupone or moreclientsusingthesettingsfromanexistingclient.Thesestepscanbe repeatedforeachclientyouwanttoconfigure.
Procedure:
1. Logontothesystem witha validDB2 userID.
2. StarttheCA.TheCAcanbe startedfromtheStartmenuonWindowsorusing thedb2cacommand.
3. From theConfiguremenu,selectImport Profile.
4. Selectoneofthefollowingimportoptions.Youcanchoosetoimportallora subsetoftheinformationina clientprofile.
All Selectthisoption toimporteverythingina clientprofile.Openthe clientprofileyouwanttoimport.
Customize
Selectthisoption toimporta subsetoftheclientprofile,suchasa specificdatabase.From theCustomizeImportProfilewindow: a. SelecttheclientprofileyouwanttoimportandclickLoad. b. Selectthedatabasestobe importedfromtheAvailable database
aliasesbox andclick>toaddthemtotheSelecteddatabasealiases box.Click>>toaddalloftheavailabledatabasestotheSelected databasealiasesbox.
c. Selectthecheckboxesthatcorrespondtotheoptionsthatyouwant tocustomize.
d. ClickImporttocompletethistask.
e. Checkyour resultsdisplayed intheResultstab. Related concepts:
v “Client-to-servercommunicationsconfigurationoverview”onpage39 Related tasks:
v “Creatinga clientprofileusingtheConfigurationAssistant” onpage47
Testing
a
database
connection
using
the
Configuration
Assistant
Yourdatabaseconnection shouldbe testedafter youconfigureit. Procedure:
Totest adatabaseconnection:
1. StarttheConfigurationAssistant.
2. Highlight thedatabase inthedetailsview andselectTest Connectionfromthe Selectedmenu.TheTest Connectionwindowopens.
3. Selectoneormoretypesofconnectionthatyouwouldliketotest (CLIisthe default).Youcantestmore thanonetype atthesametime.Entera validuser IDandpasswordfortheremote databaseandclick TestConnection.Ifthe connectionissuccessful,amessageconfirmingtheconnectionappears onthe Resultspage.
Iftheconnectiontestfailed,youwillreceivea helpmessage.Tochangeany settingsyoumayhaveincorrectlyspecified,selectthedatabase inthedetails view andselectChange DatabasefromtheSelectedmenuitem.
Related concepts:
v “Client-to-servercommunicationsconfigurationoverview”onpage39 Related tasks:
v “Configuringadatabaseconnectionbysearchingthenetworkusingthe ConfigurationAssistant”onpage46
v “ConfiguringadatabaseconnectionmanuallyusingtheConfigurationAssistant” onpage45