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

ssms scripting error

$
0
0

i am using ssms 2016 vs a 2008 database. i get a scripting error message when attempting to modify or script an SP

when I use ssms 2014 it works with no problems. i have tried dropping and recreating the sp using 2016 and it still does not work

the message:

TITLE: Microsoft SQL Server Management Studio
------------------------------

Script failed for StoredProcedure 'dbo.rashim_adv_search'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=13.0.15800.18+((SSMS_Rel).160914-0312)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Script+StoredProcedure&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

Syntax error in TextHeader of StoredProcedure 'rashim_adv_search'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=13.0.15800.18+((SSMS_Rel).160914-0312)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&LinkId=20476

------------------------------
BUTTONS:

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

the SP as scripted via 2014

USE [broadcasts]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		David Berlinger
-- Create date: 13 Sep 2011
-- Description:	rashim_adv_search
-- =============================================
create PROCEDURE [dbo].[rashim_adv_search]
(@channel_xml xml, @from date,@to date,@bi_xml xml,@edit_user int,
 @creation_name nvarchar(50),@perf_xml xml,@lyrist_xml xml,@composer_xml xml,
 @company nvarchar(50),@creation_type tinyint
)
AS
BEGIN

 declare @idoc int
 declare @chan table (channel_code tinyint)
 declare @bi table (broadcast_item int)
 declare @perf table (artist int)
 declare @lyrist table (artist int)
 declare @composer table (artist int)
 declare @edit_worker int

 if @edit_user is not null set @edit_worker=tashtit.dbo.get_worker_id_via_userid(2,@edit_user)
  set @creation_name= '%'+isnull(@creation_name,'')+'%'

 EXEC sp_xml_preparedocument @idoc OUTPUT, @channel_xml

   insert into @chan (channel_code )
     SELECT ch
            FROM       OPENXML (@idoc, '/root/r',1)
            WITH (	ch 	 tinyint)

  exec sp_xml_removedocument @idoc

  if @bi_xml is not null
    begin
      EXEC sp_xml_preparedocument @idoc OUTPUT, @bi_xml

      insert into @bi (broadcast_item )
        SELECT item
            FROM       OPENXML (@idoc, '/root/r',1)
            WITH (	item 	 int)

      exec sp_xml_removedocument @idoc
  end
  if @perf_xml is not null
  begin
     EXEC sp_xml_preparedocument @idoc OUTPUT, @perf_xml

     insert into @perf (artist )
        SELECT artist
            FROM       OPENXML (@idoc, '/root/r',1)
            WITH (	artist 	 int)

      exec sp_xml_removedocument @idoc
  end
  if @lyrist_xml is not null
  begin
       EXEC sp_xml_preparedocument @idoc OUTPUT, @lyrist_xml

       insert into @lyrist (artist )
         SELECT artist
            FROM       OPENXML (@idoc, '/root/r',1)
            WITH (	artist 	 int)

       exec sp_xml_removedocument @idoc
  end

  if @composer_xml is not null
  begin
       EXEC sp_xml_preparedocument @idoc OUTPUT, @composer_xml

      insert into @composer (artist )
         SELECT artist
            FROM       OPENXML (@idoc, '/root/r',1)
            WITH (	artist 	 int)

      exec sp_xml_removedocument @idoc
  end



SELECT distinct top 1001 'rash_adv' as rash_adv,
      dbo.schedules.schedule_code, dbo.schedules.schedule_date, dbo.schedules.start_date,
      dbo.schedules.title, dbo.rashim_titles.edit_worker,
      dbo.rashim_details.performance_code,
      creation_details_view.creation_name,
      creation_details_view.creation_name_heb, creation_details_view.creators,
      creation_details_view.main_performer, creation_details_view.recording_name,
      creation_details_view.main_performer_codes, dbo.rashim_details.item_num,
      recording_media_view.company,
      tashtit.dbo.get_users_name_via_workerid(dbo.rashim_titles.edit_worker) as edit_workername,
      tashtit.dbo.get_users_name_via_workerid(dbo.rashim_titles.edit_worker) as edit_username

FROM dbo.schedules INNER JOIN
    dbo.rashim_titles ON dbo.schedules.schedule_code = dbo.rashim_titles.schedule_code INNER JOIN
    dbo.rashim_details ON dbo.rashim_titles.rashim_code = dbo.rashim_details.rashim_code INNER JOIN
    dbo.creation_details_view ON
    dbo.rashim_details.performance_code = creation_details_view.performance_code LEFT OUTER JOIN
    dbo.recording_medias recording_media_view
    ON dbo.rashim_details.item_num = recording_media_view.device_num
  where schedules.channel_code in (select channel_code from @chan )
    and schedules.schedule_date between @from and @to
    and (@bi_xml is null or schedules.broadcast_item_code in (select broadcast_item from @bi))
    and (@edit_worker is null or dbo.rashim_titles.edit_worker=@edit_worker)
    and (dbo.creation_details_view.creation_type_code=@creation_type or @creation_type is null)
    and (creation_details_view.creation_name like @creation_name or
         creation_details_view.creation_name_heb like @creation_name or
		 @creation_name ='%%')
    and (@company is null or recording_media_view.company = @company)
    and (@perf_xml is null or creation_details_view.version_code in
                            (select version_code from dbo.version_artist_view
                              where artist_code in (select artist from @perf)))
    and (@lyrist_xml is null or creation_details_view.creation_code in
                            (select creation_code from dbo.creation_artist_view
                              where job_code in (1,11)
                                and artist_code in (select artist from @lyrist)))
    and (@composer_xml is null or creation_details_view.creation_code in
                            (select creation_code from dbo.creation_artist_view
                              where job_code in (2,11)
                                and artist_code in (select artist from @composer)))
    option(recompile)


END



???


Query on Index Rebuild

$
0
0

Hi All,

I got below error while performing index rebuild operation using DBCC DBREINDEX command. Can you please help me to fix below error.

DBCC DBREINDEX(Entity,ndx_entity_name);

Error: 

Msg 2547, Level 16, State 1, Line 1
Unable to process object ID 2023014288 (object "Entity") because it is a synonym. If the object referenced by the synonym is a table or view, retry the operation using the base object that the synonym references.

Looking at below output, there are two objects with same name in two different sachems (1 and 5). Schema 1 would be dbo and 5 was Metadata. Please advise which command I have to use to rebuild ndx_entity_name index on Entity table.

Error on occurred when a procedure run

$
0
0

Facing a prob. when a procedure executing : "Logical consistence based Error ....."

inplace Upgrade from 2008 R2 to 2014 SQL

$
0
0
Hi, I m trying to upgrade SQL server 2008 R2 to 2014 and stuck with it. the error log from bootstrap is not very helpful. Here is the error message, Anyone has come across similar error? Thanks!

Security Problem

$
0
0

Hi,

I encounter a security problem in SQL Server:

1. I install SQL Server 2008 R2 instance on Windows 7, with Windows Authentication.

2. I Login SQL Server Management Studio, with my current Windows account.

3. I go to "Security -> Roles"

4. Under sysadmin, I delete my own account by mistake.

5. Then after that, even I try to re-add my account, I will get "no permission" error.

6. I check sysadmin and find the only account is sa. But I don't know the password for sa since I have never set it during installation process(I choose WIndows Authentication, not SQL Server Authentication).

So in such a case, how can I re-obtain my sysadmin role?

Thanks

Query slow in client machine SSMS fast in server SSMS

$
0
0

Greetings All,

I have one query that run in server SSMS just need 26 secs but when run in my laptop SSMS need 11 minutes. Let me include the client statistics here

Server SSMS

Client Execution Time    14:34:41        
Query Profile Statistics            
  Number of INSERT, DELETE and UPDATE statements    0        0.0000
  Rows affected by INSERT, DELETE, or UPDATE statements    0        0.0000
  Number of SELECT statements     1        1.0000
  Rows returned by SELECT statements    493260        493260.0000
  Number of transactions     0        0.0000
Network Statistics            
  Number of server roundtrips    1        1.0000
  TDS packets sent from client    1        1.0000
  TDS packets received from server    48880        48880.0000
  Bytes sent from client    1242        1242.0000
  Bytes received from server    2.001887E+08        200188700.0000
Time Statistics            
  Client processing time    9062        9062.0000
  Total execution time    9063        9063.0000
  Wait time on server replies    1        1.0000

Laptop SSMS

Client Execution Time    14:28:38        
Query Profile Statistics            
  Number of INSERT, DELETE and UPDATE statements    0        0.0000
  Rows affected by INSERT, DELETE, or UPDATE statements    0        0.0000
  Number of SELECT statements     1        1.0000
  Rows returned by SELECT statements    493260        493260.0000
  Number of transactions     0        0.0000
