• 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
Joined
Feb 17, 2012
Messages
36
Reaction score
0
Points
0
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
 

jgraul

Active Newcomer
Joined
Feb 17, 2012
Messages
36
Reaction score
0
Points
0
Ok, so does anyone backup multiple DB2 databases on the same server?
 

Advertise at ADSM.ORG

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

DigitalOcean $100 Credit

Support ADSM.ORG and get DigitalOcean FREE credit. DigitalOcean currently offer a $100, 60-day Free Credit for new accounts. Sign-up here:

DigitalOcean Referral Badge

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: 20 18.7%
  • Keep using TSM for Spectrum Protect.

    Votes: 65 60.7%
  • Let's be formal and just say Spectrum Protect

    Votes: 13 12.1%
  • Other (please comement)

    Votes: 9 8.4%

Forum statistics

Threads
31,886
Messages
135,939
Members
21,783
Latest member
london
Top