DB2 database backup script in Linux
DB2 database backup script in Linux
The script runs under the root user:
The content of backupDB2Task. sh is as follows:
Datedir = 'date + % Y-% m-% d'
Delete_date = 'date + % Y-% m-% d -- date = '7 days ago''
Backupdir =/home/backup
Backupdir1 =/home/backupdb2
Mkdir $ backupdir/$ datedir/
Chown-R db2inst1 $ backupdir/$ datedir
Su-db2inst1-c/home/backupdb2/backupDB2.sh
Echo ------------- start to compress -----------
Cd $ backupdir/$ datedir/
Tar-zcvf $ backupdir/$ datedir. tgz *.*
Cd $ backupdir
Rm-rf $ datedir
Echo compression ended !!!
Echo --------------- delete a file a month ago ----------------------------
Echo path of the folder where the file to be processed is located
Cd $ backupdir
Rm-rf $ delete_date.tgz
Exit
DB2 database performance adjustment and optimization (1st and 2) PDF
DB2 database performance optimization
DB2 9.7 for Linux 5.4 Installation Steps
This article permanently updates the link address: