Friday, February 13, 2009

Download details: Business Contact Manager Database Admin Tool

A while back I wrote about using Business Contact Manager in office 2007.  A few people in our office wanted to use it and wanted to be able to share their contacts as a workgroup.

Initially, we looked at it using the standard setup where one person basically has the ‘Master’ copy of the database, and the rest just share it.  Since our group is a small group, this looked like a good fit at first, but quickly we realized that if the master guy was out, there were problems sharing data and we lost our major advantage we had gained.

I then found this tool that allows you to create a database on a machine that doesn’t have office 2007 installed.  So I ran it on my file server and it worked perfectly.  Now people connect to the central database and keep in sync at all times.

The only thing is, that the database needs to be backed up properly.  I created this script and set it to run through the scheduler:

backup.cmd

   1: @echo off


   2:  


   3: set SQLCMD="c:\program files\microsoft sql server\90\tools\binn\sqlcmd.exe"


   4: set DBSERVER=MYSERVER


   5: set DBINSTANCE=MSSQLSERVER


   6: set DBPORT=1433


   7: set DBCONNECT=tcp:%DBSERVER%\%DBINSTANCE%,%DBPORT%


   8:  


   9: set DBNAME=%1


  10: set BACKUPPATH=E:\backup\bcm


  11: set BKFILE=%BACKUPPATH%\%DBNAME%.bak


  12: set BKRESULT=%BACKUPPATH%\%DBNAME%_BackupResult.txt


  13: set ZIPCMD=e:\software\util\7za.exe a -tzip


  14:  


  15: DEL %BKFILE%.zip


  16:  


  17: %SQLCMD% -E -S %DBCONNECT% -Q"SET NOCOUNT ON; SELECT '%DBNAME% Backup started at - ' + CONVERT(varchar, GETDATE());" > "%BKRESULT%"


  18:  


  19: %SQLCMD% -E -S %DBCONNECT% -Q"BACKUP DATABASE %DBNAME% TO  DISK = N'%BKFILE%' WITH FORMAT, INIT,  NAME = N'Full Database Backup', SKIP, STATS = 10" >> "%BKRESULT%"


  20:  


  21: %SQLCMD% -E -S %DBCONNECT% -Q"SET NOCOUNT ON; SELECT 'Backup completed at - ' + CONVERT(varchar, GETDATE());" >> "%BKRESULT%"


  22:  


  23: %ZIPCMD% %BKFILE%.zip %BKFILE% >> "%BKRESULT%"


  24:  


  25: DEL %BKFILE% >> "%BKRESULT%"


No comments: