Quantcast
Channel: Forum SQL Server Database Engine
Viewing all 15694 articles
Browse latest View live

CHECKDB after snapshot creation - normal ?

$
0
0

Is it normal for SQL Server to do a CHECKDB on a snapshot after the snapshot was created ? 

There is a powershell script at my customer site that runs snapshots each hour and today i see in the error log that its doing CHECKDB for 2 snapshots .. the CHECKDB finishes without errors. 

but why it doesnt run a checkdb for all? or why it starts to do a checkdb for these 2 snapshots this afternoon ? 


ilikefondue


Always on configuration for developer edition

$
0
0

Hi everyone,

Please let me know, can i configure always on in 2014 developer edition?

Service 'Microsoft.SqlServer.Management.IRegistrationService in SQL server management studio

$
0
0
Hello

I am using SQL server management studio 2012. All was working fine but just few hrs before deployement it stopped working. when i open SQL server management studio it does not loads any database inside it and shows and error 

Service 'Microsoft.SqlServer.Management.IRegistrationService' not found
(Microsoft.SqlServer.Management.SDK.SqlStudio)

TITLE: Microsoft SQL Server Management Studio
------------------------------
Service 'Microsoft.SqlServer.Management.IRegistrationService' not found (Microsoft.SqlServer.Management.SDK.SqlStudio)
------------------------------
BUTTONS:

OK
------------------------------

Please tell me how can i fix this

Sajid

ex_handle_except encountered exception C0000005 - Server terminating

$
0
0

Error: 17311, Severity: 16, State: 1.

SQL Server is terminating because of fatal exception c0000005. This error may be caused by an unhandled Win32 or C++ exception, or by an access violation encountered during exception handling. Check the SQL error log for any related stack dumps or messages. This exception forces SQL Server to shutdown. To recover from this error, restart the server (unless SQLAgent is configured to auto restart).
2019-10-03 11:07:53.95 Server      **Dump thread - spid = 0, EC = 0x0000000000000000

The SQLAGENT$InstanceName service on ServerName started and then stopped.

$
0
0

SQL Server 2012 on OS 2012

The port number of Analysis Services was changed to the same number as the SQL Server Engine and SQL Server Agent.  This was done by someone else and not me.  What happened was that the SQL Server Engine and Agent stopped.  I altered the port number for the SQL Server Engine and I got it working.  But I cannot start SQL Server Agent.  When I look at the log I get the following:

2014-09-25 15:37:37 - ? [100] Microsoft SQLServerAgent version 11.0.3431.0 (X64 unicode retail build) : Process ID 5172
2014-09-25 15:37:37 - ? [495] The SQL Server Agent startup service account is NT Service\SQLAgent$InstanceNameHere.
2014-09-25 15:37:37 - ! [150] SQL Server does not accept the connection (error: 64). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start.
2014-09-25 15:37:37 - ! [000] Unable to connect to server 'ServerNameHere\InstanceNameHere'; SQLServerAgent cannot start
2014-09-25 15:37:37 - ! [298] SQLServer Error: 26, Client unable to establish connection because an error was encountered during handshakes before login. Common causes include client attempting to connect to an unsupported version of SQL Server, server too busy to accept new connections or a resource limitation (memory or maximum allowed connections) on the server. [SQLSTATE 08001]
2014-09-25 15:37:37 - ! [298] SQLServer Error: 64, TCP Provider: The specified network name is no longer available. [SQLSTATE 08001]
2014-09-25 15:37:37 - ! [298] SQLServer Error: 26, Client unable to establish connection [SQLSTATE 08001]
2014-09-25 15:37:37 - ! [298] SQLServer Error: 64, Client unable to establish connection due to prelogin failure [SQLSTATE 08001]
2014-09-25 15:37:37 - ! [382] Logon to server 'ServerNameHere\InstanceNameHere' failed (DisableAgentXPs)
2014-09-25 15:37:37 - ? [098] SQLServerAgent terminated (normally)

I have looked at various solutions and they don't seem to fix it.  Can anyone point me in the right direction?


lcerni

Polybase feature

$
0
0

Hello Team,

I need to comission Database with Polybase feature enabled. The data size will be around 3 TB.

Can you suggest minimum s/w requirements like RAM , Processer etc etc.


Regards,

sql server reporting service

$
0
0

Hi All,

We were receiving many tickets saying sql reporting service was down yesterday.

Its reported that the sql reporting service was automatically restarting for sometime yesterday.

