I want to assume that your SQL is running on a seperate box than your BES box. We do weekly reboots each data center has a different night.
The scripts are easy to write here is a pretty good reference guide labmice.techtarget.com/articles/batchcmds.htm You can google and find more info on domino or sql maint, also go to lotus' web page.
Here are some samples to get you started.
You should break them all up into different .cmd files and then use a at commands to schedule them.
Code:
To stop services use this command:
Net Stop "<Service name you want to stop>"
After you stop the services:
Use NSD -kill to ensure the domino portions has stopped
To reboot box
C:\windows\System32\tsshutdn.exe 30 /SERVER:<Server Name> /REBOOT /DELAY:30 /V
Maint on the box like fixup updall and compact
<Change to drive of data>
f:
cd\lotus\domino\data
ncompact mail1.box -t -U -c >> d:\scripts\srvmaintp.log
ncompact mail2.box -t -U -c >> d:\scripts\srvmaintp.log
ncompact log.nsf -T -U -c >> d:\scripts\srvmaintp.log
ncompact BES\BlackBerryOutbox.nsf -U -c >> d:\scripts\srvmaintp.log
ncompact BES\BlackBerryProfiles.nsf -U -c >> d:\scripts\srvmaintp.log
ncompact BES\BBdir.nsf -U -c >> d:\scripts\srvmaintp.log
ncompact BES\BBstats.nsf -U -C >> d:\scripts\srvmaintp.log
nupdall BES\BlackBerryOutbox.nsf -R >> d:\scripts\srvmaintp.log
nupdall BES\BlackBerryProfiles.nsf -R >> d:\scripts\srvmaintp.log
nupdall BES\BBdir.nsf -R >> d:\scripts\srvmaintp.log
nupdall BES\BBstats.nsf -R >> d:\scripts\srvmaintp.log
nfixup BES\BlackBerryOutbox.nsf >> d:\scripts\srvmaintp.log
nfixup BES\BlackBerryProfiles.nsf >> d:\scripts\srvmaintp.log
nfixup BES\BBdir.nsf >> d:\scripts\srvmaintp.log
nfixup BES\BBstats.nsf >> d:\scripts\srvmaintp.log