Db2 import and user access

access-controldb2

When I import data from DB2 using db2move, the dump file comes with the data exported as "USERX.MYTABLE".

The import process seems to be fine, I see lots of:

USERX.MYTABLE n rows imported …

But USERX is not on my database and when I try to select data using MYUSER, I always get empty results.

Also, if I run db2move and export the data from my local database, it agains export all rows for USERX.

How can I fix the access to MYUSER?

Best Answer

If you don't want to specify the schema explicitly, you can choose one of several options, for example:

  • Modify the default schema in the session, e.g. by issuing the statement SET CURRENT SCHEMA USERX.
  • Create an alias for the table USERX.MYTABLE in the schema MYUSER.
  • Before importing data, edit the file db2move.lst and replace all occurrences of USERX with MYUSER.