Quantcast
Channel: SQL Server Database Engine forum
Viewing all 12554 articles
Browse latest View live

not sure if applies to this forum or tsql

$
0
0
 

 

 I have been trying to find the top 10 worst performing procedures with this code.

Sql2012

SELECT TOP 10 *
FROM 
(
    SELECT 
         DatabaseName       = DB_NAME(qt.dbid)
        ,ObjectName         = OBJECT_SCHEMA_NAME(qt.objectid,dbid) + '.' + OBJECT_NAME(qt.objectid, qt.dbid)
        ,DiskReads          = SUM(qs.total_physical_reads)   -- The worst reads, disk reads
        ,MemoryReads        = SUM(qs.total_logical_reads)    --Logical Reads are memory reads
        ,Executions         = SUM(qs.execution_count)
        ,IO_Per_Execution   = SUM((qs.total_physical_reads + qs.total_logical_reads) / qs.execution_count)
        ,CPUTime            = SUM(qs.total_worker_time)
        ,DiskWaitAndCPUTime = SUM(qs.total_elapsed_time)
        ,MemoryWrites       = SUM(qs.max_logical_writes)
        ,DateLastExecuted   = MAX(qs.last_execution_time)
    FROM sys.dm_exec_query_stats AS qs
    CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt
    GROUP BY DB_NAME(qt.dbid), OBJECT_SCHEMA_NAME(qt.objectid,dbid) + '.' + OBJECT_NAME(qt.objectid, qt.dbid)

) T
ORDER BY IO_Per_Execution DESC
 The top one on the list has databaseName null and objectname null yet memoryreads,executions and IO_per_execution
are big numbers. How can I find which process it is?
 Thanks.


IIS thrown htttp 500 error

$
0
0

lot of 500 (internal server error) thrown for particular  page  with post method,

is 500 error due to db error?


in iis log :

2018-12-05 23:45:30 10.240.0.10 POST /shared/tickets/eval_condition - 443 - 96.71.57.33 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/70.0.3538.110+Safari/537.36 
https://admin.maxiwel.com/pops/orders/create_ticket?id=3507609 500 0 0 46

Error: 845, Severity: 17, State: 1: One or more recovery units belonging to database 'TP1' failed to generate a checkpoint

$
0
0

Hi experts,

  I got an error message and the error message is ambiguous. I google and find a lot of discussions but I don't know how to troubleshoot.

( https://support.microsoft.com/en-za/help/310834/description-of-common-causes-of-sql-server-error-message-844-or-error )

I run our SAP on SQL with HPE DL580. Please give me a guideline and any information is appreciated. I upload my complete errorlog on google drive( https://drive.google.com/file/d/1EKLhIGBxsEFYaJ6EIEPxUREqj0HOlLSj/view?usp=sharing )

By the way, database files and transaction log both are located on PCIe SSDs.

--- systeminfo ---

Processor(s):              4 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 85 Stepping 4 GenuineIntel ~2494 Mhz
                           [02]: Intel64 Family 6 Model 85 Stepping 4 GenuineIntel ~2494 Mhz
                           [03]: Intel64 Family 6 Model 85 Stepping 4 GenuineIntel ~2494 Mhz
                           [04]: Intel64 Family 6 Model 85 Stepping 4 GenuineIntel ~2494 Mhz

Total Physical Memory:     3,145,395 MB

---

"Windows Server 2016 Version 1607(OS Build 14393.2395)"

SQL: "Microsoft SQL Server 2012 (SP3-CU10) (KB4025925) - 11.0.6607.3 (X64) 

Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 <X64> (Build 14393: )"

--- when the problem occurred ---

2018-12-07 10:15:26.97 spid20s     Error: 5901, Severity: 16, State: 1.
2018-12-07 10:15:26.97 spid20s     One or more recovery units belonging to database 'TP1' failed to generate a checkpoint. This is typically caused by lack of system resources such as disk or memory, or in some cases due to database corruption. Examine previous entries in the error log for more detailed information on this failure.
2018-12-07 10:15:26.97 spid20s     Error: 845, Severity: 17, State: 1.
2018-12-07 10:15:26.97 spid20s     Time-out occurred while waiting for buffer latch type 3 for page (16:880781), database ID 5.

--- partial errorlog ---

2018-12-07 10:15:13.93 spid20s     A time-out occurred while waiting for buffer latch -- type 3, bp 0000013662FA21C0, page 16:880781, stat 0xb, database id: 5, allocation unit Id: 72057643394072576, task 0x00000133A2455498 : 1, waittime 300 seconds, flags 0x100000001a, owning task 0x00000133A1A4D498. Not continuing to wait.
2018-12-07 10:15:13.97 spid20s     Using 'dbghelp.dll' version '4.0.5'
2018-12-07 10:15:13.98 spid20s     **Dump thread - spid = 20, EC = 0x0000009729DAA160
2018-12-07 10:15:13.99 spid20s     ***Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\LOG\SQLDump0002.txt
2018-12-07 10:15:13.99 spid20s     * *******************************************************************************
2018-12-07 10:15:13.99 spid20s     *
2018-12-07 10:15:13.99 spid20s     * BEGIN STACK DUMP:
2018-12-07 10:15:13.99 spid20s     *   12/07/18 10:15:13 spid 22652
2018-12-07 10:15:13.99 spid20s     *
2018-12-07 10:15:13.99 spid20s     * Latch timeout
2018-12-07 10:15:13.99 spid20s     *
2018-12-07 10:15:13.99 spid20s     *  
2018-12-07 10:15:13.99 spid20s     * *******************************************************************************
2018-12-07 10:15:13.99 spid20s     * -------------------------------------------------------------------------------
2018-12-07 10:15:13.99 spid20s     * Short Stack Dump
2018-12-07 10:15:14.03 spid20s     Stack Signature for the dump is 0x000000011415DBA4
2018-12-07 10:15:26.94 spid169     Remote harden of transaction 'user_transaction' (ID 0x000000008eadcb41 0010:ab2858a7) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18905904:250) failed.
2018-12-07 10:15:26.94 spid39s     A connection timeout has occurred on a previously established connection to availability replica 'DL580-2' with id [B85FD98F-6E3B-420B-BAD3-CBD4FF4D133D].  Either a networking or a firewall issue exists or the availability replica has transitioned to the resolving role.
2018-12-07 10:15:26.94 spid819     Remote harden of transaction 'user_transaction' (ID 0x000000008eadcbda 0010:ab2858a8) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18905969:87) failed.
2018-12-07 10:15:26.94 spid36s     Remote harden of transaction 'GhostCleanupTask' (ID 0x000000008eadcd5b 0010:ab2858ab) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906120:20) failed.
2018-12-07 10:15:26.95 spid645     Remote harden of transaction 'user_transaction' (ID 0x000000008eadcbb1 0010:ab2858ac) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906127:51) failed.
2018-12-07 10:15:26.95 spid44s     AlwaysOn Availability Groups connection with secondary database terminated for primary database 'TP1' on the availability replica with Replica ID: {b85fd98f-6e3b-420b-bad3-cbd4ff4d133d}. This is an informational message only. No user action is required.
2018-12-07 10:15:26.95 spid782     Remote harden of transaction 'user_transaction' (ID 0x000000008eace892 0010:ab2858ad) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906148:70) failed.
2018-12-07 10:15:26.95 spid1656    Remote harden of transaction 'user_transaction' (ID 0x000000008eadc933 0010:ab2858af) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906182:23) failed.
2018-12-07 10:15:26.94 Server      Error: 19419, Severity: 16, State: 1.
2018-12-07 10:15:26.94 Server      Windows Server Failover Cluster did not receive a process event signal from SQL Server hosting availability group 'AGTP1' within the lease timeout period.
2018-12-07 10:15:26.95 Server      Error: 19407, Severity: 16, State: 1.
2018-12-07 10:15:26.95 Server      The lease between availability group 'AGTP1' and the Windows Server Failover Cluster has expired. A connectivity issue occurred between the instance of SQL Server and the Windows Server Failover Cluster. To determine whether the availability group is failing over correctly, check the corresponding availability group resource in the Windows Server Failover Cluster.
2018-12-07 10:15:26.95 Server      AlwaysOn: The local replica of availability group 'AGTP1' is going offline because either the lease expired or lease renewal failed. This is an informational message only. No user action is required.
2018-12-07 10:15:26.95 Server      The state of the local availability replica in availability group 'AGTP1' has changed from 'PRIMARY_NORMAL' to 'RESOLVING_NORMAL'. The replica state changed because of either a startup, a failover, a communication issue, or a cluster error. For more information, see the availability group dashboard, SQL Server error log, Windows Server Failover Cluster management console or Windows Server Failover Cluster log. 
2018-12-07 10:15:26.95 spid44s     AlwaysOn Availability Groups connection with secondary database terminated for primary database 'TP1' on the availability replica with Replica ID: {b85fd98f-6e3b-420b-bad3-cbd4ff4d133d}. This is an informational message only. No user action is required.
2018-12-07 10:15:26.95 spid934     Remote harden of transaction 'user_transaction' (ID 0x000000008eadcb69 0010:ab2858b0) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906186:137) failed.
2018-12-07 10:15:26.95 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.95 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.178]
2018-12-07 10:15:26.95 spid2182    Remote harden of transaction 'user_transaction' (ID 0x000000008eadbfd1 0010:ab2858b1) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906217:18) failed.
2018-12-07 10:15:26.95 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.95 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.172]
2018-12-07 10:15:26.95 spid1171    Remote harden of transaction 'user_transaction' (ID 0x000000008eadcc25 0010:ab2858b2) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906224:63) failed.
2018-12-07 10:15:26.95 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.95 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.172]
2018-12-07 10:15:26.95 spid620     Remote harden of transaction 'user_transaction' (ID 0x000000008e6bdf8d 0010:ab2858b3) started at Dec  7 2018 10:11AM in database 'TP1' at LSN (957263:18906246:32) failed.
2018-12-07 10:15:26.95 spid1806    Remote harden of transaction 'user_transaction' (ID 0x000000008eadc908 0010:ab2858b5) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906255:5) failed.
2018-12-07 10:15:26.95 spid281     Remote harden of transaction 'user_transaction' (ID 0x000000008ead6f6c 0010:ab2858b4) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906257:1) failed.
2018-12-07 10:15:26.95 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.95 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.173]
2018-12-07 10:15:26.95 spid1744    Remote harden of transaction 'user_transaction' (ID 0x000000008ead9cb8 0010:ab2858b7) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906258:27) failed.
2018-12-07 10:15:26.95 spid2445    Remote harden of transaction 'user_transaction' (ID 0x000000008eadc1e6 0010:ab2858b6) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906258:29) failed.
2018-12-07 10:15:26.95 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.95 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.174]
2018-12-07 10:15:26.95 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.95 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.173]
2018-12-07 10:15:26.95 spid1776    Remote harden of transaction 'user_transaction' (ID 0x000000008eadcb80 0010:ab2858b8) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906268:62) failed.
2018-12-07 10:15:26.95 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.95 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.178]
2018-12-07 10:15:26.95 spid2059    Remote harden of transaction 'user_transaction' (ID 0x000000008eadae7b 0010:ab2858b9) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906291:57) failed.
2018-12-07 10:15:26.95 spid2315    Remote harden of transaction 'user_transaction' (ID 0x000000008eadcab4 0010:ab2858bb) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906313:39) failed.
2018-12-07 10:15:26.95 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.95 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.179]
2018-12-07 10:15:26.95 spid994     Remote harden of transaction 'user_transaction' (ID 0x000000008eadc886 0010:ab2858ba) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906327:51) failed.
2018-12-07 10:15:26.95 spid20s     External dump process return code 0x20000001.
External dump process returned no errors.

2018-12-07 10:15:26.95 spid866     Remote harden of transaction 'user_transaction' (ID 0x000000008eadcb18 0010:ab2858bd) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906345:151) failed.
2018-12-07 10:15:26.95 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.95 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.174]
2018-12-07 10:15:26.95 spid1635    Remote harden of transaction 'user_transaction' (ID 0x000000008eadcbf3 0010:ab2858be) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906379:41) failed.
2018-12-07 10:15:26.95 spid1289    Remote harden of transaction 'user_transaction' (ID 0x000000008eadcc56 0010:ab2858bf) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906394:31) failed.
2018-12-07 10:15:26.95 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.95 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.179]
2018-12-07 10:15:26.96 spid780     Remote harden of transaction 'user_transaction' (ID 0x000000008eadcbc4 0010:ab2858c0) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906405:47) failed.
2018-12-07 10:15:26.96 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.96 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.173]
2018-12-07 10:15:26.96 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.96 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.175]
2018-12-07 10:15:26.96 spid1782    Remote harden of transaction 'user_transaction' (ID 0x000000008eadcc09 0010:ab2858c1) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906423:58) failed.
2018-12-07 10:15:26.96 spid2130    Remote harden of transaction 'user_transaction' (ID 0x000000008eadcc3d 0010:ab2858c2) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906445:50) failed.
2018-12-07 10:15:26.96 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.96 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.175]
2018-12-07 10:15:26.96 spid572     Remote harden of transaction 'user_transaction' (ID 0x000000008eada858 0010:ab2858c3) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906462:46) failed.
2018-12-07 10:15:26.96 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.96 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.179]
2018-12-07 10:15:26.96 spid1048    Remote harden of transaction 'user_transaction' (ID 0x000000008eadcc8f 0010:ab2858c4) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906479:29) failed.
2018-12-07 10:15:26.96 spid1800    Remote harden of transaction 'user_transaction' (ID 0x000000008eadc99d 0010:ab2858c5) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906490:30) failed.
2018-12-07 10:15:26.96 spid1388    Remote harden of transaction 'user_transaction' (ID 0x000000008eadcc6b 0010:ab2858c6) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906501:62) failed.
2018-12-07 10:15:26.96 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.96 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.172]
2018-12-07 10:15:26.96 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.96 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.173]
2018-12-07 10:15:26.96 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.96 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.178]
2018-12-07 10:15:26.96 spid150     AlwaysOn: The local replica of availability group 'AGTP1' is preparing to transition to the resolving role in response to a request from the Windows Server Failover Clustering (WSFC) cluster. This is an informational message only. No user action is required.
2018-12-07 10:15:26.96 spid881     Remote harden of transaction 'user_transaction' (ID 0x000000008eadcb2c 0010:ab2858c7) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906524:72) failed.
2018-12-07 10:15:26.96 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.96 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.175]
2018-12-07 10:15:26.96 spid1298    Remote harden of transaction 'user_transaction' (ID 0x000000008eadccaf 0010:ab2858ca) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906549:561) failed.
2018-12-07 10:15:26.96 spid718     Remote harden of transaction 'user_transaction' (ID 0x000000008ead234b 0010:ab2858cb) started at Dec  7 2018 10:15AM in database 'TP1' at LSN (957263:18906647:64) failed.
2018-12-07 10:15:26.97 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.97 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.173]
2018-12-07 10:15:26.97 spid20s     Error: 5901, Severity: 16, State: 1.
2018-12-07 10:15:26.97 spid20s     One or more recovery units belonging to database 'TP1' failed to generate a checkpoint. This is typically caused by lack of system resources such as disk or memory, or in some cases due to database corruption. Examine previous entries in the error log for more detailed information on this failure.
2018-12-07 10:15:26.97 spid20s     Error: 845, Severity: 17, State: 1.
2018-12-07 10:15:26.97 spid20s     Time-out occurred while waiting for buffer latch type 3 for page (16:880781), database ID 5.
2018-12-07 10:15:26.97 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.97 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.174]
2018-12-07 10:15:26.97 Logon       Error: 17191, Severity: 16, State: 2.
2018-12-07 10:15:26.97 Logon       Cannot accept a new connection because the session has been terminated. This error occurs when a new batch execution is attempted on a session that is logging out, or when a severe error is encountered upon connection. Check the error log to see if this session was terminated by a KILL command or because of severe errors. [CLIENT: 192.168.28.172]
2018-12-07 10:15:26.98 spid35s     The availability group database "TP1" is changing roles from "PRIMARY" to "RESOLVING" because the mirroring session or availability group failed over due to role synchronization. This is an informational message only. No user action is required.
2018-12-07 10:15:26.98 Server      Error: 10801, Severity: 16, State: 1.
2018-12-07 10:15:26.98 Server      Failed to stop the listener for Windows Failover Cluster resource '8b8c6680-2508-45a4-823b-5d91499ed14c'. Error: 87. The parameter is incorrect. 
2018-12-07 10:15:26.99 Backup      Error: 3041, Severity: 16, State: 1.








