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.

ISQL and bat files

4 posts in General Discussion Last posting was on 2005-05-06 16:50:21.0Z
Eddie Sizemore Posted on 2005-05-04 16:34:47.0Z
From: "Eddie Sizemore" <esizemoreno@spamqx.net>
Newsgroups: ianywhere.public.general
Subject: ISQL and bat files
Lines: 14
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-Original-NNTP-Posting-Host: 12-203-198-23.client.insightbb.com
Message-ID: <4278f9a4$1@forums-2-dub>
X-Original-Trace: 4 May 2005 09:34:44 -0700, 12-203-198-23.client.insightbb.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 4 May 2005 09:34:45 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 4 May 2005 09:34:47 -0700
X-Trace: forums-1-dub 1115224487 10.22.108.75 (4 May 2005 09:34:47 -0700)
X-Original-Trace: 4 May 2005 09:34:47 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4445
Article PK: 8254

Is there a way to use a bat file to start dbisql or dbisqlc and connect to a
server but not a db. I am trying to start a db run a script on the db then
stop it. I need to run the same script on many dbs. What is an easy way to
do that?



Eddie Sizemore

Sybase Central Version: 4.3.0.2398
Plug-in: Adaptive Server Anywhere 9
Plug-in Version: 9.0.2.3044


Reg Domaratzki (iAnywhere Solutions) Posted on 2005-05-04 17:58:53.0Z
From: "Reg Domaratzki \(iAnywhere Solutions\)" <Spam_bad_rdomarat@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <4278f9a4$1@forums-2-dub>
Subject: Re: ISQL and bat files
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Original-NNTP-Posting-Host: rdomarat-pc.sybase.com
Message-ID: <42790d5a@forums-2-dub>
X-Original-Trace: 4 May 2005 10:58:50 -0700, rdomarat-pc.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 4 May 2005 10:58:50 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 4 May 2005 10:58:53 -0700
X-Trace: forums-1-dub 1115229533 10.22.108.75 (4 May 2005 10:58:53 -0700)
X-Original-Trace: 4 May 2005 10:58:53 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4447
Article PK: 8256

You would use the utility database for this purpose.

ASA Database Administration Guide
Working with Database Files
Using the utility database
Connecting to the utility database

--
Reg Domaratzki, Sybase iAnywhere Solutions
Sybase Certified Professional - Sybase ASA Developer Version 8
Please reply only to the newsgroup

iAnywhere Developer Community : http://www.ianywhere.com/developer
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
-> Choose SQL Anywhere Studio
-> Set "Platform Preview" and "Time Frame" to ALL

"Eddie Sizemore" <esizemoreno@spamqx.net> wrote in message
news:4278f9a4$1@forums-2-dub...
> Is there a way to use a bat file to start dbisql or dbisqlc and connect to
a
> server but not a db. I am trying to start a db run a script on the db
then
> stop it. I need to run the same script on many dbs. What is an easy way
to
> do that?
>
>
>
> Eddie Sizemore
>
> Sybase Central Version: 4.3.0.2398
> Plug-in: Adaptive Server Anywhere 9
> Plug-in Version: 9.0.2.3044
>
>


Reg Domaratzki (iAnywhere Solutions) Posted on 2005-05-06 16:21:35.0Z
From: "Reg Domaratzki \(iAnywhere Solutions\)" <Spam_bad_rdomarat@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <4278f9a4$1@forums-2-dub>
Subject: Re: ISQL and bat files
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: rdomarat-pc.sybase.com
X-Original-NNTP-Posting-Host: rdomarat-pc.sybase.com
Message-ID: <427b998f$1@forums-1-dub>
Date: 6 May 2005 09:21:35 -0700
X-Trace: forums-1-dub 1115396495 10.25.99.235 (6 May 2005 09:21:35 -0700)
X-Original-Trace: 6 May 2005 09:21:35 -0700, rdomarat-pc.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4450
Article PK: 8265

I didn't really read your post properly. The utility_db is used to connect
to a server, but not a specific database. The following might be easier
though :

I'll assume you've already started a database server, and that all databases
have the same page size.

dbsrv9 -n MyServ

Now, just do the following in a batch file :

dbisql -nogui -c "eng=MyServ;dbf=c:\db\db1.db;uid=dba;pwd=sql" read file.sql
dbisql -nogui -c "eng=MyServ;dbf=c:\db\db2.db;uid=dba;pwd=sql" read file.sql
dbisql -nogui -c "eng=MyServ;dbf=c:\db\db3.db;uid=dba;pwd=sql" read file.sql
dbisql -nogui -c "eng=MyServ;dbf=c:\db\db4.db;uid=dba;pwd=sql" read file.sql
dbisql -nogui -c "eng=MyServ;dbf=c:\db\db5.db;uid=dba;pwd=sql" read file.sql

This will load each database on the server, execute the contents of file.sql
against the database, and then close the database. If you want to leave the
database mounted on the server, just add "autostop=no" in the connect
string.

--
Reg Domaratzki, Sybase iAnywhere Solutions
Sybase Certified Professional - Sybase ASA Developer Version 8
Please reply only to the newsgroup

iAnywhere Developer Community : http://www.ianywhere.com/developer
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
-> Choose SQL Anywhere Studio
-> Set "Platform Preview" and "Time Frame" to ALL

