반응형
로그인에서 요청한 데이터베이스 "[database name]"을(를) 열 수 없습니다. 로그인이 실패했습니다. 사용자 'user'이(가) 로그인하지 못했습니다.
- 로그인이 되지 않고 있어서 user 계정이 빠진 것인지 확인을 해보니, Role 에 권한이 빠져있음.
- 권한 추가를 체크 하고 적용 버튼을 누르니 sql server user group or role already exists in the current database 에러 발생 - DB에 사용자 user 계정 권한이 이미 존재하지만,백업 및 복원 과정에서 정상적으로 권한이 적용이 안된 케이스
** sp_change_users_login SP를 사용하여 데이터베이스 내 자동 매핑
use [DATABASE]
exec sp_change_users_login 'auto_fix', '[username]'
-- 결과창
The row for user '[username]' will be fixed by updating its login link to a login already in existence.
The number of orphaned users fixed by updating users was 1.
The number of orphaned users fixed by adding new logins and then updating users was 0.
반응형
'[DB] SQL SERVER' 카테고리의 다른 글
[MSSQL] SPN, Kerberos 접근 ERROR (1) | 2024.01.08 |
---|---|
[MSSQL] 백업 및 복구 진행률 확인 (0) | 2024.01.08 |
[MSSQL] 배치잡 실행 History 보존 기간 설정 (0) | 2023.11.08 |
[MSSQL] 배치잡 메뉴 보이지 않을 때 (public) (0) | 2023.09.05 |
[MSSQL] Identity column 초기화 (DBCC CHECKIDENT) (0) | 2023.07.31 |