db2 currently lacks an oracle-style concept of public schema, but that
does not matter so much because you have at least these alternate ways
of addressing the objects.
(a) after user2 successfully connects to the database, have that user
perform "set schema user1" to ensure that any unqualified names
mentioned by user2 map to the user1 schema (assuming that user2 has
privileges to access those objects).
That setting of the default schema for the connection can be done
interactively or programatically, possibly by db2cli.ini configuration
also.
(b) create a set of aliases so that some or all of the objects in the
user1 schema
are visible (via those aliases) from the user2 schema. Example: create
alias user2.some_table for user1.some_table. Assumes that user2 has
privileges to access the objects in the user1 schema.
jo******@canada.com wrote:
Here's how you would do it -
1. Connect to the database as SYSADM or DBADM user
2. execute the SQL - "grant DBADM on database to user <your-id>"
-- Jayesh
Thanks Jayesh.
It's good but let's say user1 create table, then when user2 login and
tried to use tables created by user1, user2 has to use like
select * from user1.table;
How to make tables created by user1, for other users use it without
specifying schema, just
like select * from table, as user1 uses?
--
Thanks
John