Results 1 to 12 of 12
  1. #1
    Join Date
    Oct 2012
    Posts
    10

    Unanswered: NickNames Creation issue

    Hi,

    i have been trying to create using script but not able to create since last 1 day.
    Below is the script i have run using that i create Server and user mapping but still not able to create Nickname,

    Could you please help me to get out of this.

    CREATE SERVER SEC_SERVER TYPE DB2/UDB VERSION 9.7 WRAPPER drda AUTHORIZATION "test" PASSWORD "test123" OPTIONS(NODE 'DB2', DBNAME 'SAMPLE');

    CREATE USER MAPPING FOR test SERVER SEC_SERVER OPTIONS(REMOTE_AUTHID 'test', REMOTE_PASSWORD 'test123');

    CREATE NICKNAME test.TESTING FOR SEC_SERVER.test.TESTING;

    Please suggest what actually I am doing wrong with the above script.

  2. #2
    Join Date
    Mar 2003
    Posts
    280
    Quote Originally Posted by Sacingle View Post
    Hi,

    i have been trying to create using script but not able to create since last 1 day.
    Below is the script i have run using that i create Server and user mapping but still not able to create Nickname,

    Could you please help me to get out of this.

    CREATE SERVER SEC_SERVER TYPE DB2/UDB VERSION 9.7 WRAPPER drda AUTHORIZATION "test" PASSWORD "test123" OPTIONS(NODE 'DB2', DBNAME 'SAMPLE');

    CREATE USER MAPPING FOR test SERVER SEC_SERVER OPTIONS(REMOTE_AUTHID 'test', REMOTE_PASSWORD 'test123');

    CREATE NICKNAME test.TESTING FOR SEC_SERVER.test.TESTING;

    Please suggest what actually I am doing wrong with the above script.
    What was the error?
    --
    Lennart

  3. #3
    Join Date
    Oct 2012
    Posts
    10
    SQL1101N Remote database "sample" on node "DB" could not be accessed with
    the specified authorization id and password. SQLSTATE=08004

  4. #4
    Join Date
    Mar 2003
    Posts
    280
    Quote Originally Posted by Sacingle View Post
    SQL1101N Remote database "sample" on node "DB" could not be accessed with
    the specified authorization id and password. SQLSTATE=08004
    can you connect to the database using the supplied credentials?

    Code:
    db2 connect to sample user test using test123
    --
    Lennart

  5. #5
    Join Date
    Oct 2012
    Posts
    10
    Yes, I am....

  6. #6
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    so do :
    db2 list db directory
    db2 connect to sample ..... (with complete output)
    db2 "select count(*) from test.TESTING "
    ..
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  7. #7
    Join Date
    Mar 2003
    Posts
    280
    Quote Originally Posted by Sacingle View Post
    Yes, I am....
    What is the result of:

    Code:
    #> db2 get dbm cfg | grep FEDERATED
    
    #> db2licm -l
    --
    Lennart

  8. #8
    Join Date
    Oct 2012
    Posts
    10
    Please find required o/p

    Federated Database System Support (FEDERATED) = YES

    Product name: "DB2 Workgroup Server Edition"
    License type: "CPU Option"
    Expiry date: "Permanent"
    Product identifier: "db2wse"
    Version information: "9.7"
    Max number of Value Units: "480"
    Max amount of memory (GB): "64"


    @przytula_guy :- I am able to connect to DB and able to select the records from that table

  9. #9
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    to be able to debug your problem - why don't you publish the requested data
    it is possible you miss something ... we can not see the setup..
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  10. #10
    Join Date
    Oct 2012
    Posts
    10
    Please find the requested data.


    System Database Directory

    Number of entries in the directory = 2

    Database 1 entry:

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


    Database 2 entry:

    Database alias = SECDB
    Database name = SECDB
    Local database directory = E:
    Database release level = d.00
    Comment =
    Directory entry type = Indirect
    Catalog database partition number = 0
    Alternate server hostname =
    Alternate server port number =


    C:\Users\Administrator>db2 connect to sample user test
    Enter current password for test:

    Database Connection Information

    Database server = DB2/NT64 9.7.4
    SQL authorization ID = test
    Local database alias = sample

    C:\Users\Administrator>db2 select count(*) from test.testing

    1
    -----------
    0

    1 record(s) selected.


    I hope provided you desired data

  11. #11
    Join Date
    Mar 2003
    Posts
    280
    Quote Originally Posted by Sacingle View Post
    Please find required o/p

    Federated Database System Support (FEDERATED) = YES

    Product name: "DB2 Workgroup Server Edition"
    License type: "CPU Option"
    Expiry date: "Permanent"
    Product identifier: "db2wse"
    Version information: "9.7"
    Max number of Value Units: "480"
    Max amount of memory (GB): "64"


    @przytula_guy :- I am able to connect to DB and able to select the records from that table
    Ok, that seems ok. I have no clue why it is not working. Here's what I usually do when I create nicknames, perhaps that can give you some ideas:

    Code:
    CONNECT TO @@DATABASE@@ @@AUTHDATA@@;
    
    -- Set up common stuff (wrapper, server, and user mapping)
    CREATE WRAPPER DRDA
            OPTIONS( DB2_FENCED 'N');
    
    CREATE SERVER @@FEDERATED@@ TYPE DB2/UDB VERSION 9
            WRAPPER DRDA AUTHORIZATION "@@USERNAME@@" PASSWORD "@@PASSWD@@"
            OPTIONS( DBNAME '@@FEDERATED@@', PASSWORD 'Y');
    
    CREATE USER MAPPING FOR "@@INSTANCE_OWNER@@" SERVER "@@FEDERATED@@"
            OPTIONS ( REMOTE_AUTHID '@@USERNAME@@', REMOTE_PASSWORD '@@PASSWD@@');
    
    CREATE NICKNAME X.Y
            FOR @@FEDERATED@@.A.B;
    @@x@@ are variables that I replace via sed, aka:

    Code:
     sed -e "s/@@DATABASE@@/<where to set up nicknames>/g" \
    --        -e "s/@@FEDERATED@@/<db which nicknames refers to>/g" \
    --        -e "s/@@USERNAME@@/<username for federated db>/g" \
    --        -e "s/@@PASSWD@@/<password for federated db>/g" \
    --      < x.dd_ > x.ddl
    --
    Lennart

  12. #12
    Join Date
    Oct 2012
    Posts
    10
    Thanks for you help,

    Finally i am able to create Nicknames,

    the only thing i did is that I run whole script at one go.

    Thanks again

Posting Permissions

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