Performance counter - indicates

$
0
0

indicate IO problem ? 

one sqlengine instance, one SSAS mulitidimentional, one SSAS tabular instance.

this warehouse server OLTP & OLAP in single drive .

is below workaround suite?

  •         Autogrow setting changed for (user & tempdb)
  •         Tempdb fileseparate as per core. (multifile)
  •         Stop taking VSS backup (Volume snapshot backups) 
  •         Need to segregate  mdf & ldf file in separate high throughput disk. (as of now everything in E: ) 
  •         Increase memory  & CPU.



Java language programmability extension details?

$
0
0
Where can I find more information about Java language programmability extension, which is a new part of Machine Learning Services, in SQL Server 2019 CTP 2.0?

The first thing I'm wanting to learn is how database-called Java code can turn around and do its own queries on the database.

Exclude DB backup from Volume snapshot backups (VSS)

$
0
0

Volume snapshot backups (VSS) backup happen one of my warehouse server,

does VSS backup degrade DB performance (I/O)?  i already have DB backup via SQL script,

how to exclude DB files from VSS?

Temp db latch wait on non allocation pages

$
0
0
I am seeing a lot of latch wait on temp db but it is not on allocation pages ( gam,sgam,pfs). application is running a stored procedure frequently and it creates local temp table. Is there any way to reduce high latch wait events for non allocation pages in tempdb 

Thanks, Nithin

SQL query and execution plan

$
0
0

I am new to the SQL Server and we are using 10.0.x version. It is a 7/8 years old java/j2ee application with the latest version of JDBC drivers and Java-8. The application is using more than a hundred SELECT queries with PreparedStatement. We are moving to Azure cloud in a multi-tenant database. 

Our DBA argues (In multi-tenant environment) that since these queries are coming from an external application, for each query SQL server creates an execution plan and it iscached. If the table starts growing, the cached execution plan is no longer valid and the results will beslow. One way to refresh the execution plan is to restart the DB server. To prevent restarting of the DB server, DBA is pushing to move all of the 100+ application queries to stored procs. If we recompile the stored procs, the execution plan will be recreated again we are good. Just by recompiling the stored procs, we are preventing server restart. As a senior developer, I think something is wrong here.

If someone knows, could you please send some SQL server documentation that SQL Server creates the execution plan for any query every time of execution? Or some pointers.

Thanks, Raj





SQL server service will not start after moving tempdb and templog to new location.

$
0
0

I am running SBS2008 on Dell box. I has been running low on the C drive which will cause the exchange to stop. I have been dealing with this for sometime now. After looking on the net, I found that sql database takes up a lot of room on the C drive and it is best to move it to another drive. So I stopped my sql service and copied my tempdb and templog which has become 15gigs them self to my D drive (D:\Windows\SYSMSI\SSEE\MSSQL.2005\MSSQL\DATA). I then ran the following query:

use master
go
Alter database tempdb modify file (name = tempdev, filename = 'D:\Windows\SYSMSI\SSEE\MSSQL.2005\MSSQL\DATA')
go
Alter database tempdb modify file (name = templog, filename = 'D:\Windows\SYSMSI\SSEE\MSSQL.2005\MSSQL\DATA')

go

I didn't know I needed to point to the file name its self I pointed it to the folder where the file I copied them too.  So now ever time I try to start the SQL Server (SBSMONITORING) it fails to start. In the sql logs I get this:

2018-12-04 17:09:45.53 Server      Microsoft SQL Server 2005 - 9.00.5000.00 (Intel X86) 
Dec 10 2010 10:56:29 
Copyright (c) 1988-2005 Microsoft Corporation
Express Edition with Advanced Services on Windows NT 6.0 (Build 6002: Service Pack 2)

2018-12-04 17:09:45.53 Server      (c) 2005 Microsoft Corporation.
2018-12-04 17:09:45.53 Server      All rights reserved.
2018-12-04 17:09:45.53 Server      Server process ID is 7964.
2018-12-04 17:09:45.53 Server      Authentication mode is WINDOWS-ONLY.
2018-12-04 17:09:45.53 Server      Logging SQL Server messages in file 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
2018-12-04 17:09:45.53 Server      This instance of SQL Server last reported using a process ID of 10848 at 12/4/2018 4:15:43 PM (local) 12/4/2018 10:15:43 PM (UTC). This is an informational message only; no user action is required.
2018-12-04 17:09:45.53 Server      Registry startup parameters:
2018-12-04 17:09:45.53 Server      -d C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf
2018-12-04 17:09:45.53 Server      -e C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
2018-12-04 17:09:45.53 Server      -l C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf
2018-12-04 17:09:45.56 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2018-12-04 17:09:45.56 Server      Detected 4 CPUs. This is an informational message; no user action is required.
2018-12-04 17:09:45.82 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
2018-12-04 17:09:45.95 Server      Database mirroring has been enabled on this instance of SQL Server.
2018-12-04 17:09:45.95 spid5s      Starting up database 'master'.
2018-12-04 17:09:46.00 spid5s      Error: 5172, Severity: 16, State: 15.
2018-12-04 17:09:46.00 spid5s      The header for file 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf' is not a valid database file header. The PageAudit property is incorrect.

Long query takes time - but - redirected to # Table then read is faster - what is issue here please?

$
0
0
Dear All - Some of the long SQL Queries having multiple joins takes time to display complete data to SQL Server Management Studio BUT the same if redirected to # Temp table and then data is read from # Temp table it is working very fast.  What can be the issue here?  Is it related to Network Latency OR what else to check for understanding the issue and fix please.  Thanks.

Raghavendra Narayana

save eml file

$
0
0

Good morning to everybody,

I am looking to find the best way to save eml file to sql server.

Do they have to be saved as stream or there is another way?

Thanks

Marco Dell'Oca

How to list multiple herarchies in order from the data

$
0
0

hi, 

I am trying to list down all the hierarchies in a data sample, each hierarchy set having one id.

Data sample:

EmpId MgrId Dept

1	2	a
2	0	a
1	5	a
5	6	a
6	0	a
2	3	b
3	4	b
4	0	b

Expected Data: List down all the hirarchies present. All under one hieararchy should be of id 1, then next hierarchy of id 2 and so on..
Hierarchy	EmpID	Dept	MgrId	Root Mgr
1	1	a	2	2
1	2	a	0	2
2	1	a	5	6
2	5	a	6	6
2	6	a	0	6
3	2	b	3	4
3	3	b	4	4
3	4	b	0	4

thanks for the help.


Bishnupriya Pradhan

Building a DWH

$
0
0

Hello

I work for a non-profit organization. Our organization has a lot of different data sources / databases. In order to make all this data excisable for users we want to build a central DWH where the data is uniformed. Our databases are all local and not in the cloud. Currently because of the different databases it is impossible for users to easily combine the data.

On advise, we have choses for a variant of the Kimball method. This is, we extract all the data from the different individual data sources to a central ‘data-store’, this is build with the use of SQL server. The ‘data-store’ also maintains the history of all the data from the individual databases. This means if a record is added or changed the old line will be closed with an end date and a new line will be added with the new data. This way we can track our historic data.

The idea is to transfer all this data to a central DWH where the data is combined through business rules to uniform data. That make it accessible for users.

The question is do you know if there is tooling for automating the writhing of the coding to fill the DWH on given metadata?

Because we are a non profit organization we cannot buy really expensive tooling, due to our limited budget we have to be smart.

Can anybody point us into the right direction?

Thanks a lot!

SQL Server 2008 R2 SP2 ""There is insufficient system memory in resource pool 'internal' to run this query" error

$
0
0

One of our products uses SQL Server 2008 R2 SP2. During the test, it is found that "There is insufficient system memory in resource pool 'internal' to run this query" error is reported. Then we upgrade to the SP3, and the issue still exist.

This issue should have been fix in "Cumulative Update package 4 for SQL Server 2008 R2"

https://support.microsoft.com/en-us/help/2345451/cumulative-update-package-4-for-sql-server-2008-r2

548996982854FIX: "There is insufficient system memory in resource pool 'internal' to run this query" error message when you run a full-text query that uses compound words in Microsoft SQL Server 2008 or in Microsoft SQL Server 2008 R2

Now SQL Server 2008 R2 is out of support, and the CU4 can't be downloaded from microsoft web site. The question is can we download the CU from other places? Or do we have any other way to workaround this issue?

The question not related is why SP2 and SP3 doesn't include this fix?

Thanks,

Guohao

DatabaseIntegrityCehck fails intermittently.

$
0
0

Have been running the Ola Hallengren scripts on our new 2016 Enterprise server for about 6 weeks or so now.  The database Integrity script only works intermittently on some instances.  Others are fine.  I cannot find a cause for these failures.



The failure on the 9<sup>th</sup> failure above for example, seems to be fine for some databases, but then just stops:


I did run the checkdb manually against the database shown, and got the following initial message, but it appeared to complete ok:

DBCC CHECKDB will not check SQL Server catalog or Service Broker consistency because a database snapshot could not be created or because WITH TABLOCK was specified.

Completed though with no issues:

This seems to relate to disk space, but my disk space have no issues:

So I’m a bit stumped.

Any clues, most appreciated.

Regards

Ian


Use of Application

$
0
0

Greetings Developers 

Hope you are well 

I have an interesting request 

Is there a way or a code that looks at the following 

1. What application is reading the DataBase? E.g. Power BI etc

2. If it Reads The Database which Tables/Views and Columns is it reading at?

if you need more understanding please feel free to ask 

thanks 

CPU Restriction for particular user

$
0
0

Hello everyone,

I just wonder if you could help me?

I have handover SQL server management from the guy that just left.

It is SXL Server 2012:

Microsoft SQL Server Management Studio          11.0.3156.0

Microsoft Analysis Services Client Tools                11.0.3130.0

Microsoft Data Access Components (MDAC)      6.3.9600.17415

Microsoft MSXML                                                           3.0 6.0

