Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Stop ASA9 db on 2k3 server from Win7 app machine to copy db

2 posts in General Discussion Last posting was on 2010-08-11 14:36:47.0Z
Mary Turner Posted on 2010-08-10 21:29:06.0Z
Sender: 91a.4c61b8c9.1804289383@sybase.com
From: Mary Turner
Newsgroups: ianywhere.public.general
Subject: Stop ASA9 db on 2k3 server from Win7 app machine to copy db
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4c61c4a2.a39.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 10 Aug 2010 14:29:06 -0700
X-Trace: forums-1-dub 1281475746 10.22.241.41 (10 Aug 2010 14:29:06 -0700)
X-Original-Trace: 10 Aug 2010 14:29:06 -0700, 10.22.241.41
Lines: 22
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:8078
Article PK: 7101

I have an ASA9 network db running on an MS Server 2003
machine, accessed from an application running on a Windows7
machine via ODBC. I am trying to run a load of test scripts
from WinRunner on the W7 machine, and these scripts
frequently need to stop the db, refresh the db by copying
the files over from another folder, then restart the db and
carry on.
Both machines have the same Admin login, and I mapped a
drive from the W7 machine to the 2K3 machine. I created a
batch file that pops over to the mapped drive and does the
copy OK, but now trying to add an automatic stop and restart
of the db so it can actually be used by the automated test
scripts.
Not being very technical (either on networks or Sybase),
what I came up with is a PSexec utility downloaded from MS
Technet, executing a net stop and net start on the service
running on the 2K3 machine. This also works fine EXCEPT
that the db files are remaining locked by something and I
get 'access denied' on the copy of each of the files.
Does anybody have an idea how to accomplish what I'm trying
to do, either tweaking what I'm doing or a completely
different approach? Thanks very much


Jeff Albion [Sybase iAnywhere] Posted on 2010-08-11 14:36:47.0Z
From: "Jeff Albion [Sybase iAnywhere]" <firstname.lastname@ianywhere.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Stop ASA9 db on 2k3 server from Win7 app machine to copy db
References: <4c61c4a2.a39.1681692777@sybase.com>
In-Reply-To: <4c61c4a2.a39.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c62b57f@forums-1-dub>
Date: 11 Aug 2010 07:36:47 -0700
X-Trace: forums-1-dub 1281537407 10.22.241.152 (11 Aug 2010 07:36:47 -0700)
X-Original-Trace: 11 Aug 2010 07:36:47 -0700, vip152.sybase.com
Lines: 57
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:8080
Article PK: 7100

Hi Mary,

On 10/08/2010 5:29 PM, Mary Turner wrote:
> Not being very technical (either on networks or Sybase),
> what I came up with is a PSexec utility downloaded from MS
> Technet, executing a net stop and net start on the service
> running on the 2K3 machine. This also works fine EXCEPT
> that the db files are remaining locked by something and I
> get 'access denied' on the copy of each of the files.

Just a thought: we reset the "read-only" flag on the database file on
shut-down, so it's possible that once the process shuts down the
database, you're losing write access. Does this file copy work without
the net start / stop commands?

> Does anybody have an idea how to accomplish what I'm trying
> to do, either tweaking what I'm doing or a completely
> different approach? Thanks very much

To use your existing solution:

If you're just copying over top of an existing database, have you tried
ensuring the original file is gone first via psexec (del /Z)?

Otherwise, I would take a look at the 'Unlocker' utility (
http://ccollomb.free.fr/unlocker/ ) to figure out what's locking the
file on the remote system during this time and get id of that process.

---

To use our utilities to do a similar thing:

Database servers can be remotely stopped using the "dbstop" utility (
http://dcx.sybase.com/index.html#1101en/dbadmin_en11/dbstop.html ),
given sufficient permissions (
http://dcx.sybase.com/index.html#1101en/dbadmin_en11/gk-database-dbengine.html
).

To start and stop a database file on a remote database server, you can
leave the database server process running and instead connect to the
"utility_db" using dbisql (
http://dcx.sybase.com/index.html#1101en/dbadmin_en11/utility-db-dbfiles.html
), and issue START / STOP DATABASE (
http://dcx.sybase.com/index.html#1101en/dbreference_en11/start-database-statement.html
) SQL statements to bring the databases up and down for your tests.

Cheers,

--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/library/sql-anywhere-techcorner
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summary.do?baseprod=144&client=ianywhere&timeframe=0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/