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

MDW - exclude system and mdw queries under query statistics

$
0
0

Hi, 

I have just set up MDW to collect information on my instance but under query statistics most of the queries are either system

related or actual mdw collection queries. 

Is it possible to exclude this ? 

I already ran this

https://support.microsoft.com/en-us/kb/2793580

but still getting lots of queries like 

insert into @rtnvalue (data) values .....

INSERT INTO #am_wait_stats_snapshots 

SELECT 
   [Session ID]    = s.session_id, 
   [User Process]  = CONVERT(CHAR(1), s.is_user_proces

etc...

So is there anyway to filter or exclude out these ?? 

SQL Server 2014 SP1 EE

thanks


ilikefondue


DB Server Processor take more utilization

$
0
0
MS SQL Server take more processor utilization ,so which Quary take more utilization how i find.

Balachandar

Blocking after SQL 2014 SP1CU6 is applied

$
0
0

I am wondering if anyone have blocking issues after applying the latest patch (SP1CU6) for SQL 2014.  It happens when using NOLOCK or READ UNCOMMITTED isolation level.  The select query will not just take the Sch-S lock but IS/S lock on a big table and causes blocking.

USE Test
GO

CREATE TABLE [dbo].[Test1]
(
    [id] [INT] IDENTITY(1,1) NOT NULL,
    [msg] [NVARCHAR](500) NULL,
    [updated] [DATETIME2](7) NULL DEFAULT (GETDATE()),
CONSTRAINT [PK_Test1] PRIMARY KEY CLUSTERED
(
    [id] ASC
)) ON [PRIMARY];

INSERT INTO dbo.test1(msg)
VALUES('this is for test');

--insert dummy data
DECLARE @i INT=1;
WHILE @i<27
BEGIN
    INSERT INTO dbo.test1(msg) SELECT msg FROM dbo.test1;
    SET @i=@i+1;
END;

DROP TABLE #a;
--select query with NOLOCK
SELECT * into #a from dbo.Test1 WITH (NOLOCK);

--When checking the lock the above SELECT takes it shows it requests IS lock on the test table. And if an big update is running at the same time one of the query will be blocked.

As a result of the CU6 we see blocking in some production queries, which did not happen before the upgrade.

How to find the size of the data that is being written to a database transactional log file per second?

$
0
0
How to know the size of the transactions that is being written to a specific database transactional log file per second? ... Better if using PerfMon... Or any way that gives me the average over a monitoring period 

Rebuilding a corrupt table

$
0
0

Last week we had one our databases get corrupted and restoring from a backup wasn't an option, so I ran DBCC checktable and fixed the 4 corrupt tables but lost some data. I was easily able to put 3 of the 4 back to where they should be but the 4th table is around 440 million rows. I am currently using BULK IMPORT to load the data from a backup and it is SUPER slow. Any suggestions for getting this table restored? I thought about using SELECT INTO and rename the table after it is good but I thought adding the indexes would take a long time too.

Thanks!

sp_dboption can't find

$
0
0

my ssms version is

Microsoft SQL Server 2014 - 12.0.4213.0 (X64)
 Jun  9 2015 12:06:16
 Copyright (c) Microsoft Corporation
 Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

but sp_dboption can't find.

anyone help?

trace flags for Sql Server 2014

$
0
0

Hi there,

Usually these flags are recommended for Sql2k8 flavours, I don't know if all of them are useful on later versions.

Our version is 2014 EE

Trace flag 4199
Trace flag 4136
Trace flag 1117
Trace flag 845

Thanks for any link provided

Assesment of storage utilization for tempdb database.

$
0
0

Hi,

At present we are having 2 node  a Sql Server 2008 R2 clustered
installation. The Datalun is a 2 TB EMC san storage which houses
the mdf files, ldf files, temp db & backup files. We are planning
to have a new Sql server 2014 or Sql Server 2016 clustered installation in another server.

For that we propose to have separate 5 drives for the mdf,
ldf,tempdb,backup files and another one for the trace and audit file.
In this context we need to do a planning for the storage. I would
like to know how best should be the tempdb storage estimated. Should
it be a percentage of all the mdf file sizes put together. The total
size of the mdf files of all databases put together is 300 GB. Or
is there any other method to asses the disk utilization tempdb
on a daily basis when it creates the temporary files for various
activities?

Thanking you in anticipation,

Binny Mathew.


Improving performance huge view

$
0
0

Dear all,

Test in on Azure atmosphere it takes just 8 sec for getting rows In our UAT cluster more than 5 minutes.

In a non-peak hours and all the indexes rebuilded/reorganized and STATS for tables performed.

I attach you the view (:-) but anyway, have you got any ideas how to improve it?

 CREATE VIEW [dbo].[EDIWarehouseOrder]
 AS

 SELECT
         sls.DOCUMENTSTATUS                                                                     AS Docstatus,
         sln.SALESSTATUS                                                                        AS Salesstatus,
         --ISNULL(sls.recid,0)                                                                    AS recid,
   ISNULL(rte.recid,0)                                                                    AS recid,
         --ISNULL(sls.SALESID,'')                                                                 AS orderno,
   ISNULL(sls.SALESID + '_' + rte.pickingrouteid,'')                                      AS orderno,
   --ISNULL(rte.pickingrouteid,'')                                                          AS orderno,
         CONVERT(NVARCHAR(8), ISNULL(sls.createddatetime,0), 112)                               AS orderdate,
         ISNULL(rte.pickingrouteid,'')                                                          AS pickinglistid,
        CONVERT(NVARCHAR(8), ISNULL(hdr.createddatetime,0), 112)                                AS pickinglistdate,
         --'O'                                                                                    AS ordertype,
   sls.salestype                                                                          AS ordertype,
         ISNULL(sls.salesid,'')                                                                 AS salesorderno,
         ISNULL(sls.PURCHORDERFORMNUM,'')                                                       AS purchaseorderno,
         --ISNULL(cus.ACCOUNTNUM,'')                                                              AS cusno,
   ISNULL(hdr.customer,'')                                                                AS cusno,
         ''                                                                                     AS status,
   --ISNULL(rte2.change,'N')                                                                AS status,   --(check if needed)
         ''                                                                                     AS bolno,
         --ISNULL(sls.customerref,'')                                                             AS shiptoxref,
   LTRIM(RTRIM(ISNULL(dloc.LOCATIONID,'')))                                               AS shiptoxref,
         --ISNULL(sln.DELIVERYNAME,'')                                                            AS shiptoname,
         LTRIM(RTRIM(ISNULL(dloc.description,'')))                                              AS shiptoname,
   --ISNULL(del.street, '')                                                                 AS shiptoadd1,


   CASE WHEN CHARINDEX(CHAR(10), del.street) > 0
             THEN SUBSTRING(del.street, 1, CHARINDEX(CHAR(10), del.street))
             ELSE del.street
         END                                                                                    AS shiptoadd1,


         --''                                       AS shiptoadd2,


           CASE WHEN     CHARINDEX(CHAR(10), del.street) > 0
                  AND CHARINDEX(CHAR(10), del.street, CHARINDEX(CHAR(10), del.street) + 1) = 0
             THEN SUBSTRING(del.street,
                           CHARINDEX(CHAR(10), del.street) + 1,
                           LEN(del.street) - CHARINDEX(CHAR(10), del.street))


            WHEN     CHARINDEX(CHAR(10), del.street) > 0
                 AND CHARINDEX(CHAR(10), del.street, CHARINDEX(CHAR(10), del.street) + 1) > 0
            THEN SUBSTRING(del.street,
                            CHARINDEX(CHAR(10), del.street) + 1,
                            CHARINDEX(CHAR(10), del.street, CHARINDEX(CHAR(10), del.street) + 1) -
                            CHARINDEX(CHAR(10), del.street))


            ELSE ''
         END                                                                                    AS shiptoadd2,


         ''                                        AS shiptoadd3,
         ISNULL(del.CITY,'')                                                                    AS shiptocity,
         ISNULL(del.[STATE],'')                                                                 AS shiptostate,
         ISNULL(del.ZIPCODE,'')                                      AS shiptozip,
         ISNULL(del.COUNTRYREGIONID,'')                                    AS shiptocountry,
         CONVERT(NVARCHAR(8), ISNULL(sls.shippingdaterequested,0), 112)                         AS shipdate,
         CONVERT(NVARCHAR(8), ISNULL(sls.DEADLINE,0), 112)                             AS canceldate,
         ISNULL(sls.dlvmode,'')                                                                 AS shipviaid,
         ISNULL(sls.payment,'')                                                                 AS termsid,
         ISNULL(LEFT(sls.DLVTERM,3),'')                                                         AS collect,
         LTRIM(RTRIM(ISNULL(tmc.SCAC,'')))                                                      AS shippinginstructions1,      -- MC 05/11/2016 Added SCAC
         ''                                                                                     AS shippinginstructions2,
         REPLACE(REPLACE(LTRIM(RTRIM(ISNULL(d1.NOTES,''))),CHAR(10),' '),CHAR(13),' ')          AS comment1,                   -- MC 04/19/2016 was ISNULL(lcmtsh.NAME,'') but no data
         ''                                                                                     AS comment2,
         ''                                                                                     AS comment3,
         ISNULL(sls.INVENTLOCATIONID,'')                                                        AS inventorylocationid,
         ''                                                                                     AS department,
         ISNULL(loc.DESCRIPTION,'')                                                             AS billtoname,

         --CASE
         --    WHEN CHARINDEX(',', adr.[ADDRESS]) > 0
         --        THEN LTRIM(RTRIM(SUBSTRING(adr.[ADDRESS],
         --                         1,
         --                         CHARINDEX(',', adr.[ADDRESS]) - 1)))
         --    ELSE ISNULL(adr.[ADDRESS],'')
         --END                                                                                    AS billtoadd1,


         CASE
             WHEN CHARINDEX(',', adr.[street]) > 0
                 THEN LTRIM(RTRIM(SUBSTRING(adr.[street],
                                  1,
                                  CHARINDEX(',', adr.[street]) - 1)))
             ELSE ISNULL(adr.[street],'')
         END                                                                                    AS billtoadd1,

         ''                                        AS billtoadd2,
         ISNULL(adr.CITY,'')                                                                AS billtocity,
         ISNULL(adr.[state],'')                                                 AS billtostate,
         ISNULL(adr.ZIPCODE,'')                                  AS billtozip,
         ISNULL(adr.COUNTRYREGIONID,'')                                AS billtocountry,
         NULL                                                                                   AS billtocontact,
         NULL                                                                              AS billtocontact2,
         NULL                                          AS billtophone,
         NULL                                                                                   AS billtophone2,
         NULL                                       AS billtofax,
         NULL                                       AS billtoemail,
         NULL                                                                                   AS cususer1,
         NULL                                                                                   AS cususer2,
         NULL                                                                                   AS cususer3,
         NULL                                                                                   AS cususer4,
         NULL                                                                                   AS cususer5,
         --ISNULL(del.recid,0)                                                                    AS altadrid,
   ISNULL(adr.recid,0)                                                                    AS altadrid,
         ISNULL(loc.description,'')                                                            AS altadrname,

   --CASE
   --          WHEN CHARINDEX(',', del.street) > 0
   --              THEN LTRIM(RTRIM(SUBSTRING(del.street,
   --                               1,
   --                               CHARINDEX(',', del.street) - 1)))
   --          ELSE ISNULL(del.street,'')
   --      END                                                                                    AS altadradd1,


      CASE
             WHEN CHARINDEX(',', adr.street) > 0
                 THEN LTRIM(RTRIM(SUBSTRING(adr.street,
                                  1,
                                  CHARINDEX(',', adr.street) - 1)))
             ELSE ISNULL(adr.street,'')
         END                                                                                    AS altadradd1,

         --CASE
         --    WHEN CHARINDEX(',', del.street) > 0
         --        THEN LTRIM(RTRIM(SUBSTRING(del.street,
         --                         CHARINDEX(',', del.street) + 1,
         --                         LEN(del.street) - CHARINDEX(',', del.street) + 1)))
         --    ELSE ''
         --END                                                                                    AS altadradd2,


   CASE
             WHEN CHARINDEX(',', adr.street) > 0
                 THEN LTRIM(RTRIM(SUBSTRING(adr.street,
                                  CHARINDEX(',', adr.street) + 1,
                                  LEN(adr.street) - CHARINDEX(',', adr.street) + 1)))
             ELSE ''
         END                                                                                    AS altadradd2,


         NULL                                                                                   AS altadradd3,
         --ISNULL(del.city,'')                                                                    AS altadrcity,
   ISNULL(adr.city,'')                                                                    AS altadrcity,
         --ISNULL(del.state,'')                                                                   AS altadrstate,
   ISNULL(adr.state,'')                                                                   AS altadrstate,
         --ISNULL(del.zipcode,'')                                                                 AS altadrzip,
   ISNULL(adr.zipcode,'')                                                                 AS altadrzip,
         --ISNULL(del.countryregionid,'')                                                         AS altadrcountry,
   ISNULL(adr.countryregionid,'')                                                         AS altadrcountry,
         NULL                                                                                   AS altadrcontact,
         NULL                                                                                   AS altadrcontact2,
         NULL                                          AS altadrphone,
         NULL                                                                                  AS altadrphone2,
         NULL                                      AS altadrfax,
         NULL                                                                                   AS altadruser1,
         NULL                                                                                   AS altadruser2,
         NULL                                                                                  AS altadruser3,
         NULL                                                                                   AS altadruser4,
         NULL                                                                                   AS altadruser5,
         NULL                                                                                   AS altadremail,
         LTRIM(RTRIM(ISNULL(sls.INVENTLOCATIONID,'')))                                       AS shipfrid,
    LTRIM(RTRIM(ISNULL(sf.NAME,'')))                                       AS shipfrname,

        CASE
            WHEN CHARINDEX(',', ila.street) > 0
                THEN LTRIM(RTRIM(SUBSTRING(ila.street,
                                 1,
                                 CHARINDEX(',', ila.street) - 1)))
            ELSE ISNULL(ila.street,'')
        END                                                                                     AS shipfradd1,

        CASE
            WHEN CHARINDEX(',', ila.street) > 0
                THEN LTRIM(RTRIM(SUBSTRING(ila.street,
                                 CHARINDEX(',', ila.street) + 1,
                                 LEN(ila.street) - CHARINDEX(',', ila.street) + 1)))
            ELSE ''
        END                                                                                     AS shipfradd2,

         ''                                                                                  AS shipfradd3,
         LTRIM(RTRIM(ISNULL(ila2.City,'')))                                                   AS shipfrcity,
         LTRIM(RTRIM(ISNULL(ila2.State,'')))                                                   AS shipfrstate,
         LTRIM(RTRIM(ISNULL(ila2.ZipCode,'')))                                                 AS shipfrzip,
         ''                                                                                   AS shipfrcountry,
         ''                                                                                    AS shipfrcontact,
         ''                                                                                    AS shipfrcontact2,
         ''                                                                                    AS shipfrphone,
         ''                                                                                    AS shipfrphone2,
         ''                                                                                    AS shipfrfax,
         ''                                       AS shipfremail,
         ''                                                                                    AS shipfruser1,
         ''                                                                                    AS shipfruser2,
         ''                                                                                    AS shipfruser3,
         ''                                                                                    AS shipfruser4,
         ''                                                                                    AS shipfruser5,
         ''                                                                                    AS locname,
         ''                                                                                    AS locadd1,
         ''                                                                                    AS locadd2,
         ''                                                                                    AS locadd3,
         ''                                                                                    AS loccity,
         ''                                                                                    AS locstate,
         ''                                                                                    AS loczip,
         ''                                                                                    AS loccountry,
         ISNULL(sln.recid,0)                                                                   AS recidline,
         ISNULL(sln.linenum,0)                                                                 AS [lineno],
         --ISNULL(sln.itemid,'')                                                              AS itemid,
   ISNULL(lin.itemid,'')                                                              AS itemid,
         ISNULL(sln.externalitemid,'')                                                         AS cusitemid,
         ISNULL(sln.[name],'')                                                                  AS itemdesc,
         NULL                                                                                  AS itemdesc2,
         CONVERT(DECIMAL(20,4), ISNULL(sln.salesprice,0))                                      AS price,              -- MC 05/18/2016 Change to retail price per Alex S. Don't send internal price to warehouse.
         1                                                                                     AS priceratio,
         CONVERT(DECIMAL(20,4), ISNULL(sln.LINEAMOUNT,0))                                      AS unitcost,           -- MC 05/18/2016 Change to retail price per Alex S. Don't send internal price to warehouse.
         ''                                                                                    AS taxflag,
         CONVERT(DECIMAL(20,4), ISNULL(sln.qtyordered,0))                                      AS qtyord,
         --CONVERT(DECIMAL(20,4), ISNULL(sln.SALESQTY,0))                                        AS qtytoship,
   CONVERT(DECIMAL(20,4), ISNULL(lin.QTY,0))                                            AS qtytoship,
         ISNULL(sln.salesunit,'')                                                             AS uom,
         ''                                                                                    AS locid,
         CONVERT(NVARCHAR(8), ISNULL(sls.RECEIPTDATEREQUESTED,0), 112)                       AS requestdate,
         CONVERT(NVARCHAR(8), ISNULL(sls.SHIPPINGDATEREQUESTED,0), 112)                       AS promisedate,
         CONVERT(NVARCHAR(8), ISNULL(sls.shippingdaterequested,0), 112)                       AS requestedshipdate,
         CAST(RETAILSALESPRICE AS money)                                                             AS linuser1,                       -- MC 05/04/2016 Use for retail price
         --''                                                                                  AS linuser1,                       -- MC 05/04/2016 Use for retail price
         sln.INVENTTRANSID                                                                     AS linuser2,
         NULL                                                                                  AS linuser3,
         NULL                                                                                AS linuser4,
         NULL                                                                                  AS linuser5,
         ''                                                                                    AS hdruser1,
         ''                                                                                    AS hdruser2,
         ''                                                                                    AS hdruser3,
         ''                                                                                    AS hdruser4,
         ''                                                                                    AS hdruser5,
         CONVERT(nvarchar(8), ISNULL(sls.createddatetime,0), 112)                            AS pickeddate,
         CONVERT(nvarchar(8), ISNULL(sls.createddatetime,0), 112)                            AS shippeddate,
         CONVERT(nvarchar(8), ISNULL(0,0), 112)                                              AS posteddate,
         sls.dataareaid                                                                         AS dataareaid

  --SELECT sls.RECID, d1.REFRECID,d1.TYPEID,sls.PARTITION,d1.PARTITION,d1.REFTABLEID
     FROM       dbo.WMSPICKINGROUTE        rte WITH (NOLOCK)

   LEFT JOIN  (SELECT distinct transrefid,'R' as change from dbo.WMSPICKINGROUTE WITH (NOLOCK) WHERE expeditionstatus = '20') rte2  -- ss 6/2/2014
          ON     rte2.transrefid        = rte.transrefid



  INNER JOIN dbo.wmsordertrans          lin WITH (NOLOCK)
          ON     rte.PICKINGROUTEID     = lin.ROUTEID
       AND rte.DATAAREAID         = lin.DATAAREAID     -- EC 10/15/2013
             AND rte.PARTITION          = lin.PARTITION

  INNER JOIN dbo.wmsorder               hdr WITH (NOLOCK)
          ON     hdr.ORDERID            = lin.orderid
             AND hdr.dataareaid         = lin.dataareaid
    AND hdr.PARTITION          = lin.PARTITION

  INNER JOIN dbo.custtable              cus WITH (NOLOCK)
          ON     hdr.customer        =  cus.accountnum
             AND hdr.dataareaid      =  cus.dataareaid
    AND hdr.PARTITION       =  cus.PARTITION


  INNER JOIN dbo.salestable               sls WITH (NOLOCK)
          ON     lin.INVENTTRANSREFID  =  sls.salesid
             AND hdr.dataareaid        =  sls.dataareaid
    AND hdr.PARTITION         =  sls.PARTITION


  INNER JOIN dbo.salesline              sln WITH (NOLOCK)
          ON     sls.salesid         =  sln.salesid
             AND lin.itemid          =  sln.itemid
             AND lin.dataareaid      =  sln.dataareaid
    AND lin.PARTITION       =  sln.PARTITION
             AND lin.INVENTTRANSID   =  sln.INVENTTRANSID  /*  BJK 12/1/2014 to account for the same item with different line
               numbers need to track back to the original inventory trans id from WMS */
  LEFT JOIN dbo.LCRSALESLINEEXT         rtl WITH (NOLOCK)
          ON     sln.RECID            = rtl.REFRECID
       AND sln.DATAAREAID       = rtl.DATAAREAID
    AND sln.PARTITION        = rtl.PARTITION


  INNER JOIN     dbo.dirpartylocation   par WITH (NOLOCK) --TK added
          ON     par.party            = cus.party
       AND par.PARTITION        = cus.PARTITION
             AND par.IsPostalAddress  = 1
             AND par.isPrimary        = 1


--  ---- ----DJI 2/6/2012 next two joins for filtering the delivery records
--  ----INNER JOIN     DirPartyLocationRole   plr WITH (NOLOCK)       -- DJI 2/6/2012
--  ----        ON     par.recid            = plr.partylocation


--  ----INNER JOIN     LogisticsLocationRole  llr WITH (NOLOCK)       -- DJI 2/6/2012
--  ----        ON     plr.locationrole     = llr.recid
--  ----               AND llr.type             = 2 --delivery

  INNER JOIN     dbo.LogisticsLocation  loc WITH (NOLOCK) --TK added
          ON     loc.recid            = par.Location
       AND loc.PARTITION        = par.PARTITION
             AND loc.ispostaladdress  = 1                       -- DJI 2/6/2012


  INNER JOIN     LogisticsPostalAddress adr WITH (NOLOCK) --TK added
          ON     adr.location              = loc.recid
       AND adr.PARTITION             = loc.PARTITION
             AND adr.ValidFrom             < GetDate()
             AND adr.ValidTo               > GetDate()


   LEFT JOIN     dbo.InventLocation         il WITH (NOLOCK)
          ON     il.InventLocationID      = rte.INVENTLOCATIONID
             AND il.DataAreaID            = hdr.DataAreaID
    AND il.PARTITION             = hdr.PARTITION


   LEFT JOIN     LogisticsPostalAddress     del WITH (NOLOCK)
          ON     del.recid                = sls.DeliveryPostalAddress
       AND del.PARTITION            = sls.PARTITION


   LEFT JOIN     dbo.LogisticsLocation      dloc WITH (NOLOCK)
          ON     del.location             = dloc.recid
       AND del.PARTITION            = dloc.PARTITION

   LEFT JOIN     INVENTLOCATIONLOGISTICSLOCATION ladr WITH (NOLOCK)
          ON     il.recid                 = ladr.inventlocation
       AND il.PARTITION             = ladr.PARTITION


   LEFT JOIN     dbo.DIRDUNSNUMBER               duns WITH (NOLOCK)                    --TK 10/23/2013
          ON     duns.RECID               = dloc.DUNSNUMBERRECID
       AND duns.PARTITION           = dloc.PARTITION


   LEFT JOIN     LogisticsPostalAddress     ila WITH (NOLOCK)
          ON     ila.location             = ladr.location
       AND ila.PARTITION            = ladr.PARTITION


   LEFT JOIN     TMSCARRIERSERVICE          tms WITH (NOLOCK)                  -- MC 04/08/2016 Added to match EDICarrier view setup.
          ON     tms.DLVMODEID            = sls.dlvmode
    AND tms.DATAAREAID           = sls.DATAAREAID
       AND tms.PARTITION            = sls.PARTITION


   LEFT JOIN     TMSCARRIER                 tmc WITH (NOLOCK)                  -- MC 05/11/2016 Added to get SCAC
          ON     tmc.CARRIERCODE          = tms.CARRIERCODE
   AND     tmc.DATAAREAID           = tms.DATAAREAID
   AND     tmc.PARTITION            = tms.PARTITION


   LEFT JOIN     dbo.LogisticsLocation  loc2 WITH (NOLOCK)  -- TK - Link to parent del adr
          ON     loc2.RECID               = par.Location
             AND loc2.ISPOSTALADDRESS     = 1
             AND loc2.PARTITION           = par.PARTITION


   LEFT JOIN     LogisticsElectronicAddress tel WITH (NOLOCK)  -- Contact info
          ON     tel.location        = loc2.recid
       AND tel.PARTITION       = loc2.PARTITION

    LEFT JOIN    (SELECT DISTINCT REFRECID, REFCOMPANYID, REFTABLEID, MAX(NOTES) as NAME FROM dbo.DOCUREF WITH (NOLOCK) GROUP BY REFRECID,REFCOMPANYID, REFTABLEID)  lcmtsh    -- EC 10/17/2013
          ON     sls.DATAAREAID       = lcmtsh.REFCOMPANYID
             AND sls.RECID            = lcmtsh.REFRECID
             AND lcmtsh.REFTABLEID    = 366
                --and lcmtsh.TYPEID = 'S&H'



-- SHIPFROM
   LEFT JOIN dbo.INVENTLOCATION sf WITH (NOLOCK)
          ON     sf.INVENTLOCATIONID      = sls.INVENTLOCATIONID                             -- MC 04/08/2016 Change back to INNER JOIN.
             AND sf.DATAAREAID            = sls.DATAAREAID
    AND sf.PARTITION             = sls.PARTITION


   LEFT JOIN     INVENTLOCATIONLOGISTICSLOCATION ladr2 WITH (NOLOCK) --TK added              -- MC 04/08/2016 Change back to INNER JOIN. Currently no data in table.
          ON     sf.recid                 = ladr2.inventlocation
       AND sf.PARTITION             = ladr2.PARTITION

   LEFT JOIN     LogisticsPostalAddress     ila2 WITH (NOLOCK) --TK added                    -- MC 04/08/2016 Change back to INNER JOIN
          ON     ila2.location             = ladr2.location
             AND ila2.validfrom           <= GETUTCDATE()            -- DJI 2/7/2012
             AND ila2.validto             >= GETUTCDATE()            -- DJI 2/7/2012
    AND ila2.PARTITION            = ladr2.PARTITION

   LEFT JOIN     DOCUREF                     d1 WITH (NOLOCK)
          ON     sls.RECID                 = d1.REFRECID
             AND 'Note'                    = d1.TYPEID
    AND 'Note/Special Instruction'= d1.NAME
             AND d1.REFTABLEID             = 366
    AND sls.PARTITION             = d1.PARTITION


   --LEFT JOIN     DOCUREF                     d2 WITH (NOLOCK)
   --       ON     sls.RECID                 = d2.REFRECID
   --          AND 'EDI Dates'               = d2.NAME
   --          AND d2.REFTABLEID             = 366
   -- AND sls.PARTITION             = d2.PARTITION



  WHERE sls.DOCUMENTSTATUS = '4'
    AND rte.EXPEDITIONSTATUS != '20'


    --AND hdr.createddatetime > GETDATE() - 60                                 -- MC 04/08/2016 Removed for testing
 --AND rte.pickingrouteid='DCA-000081'





-- USE FOR TRANSFER ORDERS. Warehouse cannot process 943's so we send them using the 940 view.
UNION ALL


         SELECT

         ''                                                                                                        AS Docstatus,
         ''                                                                                                        AS Salesstatus,
         hdr.recid                                                                                                 AS recid,
         hdr.TRANSFERID                                                                                            AS orderno,
         CONVERT(NVARCHAR(8), ISNULL(hdr.SHIPDATE,0), 112)                                                         AS orderdate,
         ''                                                                                                        AS pickinglistid,
         ''                                                                                                        AS pickinglistdate,
         ''                                                                                                        AS ordertype,
         ''                                                                                                        AS salesorderno,
         LTRIM(RTRIM(ISNULL(hdr.TRANSFERID,'')))                                                                   AS purchaseorderno,
         ISNULL(hdr.INVENTLOCATIONIDTO,'')                                                                         AS cusno,                     -- assumes warehouse ID; if using sites in AX, use loc.inventsiteid
         ''                                                                                                        AS status,
         ISNULL(hdr.TRANSFERID,'')                                                                                 AS bolno,
         ISNULL(hdr.INVENTLOCATIONIDTO,'')                                                                         AS shiptoxref,                --or loc.INVENTSITEID
         ISNULL(hdr.TOADDRESSNAME,'')                                                                              AS shiptoname,

            CASE
                     WHEN CHARINDEX(',', adr.street) > 0
                         THEN LTRIM(RTRIM(SUBSTRING(adr.STREET,
                                          1,
                                          CHARINDEX(',', adr.STREET) - 1)))
                     ELSE ISNULL(adr.STREET,'')
                  END                                                                                              AS shiptoadd1,

                 CASE
                     WHEN CHARINDEX(',', adr.STREET) > 0
                         THEN LTRIM(RTRIM(SUBSTRING(adr.STREET,
                                          CHARINDEX(',', adr.STREET) + 1,
                                          LEN(adr.STREET) - CHARINDEX(',', adr.STREET) + 1)))
                     ELSE ''
                  END                                                                                              AS shiptoadd2,

         ''                                                                                                        AS shiptoadd3,
         ISNULL(adr.CITY,'')                                                                                       AS shiptocity,
         ISNULL(adr.STATE,'')                                                                                      AS shiptostate,
         ISNULL(adr.ZIPCODE,'')                                                                                    AS shiptozip,
         ISNULL(adr.COUNTRYREGIONID,'')                                                                            AS shiptocountry,
         CONVERT(NVARCHAR(8), ISNULL(hdr.SHIPDATE,0), 112)                                                         AS shipdate,
         ''                                                                                                        AS canceldate,
         ISNULL(hdr.DLVMODEID,'')                                                                                  AS shipviaid,                  -- MC 04/08/2016 Changed to match "carrierid" in VP carrier table
         ISNULL(hdr.DLVTERMID,'')                                                                                  AS termsid,
         NULL                                                                                                      AS collect,
         ''                                                                                                        AS shippinginstructions1,
         ''                                                                                                        AS shippinginstructions2,
         --REPLACE(REPLACE(LTRIM(RTRIM(ISNULL(d1.NOTES,''))),CHAR(10),' '),CHAR(13),' ')                             AS comment1,                   -- NOTES   MC 05/10/2016 CHECK AND TEST
         NULL                                                                                                      AS comment1,
         NULL                                                                                                      AS comment2,
         NULL                                                                                                      AS comment3,
         ISNULL(hdr.INVENTLOCATIONIDTO,'')                                                                         AS inventorylocationid,        -- or loc.inventsiteid
         ''                                                                                                        AS department,
         ISNULL(hdr.FROMADDRESSNAME,'')                                                                            AS billtoname,
         NULL                                                                                                      AS billtoadd1,
         NULL                                                                                                      AS billtoadd2,
         NULL                                                                                                      AS billtocity,
         NULL                                                                                                      AS billtostate,
         NULL                                                                                                      AS billtozip,
         NULL                                                                                                      AS billtocountry,
         NULL                                                                                                      AS billtocontact,
         NULL                                                                                                      AS billtocontact2,
         NULL                                                                                                      AS billtophone,
         NULL                                                                                                      AS billtophone2,
         NULL                                                                                                      AS billtofax,
         NULL                                                                                                      AS billtoemail,
         NULL                                                                                                      AS cususer1,
         NULL                                                                                                      AS cususer2,
         NULL                                                                                                      AS cususer3,
         NULL                                                                                                      AS cususer4,
         NULL                                                                                                      AS cususer5,
         ''                                                                                                        AS altadrid,
         ISNULL(hdr.TOADDRESSNAME,'')                                                                              AS altadrname,

                  CASE
                     WHEN CHARINDEX(',', adr.street) > 0
                         THEN LTRIM(RTRIM(SUBSTRING(adr.STREET,
                                          1,
                                          CHARINDEX(',', adr.STREET) - 1)))
                     ELSE ISNULL(adr.STREET,'')
                  END                                                                                              AS altadradd1,

                 CASE
                     WHEN CHARINDEX(',', adr.STREET) > 0
                         THEN LTRIM(RTRIM(SUBSTRING(adr.STREET,
                                          CHARINDEX(',', adr.STREET) + 1,
                                          LEN(adr.STREET) - CHARINDEX(',', adr.STREET) + 1)))
                     ELSE ''
                  END                                                                                              AS altadradd2,

         NULL                                                                                                      AS altadradd3,
         ISNULL(adr.CITY,'')                                                                                       AS altadrcity,
         ISNULL(adr.STATE,'')                                                                                      AS altadrstate,
         ISNULL(adr.ZIPCODE,'')                                                                                    AS altadrzip,
         ISNULL(adr.COUNTRYREGIONID,'')                                                                            AS altadrcountry,
         NULL                                                                                                      AS altadrcontact,
         NULL                                                                                                      AS altadrcontact2,
         NULL                                                                                                      AS altadrphone,
         NULL                                                                                                      AS altadrphone2,
         NULL                                                                                                      AS altadrfax,
         NULL                                                                                                      AS altadruser1,
         NULL                                                                                                      AS altadruser2,
         NULL                                                                                                      AS altadruser3,
         NULL                                                                                                      AS altadruser4,
         NULL                                                                                                      AS altadruser5,
         NULL                                                                                                      AS altadremail,
         hdr.INVENTLOCATIONIDFROM                                                                                  AS shipfrid,             -- or sf.inventsiteid

         ISNULL(hdr.FROMADDRESSNAME,'')                                                                            AS shipfrname,
                  CASE
                     WHEN CHARINDEX(',', ila.street) > 0
                         THEN LTRIM(RTRIM(SUBSTRING(ila.STREET,
                                          1,
                                          CHARINDEX(',', ila.STREET) - 1)))
                     ELSE ISNULL(ila.STREET,'')
                  END                                                                                              AS shipfradd1,

                 CASE
                     WHEN CHARINDEX(',', ila.STREET) > 0
                         THEN LTRIM(RTRIM(SUBSTRING(ila.STREET,
                                          CHARINDEX(',', ila.STREET) + 1,
                                          LEN(ila.STREET) - CHARINDEX(',', ila.STREET) + 1)))
                     ELSE ''
                 END                                                                                               AS shipfradd2,

         ''                                                                                                        AS shipfradd3,
         ISNULL(ila.CITY,'')                                                                                       AS shipfrcity,
         ISNULL(ila.STATE,'')                                                                                      AS shipfrstate,
         ISNULL(ila.ZIPCODE,'')                                                                                    AS shipfrzip,
         ISNULL(ila.COUNTRYREGIONID,'')                                                                            AS shipfrcountry,
         ''                                                                                                        AS shipfrcontact,
         ''                                                                                                        AS shipfrcontact2,
         ''                                                                                                        AS shipfrphone,
         ''                                                                                                        AS shipfrphone2,
         ''                                                                                                        AS shipfrfax,
         ''                                                                                                        AS shipfremail,
         ''                                                                                                        AS shipfruser1,
         ''                                                                                                        AS shipfruser2,
         ''                                                                                                        AS shipfruser3,
         ''                                                                                                        AS shipfruser4,
         ''                                                                                                        AS shipfruser5,
         ''                                                                                                        AS locname,
         ISNULL(hdr.FROMADDRESSNAME,'')                                                                            AS locadd1,
         ''                                                                                                        AS locadd2,
         ''                                                                                                        AS locadd3,
         ''                                                                                                        AS loccity,
         ''                                                                                                        AS locstate,
         ''                                                                                                        AS loczip,
         ''                                                                                                        AS loccountry,
         ISNULL(lin.recid,0)                                                                                       AS recidline,
         ISNULL(lin.linenum,0)                                                                                     AS [lineno],
         lin.ITEMID                                                                                                AS itemid,
         ''                                                                                                        AS cusitemid,
         ISNULL(ite.PRODUCTNAME,'')                                                                                AS itemdesc,                       -- MC 05/10/2016 CHECK
         NULL                                                                                                      AS itemdesc2,
         0                                                                                                         AS price,
         ''                                                                                                        AS priceratio,
         0                                                                                                         AS unitcost,
         ''                                                                                                        AS taxflag,
         ISNULL(lin.QTYTRANSFER, 0)                                                                                AS qtyord,
         ISNULL(lin.QTYSHIPPED,0)                                                                                  AS qtytoship,
         UPPER(ISNULL(lin.UNITID,''))                                                                              AS uom,
         hdr.INVENTLOCATIONIDFROM                                                                                  AS locid,
         CONVERT(NVARCHAR(8), ISNULL(lin.SHIPDATE,0), 112)                                                         AS requestdate,
         CONVERT(NVARCHAR(8), ISNULL(lin.RECEIVEDATE,0), 112)                                                      AS promisedate,
         CONVERT(NVARCHAR(8), ISNULL(lin.SHIPDATE,0), 112)                                                         AS requestedshipdate,
         ''                                                                                                        AS linuser1,                       -- MC 05/04/2016 Use for retail price
         lin.INVENTTRANSID                                                                                         AS linuser2,
         NULL                                                                                                      AS linuser3,
         NULL                                                                                                      AS linuser4,
         NULL                                                                                                      AS linuser5,
         ''                                                                                                        AS hdruser1,
         ''                                                                                                        AS hdruser2,
         ''                                                                                                        AS hdruser3,
         ''                                                                                                        AS hdruser4,
         ''                                                                                                        AS hdruser5,
         CONVERT(NVARCHAR(8), ISNULL(lin.shipdate,0), 112)                                                         AS pickeddate,
         CONVERT(NVARCHAR(8), ISNULL(lin.shipdate,0), 112)                                                         AS shippeddate,
         ''                                                                                                        AS posteddate,
         hdr.dataareaid                                                                                            AS dataareaid


         FROM dbo.INVENTTRANSFERTABLE    hdr WITH (NOLOCK)



   INNER JOIN dbo.INVENTTRANSFERLINE     lin WITH (NOLOCK)


           ON     hdr.TRANSFERID       = lin.TRANSFERID
        AND hdr.dataareaid       = lin.dataareaid
     AND hdr.PARTITION        = lin.PARTITION

   INNER JOIN dbo.INVENTLOCATION         loc WITH (NOLOCK)


           ON     loc.INVENTLOCATIONID = hdr.INVENTLOCATIONIDTO
              AND loc.DATAAREAID       = hdr.DATAAREAID
     AND loc.PARTITION        = hdr.PARTITION

   INNER JOIN dbo.INVENTTABLE            itm WITH (NOLOCK)
        ON     lin.ITEMID           = itm.ITEMID
        AND lin.DATAAREAID       = itm.DATAAREAID
        AND lin.PARTITION        = itm.PARTITION

   INNER JOIN dbo.INVENTTABLEEXPANDED   ite WITH (NOLOCK)
           ON     itm.itemid          = ite.itemid
              AND itm.DATAAREAID      = ite.DATAAREAID
              AND itm.PARTITION       = ite.PARTITION


    LEFT JOIN dbo.INVENTDIM              dim WITH (NOLOCK)
           ON     lin.inventdimid      = dim.inventdimid
              AND lin.DATAAREAID       = dim.DATAAREAID
     AND lin.PARTITION        = dim.PARTITION

    LEFT JOIN dbo.INVENTLOCATION         sf WITH (NOLOCK)
           ON     sf.INVENTLOCATIONID  = hdr.INVENTLOCATIONIDFROM
        AND sf.DATAAREAID        = hdr.DATAAREAID
     AND sf.PARTITION         = hdr.PARTITION


    -- To obtain address information for Ship To Address


 LEFT JOIN dbo.LogisticsPostalAddress adr WITH (NOLOCK)                   -- MC 05/12/2016 Added
           ON     adr.RECID            = hdr.TOPOSTALADDRESS
        AND adr.PARTITION        = hdr.PARTITION


   -- LEFT JOIN dbo.INVENTLOCATIONLOGISTICSLOCATION ladr1 WITH (NOLOCK)      -- MC 05/12/2016 Orig
   --        ON     loc.recid            = ladr1.inventlocation
   --     AND loc.PARTITION        = ladr1.PARTITION


   --LEFT JOIN      LogisticsPostalAddress     adr WITH (NOLOCK)             -- MC 05/12/2016 Orig
   --       ON      adr.location         = ladr1.location
   --     AND adr.PARTITION        = ladr1.PARTITION


    -- To obtain address information for Ship From Address

   LEFT JOIN dbo.LogisticsPostalAddress ila WITH (NOLOCK)                   -- MC 05/12/2016 Added
           ON     ila.RECID            = hdr.FROMPOSTALADDRESS
        AND ila.PARTITION        = hdr.PARTITION



   --LEFT JOIN     INVENTLOCATIONLOGISTICSLOCATION ladr WITH (NOLOCK)        -- MC 05/12/2016 Orig
   --       ON     sf.recid              = ladr.inventlocation
   --      AND     sf.PARTITION          = ladr.PARTITION


   --LEFT JOIN     LogisticsPostalAddress     ila WITH (NOLOCK)              -- MC 05/12/2016 Orig
   --       ON     ila.location          = ladr.location
   --      AND     ila.PARTITION         = ladr.PARTITION


   --LEFT JOIN     DOCUREF                     d1 WITH (NOLOCK)                           -- MC 05/10/2016 CHECK AND TEST
   --       ON     hdr.RECID                 = d1.REFRECID
   --          AND 'Note'                    = d1.TYPEID
   -- AND 'Note/Special Instruction'= d1.NAME
   --          AND d1.REFTABLEID             = 366
   -- AND hdr.PARTITION             = d1.PARTITION




  WHERE hdr.TRANSFERSTATUS = 1  -- 0 = created, 1 = shipped, 2 = received        -- PUT BACK
    AND lin.LINENUM > 0
    AND lin.QTYSHIPPED > 0




    -- Optional Bar Code Table
 --LEFT JOIN dbo.InventItemBarcode    bar     WITH (NOLOCK)
 --        ON     itm.itemid         = bar.itemid
 --           AND itm.dataareaid     = bar.dataareaid
 --     AND itm.PARTITION      = bar.PARTITION
 --           AND bar.barcodesetupid = 'UPC'

















GO



Linked Servers - Sql server 2005 to connect to Oracle 11g using ldap.ora instead of tnsnames.ora

$
0
0
We have a SQL Server 2005 64bit box that needs a linked server created to Oracle 11g 64bit box. I have all the Oracle client software installed and can successfully connect to the Oracle database using SQL+ on the SQL Server 2005 64bit box. When I create the linked server and select the OraOledb.Oracle provider, I get the TNSNames error. The Oracle server does not use tnsnames.ora it uses OLAP.ora to resolve. How do I get Linked server to stop trying to connect via TNSNames and use the OLAP.ora file instead? I can't find any articles for this specific issues. All Oracle examples tell you to use TNSNAMES. The Oracle server is not under my companies control so I can not force the vendor to use tnsnames instead of OLAP.

SQL Server Transaction Log Corruption?

$
0
0

Is there a query to run to verify that transaction log is corrupted?

I have a user that has some SQL knowledge who is adamant that transaction log is corrupt.

However, I have no problem backing up the transaction log and restoring it to other servers.

Thanks in advance.

SQLServer 2008, SQL Server Services not starting.

$
0
0

hii

When I'm Starting the SQL Server Services its giving erroer like

"Windows could not start the SQL Server (SQLEXPRESS) service on local computer. Error Code 3417."

Is there any issue related with ldf file.?

if so please give solution to it.

waitng for your reply.


With Regards, CharanTeja.

Non-yielding Scheduler and Timeout occurred while waiting for latch: class 'VERSIONING_TRANSACTION_LIST'

$
0
0

Hello!

We have SQL Server instance running on Windows Server 2012 R2 with 128 GB of RAM

Microsoft SQL Server 2014 - 12.0.4100.1 (X64) 
Apr 20 2015 17:29:27 
Copyright (c) Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: )

