Quote:
|
Originally Posted by Pawan Kumar
I logged in by User A and gave grant permissiong to user B..
su - A
first asking for database connection...
db2 connect to A
then i did
db2 GRANT CONNECT ON DATABASE TO USER B
DB20000I The SQL command completed successfully.
now login by User B
su - B
and try to connect database A but througing below
db2 connect to A user A using **
SQL1013N The database alias name or database name "A" could not be found.
SQLSTATE=42705
what I need to do?
|
In this specific scenario you have to follow the following steps
first do
su - A
first asking for database connection...
db2 connect to A
then i did
db2 GRANT CONNECT ON DATABASE TO USER B
DB20000I The SQL command completed successfully.
then get details of instance for database A
then do
su - B
now you'll have to catalog the instance A using the following command
db2 catalog tcpip node <<nodename>> remote <<db2server ip>> server <<pot of node>>
now do 'db2 list node directory' and check whether the node has been cataloged
now you'll have to catalog the database
db2 catalog db <<dbname>> as alias <<alias-name>> at node <<nodename>>
where nodename is the same as the node that is specified while cataloging the node
[ points to note - database alias name cannot be same as an existing alias name or a db name ]
now do 'db2 list db directory' and check whether the database A details is displayed
now do
connect to A user <<username>> using <<password>>
[ in this case use the alias name that you have specified for database A ]