Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

Hello,

I have a Linux (Ubuntu) script that STARTS a collection of databases that operate in an HA server environment. To "be safe" there is a sleep(5) between each START but I'd like to know if that is actually necessary.

Thank you.

asked 06 Apr '17, 11:30

AlK's gravatar image

AlK
735313554
accept rate: 37%

How do you start a collection of databases (on an already running, I assume) via a shell script? I would think you would use the START DATABASE SQL statement for that, and such a statement would simply block the next statement until it is finished, so no artificial delay is needed...?

(06 Apr '17, 11:41) Volker Barth
Replies hidden

Thanks for the reply Volker.

Yes, this is done w/an Ubuntu Bash script with a series of dbisqls and START DATABASES. I pulled out my sleeps and everything just blasted right through and all dbs (per dblocate) came up with no problem (and, of course, much faster). The only issue is that a pair of terminal windows open up for each database (START on Primary and on Mirror) and they all open "at the same time". That would suggest that the START does not actually block but rather that the server is perhaps queuing up the STARTS. That's what makes me a bit nervous. Any ideas on this?

(06 Apr '17, 21:21) AlK

If your concern is related to the question whether databases can be started in parallel, why not use one single SQL batch to start all databases in sequential order?

(You could also use one "master" database which has a "DatabaseStart" event to start the "real" databases internally, not requiring a separate ISQL session. Of course such an event should be highly configurable... - Here's some discussion on such an event and the internal actions of starting several databases at the same time...)

permanent link

answered 07 Apr '17, 03:48

Volker%20Barth's gravatar image

Volker Barth
40.2k361549822
accept rate: 34%

converted 10 Apr '17, 02:47

Hi Volker,

Thanks for your input and especially for the link! If you can move your response to an "Answer" status I'd be happy to mark it as "the Answer"!

(09 Apr '17, 09:11) AlK

FWIW here is the code used to start 100 databases for a Foxhound regression test; it has worked flawlessly for years...

"%SQLANY16%\bin64\dbspawn.exe"^
  -f "%SQLANY16%\bin64\dbsrv16.exe"^
  -c 700M^
  -n ddd^
  -o dbsrv16_log.txt^
  -os 10M^
  -x tcpip^
  -zl^
  -zp^
  -zt^
  C:\projects\foxhound_100_V16_databases\ddd001.db

"%SQLANY16%\bin64\dbisql.com"^
  -c "ENG=ddd;DBN=ddd001;UID=dba;PWD=sql;LINKS=TCPIP"^
  -d1^
  READ ENCODING CP1252 $06s_script_start_ddd002_to_100.sql

"%SQLANY16%\bin64\dbisql.com"^
  -c "ENG=ddd;DBN=ddd001;UID=dba;PWD=sql;"

PAUSE
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd002.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd003.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd004.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd005.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd006.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd007.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd008.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd009.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd010.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd011.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd012.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd013.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd014.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd015.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd016.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd017.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd018.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd019.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd020.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd021.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd022.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd023.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd024.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd025.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd026.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd027.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd028.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd029.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd030.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd031.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd032.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd033.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd034.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd035.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd036.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd037.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd038.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd039.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd040.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd041.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd042.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd043.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd044.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd045.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd046.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd047.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd048.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd049.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd050.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd051.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd052.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd053.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd054.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd055.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd056.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd057.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd058.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd059.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd060.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd061.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd062.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd063.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd064.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd065.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd066.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd067.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd068.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd069.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd070.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd071.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd072.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd073.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd074.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd075.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd076.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd077.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd078.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd079.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd080.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd081.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd082.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd083.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd084.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd085.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd086.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd087.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd088.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd089.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd090.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd091.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd092.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd093.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd094.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd095.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd096.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd097.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd098.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd099.db' AUTOSTOP OFF;
START DATABASE 'C:/projects/foxhound_100_V16_databases/ddd100.db' AUTOSTOP OFF;
permanent link

answered 10 Apr '17, 08:23

Breck%20Carter's gravatar image

Breck Carter
32.5k5417261050
accept rate: 20%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×61

question asked: 06 Apr '17, 11:30

question was seen: 1,965 times

last updated: 10 Apr '17, 08:23