IBMDB2i + SAVRST

General discussion on Zend Server for IBM System i

IBMDB2i + SAVRST

Postby iplsbm on Wed Nov 28, 2012 11:15 am

Hi all,

I'm trying to save and restore MySQL data using IBMDB2i engine from my server to its backup.
I want to use some standard IBMi tools like SAVRSTxxx, but when I try to access my data on the backup server I get the following error:

"ERROR 1296 (HY000): Got error 2102 'The file has changed and might not be compatible with the MySQL table definition' from IBMDB2I".

Here is the command I used:

SAVRSTOBJ OBJ("mylib")
LIB("mytable")
RMTLOCNAME(BKPSRV)
ACCPTH(*YES)
PVTAUT(*YES)

I checked the owner of the restored PF ("mysql" on both servers), I tried to backup the entire library but nothing helps.

Does anyone know how to figure it out?

Thanks.
iplsbm
 
Posts: 5
Joined: Wed Aug 29, 2012 1:44 pm

Re: IBMDB2i + SAVRST

Postby timclark2000 on Wed Nov 28, 2012 4:16 pm

Error 2102 means that the the "File level identifier" (FID) on the DB2 table has changed. Since MySQL/IBMDB2I doesn't know what caused the FID to change (perhaps the record layout changed), it blocks access to the table to prevent potential data corruption. This is documented at https://dev. mysql. com/doc/refman/5.1/en/se-db2-metadata.html

Apparently SAVRSTOBJ alters the "File level identifier" (FID) when it restores the object on the target system. In my experience this doesn't happen when saving/restoring locally, but perhaps there's some nuance of SAVRSTOBJ that I haven't seen.

If you are certain that the layout of the table did not change, you can move past this error by deleting the appropriate .FID files in the MySQL data directory in the IFS. For example, for a table TESTSCHEMA.TESTTABLE, you should see a file ./TESTSCHEMA/TESTTABLE.FID in the data directory. After you RMVLNK this file, you should be able to access the table again.

Hope that helps,
Tim
timclark2000
 
Posts: 68
Joined: Fri May 01, 2009 8:19 pm

Re: IBMDB2i + SAVRST

Postby iplsbm on Wed Nov 28, 2012 5:21 pm

Thank you Tim.

You're right, this issue is about the FID.
If the file doesn't exist on the backup prior to the restore, you just have to delete the .FID file in the IFS but if the file exists you have to use the following command:

SAVRSTOBJ OBJ("mylib")
LIB("mytable")
RMTLOCNAME(BKPSRV)
ACCPTH(*YES)
PVTAUT(*YES)
ALWOBJDIF(*FILELVL)

Otherwise SAVRSTOBJ will end with CPF3283.

In my application, I know the layout of the table did not change then this option is good for me.

Regards,

Bruno.
iplsbm
 
Posts: 5
Joined: Wed Aug 29, 2012 1:44 pm


Return to Zend Server for IBM i

Who is online

Users browsing this forum: Google [Bot] and 2 guests