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 > Nickname on Local DB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-18-06, 11:07
udbraja udbraja is offline
Registered User
 
Join Date: Sep 2004
Posts: 111
Arrow Nickname on Local DB

Can we create a nickname for local databases?

For example:
SourceA and TargetB are two databases on same instance.

SourceA has a table x.EMP

ON TARGETB db...
1) Created a server

connect to TARGETb;

create server db_SOURCEA type db2/eee version 8.1
wrapper drda
authorization tester1
password "tester1"
options(dbname 'SOURCEA');

2) CREATE NICKNAME ON TARGETB
connect to TARGETb;
create nickname x.n_emp for db_sourcea.x.emp;

ERROR:
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:
SQL1101N Remote database "sourcea" on node "" could not be accessed with the specified authorization id and password. SQLSTATE=08004

3)db2 list db directory
Database 8 entry:

Database alias = TARGETB
Database name = TARGETB
Local database directory = /targetb_db
Database release level = a.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =

Database 9 entry:

Database alias = SOURCEA
Database name = SOURCEA
Local database directory = /sourcea_db
Database release level = a.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =


Please let me the command which will allow nickname to create successful.

Thanks
-R
Reply With Quote
  #2 (permalink)  
Old 04-18-06, 11:28
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Did you "CREATE USER MAPPING" first. TargetB needs to know how to connect to SourceA.

HTH

Andy
Reply With Quote
  #3 (permalink)  
Old 04-18-06, 13:04
udbraja udbraja is offline
Registered User
 
Join Date: Sep 2004
Posts: 111
Arrow

Thanks Andy.

My previous user mapping had wrong password (a typo).

It works.

Cheers:-)

-R
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