max server memory (MB): 62000 of total 128 GB

95% of system RAM is allocated to all three SQL instances. 

************************************************

04/27/2016 03:20:00,spid105,Unknown,A time-out occurred while waiting for buffer latch -- type 4<c/> bp 000000105BDEAD40<c/> page 1:129678<c/> stat 0x1000f<c/> database id: 4<c/> allocation unit Id: 72057594053722112<c/> task 0x0000000895BFACA8 : 0<c/> waittime 300 seconds<c/> flags 0x19<c/> owning task 0x000000101F6268C8. Not continuing to wait.
04/27/2016 03:20:00,spid110,Unknown,Timeout occurred while waiting for latch: class 'VERSIONING_TRANSACTION_LIST'<c/> id 00007FFFA536E570<c/> type 2<c/> Task 0x0000000630B468C8 : 0<c/> waittime 300 seconds<c/> flags 0x1a<c/> owning task 0x00000005E73A9088. Continuing to wait.
04/27/2016 03:19:52,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 15 ms<c/> user 693906 ms. Process Utilization 4%. System Idle 86%. Interval: 917492 ms.
04/27/2016 03:19:32,spid30s,Unknown,Timeout occurred while waiting for latch: class 'VERSIONING_TRANSACTION_LIST'<c/> id 00007FFFA536E570<c/> type 2<c/> Task 0x00000007E5947088 : 0<c/> waittime 900 seconds<c/> flags 0x1a<c/> owning task 0x00000005E73A9088. Continuing to wait.
04/27/2016 03:18:52,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 15 ms<c/> user 647953 ms. Process Utilization 4%. System Idle 86%. Interval: 857239 ms.
04/27/2016 03:17:52,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 0 ms<c/> user 600500 ms. Process Utilization 4%. System Idle 85%. Interval: 797001 ms.
04/27/2016 03:16:52,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 0 ms<c/> user 557781 ms. Process Utilization 4%. System Idle 85%. Interval: 736763 ms.
04/27/2016 03:15:52,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 0 ms<c/> user 510296 ms. Process Utilization 4%. System Idle 85%. Interval: 676525 ms.
04/27/2016 03:15:17,spid23s,Unknown,Timeout occurred while waiting for latch: class 'VERSIONING_TRANSACTION_LIST'<c/> id 00007FFFA536E570<c/> type 2<c/> Task 0x0000000A0B3CECA8 : 0<c/> waittime 600 seconds<c/> flags 0x1a<c/> owning task 0x00000005E73A9088. Continuing to wait.
04/27/2016 03:15:00,Backup,Unknown,Log was backed up. Database: BIA_SignalR<c/> creation date(time): 2015/07/03(14:10:42)<c/> first LSN: 1245:121901:1<c/> last LSN: 1245:121904:1<c/> number of dump devices: 1<c/> device information: (FILE=1<c/> TYPE=DISK: {'\\nllwdb04\NLLWDB02_BETCLOCK\TRAN\BIA_SignalR\BIA_SignalR_backup_2016_04_27_031500_5382530.trn'}). This is an informational message only. No user action is required.
04/27/2016 03:14:51,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 0 ms<c/> user 466812 ms. Process Utilization 4%. System Idle 85%. Interval: 616271 ms.
04/27/2016 03:14:32,spid30s,Unknown,Timeout occurred while waiting for latch: class 'VERSIONING_TRANSACTION_LIST'<c/> id 00007FFFA536E570<c/> type 2<c/> Task 0x00000007E5947088 : 0<c/> waittime 600 seconds<c/> flags 0x1a<c/> owning task 0x00000005E73A9088. Continuing to wait.
04/27/2016 03:13:51,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 0 ms<c/> user 420312 ms. Process Utilization 4%. System Idle 84%. Interval: 556018 ms.
04/27/2016 03:12:51,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 0 ms<c/> user 372875 ms. Process Utilization 4%. System Idle 84%. Interval: 495763 ms.
04/27/2016 03:11:50,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 0 ms<c/> user 330125 ms. Process Utilization 4%. System Idle 83%. Interval: 435509 ms.
04/27/2016 03:10:50,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 0 ms<c/> user 282765 ms. Process Utilization 4%. System Idle 81%. Interval: 375303 ms.
04/27/2016 03:10:17,spid23s,Unknown,Timeout occurred while waiting for latch: class 'VERSIONING_TRANSACTION_LIST'<c/> id 00007FFFA536E570<c/> type 2<c/> Task 0x0000000A0B3CECA8 : 0<c/> waittime 300 seconds<c/> flags 0x1a<c/> owning task 0x00000005E73A9088. Continuing to wait.
04/27/2016 03:09:50,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 0 ms<c/> user 239625 ms. Process Utilization 4%. System Idle 80%. Interval: 315049 ms.
04/27/2016 03:08:50,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 0 ms<c/> user 192562 ms. Process Utilization 4%. System Idle 80%. Interval: 254796 ms.
04/27/2016 03:07:50,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 0 ms<c/> user 145234 ms. Process Utilization 4%. System Idle 82%. Interval: 194558 ms.
04/27/2016 03:06:49,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 0 ms<c/> user 102500 ms. Process Utilization 4%. System Idle 82%. Interval: 134320 ms.
04/27/2016 03:05:49,Server,Unknown,Process 0:0:0 (0x5260) Worker 0x00000002E8472160 appears to be non-yielding on Scheduler 11. Thread creation time: 13106199868734. Approx Thread CPU Used: kernel 0 ms<c/> user 52281 ms. Process Utilization 4%. System Idle 82%. Interval: 70285 ms.
04/27/2016 03:05:49,Server,Unknown,External dump process return code 0x20000001.<nl/>External dump process returned no errors.
04/27/2016 03:05:45,Server,Unknown,Stack Signature for the dump is 0x000000000000011A
04/27/2016 03:05:45,Server,Unknown,* *******************************************************************************
04/27/2016 03:05:45,Server,Unknown,*
04/27/2016 03:05:45,Server,Unknown,* Non-yielding Scheduler
04/27/2016 03:05:45,Server,Unknown,*
04/27/2016 03:05:45,Server,Unknown,*   04/27/16 03:05:45 spid 5968
04/27/2016 03:05:45,Server,Unknown,* BEGIN STACK DUMP:
04/27/2016 03:05:45,Server,Unknown,*
04/27/2016 03:05:45,Server,Unknown,* ******************************************************************************

