Author Topic: Problem running arssockd after db2 restore.  (Read 4646 times)

lrfurtado

  • Guest
Problem running arssockd after db2 restore.
« on: February 06, 2012, 03:24:37 PM »
I restored a copy of  our QA DB2 OnDemand database to our DEV system. They both run under different user ids archive and archdev.

Our Dev system runs with the following ars.ini:

[@SRV@_ARCHIVE]
HOST=someServerDev
PROTOCOL=2
PORT=0
SRVR_INSTANCE=archive
SRVR_INSTANCE_OWNER=archdev
SRVR_OD_CFG=/opt/ondemand/config/ars.cfg
SRVR_DB_CFG=/opt/ondemand/config/ars.dbfs
SRVR_SM_CFG=/opt/ondemand/config/ars.cache
SRVR_FLAGS_SECURITY_EXIT=1

[@SRV@_DD]
PROTOCOL=1


Our QA system has the following config:

[@SRV@_ARCHIVE]
HOST=someServerQa
PROTOCOL=2
PORT=0
SRVR_INSTANCE=archive
SRVR_INSTANCE_OWNER=archive
SRVR_OD_CFG=/opt/ondemand/config/ars.cfg
SRVR_DB_CFG=/opt/ondemand/config/ars.dbfs
SRVR_SM_CFG=/opt/ondemand/config/ars.cache
SRVR_FLAGS_SECURITY_EXIT=1

[@SRV@_DD]
PROTOCOL=1



ARCHIVE,02/06/12 16:48:48,0,ARSSOCKD,,2,13,DB Error: [IBM][CLI Driver][DB2/LINUXX8664] SQL0204N "ARCHDEV.ARSAG" is an undefined name. SQLSTATE=42704 -- SQLSTATE=42S02, SQLCODE=-204, File=arsag.c, Line=4070


Is there a way to make arssockd SET CURRENT SCHEMA before issueing the SQL statements to DB2, AFAIK it is trying to use the schema associated with the user id it is runnign as.


Is there any guidelines on how to restore the DB when the users that system run as are different? archive vs archdev for instance.


Any help will be much appreciated.

Thanks.


Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Problem running arssockd after db2 restore.
« Reply #1 on: February 07, 2012, 01:54:00 AM »
Hello,

If you use db2move to do the backup/restore, then you can use that possibility:

Quote
To duplicate schema schema1 from source database dbsrc to target database dbtgt, rename the schema to newschema1 on the target, and map source table space ts1 to ts2 on the target, issue:

   
Code: [Select]
db2move dbsrc COPY -sn schema1 -co TARGET_DB dbtgt USER myuser1 USING mypass1
        SCHEMA_MAP ((schema1,newschema1)) TABLESPACE_MAP ((ts1,ts2), SYS_ANY))

(link : http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.admin.doc%2Fdoc%2Fr0002079.htm)

Sincerely yours,
Alessandro
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

lrfurtado

  • Guest
Re: Problem running arssockd after db2 restore.
« Reply #2 on: February 07, 2012, 04:27:47 AM »
What approach do you suggest for db2 v8 that doesnt support db2move copy ?

Is there no way to make arssockd set the current schema ? to something other then the current user authorization id?
« Last Edit: February 07, 2012, 04:36:28 AM by lrfurtado »

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1002
    • View Profile
Re: Problem running arssockd after db2 restore.
« Reply #3 on: February 07, 2012, 05:42:26 AM »
What approach do you suggest for db2 v8 that doesnt support db2move copy ?

First... DB2 V8 is no longer supported since 30 April 2009...

Second, I don't have anymore DB2 V8 installed... so cannot test it, but I remember that one could change the reference files of the db2move export in order to "tweak" the restore into the new schema.

third, you can look at that link : http://www.ibm.com/developerworks/data/library/techarticle/dm-0602rielau/, it might help.

An advice would be to upgrade your db2, and probably also your CMOD installation, because as it appears, you are out of support.

Quote
Is there no way to make arssockd set the current schema ? to something other then the current user authorization id?

No, the instance owner is the schema of your database. You cannot change that.

Sincerely yours,
Alessandro
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2230
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Problem running arssockd after db2 restore.
« Reply #4 on: February 07, 2012, 08:26:38 AM »
What commands did you use to restore the database?  Which user ID/ instance did you restore it into?

I'm guessing that you restored the QA database into the same instance as your dev instance, which isn't likely to work.

If you want to change the schema name, you're going to need to export all the tables in IXF format and import them into the new instance and database.

-JD.

P.S.  Alessandro is right -- you're WAY too far out of support.  Get upgraded as soon as you can!
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

lrfurtado

  • Guest
Re: Problem running arssockd after db2 restore.
« Reply #5 on: February 21, 2012, 06:02:47 PM »
This is the steps I took to get it done:

db2look -d ARCHIVE -l -a -e -td@ -o db2look.db2
sed -i -e "s/ARCHIVE/ARCHDEV/g" db2look.db2
db2move ARCHIVE export
sed -i  -e "s/ARCHIVE/ARCHDEV/g" db2move.lst
db2move ARCHIVE load