By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,304 Members | 3,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,304 IT Pros & Developers. It's quick & easy.

Restore Error - SQL1035N The database is currently in use

P: n/a
Hi all

I am getting the following error when trying to a restore "SQL1035N The
database is currently in use.SQLSTATE=57019"

Only get this once in a while.

I have the following in my script but still keep getting this error
sometimes -

NUMAPPS=`db2 list applications | grep XYZDB | wc -l `
echo "Number of apps is $NUMAPPS"
while [ $NUMAPPS -gt 0 ]; do
db2 force application all
sleep 5
NUMAPPS=`db2 list applications | grep XYZDB | wc -l `
echo "Number of apps is $NUMAPPS"
done

db2 restore database ....

Thanks in advance for your help / advice

Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Either sleep 5 isnn't enough time to force the apps or you also need to
deactivate the db...

Depending on the db2level you're at, you may also use
-QUIESCE--+-DATABASE-+--+-IMMEDIATE-+------------------------->
'-DB-------' '-DEFER-----'

.-FORCE CONNECTIONS-.--+-------------------+---------------------------------------><
PM

"Rituraj Kirti" <rk****@cisco.com> a écrit dans le message de
news:1076530271.572365@sj-nntpcache-5... Hi all

I am getting the following error when trying to a restore "SQL1035N The
database is currently in use.SQLSTATE=57019"

Only get this once in a while.

I have the following in my script but still keep getting this error
sometimes -

NUMAPPS=`db2 list applications | grep XYZDB | wc -l `
echo "Number of apps is $NUMAPPS"
while [ $NUMAPPS -gt 0 ]; do
db2 force application all
sleep 5
NUMAPPS=`db2 list applications | grep XYZDB | wc -l `
echo "Number of apps is $NUMAPPS"
done

db2 restore database ....

Thanks in advance for your help / advice

Nov 12 '05 #2

P: n/a
Rituraj,

You may also try by doing

db2 force applications all;
db2 terminate
db2stop
ipclean (it is always safe to clean all the message queues and semaphores if any).
db2start
db2 restore db2 <db-name> use .......

Hope this helps
Jignesh Shah.
Nov 12 '05 #3

P: n/a
Ken
We do redirected restore weekly.

1 - force each appl individually in a shell that loops, don't know why
we don't force all
2 - deactivate
3 - restore
4 - archive log

We also had to archive the log file after the redireced restore to
clear up transactions the were in the log for the source database V7
on UNIX.

Ken

js***@joy.com (Jignesh Shah) wrote in message news:<23**************************@posting.google. com>...
Rituraj,

You may also try by doing

db2 force applications all;
db2 terminate
db2stop
ipclean (it is always safe to clean all the message queues and semaphores if any).
db2start
db2 restore db2 <db-name> use .......

Hope this helps
Jignesh Shah.

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.