dbTalk Databases Forums  

instance owner sees db alias, other users don't

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss instance owner sees db alias, other users don't in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Peter H. Coffin
 
Posts: n/a

Default instance owner sees db alias, other users don't - 01-23-2012 , 09:00 AM






Here's a fun one.

Instance owner can see/use a local database name:

-------------------
db2 => connect
connect

Database Connection Information

Database server = DB2/LINUXX8664 9.7.0
SQL authorization ID = DB2INST2
Local database alias = CW


db2 => grant connect on database to public
grant connect on database to public
DB20000I The SQL command completed successfully.

db2 => list tables for schema src
list tables for schema src

Table/View Schema Type Creation time
------------------------------- --------------- ----- --------------------------
BVD_GME_LINKS SRC T 2012-01-18-12.54.33.628198
BVD_LINKS SRC T 2012-01-18-12.36.03.750860
BVD_MCH_CONS_OLD SRC T 2012-01-20-13.33.51.044277

3 record(s) selected.

-------------------

However other users cannot even attempt to connect to the database. They
don't even see the alias, even though the alias is listed in the
directory.

-------------------
[08:47:16] $ db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 9.7.0

You can issue database manager commands and SQL statements from the
command
prompt. For example:
db2 => connect to sample
db2 => bind sample.bnd

For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
? CATALOG DATABASE for help on the CATALOG DATABASE command
? CATALOG for help on all of the CATALOG commands.

To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND OPTIONS.

For more detailed help, refer to the Online Reference Manual.

db2 => connect to cw
SQL1013N The database alias name or database name "CW" could not be
found.
SQLSTATE=42705
db2 => list db directory

System Database Directory

Number of entries in the directory = 13

Database 1 entry:

Database alias = CW
Database name = CW
Local database directory = /saswork/db2/cw
Database release level = d.00
Comment = Client Wallet Local Storage
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =

Database 2 entry:

Database alias = XMETA
Database name = XMETA
....
-------------------

There's no duplicate CW alias, it's not saying it's forbidden to
connect to it, it's saying there's no such name or alias. It also
persists through a db2stop/db2start cycle in the same circumstance:
owner can access, user sees the entry in the directory but can't use
it.

Any suggestions for reconciling this? Obviously, I'd prefer to make
other users able to see the alias than break it for the instance
owner...

--
Either way, it'll remind the clued that there's only one letter
difference between 'turkey' and 'turnkey'.
-- Mike Andrews

Reply With Quote
  #2  
Old   
TheBoss
 
Posts: n/a

Default Re: instance owner sees db alias, other users don't - 01-23-2012 , 02:19 PM






"Peter H. Coffin" <hellsop (AT) ninehells (DOT) com> wrote in
news:slrnjhqtfp.51n.hellsop (AT) nibelheim (DOT) ninehells.com:

Quote:
Here's a fun one.

Instance owner can see/use a local database name:

-------------------
db2 => connect
connect

Database Connection Information

Database server = DB2/LINUXX8664 9.7.0
SQL authorization ID = DB2INST2
Local database alias = CW


db2 => grant connect on database to public
grant connect on database to public
DB20000I The SQL command completed successfully.

db2 => list tables for schema src
list tables for schema src

Table/View Schema Type Creation time
------------------------------- --------------- -----
-------------------------- BVD_GME_LINKS SRC
T 2012-01-18-12.54.33.628198 BVD_LINKS
SRC T 2012-01-18-12.36.03.750860 BVD_MCH_CONS_OLD
SRC T 2012-01-20-13.33.51.044277

3 record(s) selected.

-------------------

However other users cannot even attempt to connect to the database.
They don't even see the alias, even though the alias is listed in the
directory.

-------------------
[08:47:16] $ db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 9.7.0

You can issue database manager commands and SQL statements from the
command
prompt. For example:
db2 => connect to sample
db2 => bind sample.bnd

For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
? CATALOG DATABASE for help on the CATALOG DATABASE command
? CATALOG for help on all of the CATALOG commands.

To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND
OPTIONS.

For more detailed help, refer to the Online Reference Manual.

db2 => connect to cw
SQL1013N The database alias name or database name "CW" could not be
found.
SQLSTATE=42705
db2 => list db directory

