Database files are key for any application. One can never imagine the impact of a database file being accidentally deleted. There are ways to recover the data if the file is journaled . But, this would take lot of effort and business disruption. With the introduction of RESTRICT ON DROP attribute in IBM i 7.5, we can restrict a file from being deleted accidentally. Add Restriction on Drop To prevent a file/table from being deleted, ADD RESTRICTION ON DROP can be used with ALTER TABLE. By adding this restriction a file cannot be deleted both by using DLTF (Delete File) from command line/CL program or by using DROP TABLE from SQL. ALTER TABLE <Library>/<File> ADD RESTRICT ON DROP E.g.: This would add a restriction on REDDYP1/TEST and this file cannot be deleted. Once added, the file cannot be deleted. Below error would appear if we try to delete the file from command line. Same would happen with DROP TABLE from SQL. DSPFD (...
Code with PR - Technical tips on coding and more...