Search code examples
shelldb2backup

Db2 DB21019E backup script error


I am trying to run a backup script to backup database Sample

 su -c "${DB2Home}/db2 quiesce database immediate force connections" ${InstanceName} 

    echo "[INFO:`date`]Executing the backup command: ${DB2Home}/db2 backup database ${Primary_Server_DBName} to ${BackupFolder} compress without prompting "

   su -c "${DB2Home}/db2 backup database ${Primary_Server_DBName} to ${BackupFolder} compress without prompting" ${InstanceName}

I executed the script as a root user not as db2inst1 user

I am getting the following error

    [INFO:Tue Oct 21 18:44:23 IST 2014]Executing the backup command: /opt/ibm/db2/V10.5/bin/db2 backup database TIPDB to /home/db2inst1/backupFolder compress without prompting 
  DB21019E  An error occurred while accessing the directory 
    "/root".

Solution

  • The solution is to add . /home/db2inst1/sqllib/db2profile

    before the db2 operations