System Database Directory

Number of entries in the directory = 13

Database 1 entry:

Database alias = CW
Database name = CW
Local database directory = /saswork/db2/cw
Database release level = d.00
Comment = Client Wallet Local Storage
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =

Database 2 entry:

Database alias = XMETA
Database name = XMETA
...
-------------------

There's no duplicate CW alias, it's not saying it's forbidden to
connect to it, it's saying there's no such name or alias. It also
persists through a db2stop/db2start cycle in the same circumstance:
owner can access, user sees the entry in the directory but can't
use it.


Any suggestions for reconciling this? Obviously, I'd prefer to make
other users able to see the alias than break it for the instance
owner...

Hi Peter,

could it be your other users are connecting to a different instance?
Compare environment variable DB2INSTANCE for the other users vs. the
instance owner.

HTH

Cheers!

--
Jeroen

Reply With Quote
  #3  
Old   
Ian
 
Posts: n/a

Default Re: instance owner sees db alias, other users don't - 01-23-2012 , 05:21 PM



On Jan 23, 8:00*am, "Peter H. Coffin" <hell... (AT) ninehells (DOT) com> wrote:

Quote:
There's no duplicate CW alias, it's not saying it's forbidden to
connect to it, it's saying there's no such name or alias. It also
persists through a db2stop/db2start cycle in the same circumstance:
owner can access, user sees the entry in the directory but can't use
it.

Any suggestions for reconciling this? Obviously, I'd prefer to make
other users able to see the alias than break it for the instance
owner...
Chances are that the permissions somewhere in your instance
owner's home directory and/or in the local database path are not
correct.

Can the user connect to other databases in the same instance?

If not, you might try using db2iupdt (which should correct
permissions in the sqllib directory).

If so, there will probably be error messages in the db2diag.log
indicating what file is unreadable...

Reply With Quote
  #4  
Old   
Peter H. Coffin
 
Posts: n/a

Default Re: instance owner sees db alias, other users don't - 01-23-2012 , 05:54 PM



On 23 Jan 2012 20:19:09 GMT, TheBoss wrote:
Quote:
"Peter H. Coffin" <hellsop (AT) ninehells (DOT) com> wrote in
news:slrnjhqtfp.51n.hellsop (AT) nibelheim (DOT) ninehells.com:

Here's a fun one.

Instance owner can see/use a local database name:

-------------------
db2 => connect
connect

Database Connection Information

Database server = DB2/LINUXX8664 9.7.0
SQL authorization ID = DB2INST2
Local database alias = CW


db2 => grant connect on database to public
grant connect on database to public
DB20000I The SQL command completed successfully.

db2 => list tables for schema src
list tables for schema src

Table/View Schema Type Creation time
------------------------------- --------------- -----
-------------------------- BVD_GME_LINKS SRC
T 2012-01-18-12.54.33.628198 BVD_LINKS
SRC T 2012-01-18-12.36.03.750860 BVD_MCH_CONS_OLD
SRC T 2012-01-20-13.33.51.044277

3 record(s) selected.

-------------------

However other users cannot even attempt to connect to the database.
They don't even see the alias, even though the alias is listed in the
directory.

-------------------
[08:47:16] $ db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 9.7.0

You can issue database manager commands and SQL statements from the
command
prompt. For example:
db2 => connect to sample
db2 => bind sample.bnd

For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
? CATALOG DATABASE for help on the CATALOG DATABASE command
? CATALOG for help on all of the CATALOG commands.

To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND
OPTIONS.

For more detailed help, refer to the Online Reference Manual.

db2 => connect to cw
SQL1013N The database alias name or database name "CW" could not be
found.
SQLSTATE=42705
db2 => list db directory

System Database Directory

Number of entries in the directory = 13

Database 1 entry:

Database alias = CW
Database name = CW
Local database directory = /saswork/db2/cw
Database release level = d.00
Comment = Client Wallet Local Storage
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =

Database 2 entry:

Database alias = XMETA
Database name = XMETA
...
-------------------

There's no duplicate CW alias, it's not saying it's forbidden to
connect to it, it's saying there's no such name or alias. It also
persists through a db2stop/db2start cycle in the same circumstance:
owner can access, user sees the entry in the directory but can't
use it.


Any suggestions for reconciling this? Obviously, I'd prefer to make
other users able to see the alias than break it for the instance
owner...


Hi Peter,

could it be your other users are connecting to a different instance?
Compare environment variable DB2INSTANCE for the other users vs. the
instance owner.
Same instance for both users. And wouldn't that ALSO affect what the
directory showed? That is, it wouldn't show another instance's db
directory, right?

--
With a Dremel tool and a cut-off wheel, _everything_ takes a flat-blade
screwdriver.
-- Matt Roberds in the Monastery

Reply With Quote
  #5  
Old   
Peter H. Coffin
 
Posts: n/a

Default Re: instance owner sees db alias, other users don't - 01-23-2012 , 05:57 PM



On Mon, 23 Jan 2012 15:21:37 -0800 (PST), Ian wrote:
Quote:
On Jan 23, 8:00?am, "Peter H. Coffin" <hell... (AT) ninehells (DOT) com> wrote:

There's no duplicate CW alias, it's not saying it's forbidden to
connect to it, it's saying there's no such name or alias. It also
persists through a db2stop/db2start cycle in the same circumstance:
owner can access, user sees the entry in the directory but can't use
it.

Any suggestions for reconciling this? Obviously, I'd prefer to make
other users able to see the alias than break it for the instance
owner...

Chances are that the permissions somewhere in your instance
owner's home directory and/or in the local database path are not
correct.

Can the user connect to other databases in the same instance?
Yes. Using the same instance, the user that cannot access the cataloged,
local CW databse CAN use the instance to connect to other (at least
remote) databases using that catalog.

Quote:
If not, you might try using db2iupdt (which should correct
permissions in the sqllib directory).

If so, there will probably be error messages in the db2diag.log
indicating what file is unreadable...
I'll check that next. Thanks.

--
With a Dremel tool and a cut-off wheel, _everything_ takes a flat-blade
screwdriver.
-- Matt Roberds in the Monastery

Reply With Quote
  #6  
Old   
Peter H. Coffin
 
Posts: n/a

Default Re: instance owner sees db alias, other users don't - 01-23-2012 , 06:33 PM



On Mon, 23 Jan 2012 15:21:37 -0800 (PST), Ian wrote:
Quote:
There's no duplicate CW alias, it's not saying it's forbidden to
connect to it, it's saying there's no such name or alias. It also
persists through a db2stop/db2start cycle in the same circumstance:
owner can access, user sees the entry in the directory but can't use
it.

Any suggestions for reconciling this? Obviously, I'd prefer to make
other users able to see the alias than break it for the instance
owner...

Chances are that the permissions somewhere in your instance
owner's home directory and/or in the local database path are not
correct.

Can the user connect to other databases in the same instance?
Further checking: remote databases, okay. other local databases, no, not
those either.

Quote:
If not, you might try using db2iupdt (which should correct
permissions in the sqllib directory).
Oh there we go.... kicking everything off, running that, signing back in
with a fresh shell session and running the same db2profile now give
access, to both instance owner *and* reular users. Effusive thanks!

--
This was, apparently, beyond her ken. So far beyond her ken that she
was well into barbie territory.
-- J. D. Baldwin

Reply With Quote
  #7  
Old   
TheBoss
 
Posts: n/a

Default Re: instance owner sees db alias, other users don't - 01-25-2012 , 04:06 PM



"Peter H. Coffin" <hellsop (AT) ninehells (DOT) com> wrote in
news:slrnjhrspr.51n.hellsop (AT) nibelheim (DOT) ninehells.com:

Quote:
On 23 Jan 2012 20:19:09 GMT, TheBoss wrote:
...

Hi Peter,

could it be your other users are connecting to a different instance?
Compare environment variable DB2INSTANCE for the other users vs. the
instance owner.

Same instance for both users. And wouldn't that ALSO affect what the
directory showed? That is, it wouldn't show another instance's db
directory, right?

Yes, you're right.
I misinterpreted the db directory you showed as coming from the instance
owner.
I'm glad Ian's solution solved the issue.

Cheers!

--
Jeroen

Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.