We see a msg 'Service started successfully' with event id: 0 intermittently for 2 hours. There were no logs that the service got stopped. We have only logs saying the service started successfully.

We dont see any errors except the below in eventvwr when the reporting service was restarted:

(Application error)
Faulting application name: SQLPS.exe, version: 12.0.2000.8, time stamp: 0x5306bda0
Faulting module name: KERNELBASE.dll, version: 6.3.9600.19358, time stamp: 0x5ccfa112

(.Net Runtime error)
Application: SQLPS.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.OutOfMemoryException

Could you please help me in understanding the cause?


rewritebatchedstatements parameter is not working

$
0
0

Hi, 
As part of performances story, we have made batch inserts instead of single inserts in our java code.

Please find Sample code code:

String myConnectionString ="jdbc:sqlserver://mbaastest18.konylabs.net:1433;databasename=TOMCATmfreportsdbSINGLEX56";try(Connection con =DriverManager.getConnection(myConnectionString,"root","whatever")){try(PreparedStatement ps = con.prepareStatement("INSERT INTO jdbc (`name`) VALUES (?)")){for(int i =1; i <=5; i++){
            ps.setString(1,String.format("Line %d: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
                    i));
            ps.addBatch();}
        ps.executeBatch();}}

But the real problem is insertion is happening like below

INSERT INTO jdbc (`name`) VALUES ('Line 1: Lorem ipsum ...')
INSERT INTO jdbc (`name`) VALUES ('Line 2: Lorem ipsum ...')

But I need something like below. So, I tried attaching rewritebatchedstatements parameter to the connection url,it worked for mysql but not working sql server.

INSERTINTO jdbc (`name`)VALUES('Line 1: Lorem ipsum ...'),('Line 2: Lorem ipsum ...')

Is there any way to make it work?

I have read about bulk copy command, but currently we cannot afford to use it.
Any help would be appreciated. 


In-Mmory OLTP tables is crashing a database

$
0
0

Hi Experts,

Our database is going to suspect mode after SQL is getting restarted.

Further scrutinizing, we could see surplus space in OLTP In-memory filegroup.So kindly help to check on the issue based on below logs.

Failed to create new file 'K:\MSSQL13.MSSQLSERVER\MSSQL\Data\XXXXXX_mod_dir\$HKv2\{0A5F80AB-2DB8-421E-AB01-C9EC2ED1F215}.hkckp'. Error code: 0x88000028. (e:\b\s3\sources\sql\ntdbms\hekaton\stglib\stgutil.cpp : 171)
[WARNING] Database ID: [6]. Container ID: [{B63A9CA0-1367-4348-A464-6F7254D786F4}]. Container Path: [K:\MSSQL13.MSSQLSERVER\MSSQL\Data\XXXXXX_mod_dir\$HKv2\]. Failed to allocate free file in container, will try again later. Error: 0x88000028. (e:\b\s3\sources\sql\ntdbms\hekaton\stglib\freefilemgr.cpp : 725)
   [WARNING] Database ID: [6]. Failed to create new file 'K:\MSSQL13.MSSQLSERVER\MSSQL\Data\XXXXXX_mod_dir\$HKv2\{3E9AB42B-2830-469F-8E3F-3FAA3AB7606D}.hkckp'. Error code: 0x88000028. (e:\b\s3\sources\sql\ntdbms\hekaton\stglib\stgutil.cpp : 171)
[WARNING] Database ID: [6]. Container ID: [{B63A9CA0-1367-4348-A464-6F7254D786F4}]. Container Path: [K:\MSSQL13.MSSQLSERVER\MSSQL\Data\XXXXXX_mod_dir\$HKv2\]. Failed to allocate free file in container, will try again later. Error: 0x88000028. (e:\b\s3\sources\sql\ntdbms\hekaton\stglib\freefilemgr.cpp : 725)
  [WARNING] Database ID: [6]. Failed to create new file 'K:\MSSQL13.MSSQLSERVER\MSSQL\Data\XXXXXX_mod_dir\$HKv2\{F45E0049-CB14-4286-BC31-D5678D81601E}.hkckp'. Error code: 0x88000028. (e:\b\s3\sources\sql\ntdbms\hekaton\stglib\stgutil.cpp : 171)
  [WARNING] Database ID: [6]. Container ID: [{B63A9CA0-1367-4348-A464-6F7254D786F4}]. Container Path: [K:\MSSQL13.MSSQLSERVER\MSSQL\Data\XXXXXX_mod_dir\$HKv2\]. Failed to allocate free file in container, will try again later. Error: 0x88000028. (e:\b\s3\sources\sql\ntdbms\hekaton\stglib\freefilemgr.cpp : 725)
