Home > database >  How to stop and start the SQL server in the PB
How to stop and start the SQL server in the PB

Time:10-05

Use the method of DOS are not enough, because the server to stop and start the takes time, not stop and start, PB is the following statement is executed, expert advice please

CodePudding user response:

I see the post every day, how no one back?

CodePudding user response:

Essentially I am not very well, do not know to have the method called directly, but DOS calls must be feasible and method is to write a bat file, the first sentence to stop or start the SQL server, the second sentence to establish an empty file

Pb in written like this:
1, delete as a symbol of the empty file
2, call batching
3, whether empty file exists, there continues to perform, otherwise the timeout to exit

CodePudding user response:

Can use DOS command!

Because the server is stopped and started takes time, not stop and start, PB is the following statement is executed the

The following statement? What is the content!

Really want to wait, can to the program for a period of delay

CodePudding user response:

Using DOS, I is to use the DOS to achieve!
The principle is this:
1. The run (" net stop mssqlserver)
2. My is xp system, run the window title to c: \ Windows \ system32 \ CMD exe
System here is different, the path will be different, you can call API function to get the system directory,
3. The use of API functions FindwindowA search title to c: \ Windows \ system32 \ CMD window exe, until the return to handle is not 0, that is, the DOS window has already started to run,
4. Reuse FindwindowA find c: \ Windows \ system32 \ CMD exe window, handle until the return to zero, the net stop.. Has finished running,
5. Run (" net start..
")Under the similar repeat 2-3
. After execution of programs

CodePudding user response:

Connect to the database of the place and then adjust the can solve this problem, the database=false

CodePudding user response:

One is the database=false inside there are a lot of some of the tuning you can carefully look at the

CodePudding user response:

Lz want?

CodePudding user response:

I don't know, to help
  • Related