06-15-2012 02:23 AM
Hi all,
Yesterday we moved our OpsCenter database (running on Windows) to another disk device by changing the file C:\program Files\Symantec\OpsCenter\server\db\CONF\databases.conf, according to the Admin Manual.
All things work fine except for our dbbackup script:
E:\OpsCenterBackup>"C:\Program Files\Symantec\OpsCenter\server\bin\dbbackup.bat" E:\OpsCenterBackup
Backing up the OpsCenter database...
ERROR backing up the OpsCenter Database, Exiting...
Any ideas?
Solved! Go to Solution.
06-15-2012 02:41 AM
Most of the script uses variables based on the location of the .bat file
You either need to edit it, move the .bat file to the other drive, or both
Quite possibly both as it creates its own variables based on where it is run from and then locates everything else based upon that but it may need more from the system itself than the database so more likely that you need to specify the database location and its backup location and leave it where it is
It is relatively clear where it gets everything from so shouldnt be too difficult to edit after being moved
06-15-2012 02:30 AM
Does the dbbackup.bat file contain the location of the DB ?
If so, try changing it to the new location ...
Martin
ps. copy the file first ....
06-15-2012 02:41 AM
Most of the script uses variables based on the location of the .bat file
You either need to edit it, move the .bat file to the other drive, or both
Quite possibly both as it creates its own variables based on where it is run from and then locates everything else based upon that but it may need more from the system itself than the database so more likely that you need to specify the database location and its backup location and leave it where it is
It is relatively clear where it gets everything from so shouldnt be too difficult to edit after being moved
06-15-2012 02:58 AM
Yep, think your right, the location of the actual DB is not in the file, I've just looked.
It does have this though ...
set SERVER_INSTALL_DIR=%SERVER_INSTALL_DIR:"=%
06-15-2012 03:13 AM
I checked the dbbackup.bat file and it indeed uses many variables, but running the file from another location, as you suggested, generates another error which indicates that it is ment to ben run from the original location:
E:\OpsCenterBackup\Scripts>dbbackup.bat e:\opscenterbackup
'"E:\OpsCenterBackup\Scripts\\setEnv.bat"' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
"Could not find "=\config\db.conf file"
06-15-2012 03:18 AM
setenv.bat might be holding an interesting entry?
SET "DB_INSTALL_DIR=C:\PROGRA~1\Symantec\OPSCEN~1\server\db"
Since this dir is holding the data dir.
On the contrary, changing this makes the other subdirs in server\db inaccessible.
06-15-2012 03:20 AM
That pretty much what i was saying - probably best to leave it where it was and edit the database location paths / varaiables
You will need to read through carefully to undertsand what it is doing and edit as appropriate
06-15-2012 03:35 AM
Mark, it is odd. Symantec supplies a well-designed product and offers the possiblity to move the database by doing a documented change : modify 1 variable in the ...server\db\CONF\databases.conf file.
If the dbbackup script had to be modified as well, I trust it would be documented as well.
And in dbbackup the conf-file is read:
set SERVER_INSTALL_DIR=%SERVER_INSTALL_DIR:"=%
set /p OPSCENTER_DB_FILE=<"%SERVER_INSTALL_DIR%\db\conf\databases.conf"
set temp=
for %%f in (%OPSCENTER_DB_FILE%) do (
set temp=!temp!%%~f
set temp=!temp!
)
set temp=%temp%
set "OPSCENTER_DB_FILE=%temp%"
if not exist "%OPSCENTER_DB_FILE%" (
echo "%PRODUCT_NAME% database file %OPSCENTER_DB_FILE% does not exist"
exit /b 6
)
06-15-2012 03:38 AM
I agree with you - but can find no reference to the script needing changing after a database move - worth logging a call and getting them to do the work and clarify exactly which items need to be changed
I think it is straight forward but if it gets raised with Symantec they usually then add a tech note on what needs doing which will helpo others in the future
06-15-2012 03:42 AM
Ahh, well spotted, that could well be it ...
I was close ...
M