0

On Db2 v11.5.8.0 on Linux/x86-64 couple of mouths ago we have moved our database from one Linux to another. Every night at the time of backup error is written in db2diag.log file.

2023-08-16-02.14.13.540270+120 E19866377E1207        LEVEL: Error (OS)
PID     : 48681                TID : 140572366989056 PROC : db2sysc 0
INSTANCE: myinst               NODE : 000            DB   : mydb
APPHDL  : 0-24364              APPID: *LOCAL.myinst.230816000503
AUTHID  : MXIN                 HOSTNAME: myhostname
EDUID   : 172                  EDUNAME: db2agent (mydb) 0
FUNCTION: DB2 UDB, oper system services, sqloopenp, probe:80
MESSAGE : ZRC=0x840F0001=-2079391743=SQLO_ACCD "Access Denied"
          DIA8701C Access denied for resource "", operating system return code 
          was "".
CALLED  : OS, -, open                             OSERR: EACCES (13)
DATA #1 : Codepath, 8 bytes
4:11:12:24:40
DATA #2 : File name, 63 bytes
/cifs/db2sd-db2prod/mydb.0.myinst.DBPART000.20230324020503.001
DATA #3 : SQO Open File Options, PD_TYPE_SQO_FILE_OPEN_OPTIONS, 4 bytes
SQLO_REVISE, SQLO_READWRITE, SQLO_EXCLUSIVE, SQLO_WRITETHRU

Like I see from shell script first command is "backup database..." and then second command is:

PRUNE HISTORY $(date -d -$PHISTORYday +"%Y%m%d") AND DELETE;

Prune command is the most likely candidate for this error. I know we used to store backups on /cifs/db2sd-db2prod directoy, but we have new location for backup.

From the file name from error message "20230324020503.001" it looks like database is looking for 5 moths old backup file, probably at the stage of pruning, but can't find it, because path to this file does not exists anymore.

I would just like to have db2diag.log file as clean as possible. How to fix this problem?

1
  • I guess you'll need to force-prune all history prior to the date on which you moved the database.
    – mustaccio
    Aug 19, 2023 at 12:53

1 Answer 1

0

Use the UPDATE HISTORY command to mark the corresponding history entries as deleted.
You may use the following statement to generate the corresponding Db2 CLP commands.

SELECT 
--EID, SEQNUM, ENTRY_STATUS 
'UPDATE HISTORY EID ' || EID || ' WITH STATUS X'
FROM SYSIBMADM.DB_HISTORY 
WHERE OBJECTTYPE = 'D' AND OPERATION = 'B'
AND START_TIME = '20230324020503'

Don't use the ADMIN_CMD routine to run these statements - it does nothing at least on my Windows 11.5.7 version (it's probably some bug).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.