As you can see there are several types of latch timeouts.

One of them applies to msdb database.

Next, I've tried to analyze mini dump with the following results.

Copied stack:

00 sqlmin!Spinlock<135,4,1>::SpinToAcquireWithExponentialBackoff
01 sqlmin!XVMgr::RemoveInactiveXVB
02 sqlmin!XVMgr::GC
03 sqlmin!XVB::ReleaseXVB
04 sqlmin!ReadOnlyXactImp::UnInit
05 sqlmin!ReadOnlyXactImp::Rollback
06 sqllang!CMsqlReadOnlyXact::Commit
07 sqllang!CMsqlXactInternalReadOnly::Commit
08 sqllang!CMsqlXactImp::Commit
09 sqllang!CXStmtQuery::FinishNormalImp
0a sqllang!CMsqlExecContext::ExecuteStmts<1,0>
0b sqllang!CMsqlExecContext::FExecute
0c sqllang!CSQLSource::Execute
0d sqllang!ExecuteSql
0e sqllang!CSpecProc::ExecuteSpecial
0f sqllang!CSpecProc::Execute
10 sqllang!process_request
11 sqllang!process_commands
12 sqldk!SOS_Task::Param::Execute
13 sqldk!SOS_Scheduler::RunTask
14 sqldk!SOS_Scheduler::ProcessTasks
15 sqldk!SchedulerManager::WorkerEntryPoint
16 sqldk!SystemThread::RunWorker
17 sqldk!SystemThreadDispatcher::ProcessWorker
18 sqldk!SchedulerManager::ThreadEntryPoint
19 kernel32!BaseThreadInitThunk
1a ntdll!RtlUserThreadStart

