I'm following the steps listed in the wiki to backup the database but every time I try to run Backup I get Access denied errors. I am running Vista and using my administrator account.
Any suggestions?
Can't backup database?
Débuté par
PavelNovotny
, déc. 11 2009 12:26
#1
Posté 11 décembre 2009 - 12:26
#2
Posté 11 décembre 2009 - 12:34
Oh MSSQL, you cause such pain...
I'm not as experienced with troubleshooting database issues as Allan is, but my first suggestions would be to try changing the directory where the backup is being written to (set in config.ini), perhaps to someplace nice and simple like C:\\ as a temporary measure. Also perhaps try running the batch file explicitly in administrator mode (right-click and select "run as administrator").
I'm not as experienced with troubleshooting database issues as Allan is, but my first suggestions would be to try changing the directory where the backup is being written to (set in config.ini), perhaps to someplace nice and simple like C:\\ as a temporary measure. Also perhaps try running the batch file explicitly in administrator mode (right-click and select "run as administrator").
#3
Posté 11 décembre 2009 - 12:44
Won't let me change anything in config.ini - I get an error when I try to save it.
Cannot create...
Make sure the path and file name are correct.
Cannot create...
Make sure the path and file name are correct.
#4
Posté 11 décembre 2009 - 12:45
Won't let me run as an administrator either - that option is greyed out.
#5
Posté 11 décembre 2009 - 12:54
Weird. It could be that the directory the backup batch file is in is restricted in some way I'm not familiar with. We use Windows XP for development internally, in part because of the annoyance of these sorts of Vista shenanigans. 
Perhaps try copying the backup/restore directory somewhere else where Vista might not be so paranoid about letting you run or edit stuff?
Alternately, you can try running the SQL commands directly from the command line instead. The batch files really only exist to wrap a single SQL command in a convenient-to-run package.
http://social.biowar...kup_and_restore has the commands you'll need to do this. If it doesn't work, either check to ensure that sqlcmd.exe is in your path or run the command from the directory that sqlcmd.exe is in.
Perhaps try copying the backup/restore directory somewhere else where Vista might not be so paranoid about letting you run or edit stuff?
Alternately, you can try running the SQL commands directly from the command line instead. The batch files really only exist to wrap a single SQL command in a convenient-to-run package.
http://social.biowar...kup_and_restore has the commands you'll need to do this. If it doesn't work, either check to ensure that sqlcmd.exe is in your path or run the command from the directory that sqlcmd.exe is in.
#6
Posté 11 décembre 2009 - 04:25
Check if you have write privs on the folder (right-click -> properties on xp, don't know how on Vista). I don't know abt Vista but even some AV software like McAfee can make a drive write-protected on occasion -> you won't be able to write in that folder even if you are an admin then.
#7
Posté 11 décembre 2009 - 05:15
SQL will not let me do anything - it keeps saying that I don't have permission even though I am the administrator for this machine.
Is this a known problem with this version of SQL and Vista?
Is this a known problem with this version of SQL and Vista?
#8
Posté 11 décembre 2009 - 07:16
Here's the Error Message I get from the SQL Server Management Studio Express (just installed it to see if it helps).
TITLE: Microsoft SQL Server Management Studio Express
------------------------------
Backup failed for Server 'XXXXXXXXX\\BWDATOOLSET'. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft....er&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The server principal "XXXXXX\\XXXXXXXX" is not able to access the database "bw_dragonage_content" under the current security context. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft....00&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
TITLE: Microsoft SQL Server Management Studio Express
------------------------------
Backup failed for Server 'XXXXXXXXX\\BWDATOOLSET'. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft....er&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The server principal "XXXXXX\\XXXXXXXX" is not able to access the database "bw_dragonage_content" under the current security context. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft....00&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
#9
Posté 11 décembre 2009 - 09:27
PavelNovotny wrote...
Won't let me change anything in config.ini - I get an error when I try to save it.
Cannot create...
Make sure the path and file name are correct.
Just an idea here, but maybe config.ini needs to be saved as administrator. Start notepad (or whatever editing program you use) as administrator (right click, Run as administrator), open config.ini by using Open from notepad, and you'll be able to save it. Give it a try and see if this helps.
#10
Posté 11 décembre 2009 - 03:27
The problem seems to be that SQL is not recognizing me as an administrator and won't let me do anything.
I wonder if it's something about this version of SQL having difficulty with Vista security. Every time I try anything - even moving database related folders or files - I get an error.
I wonder if it's something about this version of SQL having difficulty with Vista security. Every time I try anything - even moving database related folders or files - I get an error.
#11
Posté 11 décembre 2009 - 04:28
I think I found the solution online:
backup/restore access denied SQL2005Express
Cannot open backup device 'C:\\Documents and Settings\\user.DOMAIN\\Local
Settings\\Temp\\Asc\\db_backup.bck'. Operating system error 5(Access is
denied.).
BACKUP DATABASE is terminating abnormally.
The account that sql server runs under probably does not have
permission to use that particular folder. Try opening up the services
dialog (type services.msc at the command line), and find the service
'SQL Server (SQLEXPRESS)' or something similar. If you click on
properties and then the logon tab, it will list the account that sql
server runs under - probably named 'NT Network Service'.
So now you can simply change the sql server logon to 'local system'.
You might also have to tick the 'allow service to interact with
desktop' button. This should allow the backup/restore procedure to
access the files because it is running as a normal application.
backup/restore access denied SQL2005Express
Cannot open backup device 'C:\\Documents and Settings\\user.DOMAIN\\Local
Settings\\Temp\\Asc\\db_backup.bck'. Operating system error 5(Access is
denied.).
BACKUP DATABASE is terminating abnormally.
The account that sql server runs under probably does not have
permission to use that particular folder. Try opening up the services
dialog (type services.msc at the command line), and find the service
'SQL Server (SQLEXPRESS)' or something similar. If you click on
properties and then the logon tab, it will list the account that sql
server runs under - probably named 'NT Network Service'.
So now you can simply change the sql server logon to 'local system'.
You might also have to tick the 'allow service to interact with
desktop' button. This should allow the backup/restore procedure to
access the files because it is running as a normal application.
#12
Posté 11 décembre 2009 - 04:55
Guess I spoke too soon - that didn't solve the problem either. :-P
#13
Posté 11 décembre 2009 - 08:47
Upgrading to SQL Express 2008 to see if that helps.
#14
Posté 11 décembre 2009 - 08:55
BryanDerksen wrote...
Oh MSSQL, you cause such pain...
He laughs in the face of danger
#15
Posté 11 décembre 2009 - 11:20
FINALLY got backup to work. I had to install SQL Express 2008, and the 2008 Express management one, and then I was able to change my permissions and get a backup.
Now to install the new toolset and see if Recover works as well. :-P
Now to install the new toolset and see if Recover works as well. :-P
#16
Posté 12 décembre 2009 - 12:08
Good luck!
MySQL woulda treated you better.
MySQL woulda treated you better.
#17
Posté 12 décembre 2009 - 12:19
Glad to see you were able to work through that. Once the obvious ideas were eliminated earlier in the thread, I'm afraid I was reduced to just sitting in the corner mumbling about Vista and MSSQL in my usual mixture of whimpering rage. I'll add "try the 2008 version" to my repertoire of suggestions.
#18
Posté 31 juillet 2010 - 11:54
If you get this error, I was able to back up the database using Microsoft SQL Management Studio but I had to run prog as Administrator.





Retour en haut