Network Statistics            
  Number of server roundtrips    1        1.0000
  TDS packets sent from client    1        1.0000
  TDS packets received from server    74842        74842.0000
  Bytes sent from client    1242        1242.0000
  Bytes received from server    2.001887E+08        200188700.0000
Time Statistics            
  Client processing time    736908        736908.0000
  Total execution time    737367        737367.0000
  Wait time on server replies    459        459.0000

What is the reason will causing this? I m getting 490k rows from the server. Thank you very much.

Regards,

Justin Wong

SQL Agent Jobs failure count Mismatch

$
0
0

Hi All,

I need some help in the below query. There are 2 queries.

1st query which will tell me the monthly wise job report which includes columns such as TotalJobExecutions, Success Count, Failure count, Retry count, Cancel count.

2nd query, is completly concentrated on Failure count. Here i wanted to find out the reasons for the job failures.

These 2 queries is showing correct output on my local instance. bascially, I installed a sql instance and created 3 jobs and made them fail for few runs. On my local instance, the queries and counts are matching perfectly. But, when I run the set of queries, the counts are mismatching. i.e. The sum(failure count) column in the 1st output doesnt match up with the Sum(totalCount) in the 2nd output.

Note: also I am considering only last 3 months worth data.i.e. i am interested in last 3 months job failures. Please check with WHERE clause conditions.
Now I wanted to understand when I ran the same 2 queries in PROD server, why there is count mistmatch. I am completely not able to understand. How can I fix this? Is there anything am I missing in the 2nd query. Also, in the 2nd query I am considering step id =0 (i.e. job outcome) like I did in 1st query.Instead, to get the exact error message, I am considering the failed step to know the exact error message and I am joining the messageid to sys.sysmessages dmv to know the actual reasons for the job failures. (stepid<>0)

Is there any special scenario or extra condition I am missing in the 2nd query. I am literally confused here. does running rerunning any failed step from point of failure will that a make a difference in the counts? I have also tested that case as well still counts show me correct on local instant but on prod where we have around 100 jobs which is showing wrong results.
or else if a job is has multiple schedules does it make any difference????

All I am looking for is, if I sum up the values of "FailureCount" column values, that should match if I sum TotalCount column values in the 2 query output.

Can anybody help ?

Query 1
==============
use msdb
go
;
with MyCte
as
(
SELECT j.name JobName,
h.run_status,
msdb.dbo.agent_datetime(h.run_date, h.run_time) rundatetime,
case h.run_status when 0 then 'failed'
when 1 then 'Succeded'
when 2 then 'Retry'
when 3 then 'Cancelled'
when 4 then 'In Progress'
end as ExecutionStatus
--h.message MessageGenerated
FROM sysjobhistory h inner join sysjobs j
ON j.job_id = h.job_id
where h.step_id = 0
and msdb.dbo.agent_datetime(h.run_date, h.run_time) between '2016-06-01 00:00:00.000' and '2016-09-21 23:59:59.000'
)
select
@@servername AS Servername, --//CHANGE THE SERVERNAME
[Month]=cast(month(rundatetime) as varchar(2))+'/'+cast(year(rundatetime) as varchar(4)) ,
[TotalExecutions] = count(*)
,SuccessCount = sum(case when ExecutionStatus = 'Succeded' then 1 else 0 end)
,FailureCount = sum(case when ExecutionStatus = 'failed' then 1 else 0 end)
,RetryCount = sum(case when ExecutionStatus = 'Retry' then 1 else 0 end)
,CancelledCount = sum(case when ExecutionStatus = 'Cancelled' then 1 else 0 end)
from MyCte
group by cast(month(rundatetime) as varchar(2))+'/'+cast(year(rundatetime) as varchar(4))
go


Query 2
==============
;
with FailureReasons
AS
(
SELECT [JobName] = JOB.name,
msdb.dbo.agent_datetime(HIST.run_date, HIST.run_time) as RunDateTime,
[Step id] = HIST.step_id,
[StepName] = HIST.step_name,
HIST.run_status,
[Status] = CASE WHEN HIST.run_status = 0 THEN 'Failed'
WHEN HIST.run_status = 1 THEN 'Succeeded'
WHEN HIST.run_status = 2 THEN 'Retry'
WHEN HIST.run_status = 3 THEN 'Canceled'
END,
HIST.sql_severity,
HIST.sql_message_id,
HIST.message

FROM sysjobs JOB
INNER JOIN sysjobhistory HIST ON HIST.job_id = JOB.job_id
where HIST.run_status = 0 -- means only failed
and msdb.dbo.agent_datetime(HIST.run_date, HIST.run_time) between '2016-06-01 00:00:00.000' and '2016-09-21 23:59:59.000'
and step_id <> 0
)
SELECT t1.sql_message_id "Error #",t2.[Description], [TotalCount] = COUNT(1)
from FailureReasons t1
inner join sys.sysmessages t2 on (t1.sql_message_id = t2.error)
where t2.msglangid = 1033
group by t1.sql_message_id,t2.[Description]
ORDER BY [TotalCount] DESC

