Unanswered: Changing database logging from circular to archive
I am actually setting up a DB2 production server. I did a backup of a database on the DEV server, and then did a redirected restore on my PROD server. After that, I changed the database logging method from circular to archive.
Here is the command I used :
CONNECT TO DOD015;
QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS;
UPDATE DB CFG FOR DOD015 USING logarchmeth1 "DISK:E:\DB2D001\DOD015\LOGDIR\ARCHIVES" failarchpath "E:\DB2D001\DOD015\LOGDIR\FAIL" logprimary 13 logsecond 4 logfilsiz 1024;
BACKUP DATABASE DOD015 TO "E:\BACKUP" WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 COMPRESS WITHOUT PROMPTING;
The command has been executed without errors, BUT DB2 keeps creating the full path (instance/database/node/etc....) even if I specified a custom path for my archive logs and fail logs... What I expected from DB2 :
Archive logs directly in : E:\DB2D001\DOD015\LOGDIR\ARCHIVES
Fail logs directly in : E:\DB2D001\DOD015\LOGDIR\FAIL
What DB2 did :
Archive logs : E:\DB2D001\DOD015\LOGDIR\ARCHIVES\DB2D001\DOD015\NODE0000\C0000000Fail logs : E:\DB2D001\DOD015\LOGDIR\FAIL\DB2D001\DOD015\NODE0000\C0000000
I would like to know if it is possible to change it so it could work as expected?
DB2 tries to ensure that archive logfile don't get mixed up. That's why it creates the subdirectories. If you have a partitioned database with two or more partiotions on the same box and DB2 woul use your settings the archived logfiles from these partitions would end up in the same directory.
I don't know if there's an Option to turn it off, but you could create your own user-exit to achieve it. Also you could work with links to trick DB2. But you have to change the Links after a restore, because DB2 will use a new Log-Chain (the last directory; ....\C000000).