473,587 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Restore Error - SQL1035N The database is currently in use

Hi all

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

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
3 25621
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.c om> 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=57 019"

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
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
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.go ogle.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3101
by: Jasper Recto | last post by:
I have a little program that opens a progress database and runs a report. Dim Path As Object Dim Report As Object Path = "d:\ReportBuilder\VendorShipping.p" Report = Shell("""V:\PROGRESS\bin\prowin32.exe"" """ & Path & """", 1) When it tries to run I get this error: Error
5
17714
by: mikkel | last post by:
Hello, Im working on a project where I have to bring at production database in house for regression testing. The people who hosts the database (db2 version 7) has made a backup of the base and given me a CD containing one file... When I try to do a restore to new Database I get the dreaded SQL2542N
5
7057
by: Clodoaldo Pinto Neto | last post by:
I suspect there is something wrong because it takes 73s to delete a single line from a table whith 140 lines. So I tried to reindex the database: bash-2.05b$ postgres -P -O -D /var/lib/pgsql/data KakaoStats LOG: database system was shut down at 2004-04-11 19:55:10 BRT LOG: checkpoint record is at 7/9505D650 LOG: redo record is at...
1
7847
by: jesmi | last post by:
my code is: U]employee.cfm <html> <head> <title>Employee List</title> </head> <body> <h1>Employee List</h1>
0
1276
by: sueamus | last post by:
Hi, Am trying to do a restore of a database but am getting this error " SQL2009C There is no enough memory available to run the utility". When backing up, i increased util_heap_sz and dbheap configuration parameters of the database before backing up.I have also increased the restbufsz configuration parameter but am still getting the same...
12
49376
by: ewarts | last post by:
Hey Guys, I have an access database with a few tables and forms. I was trying to add a new combo box to one of my forms and to do so i needed to add the referenced data to my reference data table. simple or so I thought, but while attempting to do so I got the following error ""database engine could not lock table because it is already in use...
1
3952
by: Akino877 | last post by:
Hello, I have a simple Perl program that connects to MySQL and creates a table of first names and last names. The code is as follows : #!/usr/bin/perl -w use DBI; use Mysql; use DBD::mysql;
2
3466
mgpsivan
by: mgpsivan | last post by:
Hi, How can we backup or restore a database with all its tables,procedures,views,triggers etc., when i tried using mysqldump command i'm able to backup the tables and procedures alone.But restoring it is still a ? Can any one help me with this problem. Please let me know the way to backup and restore the complete database. Thanks...
1
15309
debasisdas
by: debasisdas | last post by:
This is a sample code for taking backup and restore of access database Dim DBTempSource As Database Dim DBTempDestination As Database Dim RecTempSource As Recordset Dim RecTempDestination As Recordset Sub MBackup()
0
7920
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.