Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2010
    Location
    USA
    Posts
    10

    Unanswered: 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 ???

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  3. #3
    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

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  5. #5
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    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?

  6. #6
    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 =

  7. #7
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    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 =

  8. #8
    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.

  9. #9
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    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

  10. #10
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •