백업 장치를 열 수 없습니다. 운영 체제 오류 5
아래는 .bak
데이터베이스 를 백업 (생성)하는 데 사용하는 쿼리입니다 .
그러나 실행할 때마다 항상이 오류 메시지가 나타납니다.
메시지 3201, 수준 16, 상태 1, 줄 1
백업 장치 'C : \ Users \ Me \ Desktop \ Backup \ MyDB.Bak'을 열 수 없습니다. 운영 체제 오류 5 (액세스가 거부되었습니다.).메시지 3013, 수준 16, 상태 1, 줄 1
백업 데이터베이스가 비정상적으로 종료됩니다.
이것은 내 쿼리입니다.
BACKUP DATABASE AcinsoftDB
TO DISK = 'C:\Users\Me\Desktop\Backup\MyDB.Bak'
WITH FORMAT,
MEDIANAME = 'C_SQLServerBackups',
NAME = 'Full Backup of MyDB';
미리 감사드립니다.
네, 방금이 점수를 받았습니다.
Windows 서비스를보십시오. 시작> 관리> 서비스
SQL Server (MSSQLSERVER)라는 목록에서 서비스를 찾으십시오. "로그온 방식"열을 찾으십시오 (목록에없는 경우 추가해야 함).
디렉토리에 권한을 부여해야하는 계정으로 탐색기> 속성> 공유 (및 보안)에서 마우스 오른쪽 버튼을 클릭하십시오.
참고 : 네트워크를 통과하는 경우 실제 디렉토리 및 공유에 권한을 부여하십시오.
적용 권한이 전파 될 때까지 기다렸다가 백업을 다시 시도하십시오.
참고 2 : 네트워크를 통해 백업 중이고 SQL이 "로컬 서비스"로 실행중인 경우 문제가 생길 수 있습니다 ... 권한을 할당하려고 시도하거나 로컬로 백업하고 xcopy를 SQL Server 외부에서 더 쉽게 수행 할 수 있습니다 ( 한 시간 후).
참고 3 : 네트워크 서비스로 실행 중이면 원격 시스템이 SQL Server의 네트워크 서비스를 인식하지 못합니다. 이 경우 실제 컴퓨터 자체에 대한 권한을 추가해야합니다 (예 : MyServer $.
시작 메뉴에서 SQL Server 폴더로 이동하고 구성 도구를 클릭하십시오. SQL Server 구성 관리자 선택 SQL Server 서비스에서 원하는 인스턴스에서 (다른 이름으로 로그온)을 로컬 시스템으로 변경하십시오.
SQL Server 서비스 계정에 폴더에 쓸 수있는 권한이 없습니다 C:\Users\Kimpoy\Desktop\Backup\
최근에이 문제가 있었지만 서버 A에서 백업 작업을 실행하고 있었지만 백업중인 데이터베이스는 서버 B에 서버 C의 파일 공유에있었습니다. 서버 A의 에이전트가 서버 B에게 백업을 실행하도록 지시하면 -sql 명령-서버 C에 백업을 쓰려고 시도하는 SERVER B에서 실제로 sql이 실행중인 서비스 계정
실제 BACKUP DATABASE 명령을 수행하는 SQL Server의 서비스 계정은 에이전트가 아니라 파일 시스템에 대한 권한이 필요합니다.
방금이 과정을 거치고있었습니다. 내 MSSQLSERVER 로그인 사용자가 있는지 확인 full access
했지만 여전히 문제가 발생했습니다. 대상을 C의 루트로 이동 한 후에 만 작동했습니다. 더 중요한 것은 모든 권한을 가진 공유가 있었지만 테스트로 "Everyone"을 시도한 경우에도 사용자 폴더에서 더 중요합니다.
내 문제가 "수정 된"것으로 간주되는지 모르겠지만 "작동 중"입니다.
이 글타래를 발견 한 다른 사용자를위한 참고 자료입니다.
Windows 10에서 SQL Express 2014 SP1과 동일한 문제에 직면합니다.
작동하는 솔루션
- 서비스를 입력하여 서비스 열기
- SQL Server (SQLExpress)를 찾아서 엽니 다.
- 로그온 탭으로 이동
- 로컬 시스템 계정을 선택하십시오 (또한 서비스가 데스크탑과 상호 작용하도록 허용 확인)
- 확인을 클릭하십시오. 서비스를 중지하십시오. 서비스를 다시 시작하십시오.
- 문제 해결됨
복원 프로세스를 수행 할 권한을 부여해야하는 사용자를 찾으려면 다음 단계를 수행하십시오.
SQL Server가 설치된 서버로 이동해야합니다. SQL Server 구성 관리자 찾기
다음으로 "SQL Server Services"로 이동해야합니다.
Under your SQL Server (MSSQLSERVER) instance there will be an account with column "Logon As", in my case it is NT Service\MSSQLSERVER.
That is the account which you need to add under Security tab of your source .bak location and give that user the "Read" permissions so that the backup file can be read.
Let's say your backup file is present at "D:\Shared" folder, then you need to give permissions like this:
I had a similar issue. I added write permissions to the .bak file itself, and my folder that I was writing the backup to for the NETWORK SERVICE user. To add permissions just right-click what file/directory you want to alter, select the security tab, and add the appropriate users/permissions there.
Here is what I did to by-pass the issue.
1) Go to backup
2) Remove the destination file-path to disk
3) Click on Add
4) In the File name: check box manually type in the backup name after ..\backup like below where Yourdb.bak is the database backup name
C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Backup\Yourdb.bak
5) Click on OK
Hope this helps!
I had the same issue and the url below really helped me.
It might help you as well.
I know it is not an exact solution but using external drive paths solves this problem.
BACKUP DATABASE AcinsoftDB
TO DISK = 'E:\MyDB.Bak'
WITH FORMAT,
MEDIANAME = 'C_SQLServerBackups',
NAME = 'Full Backup of MyDB';
Msg 3201, Level 16, State 1, Line 1 Cannot open backup device 'C:\Backup\Adventure_20120720_1024AM.trn'. Operating system error 5(Access is denied.). Msg 3013, Level 16, State 1, Line 1 BACKUP LOG is terminating abnormally.
I verified backup folder on C drive, Is new service account is having full control access permission or not?, I realized that "Test\Kiran" service account is not having Full control security permission.
Please follow the below steps to give full control to service account:
- Go to C drive, Right click on Backup folder.
- Select Security tab.
- Click on Edit button, new window will open.
- Click on Add button and enter Test\Kiran user account and click check name button, this will validate you entered user is existing or not, if it is existing it will show the user on window, select OK.
- Select you entered user name and select Full Control check box under allow.
Please check the access to drives.First create one folder and go to folder properties ,
You may find the security tab ,click on that check whether your user id having the access or not.
if couldn't find the your id,please click the add buttion and give user name with full access.
Share this folder and use UNC path, by example: \pc\backups\mydb.bak
Then You can stop share.
Not very elegant, but it resolves all permissions problems (You need to give permissions to share as well, as mentioned above)
I experienced this problem when the .BAK file was temporarily stored in a folder encrypted with BitLocker. It retained the encryption after it was moved to a different folder.
The NETWORK SERVICE account was unable to decrypt the file and gave this thoroughly informative error message.
Removing BitLocker encryption (by unchecking "Encrypt contents to secure data" in the file properties) on the .BAK file resolved the issue.
I have the same error. Following changes helped me to fix this.
I had to check Server Manager->Tool->Services and find the user ("Log On As" column) for service: SQL Server (SQLEXPRESS).
I went to the local folder (C:\Users\Me\Desktop\Backup) and added "NT Service\MSSQL$SQLEXPRESS" as the user to give Write permissions.
Hi you need to change the query from:
BACKUP DATABASE AcinsoftDB
TO DISK = 'C:\Users\Me\Desktop\Backup\MyDB.Bak'
to
BACKUP DATABASE AcinsoftDB
TO DISK = N'C:\Users\Me\Desktop\Backup\MyDB.Bak'
You have to add a N in front of the path works for me.
One of the reason why this happens is you are running your MSSQLSERVER Service not using a local system. To fix this issue, use the following steps.
- Open run using Windows + R
- Type services.msc and a services dialog will open
- Find SQL Server (MSSQLSERVER)
- Right click and click on properties.
- Go to Log on tab
- Select Local System account and click on "Apply" and "OK"
- Click on Stop link on the left panel by selecting the "SQL Server (MSSQLSERVER)" and Start it again once completely stopped.
- Enjoy your backup.
Hope it helps you well, as it did to me. Cheers!
SQL Server is not able to access (write) the backup into the location specified.
First you need to verify the service account on which the Sql server is running. This can be done by using Configuration manager or Services.msc.
or
Use below query :
SELECT DSS.servicename, DSS.startup_type_desc, DSS.status_desc, DSS.last_startup_time, DSS.service_account, DSS.is_clustered, DSS.cluster_nodename, DSS.filename, DSS.startup_type, DSS.status, DSS.process_id FROM sys.dm_server_services AS DSS;
Now look at the column service_account and note it down.
Go to the location where you are trying to take the backup.In your case : C:\Users\Me\Desktop\Backup
Right click--> Properties --> Security -->
Add the service account and provide read/write permissions. This will resolve the issue.
참고 URL : https://stackoverflow.com/questions/3960257/cannot-open-backup-device-operating-system-error-5
'Programing' 카테고리의 다른 글
브라우저 탭에 포커스가 있는지 감지 (0) | 2020.07.02 |
---|---|
에 jQuery UI 제출 대화 상자 (0) | 2020.07.02 |
NumPy Matrix와 Array 클래스의 곱셈은 어떻게 다릅니 까? (0) | 2020.07.02 |
Android Studio의 "구현되지 않은 메소드 추가"기능 (0) | 2020.07.02 |
사용자가 브라우저 기록으로 돌아갈 수 있는지 확인하는 방법 (0) | 2020.07.02 |