Sample output


Thanks,

Sam

Shrinking logs without taking backup

$
0
0

Hi guys, I've got one package that fills one huge table every night. Everything works, the only problem is that the package creates something like 200 GB of logs every time. So what I do is taking a back up and shrink the log in order to save space (I am very strict). The question is: what happens if I don't take the backup and I shrink the log?

Thanks


job step id not found

$
0
0

Hi experts,

I have seen this process blocking many of my executions... when I hit on details it points me to a 'stored procedure' that is NOT part of any job... so I try to investigate it, but I searched the Id on every table in msdb, and couldnt find it... what's this? can a deleted job, be still being executed?

SQL Server Upgrade Certification Exam

$
0
0

Hi All,

         I have completed myMCTS 2008 SQL Server Examination in 2012, then last year I wrote MCSA:70-457 SQL Server Upgrade Part 1, Now I was planning to write MCSA:70-458 SQL Server Upgrade Part 2. But this exam is now retired. I want to earn MCSA SQL Server 2012.

 How can i get MCSA SQL Server 2012 now?

UNICODE, table option for all the existing char/varchar columns

$
0
0

Hi guys,

As a Microsoft DBA for more that 25 years and talking from my experience, there are one issue that i'm asked to deal with from time to time, i have an idea and i wanted to ask you 'Microsoft' guys if this is a good one, at last for me it will be great.

This is the issue...

I am working with UNICODE from time to time, and as you know to have this you must use NCHAR/NVARCHAR column types, also of course to use that 'N' when doing DML's like INSERT/UPDATE, the big question is why is not enough to set an option for particular table(s) that will just 'turn' the existing CHAR/VARCHAR into UNICODE, without altering them to NCHAR/NVARCHAR, using the existing ones.

Also, i need to use that "N" and if i have DML's as mentioned as 'hard-coded' in the applications, i really have a problem, why i still need to use this 2nd thing in order to have UNICODE data ?

The same, i think that we just need an option on table(s) that will turn the CHAR's into UNICODE and that's it, all the INSERTS or UPDATES will continue to work as before the UNICODE, saving data as it should be.

Thanks,

Victor Shahar

DBA


בברכה, ויקטור שחר DBA


Some SQL jobs suddenly stop working, always "executing"

$
0
0
Hello, we have a had a few SQL jobs start executing but not finishing. Sometimes they fail after 30-40 hours, but usually we catch them and cancel them. The jobs are stored procedures that run in just a couple seconds if we just execute the SP. The jobs ran fine until a week or so ago, I don't know of any changes to the server. I do know if I run the job scheduled or manually start the job, it is always failing. If I just run the SP, it is always succeeding. Nothing appears in the error logs. The jobs say they are executing, but they never finish. I tried to force recompile on the SPs in case there was a parameter sniffing issue, but that didn't help. 

[SQL Server] Track operations history on a table

$
0
0

Hi all,

I am using SQL Server 2008 R2 and here is my problem: I would like to get all DML operations (INSERT, DELETE, UPDATE & if possible SELECT) queried on a table, and if there is a way to query this information.

E.g. I would like to know that 7 lines have been inserted in my dbo.Products table today.

I explored some leads like:

- TRIGGERS, that can enable an action after a DML action (except SELECT), BUT they seem to not have any information on the event/query triggering them. So if I put an UPDATE trigger on my target table, I don't know which line(s) have been updated.

- CDC: Change data captures, that can give me the kind of DML instruction (except SELECT) and a SLN number, BUT I still don't know the content of the change and how many lines have been deleted in such case...

Thanks a lot for your help!

Guillaume

SMO causing deadlock

$
0
0

We have .Net code that does database replication using SMO. We use SMO to extract schema from source database and create them in destination database. And in recent past we started receiving bunch of deadlock issues. On analyzing the deadlocks graphs we found that some system base tables (ex: sys.sysrowsets) are causing the deadlocks. On some more investigation we found that..there are some SQL jobs running on parent DB that alter few tables (like renaming column, creating new column, dropping and recreating index etc.) that will internally update SQL Server base tables. At the same time using SMO we are capturing definition of tables which again depends upon system base tables internally. This is causing deadlock and SMO is the deadlock victim.

