If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to catalog the local db in instance

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-29-10, 09:37
yyt030 yyt030 is offline
Registered User
 
Join Date: Apr 2010
Location: USA
Posts: 10
How to catalog the local db in instance

Hi,all

i create a db :testdb ,it's entry type is :Indirect
but i want to change it to :Remote

i do it like this :
db2 catalog local node ndetest
db2 catalog db testdb at node ndetest

then restart the instance

db2 connect to testdb user test using test

but it error


ADM7519W DB2 could not allocate an agent. The SQLCODE is "-1225".
MESSAGE : ADM7009E An error was encountered in the "TCPIP" protocol support.
A possible cause is that the maximum number of agents has been
exceeded.


How I can do ???
Reply With Quote
  #2 (permalink)  
Old 10-29-10, 10:59
Marcus_A Marcus_A is online now
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
If you want it remote, you can catalog a TCPIP node using a host name and port. The commands to "catalog TCPIP node" are documented in the Command Reference. Then catalog a database to the remote node.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 10-29-10, 11:50
yyt030 yyt030 is offline
Registered User
 
Join Date: Apr 2010
Location: USA
Posts: 10
Quote:
Originally Posted by Marcus_A View Post
If you want it remote, you can catalog a TCPIP node using a host name and port. The commands to "catalog TCPIP node" are documented in the Command Reference. Then catalog a database to the remote node.
o ,yes ,i do it
but i can't connect the db
Database 1 entry:

Database alias = TESTDB
Database name = TESTDB
Node name = NDETEST
Database release level = d.00
Comment =
Directory entry type = Remote
Authentication = SERVER
Catalog database partition number = -1
Alternate server hostname =
Alternate server port number =

[db2inst1@myhost ~]$ db 2con^C
[db2inst1@myhost ~]$ db2 connect to testdb
SQL1224N The database manager is not able to accept new requests, has
terminated all requests in progress, or has terminated the specified request
because of an error or a forced interrupt. SQLSTATE=55032

and the db2inst1.nfy file list some error

ADM7009E An error was encountered in the "TCPIP" protocol support. A possible
cause is that the maximum number of agents has been exceeded.

so ,I think the local db can't catalog at local node,but catalog ...as other name
Reply With Quote
  #4 (permalink)  
Old 10-29-10, 13:05
Marcus_A Marcus_A is online now
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Here is a link for how to do it in Version 8, but this will work in newer versions:
DB2 Universal Database

Your db name and alias name are the same, which makes me believe you issued the wrong commands. You don't want to remove the local db directory entry, you just want to add a new one to points to a remote TCPIP node entry you must create, so for the new db defintion, the db name and alias name will be different.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #5 (permalink)  
Old 10-29-10, 18:20
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Quote:
Originally Posted by yyt030 View Post
i create a db :testdb ,it's entry type is :Indirect
but i want to change it to :Remote
Why do you want to change it to remote?
Reply With Quote
  #6 (permalink)  
Old 10-30-10, 01:03
yyt030 yyt030 is offline
Registered User
 
Join Date: Apr 2010
Location: USA
Posts: 10
Wink

Quote:
Originally Posted by Marcus_A View Post
Here is a link for how to do it in Version 8, but this will work in newer versions:
DB2 Universal Database

Your db name and alias name are the same, which makes me believe you issued the wrong commands. You don't want to remove the local db directory entry, you just want to add a new one to points to a remote TCPIP node entry you must create, so for the new db defintion, the db name and alias name will be different.
As you say,I do it and works well
exp.
Database 1 entry:

Database alias = TESTDB
Database name = TESTDB
Local database directory = /home/db2inst1
Database release level = d.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =

Database 2 entry:

Database alias = LOOPDB
Database name = TESTDB
Node name = NDETEST
Database release level = d.00
Comment =
Directory entry type = Remote
Catalog database partition number = -1
Alternate server hostname =
Alternate server port number =


but how to do change the local db TESTDB to remote and Not need to catalog another alias db LOOPDB?
it looks like this:

db2 list db directory

Database 1 entry:
Database alias = TESTDB
Database name = TESTDB
Node name = NDETEST
Database release level = d.00
Comment =
Directory entry type = Remote
Authentication = SERVER
Catalog database partition number = -1
Alternate server hostname =
Alternate server port number =
Reply With Quote
  #7 (permalink)  