Current stack:

00 sqlmin!Spinlock<135,4,1>::SpinToAcquireWithExponentialBackoff
01 sqlmin!XVMgr::RemoveInactiveXVB
02 sqlmin!XVMgr::GC
03 sqlmin!XVB::ReleaseXVB
04 sqlmin!ReadOnlyXactImp::UnInit
05 sqlmin!ReadOnlyXactImp::Rollback
06 sqllang!CMsqlReadOnlyXact::Commit
07 sqllang!CMsqlXactInternalReadOnly::Commit
08 sqllang!CMsqlXactImp::Commit
09 sqllang!CXStmtQuery::FinishNormalImp
0a sqllang!CMsqlExecContext::ExecuteStmts<1,0>
0b sqllang!CMsqlExecContext::FExecute
0c sqllang!CSQLSource::Execute
0d sqllang!ExecuteSql
0e sqllang!CSpecProc::ExecuteSpecial
0f sqllang!CSpecProc::Execute

As I've correctlyunderstood sqllang!process_request generated Non-yielding Scheduler exception

Update statistics maintainance plan was running on the schedule basis in this time.

Could somebody explain me what is happened.


blocking problem

$
0
0

Now and then, like every fortnight, we experience severe blocking problem (user experience as a total hang) in a production environment running SQL2012.