Microsoft Internet Explorer                                       9.11.9600.19155

Microsoft .NET Framework                                         4.0.30319.36468

Operating System                                                           6.3.9600

It always was a problem with this server as it was running slow and hang very often.

I did some investigation to find out what the problem actually is and found out that server is timing out because it runs out from memory and CPU.

First think I did was to check memory limit and it has been setup to 2500TB (WTF!?), I have change it to 8GB so usage dropped to around 80%.

I have fixed loads of indexes on tables as well (don’t ask J)

The last problem I have is that server runs out with CPU. Again I did some investigation and found out that CPU is used by one user called “Reporter”.

This user is used to run all reports created by previous guy… long story short, I wanted to cry when I have seen how those queries has been written… tens of temp tables, data copied across the tables several of times etc.

So basically each of his queries are very expensive, and there is over hundred different reports that can be run by several of people…

What I should do is to delete all those reports and rebuild them properly, unfortunately due to amount I can’t do that, new server, CRM system and reporting system will be implemented in March, so there is no point to spend weeks rebuilding the reporting system that will be replaced week later.

That means that I need to somehow survive 3,5 months with that what I have. I’m looking for to somehow restrict CPU usage for this particular user, or to lower the priority for queries run by this user.

I don’t care is report will run one hour or one day as long as CRM system will able to use DB without any problems.

I can’t use Resource Governor as it’s available in Enterprise edition only L

Have anybody have any idea how could I do this? I know it’s a bit challenging, but maybe?

How to Restore only Selected Tables from Backup

$
0
0

How to Restore only Selected Tables from Backup please?

Want to avoid third party tools.


Raghavendra Narayana

SQL Server service does not autostart on Windows Server 2019 DC

$
0
0

Hi,

I've installled SQL Server 2017 Developer on a Windows Server 2019.
The Windows Server is also a domain controller (it is my developer machine).

Now if I start the server, the SQL Server service for all instances does not start automatically.
Event log says that the service could not be started because of wrong username or password.

If I start the service manually without changing anything the service is starting without errors.

While researching the problem I've found several tasks, which all did not solve the problem.
Delayed start is not an acceptable option.

Now I installed SQL Server 2017 on a Windows Server 2016, which is also a domain controller.

The service starts without any problems.

Any ideas, why I have that problem only on a Windows Server 2019 DC ?

THX for any help or ideas ...

Unaccounted memory and System.outofMemoryException issue

$
0
0

I am facing an memory issue as pointed out by application person as they get below error on their application interface, this erorr appears when reports are being run and system is starved our of memory so the reports crash is what is putforward

-------------------

Error -Exception of type 'System.outofMemoryException' was thrown
at String.CtorCharCount
Last DataFactory error : 
Stack Trace :
At System.String.CtorCharCount(Char c,Int32 count)
at Microsoft.VisualBasic.compilerservices likeoperator matchrange(string source,Int32)

---------------

On the SQL server below can be observed on querying dm_os_process_memory, the max server memory on this SQL2014 ENT core editon (4 cores) is set to 90GB and we have total OS server memory as 100GB.

Memory_usedby_Sqlserver_MBLocked_pages_used_Sqlserver_MBTotal_VAS_in_MBprocess_physical_memory_lowprocess_virtual_memory_low
910189025813421772700

When i query buffer descriptors i can see below utilisation that comes close to 73 G B , on task manager i can see SQL server.exe using 726,728K .

What confuses is where is the remaining memory between 73 GB to 90GB getting into as i cant see if SQL uses that much internally. 

db_namedb_buffer_pagesdb_buffer_MBdb_buffer_percent
X729977457029NULL
Y1632451275NULL
Z1352311056NULL
tempdb26670208NULL
msdb298623NULL
A184214NULL
B5914NULL
master2021NULL
C190NULL
model130NULL


Viewing all 12554 articles
Browse latest View live


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