Old 10-30-10, 07:15
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Quote:
Originally Posted by yyt030 View Post
but how to do change the local db TESTDB to remote and Not need to catalog another alias db LOOPDB?
it looks like this:

db2 list db directory

Database 1 entry:
Database alias = TESTDB
Database name = TESTDB
Node name = NDETEST
Database release level = d.00
Comment =
Directory entry type = Remote
Authentication = SERVER
Catalog database partition number = -1
Alternate server hostname =
Alternate server port number =

I don't know why you want this to be remote but here is an example:

whatever@panipuri /home/whatever > db2 create db test
DB20000I The CREATE DATABASE command completed successfully.

whatever@panipuri /home/whatever > db2 uncatalog db test
DB20000I The UNCATALOG DATABASE command completed successfully.
DB21056W Directory changes may not be effective until the directory cache is
refreshed.

whatever@panipuri /home/whatever > db2 catalog tcpip node local remote localhost server 21267
DB20000I The CATALOG TCPIP NODE command completed successfully.
DB21056W Directory changes may not be effective until the directory cache is
refreshed.

whatever@panipuri /home/whatever > db2 catalog db test as test at node local
DB20000I The CATALOG DATABASE command completed successfully.
DB21056W Directory changes may not be effective until the directory cache is
refreshed.


whatever@panipuri /home/whatever > db2 list db directory

System Database Directory

Number of entries in the directory = 1

Database 1 entry:

Database alias = TEST
Database name = TEST
Node name = LOCAL
Database release level = c.00
Comment =
Directory entry type = Remote
Catalog database partition number = -1
Alternate server hostname =
Alternate server port number =
Reply With Quote
  #8 (permalink)  
Old 10-30-10, 08:05
yyt030 yyt030 is offline
Registered User
 
Join Date: Apr 2010
Location: USA
Posts: 10
Quote:
Originally Posted by db2girl View Post
I don't know why you want this to be remote but here is an example:

whatever@panipuri /home/whatever > db2 create db test
DB20000I The CREATE DATABASE command completed successfully.

whatever@panipuri /home/whatever > db2 uncatalog db test
DB20000I The UNCATALOG DATABASE command completed successfully.
DB21056W Directory changes may not be effective until the directory cache is
refreshed.

whatever@panipuri /home/whatever > db2 catalog tcpip node local remote localhost server 21267
DB20000I The CATALOG TCPIP NODE command completed successfully.
DB21056W Directory changes may not be effective until the directory cache is
refreshed.

whatever@panipuri /home/whatever > db2 catalog db test as test at node local
DB20000I The CATALOG DATABASE command completed successfully.
DB21056W Directory changes may not be effective until the directory cache is
refreshed.


whatever@panipuri /home/whatever > db2 list db directory

System Database Directory

Number of entries in the directory = 1

Database 1 entry:

Database alias = TEST
Database name = TEST
Node name = LOCAL
Database release level = c.00
Comment =
Directory entry type = Remote
Catalog database partition number = -1
Alternate server hostname =
Alternate server port number =
first,thanks for your reply,I done it ,but can't connect it ,can you confirm your db works well ???

SQL1224N The database manager is not able to accept new requests, has
terminated all requests in progress, or has terminated the specified request
because of an error or a forced interrupt. SQLSTATE=55032

ADM7009E An error was encountered in the "TCPIP" protocol support. A possible
cause is that the maximum number of agents has been exceeded.
Reply With Quote
  #9 (permalink)  
Old 10-30-10, 10:01
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
This was just an example of how to get the same db name and alias with type = remote

If, for some reason, you want to change the type from local to remote and keep the alias name the same , then you can do something similar to:

-- I already have a local db test created

$ db2 catalog db test as ltest
$ db2 uncatalog db test
$ db2 catalog db ltest as test at node local
Reply With Quote
  #10 (permalink)  
Old 10-31-10, 06:58
yyt030 yyt030 is offline
Registered User
 
Join Date: Apr 2010
Location: USA
Posts: 10
Yes,I see it,Thanks vary mach .
remote db can't exist alone and must match the local db
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On