Linux SQL Server: can't show logs with SSMS - sql-server

Just installed SQLServer (Express edition, ver. 14.0.3030) on Ubuntu 16.04.3.
Usual operations work without errors: client connections and queries, AD integrated logins, backup/restores.
I can't show logs with SSMS (ver. 17.8.1) from Windows 10 Pro 1709 x64: expanding "Management" --> "SQL Server Logs" I get the following error:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
------------------------------
A severe error occurred on the current command.
The results, if any, should be discarded. (Microsoft SQL Server, Error: 0)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=14.00.3030&EvtSrc=MSSQLServer&EvtID=0&LinkId=20476
A search on Google lead to posts that suggested to run sys.xp_readerrorlog.
Here's the output:
EXEC sys.xp_readerrorlog
Msg 22004, Level 16, State 1, Line 0
Failed to open loopback connection. Please see event log for more information.
Msg 22004, Level 16, State 1, Line 0
Error log location not found.
SQLServer logs in /var/opt/mssql/log show nothing interesting.
Any suggestion?
UPDATE: tried connecting both with SQL authentication and Integrated AD authentication: same error.

Related

SQL Server 2019 service won't start

I just downloaded and installed SQL Server 2019 on my Windows 10 machine. But I was not able to connect to it via SSMS.
I went to the services and saw that "SQL Server (MSSQLSERVER)" service is not started. When I start the service it shows message
The SQL Server mssqlserver service on local computer started and stopped
I checked for event log and there is an error:
SQL Server is terminating a system or background task Logwriter Task due to errors in starting up the task (setup state 8).
In SQL ErrorLog I can see following lines that I think are relevant.
Error: 17312, Severity: 16, State: 1.
2019-11-04 01:12:49.11 spid2s SQL Server is terminating a system or background task AzureLeaseRenewalTask due to errors in starting up the task (setup state 8).
2019-11-04 01:12:49.11 spid1s CImageHelper::Init () Version-specific dbghelp.dll is not used
2019-11-04 01:12:49.11 spid2s Error: 28709, Severity: 16, State: 19.
2019-11-04 01:12:49.11 spid2s Dispatcher was unable to create new thread.
2019-11-04 01:12:49.13 spid1s ***Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\LOG\SQLDump0007.txt
2019-11-04 01:12:49.13 spid1s SqlDumpExceptionHandler: Process 1 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.

Microsoft ODBC Driver 13 for SQL Server : Login failed for user 'sa'

Im installing the MDM of Informatica.
MDM 10.2 - Jboss 6.4 EAP - SQL Server 11 - Windows Server 2008 R2.
During the creation of the schema 'sip_ant.bat create_bpm' i got this error
Microsoft ODBC Driver 13 for SQL Server : Login failed for user 'sa'.
(Same eeror with another user)
I already tried to use the Auth Mixed Mode and restarted the instance of the DB.
Error received is
D:\informatica\database\bin\common.xml:248: The following error occurred while executing this line:
D:\informatica\database\bin\mssql\database.xml:1214: Launched command return error code 1.
And that's the line of database.xml:1214 that refers:
collation_name="${activevos.collation}" param2=""${dbpath_short}"" param1="${activevos.password}">
Im able to login via SQLCMD on CMD with user 'sa' and other users.
MDM and SQL Server are on different Machine.
Any suggestion?
By default SQL Server will track failed logins and register it in the server log along with the reason. So check out your errorlog and look for errors 18456.
You can read the log by using SQL Server Management Studio by going to server, Management, SQL Server Logs, Current. Or any other way you prefer.
You'll find something like this:
2018-02-27 13:51:26.120 Logon Error: 18456, Severity: 14, State: 5.
2018-02-27 13:51:26.120 Logon Login failed for user 'fasd'. Reason: Could not find a login matching the name provided. [CLIENT: 10.80.62.89]
server=Yourservername,portnumber
You can put the above in your connection string
Problem was due to Customer configured another Default SQL port to use on SQL Management.

Unable to change Authentication Mode in SQL Server: Microsoft SQL Server, Error: 229

I have just installed SQL Server 2016 Service Pack 1 Express and SSMS 2017 using the Basic option from the installation wizard. After installation, I wanted to change the mode of authentication from Windows Authentication to SQL Server Authentication. I was following the steps given in the link: Change Server Authentication Mode from docs.Microsoft.com. Upon clicking OK after changing the authentication mode, I am getting the following error:
The EXECUTE permission was denied on the object 'xp_instance_regwrite', database 'mssqlsystemresource', schema 'sys'. (Microsoft SQL Server, Error: 229)
TITLE: Microsoft SQL Server Management Studio
------------------------------
Alter failed for Server 'SHASHANK-PC\SQLEXPRESS'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?
ProdName=Microsoft+SQL+Server&ProdVer=14.0.17213.0+((SSMS_Rel).171128-2020)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Alter+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
The EXECUTE permission was denied on the object 'xp_instance_regwrite', database 'mssqlsystemresource', schema 'sys'. (Microsoft SQL Server, Error: 229)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=13.00.4001&EvtSrc=MSSQLServer&EvtID=229&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
What to do?
After you rebooted are you logged back in as sa with the correct password for the sa account?
If you are then try:
GRANT EXECUTE ON xp_instance_regwrite TO [user]
(user being the user you are logged in as).
There was also an answer posted here: https://www.sqlservercentral.com/Forums/Topic1176585-391-1.aspx

Login failed for user 'XYZ' Error: 18456, Severity: 14, State: 5

I'm trying to map the content of a relational database to RDF using D2RQ.
To generate-mapping I'm using Command Prompt. I’m trying to access the SQL Server database but I’m getting the error:
Database Connection to jdbc:sqlserver://servername;databaseName=.. failed.
Login failed for user 'XYZ'.
I’ve checked the SQL error log:
Error: 18456, Severity: 14, State: 5.
Login failed for user 'NT Service\ReportServer'. Reason: Could not find a login matching the name provided. [CLIENT:192.168.29.1]
While in SQL Server i can open the database with this user.
Connection properties on SQL Server:
see Connection Properties on SQL Server
My team lead, pointed out the issue. As I could not find the issue/solution here, posting it for others.
I knew I could not use windows authentication, so I was trying to use SQL Server Authentication, this was the problem.
To access SSMS as a different user - When opening SSMS from your PC; Shift + right click > ‘Run as Different User’ enter ID ‘Admin1’ + password, proceed as normal.

Create User To Run SQL Migration Script Azure SQL

Currently moving a database to Azure SQL. I've generated a script to import the database. In SQL management studio, I've connected to the cloud database as the server admin. I try to run the script - though I get multiple errors such as -
ODBC error: State: 28000: Error: 18456 Message:'[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user '##MS_InstanceCertificate##'.'.
Msg 5069, Level 16, State 3, Line 11
and
Looking around I found;
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-manage-logins
I went through the steps to create a user and add to the role dbmanager.
I'm still getting the same errors when running the database import script.
As a heads up, I've run this script logged in as the server admin and as the user created by the server admin.
Any help is greatly appreciated.
The error message is a bit misleading, it hasn't (necessarily) something to do with certificates. In general, this error message says that connecting to the database with a certain user failed. So check...
if the user exists
if the username is spelled correctly
if the database you connect to exists
if the database name is spelled correctly

Resources