Community
Showing results for 
Search instead for 
Do you mean 
Reply

Act 2012 possible to detach database via script?

New Member
Posts: 1
Country: USA

Act 2012 possible to detach database via script?

[ Edited ]

Does anyone know if it is possible to detach a database using a script (DOS like commands or otherwise, something that can be made into a batch file preferrably), as it seems whenever my backup sync software runs, it fails to always backup the adf and alf file as they are locked by being attached.

 

I've had to manually go into actdiag, detach, run the backup job, and re-attached the database, which is really annoying... I want to automate the process.

 

My idea is to run a script using Windows Task scheduler to detach, run the backup software to sync, then use task scheduler to re-attach (with proper timings between the three steps of course) so all is well.

 

Is this a bad way to go about it, any other idea's to resolve my issue... I am willing to hear them out.

 

TIA 

:-)

Platinum Elite Contributor
Posts: 14,384
Country: Australia

Re: Act 2012 possible to detach database via script?

The normal way is to use the ACT! Scheduler to run a backup of the database to a ZIP file ... then the backup software will backup that file.

The other way is to stop the SQL service before the backup and restart it after as per:
http://blog.glcomputing.com.au/2009/09/automating-backups-for-act-by-sage.html
Bronze Super Contributor
Posts: 1,679
Country: Australia

Re: Act 2012 possible to detach database via script?

I'd be inclinded to use a script like Mike's that stops and starts the ACT7 SQL service.

 

Although... with the new ACTDiag that comes with 2012, it now supports command line options, one of which is DETACH and antoher is ATTACH. I think however that it'll be easier using net stop and net start.

 

I've got more than few sites that use the ACT! Scheduler to do a 'regular' backup and a script to stop/start the SQL service and do a second more customised backup.

 

Ben.