[WARNING] Database ID: [6]. Failed to create new file 'K:\MSSQL13.MSSQLSERVER\MSSQL\Data\XXXXXX_mod_dir\$HKv2\{50E2314D-4916-46D2-BF5E-2034CC484F3D}.hkckp'. Error code: 0x88000028. (e:\b\s3\sources\sql\ntdbms\hekaton\stglib\stgutil.cpp : 171)
  [WARNING] Database ID: [6]. Container ID: [{B63A9CA0-1367-4348-A464-6F7254D786F4}]. Container Path: [K:\MSSQL13.MSSQLSERVER\MSSQL\Data\XXXXXX_mod_dir\$HKv2\]. Failed to allocate free file in container, will try again later. Error: 0x88000028. (e:\b\s3\sources\sql\ntdbms\hekaton\stglib\freefilemgr.cpp : 725)
  [WARNING] Database ID: [6]. Failed to create new file 'K:\MSSQL13.MSSQLSERVER\MSSQL\Data\XXXXXX_mod_dir\$HKv2\{031AEB33-4670-4B73-A644-16545EB9C794}.hkckp'. Error code: 0x88000028. (e:\b\s3\sources\sql\ntdbms\hekaton\stglib\stgutil.cpp : 171)
 [WARNING] Database ID: [6]. Container ID: [{B63A9CA0-1367-4348-A464-6F7254D786F4}]. Container Path: [K:\MSSQL13.MSSQLSERVER\MSSQL\Data\XXXXXX_mod_dir\$HKv2\]. Failed to allocate free file in container, will try again later. Error: 0x88000028. (e:\b\s3\sources\sql\ntdbms\hekaton\stglib\freefilemgr.cpp : 725)
  [WARNING] Database ID: [6]. Failed to create new file 'K:\MSSQL13.MSSQLSERVER\MSSQL\Data\XXXXXX_mod_dir\$HKv2\{AB62B3CF-C4EF-4BC5-A949-4BDF8D6A3D8D}.hkckp'. Error code: 0x88000028. (e:\b\s3\sources\sql\ntdbms\hekaton\stglib\stgutil.cpp : 171)
 [WARNING] Database ID: [6]. Container ID: [{B63A9CA0-1367-4348-A464-6F7254D786F4}]. Container Path: [K:\MSSQL13.MSSQLSERVER\MSSQL\Data\XXXXXX_mod_dir\$HKv2\]. Failed to allocate free file in container, will try again later. Error: 0x88000028. (e:\b\s3\sources\sql\ntdbms\hekaton\stglib\freefilemgr.cpp : 725)
[INFO] Database ID: [6]. Failed to open/create file of type '2' in container 'K:\MSSQL13.MSSQLSERVER\MSSQL\Data\XXXXXX_mod_dir\$HKv2\'. Error code: 0x88000028. Retrying the operation (1).

So kindly do check and let us know if you need any more information on this matter.Thank you

Regards,

Naren poosa

Security related question

$
0
0
Hi All,

This is Security related question. Please help.

Is the below command equivalent to EXEC sp_change_users_login 'Update_One', 'dbuser', 'login';    ?

USE [DatabaseName]
ALTER USER [DbUserName]
WITH LOGIN = [LoginName]

if so, from which version MICROSOFT has changed this ? does both commands use to fix a orphan user?

Thanks,

Sam

BULK INSERT error when the file location changed to remote share

$
0
0

I am getting following error on BULK INSERT now that the file location was changed to remote share. Before it used to a shared folder in local drive and we never ran into this issue. I have made sure both SQL server and file permissions are in place. I am running this BULK INSERT from my local PC connecting to SQL Server via SSMS.

Before when I ran this command from SSMS, it was \\SQLServer\FTP location which was a shared folder in local drive in that SQL Server but now I changed the file location to a network share \\Fileshare\FTP and have the above error but both SQL service account(domain account) and me(domain account) have elevated permission on that new location.

Any help or suggestions!!

Thanks,

--Anup


Repair msdb database that is labeled Suspect

$
0
0

Can "Suspect" msdb be successfully repaired if there is no backup of the database?

Can you please send me the process that I should follow to repair the database?

Problem with Data Migration Assistant - SQL

$
0
0

Hello,
I am doing an assessment to migrate my SQL Server 2005 database, use DMA but it does not finish the full analysis, but it gives the error below. There is very little documentation on this, and I have not been able to obtain a solution.

