4 ANÁLISIS DE RESULTADOS
4.1 Resultados del caso base
4.1.1 Criterios de elección 173
Use thefollowingworksheettohelp identifytherequiredparametervaluesfor configuringNamedPipescommunications.
Table8.NamedPipesparametervaluesworksheet
Parameter Description SampleValue YourValue
Computername (computer_name)
Thecomputernameoftheserver machine.
Ontheservermachine,tolocatethe valueforthisparameter,clickon
StartandselectSettings,Control Panel.Double-clickontheNetwork
folderandselecttheIdentification
tab.Recordthecomputername.
server1
Instancename (instance_name)
Thenameoftheinstanceonthe servertowhichyouareconnecting.
db2
Nodename(node_name) Alocalalias,ornickname,that describesthenodetowhichyouare tryingtoconnect.Youcanchoose anynameyouwant;however,all nodenamevalueswithinyourlocal nodedirectorymustbeunique.
db2node
Related tasks:
v “CatalogingaNamed PipesnodefromaclientusingtheCLP”onpage56 v “Configuringclient-to-serverconnectionsusingthecommandlineprocessor”on
page51
Updating
files
on
the
client
Updating
hosts
and
services
files
for
TCP/IP
connections
Thistaskexplains whenandhow toupdatethehostsfileand servicesfileonthe client withcommunicationparameter valuesfortheremote databaseserver.This taskisoptionalforconnectionsusingTCP/IPand doesnotapplytoconnections usingNamed Pipes.Thistaskispart ofthelargertaskof configuring
client-to-server connectionusingtheCLP. Whentoupdate thehostsfileorservices file:
Youneedtoupdatethehostsfileifyouwanttoestablisha connectiontothe remote databaseserverusingitshostnameandyour networkdoesnotcontaina DNS(domainnameserver)thatcanbeusedtoresolvethathostnametoanIP address.Thisstepisnotrequiredif youwanttorefertotheremote database serverusingitsIPaddress.
Youneedtoupdatetheservicesfileifyouwanttospecifyaconnection service namewhenestablishinga connectiontotheremotedatabaseserver.Aconnection
serviceisanarbitrarynamethatrepresentstheconnectionportnumber.Thisstepis
NotetheadditionalconsiderationsforUNIXclients inanenvironmentthatuses Network InformationServices(NIS):
v Ifyouarenotusingadomainnameserveronyournetwork, youmust update thehosts fileandservicesfilelocatedonyour NISmasterserver.
Procedureforupdating thehostsfile:
Use thisprocedureto updatethehostsfileontheclienttoresolvetheremote server's hostnametoitsIPaddress.
1. Usea texteditortoaddanentrytothehostsfilefortheserver’sIPaddress. For example:
9.21.15.235 myserver # IP address for myserver where:
9.21.15.235
representstheip_address myserver
representsthehostname
# representsa commentdescribingtheentry
IftheserverisnotinthesamedomainastheDB2client,youmust providea fullyqualifieddomainnamesuchasmyserver.spifnet.ibm.com,where spifnet.ibm.comrepresentsthedomainname.
Procedureforupdating theservicesfile:
Use thisprocedureto updatetheservicesfileontheclienttoresolve aservice nametotheremoteserver'sportnumber.
1. Using atexteditor,addtheConnectionServicenameandportnumbertothe servicesfile.
For example:
server1 50000/tcp # DB2 connection service port where:
server1 representstheConnectionServicename
50000 representstheconnectionportnumber(50000 isthedefault)
tcp representsthecommunicationprotocolthatyouareusing # representsthebeginningofacommentthatdescribes theentry Locationof thelocal hostsfile andservicesfile
The followingtable liststhelocationofthehosts fileand servicesfilereferredto in theprecedingprocedures.
Table9.Locationofthehostsfileandservicesfile
OperatingSystem Directory
Windows2000/Windows XP/WindowsServer2003
%SystemRoot%\system32\drivers\etcwhere%SystemRoot%isa systemdefinedenvironmentvariable
UNIX /etc
v “CatalogingaTCP/IPnodefroma clientusingtheCLP”onpage55
v “Configuringclient-to-serverconnectionsusingthecommandlineprocessor”on page51
Cataloging
a
server
node
from
a
client
Cataloging
a
TCP/IP
node
from
a
client
using
the
CLP
Cataloginga TCP/IPnodeadds anentrytotheDB2 client’snodedirectory that describes theremotenode.Thisentryspecifies thechosenalias(node_name),the
hostname (orip_address),and thesvcename(orport_number)thattheclientusesto
accesstheremotehost. Prerequisites:
v Youmust haveSystemAdministrative(SYSADM)orSystemController (SYSCTRL)authority,orhavethecatalog_noauthoption settoON.Youcannot cataloganode usingrootauthority.
Procedure:
Tocatalog aTCP/IPnode:
1. Logontothesystem asa userwith SystemAdministrative(SYSADM)or SystemController(SYSCTRL)authority.
2. IfyouareusingaUNIXclient,setuptheinstanceenvironment.Runthe start-upscript:
For bash,BourneorKornshell . INSTHOME/sqllib/db2profile For Cshell
source INSTHOME/sqllib/db2cshrc
whereINSTHOMErepresentsthehomedirectoryoftheinstance. 3. StarttheDB2commandlineprocessor.On Windows,issuethedb2cmd
commandfromacommandprompt.On UNIX,issuethedb2commandfroma commandprompt.
4. Catalogthenodebyenteringthefollowingcommandsinthecommandline processor:
db2 => catalog tcpip node node_name remote hostname|ip_address
server service_name|port_number [remote_instance instance_name] [system system_name] [ostype
os_type]
db2 => terminate where:
v node_name representsalocalnicknameyoucansetfor thecomputerthathas thedatabaseyouwanttocatalog.
v remote_instance representsthenameoftheserverinstanceonwhichthe database resides.
v systemrepresentstheDB2systemnamethatisusedtoidentifytheserver. v ostyperepresentstheoperatingsystemtype oftheserver.
Notes:
b. Althoughremote_instance,system,and ostypeare optional,theyare requiredforuserswho wanttousetheDB2 tools.
c. Theservice_nameusedontheclientdoesnothavetobethesameastheone
ontheserver.However, theportnumbersthattheymaptomustmatch d. Whilenotshown here,thecatalogtcpipnodecommandprovides the
optiontoexplicitlyspecifytheversionofIP,namelyIPv4orIPv6. Example:
Tocataloga nodethatyouwanttocalldb2nodeonaremote server
myserver.ibm.comthatisusingportnumber50000,youwouldenterthe
followingfroma db2prompt:
db2 => catalog tcpip node db2node remote myserver server 50000 DB20000I The CATALOG TCPIP NODE command completed successfully.
DB21056W Directory changes may not be effective until the directory cache is refreshed.
db2 => terminate
DB20000I The TERMINATE command completed successfully. Related tasks:
v “Catalogingadatabase fromaclientusingtheCLP”onpage57
v “Configuringclient-to-serverconnectionsusingthecommandlineprocessor”on page51
Related reference:
v “CATALOGTCPIP/TCPIP4/TCPIP6NODEcommand”inCommandReference v “TCP/IPworksheetforconfiguringaclienttoserverconnection”onpage52
Cataloging
a
Named
Pipes
node
from
a
client
using
the
CLP
Cataloginga NamedPipesnodeaddsanentrytotheclient’snodedirectoryto describetheremotenode.Thisentryspecifiesthechosenalias(node_name),the remote server’sworkstationname(computer_name),andtheinstance(instance_name) thattheclientwillusetoaccesstheremoteDB2server.
Procedure:
Tocatalog aNamed PipesnodeonaDB2client,typethefollowingcommandin thecommandlineprocessor (CLP):
db2 => catalog npipe node node_name
db2 => remote computer_name instance instance_name
db2 => terminate Example:
Tocatalog aremotenode calleddb2nodethatislocatedona servercalledserver1in thedb2instance,use:
db2 => db2 catalog npipe node db2node remote server1 instance db2
db2 => terminate Related tasks:
v “Configuringclient-to-serverconnectionsusingthecommandlineprocessor”on page51
Related reference:
v “CATALOGNAMEDPIPENODEcommand”inCommand Reference
v “NamedPipesworksheet forconfiguringNamed Pipesontheclient”onpage53
Cataloging
a
database
from
a
client
Cataloging
a
database
from
a
client
using
the
CLP
Thistaskdescribeshow tocataloga databasefromaclientusingthecommand lineprocessor(CLP).
Before aclientapplication canaccessa remotedatabase,thedatabasemustbe catalogedontheclient.Whenyoucreateadatabase,thedatabaseisautomatically catalogedontheserverwithadatabase aliasthatisthesameasthedatabase name, unlessadifferentdatabasealiaswasspecified.
Theinformationinthedatabasedirectory, alongwiththeinformationinthenode directory (unlessyouarecataloginga localdatabasewhereanode isnotneeded), isusedontheDB2 clienttoestablishaconnectiontotheremotedatabase.
Prerequisites:
v Yourequire avalidDB2user ID.DB2doesnotsupportusingrootauthorityto catalogadatabase.
v Youmust haveSystemAdministrative(SYSADM)orSystemController (SYSCTRL)authority,orhavethecatalog_noauthoption settoON
v Youwillneedthefollowinginformationwhencataloginga remotedatabase: – Databasename
– Databasealias – Nodename
– Authenticationtype(optional) – Comment(optional)
Refertotheparametervaluesworksheetforcatalogingadatabaseformore informationaboutthese parametersandto recordthevaluesthatyouuse. v Thefollowingparametervaluesareapplicablewhencatalogingalocaldatabase:
– Databasename – Drive
– Databasealias
– Authenticationtype(optional) – Comment(optional)
Localdatabasescanbeuncataloged andrecatalogedat anytime. Procedure:
Tocatalog adatabaseontheclient:
2. Optional. UpdatetheYourValue columnintheParameter valuesworksheet for catalogingadatabase.
3. IfyouareusingtheDB2 databaseonaUNIXplatform,setuptheinstance environment.Runthestart-upscript:
For bash,BourneorKornshell . INSTHOME/sqllib/db2profile For Cshell
source INSTHOME/sqllib/db2cshrc
where:INSTHOMErepresentsthehome directoryoftheinstance. 4. StarttheDB2commandlineprocessor.On Windows,issuethedb2cmd
commandfromacommandprompt.On UNIX,issuethedb2commandfroma commandprompt.
5. Catalogthedatabasebyenteringthefollowingcommandsinthecommandline processor:
db2 => catalog database database_name as database_alias at node node_name [ authentication auth_value ]
where:
v database_name representsthenameofthedatabaseyouwanttocatalog. v database_aliasrepresentsa localnicknameforthedatabaseyouwantto
catalog.
v node_name representsanicknameyoucansetfor thecomputerthathasthe database youwanttocatalog.
v auth_valuespecifies thetype ofauthenticationthatwilltakeplacewhen connecting tothedatabase.Thisparameterdefaults totheauthentication type specifiedontheserver.Specifyinganauthenticationtype canresultina performance benefit.Examplesof validvaluesinclude:SERVER,CLIENT, SERVER_ENCRYPT,and KERBEROS.
Example:
Tocatalog aremotedatabase calledsamplesothatithasthelocaldatabase alias
mysample, onthenode db2nodeusingauthenticationserver,enterthefollowing
commands:
db2 => catalog database sample as mysample at node db2node
authentication server
db2 => terminate Related tasks:
v “Configuringclient-to-serverconnectionsusingthecommandlineprocessor”on page51
v “Testingtheclient-to-server connectionusingtheCLP”onpage59 Related reference:
v “Parametervaluesworksheetforcataloginga database”onpage59 v “CATALOGDATABASEcommand”inCommandReference