on 2016 May 13 2:40 PM
Am trying to test a restore script for a SQL Anywhere 11 database on our staging server. Here is my batch file:
EECHO restore db started >>db_restore_log.txt ATTRIB -R D:\\DonorCentral\\DB\\dctemp.db >>db_restore_log.txt RENAME D:\\DonorCentral\\DB\\dctemp.db old_dctemp.db >>db_restore_log.txt COPY C:\\DonorCentral\\DB\\dctemp.log C:\\DonorCentral\\DB\\old_dctemp.log >>db_restore_log.txt COPY D:\\DonorCentral\\Backup\\dctemp.db D:\\DonorCentral\\DB\\dctemp.db >>db_restore_log.txt "%SQLANY11%\\bin32\\dbsrv11.exe" -o db_restore_log.txt D:\\DonorCentral\\DB\\dctemp.db -a D:\\DonorCentral\\Backup\\dctemp.log "%SQLANY11%\\bin32\\dbsrv11.exe" -o db_restore_log.txt D:\\DonorCentral\\DB\\dctemp.db -a C:\\DonorCentral\\DB\\dctemp.log
Running this successfully does the file operations (i.e. ATTRIB, RENAME, COPY) and opens the database server console. However, it fails when trying to restore the transaction log from the backup. The message is "Cannot open transaction log file -- access is denied". The log from the backup is not read-only. Any ideas on problem and resolution?
Thanks, Tom
Request clarification before answering.
Thanks for the replies. I resolved this by running the batch file as an administrator.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FWIW, with Windows 10, I am getting THIS CLOSE to disabling UAC altogether:
HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System" -Name "EnableLUA" -Value "0"
On a computer used only by Administrator users it is hard to justify the existence of UAC... of all the hundreds (thousands?) of times it has gotten in my way, it has protected me ... exactly ... zero times.
User | Count |
---|---|
76 | |
30 | |
8 | |
8 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.