On AIX and HP-UX, databases must be cataloged as remote, regardless of
whether they are local or remote. To catalog a local database as
remote:
- Gather the following information:
- db2node
- The local alias you choose for the server node.
- hostname
- The TCP/IP name of the server node. You can find this name by
running the HOSTNAME command on the server.
- service_name
- The TCP/IP service name for the server instance. You can find this
name by running the following DB2 command:
get database manager configuration
The service_name is in the SVCENAME field, and is case sensitive.
- database_name
- The name of the database that you want to access.
- database_alias
- The local alias that you choose for the database.
- Make sure that the DB2COMM variable is set for TCP/IP on the server, and
make sure your /etc/services file contains entries that identify the
connection and interrupt ports for the DB2 instance. For example, if
your instance is db2inst1, your entries would look like this:
db2cdb2inst1 50000/tcp # Connection port for DB2 instance db2inst1
db2idb2inst1 50001/tcp # Interrupt port for DB2 instance db2inst1
- Catalog the node as remote using the following DB2 command, specifying the
information that you gathered in the first step:
catalog tcpip node db2node remote hostname server service_name
For example:
catalog tcpip node olapsrc remote tak3 server db2cdb2inst1
- Catalog the server database from the client using the following DB2
command, specifying the information that you gathered in the first step:
catalog database database_name as database_alias at node db2node
For example:
catalog database SAMPLE as RSAMPLE at node olapsrc
- Flush the catalog buffers using the DB2 TERMINATE command.
- Use the DB2 command line processor to make sure that you can connect to
the database alias.
For example, test the connection by issuing the following commands:
connect to remote_db_name
create table t1 (product1 char(3))
insert into t1 values ('100')
select * from t1
drop table t1
connect reset
If any failure occurs, check your DB2 setup before starting DB2 OLAP
Server.