<docbook><section><title>HowDoIIdentifyTheDB2InstanceName</title><para> </para><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Identify the DB2 Instance Name </bridgehead>
<para> </para><bridgehead class="http://www.w3.org/1999/xhtml:h3">On Windows</bridgehead>
<para>1.
 Login to the DB2 DBMS server.</para><para>2.
 Launch the DB2 Control Center.</para><para>3.
 Available instance names should appear in the DB2 Control Center interface.</para><para> </para><bridgehead class="http://www.w3.org/1999/xhtml:h3">On Unix</bridgehead>
<para> </para><bridgehead class="http://www.w3.org/1999/xhtml:h4">Method 1: /etc/services  </bridgehead>
<para> 1.
 Login to the machine that hosts the DB2 DBMS.</para><para>2.
 vi the /etc/services file.</para><programlisting>vi /etc/services
</programlisting><para> 3.
 Locate the socket service associated with your target database.</para><para>4.
 Determine if the instance name is listed in the comment portion of the socket service entry.</para><bridgehead class="http://www.w3.org/1999/xhtml:h4">Method 2: get instance </bridgehead>
<para>1.
 Login to the machine that hosts the DB2 DBMS.</para><para>2.
 su to your db2 instance owner.
 For example:</para><programlisting>su db2instance1
</programlisting><para>3.
 Execute the .profile associated with the db2 instance owner.
 For example:</para><programlisting>. ./.profile
</programlisting><para>4.
 cd into the $DB2INSTANCE/sqllib/bin directory.</para><programlisting>cd $DB2INSTANCE/sqllib/bin
</programlisting><para>5.
 Execute the db2 command.</para><programlisting>./db2
</programlisting><para>6.
 Use the get instance option to get the current instance name.</para><programlisting>get instance
</programlisting></section></docbook>