성태의 닷넷 이야기
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] The Windows Registry Adventure #1: ...
[정성태] systemd for Developers I ; https:/...
[정성태] 엄밀히 object 타입의 인스턴스가 다른 타입으로 형변환 가능...
[정성태] 아래의 글에서 나오는 "Windows Application Pa...
[정성태] The history of calling conventions,...
[정성태] Secure and Deploy .NET Windows Form...
[정성태] Get Started with Milvus Vector DB i...
[정성태] cyberark/PipeViewer - A tool that...
[정성태] WinForms in a 64-Bit world – our st...
[정성태] 예제에서 SELECT_SQL도 내부적으로는 SqlCommand/...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
제니퍼 .NET
닷넷
COM 개체 관련
스크립트
VC++
VS.NET IDE
Windows
Team Foundation Server
디버깅 기술
오류 유형
개발 환경 구성
웹
기타
Linux
Java
DDK
Math
Phone
Graphics
사물인터넷
부모글 보이기/감추기
내용
<div style='display: inline'> <h1 style='font-family: Malgun Gothic, Consolas; font-size: 20pt; color: #006699; text-align: center; font-weight: bold'>SSMS로 DB 접근 시 The server principal "..." is not able to access the database "..." under the current security context.</h1> <p> 이런 오류가 발생한다면?<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Cannot connect to .... ADDITIONAL INFORMATION: The server principal "...[db_account]..." is not able to access the database "...[database]..." under the current security context. Cannot open user default database. Login failed. Login failed for user '...[db_account]...'. (Microsoft SQL Server, Error: 916) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=916&LinkId=20476 </pre> <br /> 해당 계정에 대해 기본 데이터베이스가 정해져 있지 않기 때문에 발생하는 것으로 권한 부족이 원인이므로 명시적으로 role을 부여하면 됩니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Azure / SQL Server / Cannot open user default database (Login failed) ; <a target='tab' href='https://blog.sqlserveronline.com/2017/10/26/azure-sql-server-cannot-open-user-default-database/'>https://blog.sqlserveronline.com/2017/10/26/azure-sql-server-cannot-open-user-default-database/</a> </pre> <br /> 또는, 위의 글에서도 나오지만 "Connection Properties" 탭을 통해 연결 대상이 되는 데이터베이스를 "default"가 아닌, 원래 권한이 있는 데이터베이스를 지정하면 됩니다.<br /> <br /> <hr style='width: 50%' /><br /> <br /> 참고로, 정상적인 권한 부여가 되지 않은 데이터베이스를 아래의 글에 설명했던,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Azure 데이터베이스를 로컬 DB로 이전하는 방법 ; <a target='tab' href='https://www.sysnet.pe.kr/2/0/1667'>https://www.sysnet.pe.kr/2/0/1667</a> </pre> <br /> bacpac 파일로 export하려고 시도하면 이런 오류가 발생합니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > TITLE: Microsoft SQL Server Management Studio Could not extract package from specified database. (Microsoft.SqlServer.Dac) ADDITIONAL INFORMATION: The reverse engineering operation cannot continue because you do not have View Definition permission on the '...' database. (Microsoft.Data.Tools.Schema.Sql) </pre> <br /> 아마도 (저도 해본 것은 아니라서) 명시적으로 권한 부여를 하면 될 것입니다. (혹은, 애당초 sa 계정으로 로그인해 처리하면 됩니다.)<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > // 세세하게 적용을 한다면? GRANT VIEW ANY DEFINITION TO [...db_account...] // 또는, 아예 db_owner 권한을 부여하려면? EXEC sp_addrolemember N'db_owner', N'azure_db_user' </pre> </p><br /> <br /><hr /><span style='color: Maroon'>[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]</span> </div>
첨부파일
스팸 방지용 인증 번호
9455
(왼쪽의 숫자를 입력해야 합니다.)