Search code examples
unixdb2database-schemaaixcatalog

specify default schema for a database in db2 client


Do we have any way to specify default schema in cataloged DBs in db2 client in AIX.

The problem is , when it's connecting to DB, it's taking user ID as default schema and that's where it's failing.

We have too many scripts that are doing transactions to DB without specifying schema in their db2 sql statements. So it's not feasible to change scripts at all.

Also we can't create users to match schema.


Solution

  • You can create alias in the new user schema that points to the tables with the other schema. Refer these links :

    http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.sql.ref.doc/doc/r0000910.html

    http://bytes.com/topic/db2/answers/181247-do-you-have-always-specify-schema-when-using-db2-clp