• Please help support our sponsors by considering their products and services.
    Our sponsors enable us to serve you with this high-speed Internet connection and fast webservers you are currently using at ADSM.ORG.
    They support this free flow of information and knowledge exchange service at no cost to you.

    Please welcome our latest sponsor Tectrade . We can show our appreciation by learning more about Tectrade Solutions
  • Community Tip: Please Give Thanks to Those Sharing Their Knowledge.

    If you receive helpful answer on this forum, please show thanks to the poster by clicking "LIKE" link for the answer that you found helpful.

  • Community Tip: Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING)

    Click the link above to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This notice will disappear after you have made at least 3 posts.

Problems Backing Up 2 DBs With Cron

jgraul

Active Newcomer
#1
I have a Linux server with DB2 9.7. There are two databases running. I've created scripts to stop the applications and backup the databases using the API then restart the applications. This works great interactively, but when running them from cron, I am getting SQL1035N The database is currently in use. SQLSTATE=57019. What's the difference in running them from cron and interactively? I put a symbolice link to the script in the cron.daily directory. Here's a copy of the db2 backup script:

#!/bin/bash
# DB2 Server Name: npsetl000_db2
#
logfile=/opt/tivoli/tsm/client/api/log/db2full.log
echo "------------------------------------------" >> $logfile
date >> $logfile
#

echo "---- Forcing all users off of database ---" >> $logfile
db2 connect to IADB >> $logfile
db2 quiesce database immediate force connections >> $logfile
db2 connect reset >> $logfile
echo "---- Backing up Database IADB -------------" >> $logfile
db2 backup db IADB use TSM >> $logfile
db2 connect to IADB >> $logfile
db2 unquiesce database >> $logfile
db2 connect reset >> $logfile
echo "------------------------------------------" >> $logfile

echo "---- Forcing all users off of database ---" >> $logfile
db2 connect to XMETA >> $logfile
db2 quiesce database immediate force connections >> $logfile
db2 connect reset >> $logfile
echo "---- Backing up Database XMETA ------------" >> $logfile
db2 backup db XMETA use TSM >> $logfile
db2 unquiesce database >> $logfile
db2 connect reset >> $logfile
echo "-----------------------------------------" >> $logfile
 

Advertise at ADSM.ORG

If you are reading this, so are your potential customer. Advertise at ADSM.ORG right now.

UpCloud high performance VPS at $5/month

Get started with $25 in credits on Cloud Servers. You must use link below to receive the credit. Use the promo to get upto 5 month of FREE Linux VPS.

The Spectrum Protect TLA (Three-Letter Acronym): ISP or something else?

  • Every product needs a TLA, Let's call it ISP (IBM Spectrum Protect).

    Votes: 17 19.5%
  • Keep using TSM for Spectrum Protect.

    Votes: 53 60.9%
  • Let's be formal and just say Spectrum Protect

    Votes: 10 11.5%
  • Other (please comement)

    Votes: 7 8.0%

Forum statistics

Threads
31,468
Messages
134,122
Members
21,568
Latest member
MESSID
Top