My question is

1. Is there is any setting available for SMO that will avoid deadlocks?

2. If not is there is any simple alternate way to extract schema of SQL objects?

For you reference I am pasting the error and deadlock graph here:

<StackTrace>   at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithList(DependencyCollection depList, SqlSmoObject[] objects, Boolean discoveryRequired)

   at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithList(Urn[] urns, SqlSmoObject[] objects)

   at Microsoft.SqlServer.Management.Smo.Scripter.Script(Urn[] urns, SqlSmoObject[] objects)

   at DataMigration.BulkCopyTable(String schemaName, String tableName)  at DataMigration.CopyTableWithData()

</StackTrace>

<ExceptionSource>Microsoft.SqlServer.Smo</ExceptionSource><Data><HelpLink.ProdName>Microsoft SQL Server</HelpLink.ProdName><HelpLink.BaseHelpUrl>http://go.microsoft.com/fwlink</HelpLink.BaseHelpUrl><HelpLink.LinkId>20476</HelpLink.LinkId><HelpLink.ProdVer>11.0.2100.60 ((SQL11_RTM).120210-1917 )</HelpLink.ProdVer><HelpLink.EvtSrc>Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText</HelpLink.EvtSrc><HelpLink.EvtData1>Script</HelpLink.EvtData1><HelpLink.EvtData2>Server</HelpLink.EvtData2></Data><SqlException><Message>Transaction (Process ID 379) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.</Message>

 

 

 

Occasional connectivity issues.

$
0
0

Greetings. We are getting SQL Server connectivity errors on a very intermittent basis. We've looked everywhere and all the info we have is posted below from the various sources. Note that this is not occurring from just one app server but a few, and that it's also occurring on more than one SQL Server instance.

Application Error (more details lower in the thread):

The connection error occurred again last night (log message):

System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake.

SQL Message Captured:

-         Interesting to note the high time to establish SSL in yellow

-         <value>Network error code 0x2746 occurred while establishing a connection; the connection has been closed. This may have been caused by client or server login timeout expiration.Time spent during login: total 12109 ms, enqueued 0 ms, network writes 1 ms, network reads 2109 ms,establishing SSL 9997 ms, network reads during SSL 9997 ms, network writes during SSL 0 ms, secure calls during SSL 0 ms, enqueued during SSL 0 ms, negotiating SSPI 0 ms, network reads during SSPI 0 ms, network writes during SSPI 0 ms, secure calls during SSPI 0 ms, enqueued during SSPI 0 ms, validating login 0 ms, including user-defined login processing 0 ms. [CLIENT: myIPAddress]</value>

Network Capture (trace file attached):