The blocking process always shows subtype BULKOP_BACKUP_DB and object tempdb (from betalockinfo)

Grateful for tips how to resolve this issue

Document DB and SQL Server

$
0
0

Guys,

    Do we have option to interlink Document DB and SQL Server? 

Cheers,

Venkatesan Prabu. J

http://www.wikitechy.com/

  


Venkatesan Prabu .J www.kaashivinfotech.com http://venkattechnicalblog.blogspot.com/



dbo.Base and dbo.ExtensionBase tables are missing from my CRM 2011 organization database

$
0
0

Hi community

Does anyone knows about an emergency method/hack to recover missing dbo objects that might have been deleted by using  query commands on SQL, I´ve found  this inconsistency because the  CRM entity is corrupted in my organization's web application... and when I try to open/delete this entity on crm  only appears an sql error that says the dbo.entitynameBase is not valid

If anybody  has some information on what to do when these kind of situations happens, please let me know. 

Note: I don't have any other db backup  from where I could restore the whole organization before this error :(

Thanks in advance!



what the means Mode '0-null'

$
0
0

I run the  T-SQL below , and saw 0-null ,what the means? why SQL need them?

update  [dbo].[Table_1] set C2='44'  where [C1]='A4'



Please click the Mark as Answer button if a post solves your problem!


Showing statistics for non indexed views?

$
0
0

Dear all,

 

Primary platform is SQL Server 2014 SP1

How can I see all the stats for one view?

I am using the 'Include client statistics' in every trial I run from SSMS and now I would like to see the whole histogram along with more info)

DBCC SHOW_STATISTICS doesn’t work or so seems with non indexed views.

Msg 5239, Level 16, State 1, Line 16

Unable to process object ID 1765372037 (object 'EDIWarehouseOrder') because this DBCC command does not support objects of this type.

 

ACT! Premium wont open

$
0
0
Says the system server cant open data. I think it is something with SQL but have no idea . I am not savvy at this stuff. I did an upgrade and now ACT data won't open.

A Coffman

BUG ??

$
0
0
SELECT 1
WHERE 'FROM_DATE|2' LIKE '%FROM_DATE_2%'
Viewing all 15872 articles
Browse latest View live


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