Can someone tell me what I can do, thank you in advance:

The assessment of database 'basededatos' on server 'instanciaA' failed.
Failed to collect data against Node 'basededatos' ('Database_SqlInstance__basededatos').  It was retried 0 time(s). The following error occurred:

Generic SQL exception. Node=basededatos UniqueName=Database_SqlInstance__basededatos SqlError=195.
Type=Microsoft.Sirona.Collection.CollectionException

Server stack trace: 
   en Microsoft.Sirona.Collection.DataCollectorBase.Collect(INode node, IDataNodeReference existingReference)
   en Microsoft.Sirona.Workflow.Activities.Collection.DataCollectorActivity`1.ExecuteDataCollector(T dataCollector, INode node, IDataNodeReference existingReference)
   en System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   en System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
Exception rethrown at [0]: 
   en System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
   en System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
   en Microsoft.Sirona.Workflow.Activities.Collection.DataCollectorActivity`1.CollectMethodCaller.EndInvoke(IAsyncResult result)
   en Microsoft.Sirona.Workflow.Activities.Collection.DataCollectorActivity`1.EndExecute(NativeActivityContext context, IAsyncResult result)
   en Microsoft.Sirona.Workflow.Activities.Core.AsyncNativeActivity.BookmarkResumeToComplete(NativeActivityContext context, Bookmark bookmark, Object state)
   en System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

+Generic SQL exception. Node=basededatos UniqueName=Database_SqlInstance__basededatos SqlError=195
+Type=Microsoft.Sirona.Collection.PrerequisiteException

+   en Microsoft.Sirona.DataCollectors.SqlDataCollector.ExecuteSql(INode node, XmlWriter writer)
   en Microsoft.Sirona.DataCollectors.SqlDataCollector.LockNodeAndExecuteSql(INode node, XmlWriter writer)
   en Microsoft.Sirona.DataCollectors.SqlDataCollector.CollectInternal(INode node, IDataNodeReference reference)
   en Microsoft.Sirona.Collection.DataCollectorBase.ImpersonateAndCollect(INode node, IDataNodeReference reference)
   en Microsoft.Sirona.Collection.DataCollectorBase.Collect(INode node, IDataNodeReference existingReference)

++'object_schema_name' is not a recognized built-in function name.
Incorrect syntax near the keyword 'AS'.
Incorrect syntax near 'os'.
++Type=System.Data.SqlClient.SqlException
++   en System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   en System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   en System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   en System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   en System.Data.SqlClient.SqlDataReader.get_MetaData()
   en System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   en System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   en System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   en System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   en System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   en Microsoft.Sirona.DataCollectors.SqlDataCollector.ExecuteSql(INode node, XmlWriter writer)

How to change the MSSQLSERVER Service Startup Account from NT Service\MSSQLSERVER to custom Windows account ?

$
0
0

Hello


Can you let me know an easy method to change the MSSQLSERVER Service Startup Account from NT Service\MSSQLSERVER to a custom Windows account in 2016 version ? Here are my requirements.


1) Create a new Windows O.S account called sqlserver_owner.

2) But do Not make it part of the administrators group.

3) Create an SQL Server login principle with SYSADMIN fixed server role for this sqlserver_owner account. 

I went to SQL Server configuration manager and chosen the SQL Server (MSSQLSERVER) account => right click and tried to change from NT Service\MSSQLSERVER to sqlserver_owner. It changed it. 

4) Now when i login to the Windows server using sqlserver_owner, i am not able to stop and start this service. When i try from windows component services, the stop and start buttons are greyed out.  When i try to click on SSMS => right click => restart , it asks for Administrator's password.

Basically, i would like to use a custom Windows login name as the MSSQLSERVER service owner, but not make it part of Windows administrators group.  Is it not possible in SQL server 2016 version ?

For audit compliance databases, i do not want to make it part of Windows administrators group for segregation of duties. The DBA login should not be part of Windows administrators group

I have seen this article https://msdn.microsoft.com/en-us/library/ms143504.aspx , but it has several steps and a series of permissions to be granted to sqlserver_owner to make it equal in nature to NT Service\MSSQLSERVER . But that is very lengthy and I hoping for a simple solution.

In older versions such as 2008, all that i had to do was add to SQLServerMSSQLUser$ComputerName$InstanceName and SQLServerSQLAgentUser$ComputerName$InstanceName groups.

-Srini


Waiting queries

$
0
0
Do waiting queries increase CPU load ? How to reduce wait time of waiting queries ? 

T-SQL query to Get RowCount and When Last Table was Updated DateTime?

$
0
0

Query to Get RowCount and When Last Table was Updated DateTime

IF OBJECT_ID('tempdb.dbo.#TableLastUpdated', 'U') IS NOT NULL
 DROP TABLE #TableLastUpdated

SELECT OBJECT_NAME(OBJECT_ID) AS TableName, 
       MAX(last_user_update) AS Last_User_Update
INTO #TableLastUpdated
FROM sys.dm_db_index_usage_stats
GROUP BY OBJECT_NAME(OBJECT_ID)


SELECT T.name AS TableName, 
       I.rows AS NumberOfRows,
   tlu.Last_User_Update

FROM sys.tables AS T
     INNER JOIN sys.sysindexes AS I ON T.object_id = I.id
                                       AND I.indid < 2
     LEFT JOIN #TableLastUpdated tlu ON tlu.TableName = T.name
ORDER BY Last_User_Update ASC

Is there any other way to find out this..? Don't want to scan each and every table.


Thanks Shiven:) If Answer is Helpful, Please Vote

SQL Server 2019 Polybase Performance issues with wide external tables on Oracle

$
0
0

SQL Server 2019 Polybase Performance issues with wide external tables on Oracle.

We are testing Polybase performance and we have an issue with wide ORACLE tables (100+ columns) - they perform very slowly, and take minutes to execute a simple select statement whereas accessing the same ORACLE table through a narrow external table is much faster.

We ultimately need to expose all of the columns from ORACLE tables.

What can we do to make performance of wide External Tables better?

RAM, CPU, Disk IO increase didn't make any difference to performance...

Thanks in advance!

Connectivity troubleshooting help

$
0
0
Hi All,

Today, Users are complaining about intermitent database connectivity issues from tomcat application server which is deployed on Linux.
Database server is running on Windows Server 2016 DataCenter edition and Sql Server 2012 Enterprise Edition SP4.

I checked few things from sql server side.  

- Able to PING db server
- Able to TELNET on 1433
- sql server services are up and running
- Tcp protocol is enabled
- Its a Default instance, running on port # 1433, able to connect using ssms ,
- Able to do .udl test from another window machine it works fine.
- Added port 1433 as an exception in firewall on Server.

As a whole I don't see any issue with sql server nor any errors in SQL Server ERRORLOG. Error seems to be not a SQL error but an error generated by informatica tool itself.
However, one of the application developer is complaining that they are seeing connectivity errors from Application srv.
They run informatica ETL tool and try to make db connection to DB Server.

Their application log has some similar errors

Error message from application log from app team
=====================================================
Error connecting to database [
[Informatica][ODBC 20101 driver]7505
Database driver error...
Function Name : Connect
Database driver error...
Function Name : Connect
Database Error: Failed to connect to database using user [kevin] and connection string [crmprod].].

Moreover, db team doesnt have any access on app server which is running on Linux.

After doing some research found this resoure. Not sure how much it will be useful.
https://kb.informatica.com/solution/23/pages/65/527185.aspx

How to approach or fix this issue? what additional questions can be asked to isolate that this is not a sql issue and it's an error thrown by Informatica tool?
Other question is, how to test connectivity issues to SQL Server on Linux box?

Appreciate your help here.

Thanks,
Sam


Insufficient space for logs in a restore. how can get rid of the logs?

$
0
0

Hi guys, 

When I try to restore a database in the Dev Environment it gives error:

There is insufficient space in E:\\Logs....

Is there a way to restore the database from a backup without the logs (which I don't need in the dev environment).

Many Thanks

SqlPS Invoke-SqlCmd stops all output if the first SELECT in a batch returns now rows

$
0
0

I just lost half my day chasing this insane bug.  I tried upgrading to the recommended SqlServer powershell module to see if it fixes it, but all that seemed to do was break both SqlPS and SqlServer modules.

In the case where you have a script that contains multiple PRINT and SELECT statements, and the first SELECT returns no rows, all following SELECTs and PRINTs are silently ignored.

For example:

>> Invoke-Sqlcmd -ServerInstance . -Database 'pureprod' -query "
>>  PRINT 'firstprint'
>>  SELECT 'firstselect' where 0 = 1
>>  PRINT 'secondprint'
>>  SELECT 'secondselect'
>>  PRINT 'thirdselect'
>>  SELECT 'thirdselect'
>>  PRINT 'fourthprint'
>>  " -verbose

gives just

VERBOSE: firstprint

Viewing all 15694 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>