-         There are several retransmissions from the SQL instance to the App server (myAppServer (myIPAddress)

-         Then there is a reset request from the app server to the SQL instance

-         467         2016-07-19 08:27:00.405430160  10.7.50.10            10.7.4.125            TCP        68           44590 1433 [RST, ACK] Seq=1496031372 Ack=1496031636 Win=0 Len=0

-         Also see the below regarding SSL Self Signed Fallback.

...^......$....*....+....,....0....1.$..U......:............v,..M...K.?.....j...B..w.}./{........0...........%....&....'....'....(............[1496030773 bytes missing in capture file]...^......$....*....+....,....0....1.$..U......:............v,..M...K.?.....j...B..w.}./{.....[1496030819 bytes missing in capture file]...0...........%....&....'....'....(...............................W.......y`...3.....@..!.F...B0....*.<./.=.5...

.'.....+.#.,.$. .

.@.2.j.8.......G........

myDBServer.

...............

..................................m........`...Q..W......`.....N&. .~ot.U.zr3 .... B0....j.zO.'Q\..5..X..@q....gP...<.. ...................0...0..b...........T...Iu....0.0

. *.H..

.....0;1907..U...0.S.S.L._.S.e.l.f._.S.i.g.n.e.d._.F.a.l.l.b.a.c.k0..

160714073545Z.

460714073545Z0;1907..U...0.S.S.L._.S.e.l.f._.S.i.g.n.e.d._.F.a.l.l.b.a.c.k0..0

. *.H..

.........0.......R..H...4.....Jr.U.4rl'..?.N

.- .._k...-... q...j...[(.2'...Nc.4......WbTI..W..j.;..(+S/..U..P%..&..;.....#..Y....E....o{a.6..h5.....0

. *.H..

............/....;.u..8...... F].X..xP-.^\.H.[......@...G...lG:*......wJ...Eh......$....;.........s......f.,.n......PP#.G......->7.:............................1.XL..&....P...JM.....]D....v?N....`E{N..._?.9.OG....w..Ph.......!....5..e.m......Po.....G.../s...X..[..!]...g....*.8..K..+Y=.............P.w......"...........j...p.....,....U.. mol.D].w')..!..N.)........J2F.!.4.....C.....c..............Pf..|..

p..PC.f.7....

....~sGT...4f./.L..j...dp.....T.>............(....p......U.

All ideas are welcome, thanks!


Thanks in advance! ChrisRDBA



Checkpoint duration more than 5 sec when 0 pages droped to disk

$
0
0

Dear colleagues!
We have got a problem with long executing of a command – «checkpoint».

Our server:

Microsoft SQL Server 2012 (SP3) (KB3072779) - 11.0.6020.0 (X64) 
    Oct 20 2015 15:36:27 
    Copyright (c) Microsoft Corporation
    Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 <X64> (Build 9600: )
Sp_configure:

nameminimum maximumconfig_valuerun_value
access check cache bucket count06553600
access check cache quota0214748364700
Ad Hoc Distributed Queries010 0
affinity I/O mask-2147483648214748364700
affinity mask-2147483648214748364700
affinity64 I/O mask-2147483648214748364700
affinity64 mask-2147483648214748364700
Agent XPs0 111
allow updates010 0
backup compression default011 1
blocked process threshold (s)08640000
c2 audit mode010 0
clr enabled0 111
common criteria compliance enabled010 0
contained database authentication010 0
cost threshold for parallelism0327673276732767
cross db ownership chaining010 0
cursor threshold-12147483647-1-1
Database Mail XPs011 1
default full-text language0214748364710331033
default language099990 0
default trace enabled010 0
disallow results from triggers010 0
EKM provider enabled010 0
filestream access level020 0
fill factor (%)01000 0
ft crawl bandwidth (max)032767100100
ft crawl bandwidth (min)03276700
ft notify bandwidth (max)032767100100
ft notify bandwidth (min)03276700
index create memory (KB)704214748364700
in-doubt xact resolution020 0
lightweight pooling010 0
locks5000 21474836470 0
max degree of parallelism03276744
max full-text crawl range02564 4
max server memory (MB)1282147483647960000960000
max text repl size (B)-121474836476553665536
max worker threads1286553500
media retention03650 0
min memory per query (KB)512214748364710241024
min server memory (MB)02147483647016
nested triggers011 1
network packet size (B)5123276740964096
Ole Automation Procedures010 0
open objects0214748364700
optimize for ad hoc workloads011 1
PH timeout (s)136006060
precompute rank010 0
priority boost010 0
query governor cost limit0214748364700
query wait (s)-12147483647-1-1
recovery interval (min)03276700
remote access011 1
remote admin connections010 0
remote login timeout (s)021474836471010
remote proc trans010 0
remote query timeout (s)02147483647600600
Replication XPs010 0
scan for startup procs010 0
server trigger recursion011 1
set working set size010 0
show advanced options011 1
SMO and DMO XPs011 1
transform noise words010 0
two digit year cutoff1753999920492049
user connections03276700
user options0327671642416424
xp_cmdshell0 100




namedb_size                ownerdbidcreated       status                            compatibility_level
test7 2289686.56 MBsa         7Aug 29 2015Status=ONLINE, Updateability=READ_WRITE, UserAccess=MULTI_USER, Recovery=SIMPLE, Version=706, Collation=Cyrillic_General_CI_AS, SQLSortOrder=0, IsTornPageDetectionEnabled, IsAutoCreateStatistics110




namefileid filenamefilegroupsizemaxsizegrowthusage
gb_Data1 G:\test7.mdfPRIMARY2344536128 KBUnlimited512000 KBdata only
gb_Log2 G:\test7_log.ldf[NULL]102912 KBUnlimited102400 KBlog only


test code:

select getdate()
checkpoint
go
select getdate()
checkpoint
go
select getdate()
checkpoint
go


and every time it executed 5 sec or more.

Our server has 4 E7 processors - 4890v2 2.79Ghz
And 1Tb memory.

We set counters on the server for check response time on disks, but haven't seen anything critical on disks.
Besides haven't seen correlation between the operation checkpoint, size of the written data on a disk(pages\sec) and duration. It doesn't mater how many data would be written, or when was the last checkpoint time of execution checkpoint - 5 seconds or more.
Even if  execute 5 checkpoint in a row- each takes 5 sec.

for bigger amount of information we set a flag on the server:
dbcc traceon(3502,-1)

And have received the following records:
1.
on the working server

2016-09-22 14:04:21.41 spid1179    DBCC TRACEON 3502, server process ID (SPID) 1179. This is an informational message only; no user action is required.
2016-09-22 14:04:25.58 spid1179    Ckpt dbid 7 started 
2016-09-22 14:04:25.58 spid1179    About to log Checkpoint begin.
2016-09-22 14:04:25.59 spid1179    Ckpt dbid 7 phase 1 ended (0)
2016-09-22 14:04:26.04 Logon       Error: 18456, Severity: 14, State: 8.
2016-09-22 14:04:26.04 Logon       Login failed for user 'a.mirzoyan'. Reason: Password did not match that for the login provided. [CLIENT: 10.0.2.46]
2016-09-22 14:04:31.10 spid1179    About to log Checkpoint end.
2016-09-22 14:04:31.10 spid1179    Ckpt dbid 7 complete
2016-09-22 14:04:31.13 spid1179    Ckpt dbid 7 started 
2016-09-22 14:04:31.13 spid1179    About to log Checkpoint begin.
2016-09-22 14:04:31.14 spid1179    Ckpt dbid 7 phase 1 ended (0)
2016-09-22 14:04:35.65 spid29s     About to log Checkpoint begin.
2016-09-22 14:04:36.15 spid29s     About to log Checkpoint end.
2016-09-22 14:04:36.96 spid1179    About to log Checkpoint end.
2016-09-22 14:04:36.96 spid1179    Ckpt dbid 7 complete
2016-09-22 14:04:36.97 spid3489    Ckpt dbid 7 started 
2016-09-22 14:04:36.97 spid3489    About to log Checkpoint begin.
2016-09-22 14:04:36.98 spid3489    Ckpt dbid 7 phase 1 ended (8)
2016-09-22 14:04:42.41 spid3489    About to log Checkpoint end.
2016-09-22 14:04:42.41 spid3489    Ckpt dbid 7 complete
2016-09-22 14:04:42.68 spid3489    Ckpt dbid 7 started 
2016-09-22 14:04:42.68 spid3489    About to log Checkpoint begin.
2016-09-22 14:04:42.68 spid3489    Ckpt dbid 7 phase 1 ended (8)
2016-09-22 14:04:50.20 spid3489    About to log Checkpoint end.
2016-09-22 14:04:50.20 spid3489    Ckpt dbid 7 complete
2016-09-22 14:04:56.45 spid29s     Ckpt dbid 9 started 
2016-09-22 14:04:56.45 spid29s     About to log Checkpoint begin.
2016-09-22 14:04:56.74 spid29s     Ckpt dbid 9 phase 1 ended (0)
2016-09-22 14:05:02.37 spid29s     About to log Checkpoint end.
2016-09-22 14:05:02.37 spid29s     Ckpt dbid 9 complete

2.

2016-09-22 14:02:01.54 spid68      DBCC TRACEON 3502, server process ID (SPID) 68. This is an informational message only; no user action is required.
2016-09-22 14:02:46.80 spid82      Ckpt dbid 7 started 
2016-09-22 14:02:46.80 spid82      About to log Checkpoint begin.
2016-09-22 14:02:46.81 spid82      Ckpt dbid 7 phase 1 ended (8)
2016-09-22 14:02:46.94 spid82      About to log Checkpoint end.
2016-09-22 14:02:46.94 spid82      Ckpt dbid 7 complete
2016-09-22 14:02:46.98 spid82      Ckpt dbid 7 started 
2016-09-22 14:02:46.98 spid82      About to log Checkpoint begin.
2016-09-22 14:02:46.98 spid82      Ckpt dbid 7 phase 1 ended (8)
2016-09-22 14:02:47.09 spid82      About to log Checkpoint end.
2016-09-22 14:02:47.09 spid82      Ckpt dbid 7 complete
2016-09-22 14:02:48.75 spid82      Ckpt dbid 7 started 
2016-09-22 14:02:48.75 spid82      About to log Checkpoint begin.
2016-09-22 14:02:48.76 spid82      Ckpt dbid 7 phase 1 ended (8)
2016-09-22 14:02:48.87 spid82      About to log Checkpoint end.
2016-09-22 14:02:48.87 spid82      Ckpt dbid 7 complete
2016-09-22 14:02:48.89 spid82      Ckpt dbid 7 started 
2016-09-22 14:02:48.89 spid82      About to log Checkpoint begin.
2016-09-22 14:02:48.89 spid82      Ckpt dbid 7 phase 1 ended (8)
2016-09-22 14:02:49.00 spid82      About to log Checkpoint end.
2016-09-22 14:02:49.00 spid82      Ckpt dbid 7 complete
2016-09-22 14:02:49.83 spid82      Ckpt dbid 7 started 
2016-09-22 14:02:49.83 spid82      About to log Checkpoint begin.
2016-09-22 14:02:49.83 spid82      Ckpt dbid 7 phase 1 ended (8)
2016-09-22 14:02:49.94 spid82      About to log Checkpoint end.
2016-09-22 14:02:49.94 spid82      Ckpt dbid 7 complete
2016-09-22 14:02:50.20 spid82      Ckpt dbid 7 started 
2016-09-22 14:02:50.20 spid82      About to log Checkpoint begin.
2016-09-22 14:02:50.21 spid82      Ckpt dbid 7 phase 1 ended (8)
2016-09-22 14:02:50.32 spid82      About to log Checkpoint end.
2016-09-22 14:02:50.32 spid82      Ckpt dbid 7 complete

on the test server resources following:
2 processors and 256Gb memory

and we can't repeat this problem on test server.

Why time of execution checkpoint on production server is so big?

SQL Messages Displaying random charcaters intead of alert/message

$
0
0

Hello,

My DBA is getting some weird messages from the SQL jobs. Some of them display just fine in his iPhone, but there are some that only the title comes with readable text, but the body is just random characters.

I Wonder if it could be the Font, but where should I change that or could be IOS 9.3.4 and up.

I also tried to add my android device, but I only get the title no body.

Thanks in advance

Setting processor/IO affinity mask using sp_configure

$
0
0

Hi,

In SSMS, sql server 2014 shows 4 NumaNodes (0-3), each of them 20 CPUs. I know that this server has 4 physical cores, with 10 logical CPUs (schedulers) each. First of all, why is SSMS showing 80 CPUs, when I know that we have only 40 logical cores???

Also, we plan to set Processor/Affinity mask to use only half of CPUs (don't ask why, it is part of the test), so considering what I said about incorrect number of CPUs shown in SSMS, and fact that we have 40 Cores, what would be sp_configure 'affinity mask' value for this server to use only 24 cores (out of 40)???? I found only simple examples online (including Microsoft and BOL), where they show only i.e. 8 CPUs (i.e. 11111110 meaning 254).

This command returns 40:

select scheduler_id,cpu_id, status, is_online from sys.dm_os_schedulers where status='VISIBLE ONLINE'

...and this returns 80, 20, and 4 respectively:

select cpu_count, hyperthread_ratio, cpu_count/hyperthread_ratio as physical_cpu_count from sys.dm_os_sys_info

Thanks,



Pedja

how to solve [Microsoft][SQL Server Native Client 11.0]SMux Provider: Physical connection is not usable [xFFFFFFFF].

$
0
0

Windows server 2012R2.

SQL Server 2012R2.

client windows 10. 

Error:  [Microsoft][SQL Server Native Client 11.0]SMux Provider: Physical connection is not usable [xFFFFFFFF].   Please refer this error to your database administrator or see your database documentation for further assistance.

Sql Server Audit/ Event Session

$
0
0

Hi ,

Whenever we are stopping an server audit or a event session , the server is going into hung mode , response is received only after 25 mins.  This is my analysis on this

  • Using perfmon and task manager I observed , CPU/DISK/BUFFER are all normal.
  • Only sql server affected , no other heavy OS process observed at the same time. The other OS activities responds normally .
  • Sql server does not respond to any command (sp_who2,sysprocesses ,dmv ,sp_lock etc.)
  • Even DAC goes into hung mode.
  • I ran profiler but did not found ,any other Sql statement consuming heavy resources around the same time.
  • As soon as the stop statement is completes sql server starts behaving normal. All queries start reflecting the results.
  • This does not happens when server audit or  event session is started.

The sql version is 2008 r2 , Enterprise Edition , SP3. I looked MS sites , they suggested some patch updates for SP1/SP2, but I am already on SP3.

Any suggestion/ help is appreciated .

Thanks

Aslam

 

Viewing all 15889 articles
Browse latest View live


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