Start a Conversation

Unsolved

D

4 Posts

805

April 6th, 2022 05:00

How to manually delete DB2 backups

Hello

We have a problem with manually deleting DB2 backups.

We set DB2 parameters on our DB (FN_GCD)

Vendor options
(VENDOROPT) = @DB/nsr/apps/config/nmda_db2.cfg

Auto deletion of recovery objects
(AUTO_DEL_REC_OBJ) = ON

[root@testfilenetdb2 config]# more nmda_db2.cfg
DB2_NODE_NAME=db2inst1
DB2_USER=db2inst1
DB2INSTANCE=db2inst1
INSTHOME=/home/db2inst1
NSR_SERVER=server_name
NSR_CLIENT=client_name
NSR_DATA_VOLUME_POOL =pool_name
NSR_LOG_VOLUME_POOL =pool_name


Here is our backup:
[db2inst1@...]$ nsrinfo -v -n db2 -s nwzg1.intranet.fina.hr -X all testfilenetdb2.unix.fina.hr | grep FN_GCD
...
version=1, DB2, objectname=/FN_GCD/NODE0000 /DB_BACKUP.20220304210025.1, createtime=Fri Mar 4 21:00:25 2022, copytype=3 BSACopyType_BACKUP, copyId=1646424025.1646424026, restoreOrder=1646424025.1, objectsize=0.0, resourcetype=database, objecttype=4 BSAObjectType_DATABASE, objectstatus=2 BSAObjectStatus_ACTIVE, description=NMDA_v193:DB2_v1156:FULL_BACKUP:FN_GCD:TEQ, objectinfo=db2inst1:1, NSR size=327298560

We want to delete it:
[db2inst1@...]$ db2 connect to fn_gcd
Database Connection Information
Database server = DB2/LINUXX8664 11.5.6.0
SQL authorization ID = DB2INST1
Local database alias = FN_GCD

[db2inst1@...]$ db2 prune history 20220304 and delete
DB20000I The PRUNE command completed successfully.

[db2inst1@...]$ db2 terminate
DB20000I The TERMINATE command completed successfully.


It is still here:

[db2inst1@...]$ nsrinfo -v -n db2 -s nwzg1.intranet.fina.hr -X all testfilenetdb2.unix.fina.hr | grep FN_GCD
...
version=1, DB2, objectname=/FN_GCD/NODE0000 /DB_BACKUP.20220304210025.1, createtime=Fri Mar 4 21:00:25 2022, copytype=3 BSACopyType_BACKUP, copyId=1646424025.1646424026, restoreOrder=1646424025.1, objectsize=0.0, resourcetype=database, objecttype=4 BSAObjectType_DATABASE, objectstatus=2 BSAObjectStatus_ACTIVE, description=NMDA_v193:DB2_v1156:FULL_BACKUP:FN_GCD:TEQ, objectinfo=db2inst1:1, NSR size=327298560

We can still see backup “20220304”. Why is it still there if it was deleted in earlier step?
We can see it also in NMC cosole.

Regards

2.4K Posts

April 6th, 2022 06:00

What you use are database commands - of course NW does not understand that.

This is what you have to do:

  -  find out the SSID of the db backup to be deleted.

  -  delete it with nsrmm -y -d -S ssid

This should do the job ... for NetWorker.

 

4 Posts

April 7th, 2022 00:00

Thank you for your reply, but the document (NetWorker Module for Databases and Applications Admin Guide) says: "The db2 prune command deletes backup entries for DB2 databases or tablespaces from both the
DB2 server and NetWorker server." How this can be achieved?

 

2.4K Posts

April 7th, 2022 01:00

Sorry, I am not a DB specialist. I just thought how to delete the save set via NW. This might be necessary to correct a malfunction.

According to the docs, one of the reason could be that "db2 prune" will not work when it is a snapshot backup. Then - according to the docs - another procedure applies.

 

No Events found!

Top