"Eddie Sizemore" <esizemoreno@spamqx.net> wrote in message
news:4278f9a4$1@forums-2-dub...
> Is there a way to use a bat file to start dbisql or dbisqlc and connect to
a
> server but not a db. I am trying to start a db run a script on the db
then
> stop it. I need to run the same script on many dbs. What is an easy way
to
> do that?
>
>
>
> Eddie Sizemore
>
> Sybase Central Version: 4.3.0.2398
> Plug-in: Adaptive Server Anywhere 9
> Plug-in Version: 9.0.2.3044
>
>


Eddie Sizemore Posted on 2005-05-06 16:50:21.0Z
From: "Eddie Sizemore" <esizemoreno@spamqx.net>
Newsgroups: ianywhere.public.general
References: <4278f9a4$1@forums-2-dub> <427b998f$1@forums-1-dub>
Subject: Re: ISQL and bat files
Lines: 118
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 12-203-198-23.client.insightbb.com
X-Original-NNTP-Posting-Host: 12-203-198-23.client.insightbb.com
Message-ID: <427ba04d$1@forums-1-dub>
Date: 6 May 2005 09:50:21 -0700
X-Trace: forums-1-dub 1115398221 12.203.198.23 (6 May 2005 09:50:21 -0700)
X-Original-Trace: 6 May 2005 09:50:21 -0700, 12-203-198-23.client.insightbb.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4451
Article PK: 8260

Thanks that is better than what I ended up doing. I did not know about the
dbf. I have always used dbn.

dbisql -c "uid=DBA;pwd=SQL;eng=GSIServer;dbn=utility_db" START ENGINE AS
UpdateServer STARTLINE "dbeng9 -gp 4096 -c 256M"

dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\Cons\Cons.db' ON UpdateServer
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\04\04.db' ON UpdateServer
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\05\05.db' ON UpdateServer
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\06\06.db' ON UpdateServer
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\08\08.db' ON UpdateServer
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\11\11.db' ON UpdateServer
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\12\12.db' ON UpdateServer
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\13\13.db' ON UpdateServer
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\13A\13A.db' ON UpdateServer
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\22\22.db' ON UpdateServer
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\23\23.db' ON UpdateServer
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\24\24.db' ON UpdateServer
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\25\25.db' ON UpdateServer
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=utility_db" START DATABASE
'D:\GSI\NLS\28\28.db' ON UpdateServer

dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=Cons" %1
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=04" %1
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=05" %1
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=06" %1
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=08" %1
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=11" %1
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=12" %1
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=13" %1
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=13A" %1
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=22" %1
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=23" %1
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=24" %1
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=25" %1
dbisql -c "uid=DBA;pwd=SQL;eng=UpdateServer;dbn=28" %1

"Reg Domaratzki (iAnywhere Solutions)" <Spam_bad_rdomarat@ianywhere.com>

wrote in message news:427b998f$1@forums-1-dub...
>I didn't really read your post properly. The utility_db is used to connect
> to a server, but not a specific database. The following might be easier
> though :
>
> I'll assume you've already started a database server, and that all
> databases
> have the same page size.
>
> dbsrv9 -n MyServ
>
> Now, just do the following in a batch file :
>
> dbisql -nogui -c "eng=MyServ;dbf=c:\db\db1.db;uid=dba;pwd=sql" read
> file.sql
> dbisql -nogui -c "eng=MyServ;dbf=c:\db\db2.db;uid=dba;pwd=sql" read
> file.sql
> dbisql -nogui -c "eng=MyServ;dbf=c:\db\db3.db;uid=dba;pwd=sql" read
> file.sql
> dbisql -nogui -c "eng=MyServ;dbf=c:\db\db4.db;uid=dba;pwd=sql" read
> file.sql
> dbisql -nogui -c "eng=MyServ;dbf=c:\db\db5.db;uid=dba;pwd=sql" read
> file.sql
>
> This will load each database on the server, execute the contents of
> file.sql
> against the database, and then close the database. If you want to leave
> the
> database mounted on the server, just add "autostop=no" in the connect
> string.
>
> --
> Reg Domaratzki, Sybase iAnywhere Solutions
> Sybase Certified Professional - Sybase ASA Developer Version 8
> Please reply only to the newsgroup
>
> iAnywhere Developer Community : http://www.ianywhere.com/developer
> iAnywhere Documentation :
> http://www.ianywhere.com/developer/product_manuals
> ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
> -> Choose SQL Anywhere Studio
> -> Set "Platform Preview" and "Time Frame" to ALL
>
> "Eddie Sizemore" <esizemoreno@spamqx.net> wrote in message
> news:4278f9a4$1@forums-2-dub...
>> Is there a way to use a bat file to start dbisql or dbisqlc and connect
>> to
> a
>> server but not a db. I am trying to start a db run a script on the db
> then
>> stop it. I need to run the same script on many dbs. What is an easy way
> to
>> do that?
>>
>>
>>
>> Eddie Sizemore
>>
>> Sybase Central Version: 4.3.0.2398
>> Plug-in: Adaptive Server Anywhere 9
>> Plug-in Version: 9.0.2.3044
>>
>>
>
>