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

SQLServer 2016 - "Maintenance clean up task" stuck - xp_delete_file problem

$
0
0

Hello,

On our new SQLServer 2016, the "Maintenance Cleanup Task" do not delete backup file.

I never had the problem with on older installation (2008R2 to 2014)

In the activity monitor, the session running this command is waiting on "MSQL_XP" .

 "EXECUTE master.dbo.xp_delete_file 0,N'U:\Backup\MSSQL13.SSDE\MSSQL\Backup\model\model_backup_2016_09_16_155708_9880904.bak'"

Then after 60 seconds, the task go in error : 

Executed as user: xxxx\yyyyy . Microsoft (R) SQL Server Execute Package Utility  Version 13.0.1601.5 for 64-bit  Copyright (C) 2016 Microsoft. All rights reserved.    Started:  16:08:16  Progress: 2016-09-16 16:08:16.77    Source: {F609BD64-CBC9-42CF-85EE-3537D0A1DF7A}      Executing query "DECLARE @Guid UNIQUEIDENTIFIER      EXECUTE msdb..sp...".: 100% complete  End Progress  Error: 2016-09-16 16:09:16.89     Code: 0xC002F210     Source: Maintenance Cleanup Task Execute SQL Task     Description: Executing the query "EXECUTE master.dbo.xp_delete_file 0,N'U:\Backup\MS..." failed with the following error: "Error executing xp_delete_file extended stored procedure: Specified file is not a SQL Server backup file.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  16:08:16  Finished: 16:09:17  Elapsed:  60.938 seconds.  The package execution failed.  The step failed.

I tried reading the header of this file, no problem found :

RESTORE HEADERONLY 
FROM DISK = N'U:\Backup\MSSQL13.SSDE\MSSQL\Backup\model\model_backup_2016_09_16_155708_9880904.bak' 
WITH NOUNLOAD;
GO

model_backup_2016_09_16_155708_9880904NULL1NULL012saSERVER\SSDEmodel8522003-04-08 09:13:36.0002833408340000001727000373400000017440000134000000172700037340000001665000372016-09-16 15:57:09.0002016-09-16 15:57:09.00000103319660913046081301708SERVER 512EBD0FE66-F91F-43F1-99C3-B52D803BB13690D16058-F1D1-4E96-8EC6-8D7BFDA42F15Latin1_General_CI_ASEBD0FE66-F91F-43F1-99C3-B52D803BB136000000000090D16058-F1D1-4E96-8EC6-8D7BFDA42F15NULLSIMPLENULLNULLDatabaseBC2B2591-4ECC-4760-8811-5E5D3EECCABD28334080NULLNULLNULL

I tried to delete a specific Maintenance plan text report, it worked fine. This problem seems to be specific for backup file, compressed or not.

I have the same problem on  every other server with SQLServer 2016.



SQL Server 2014 columnstore with partitioning/indexed views bug

$
0
0

Hi all,

This appears to be two separate bugs in SQL Server 2014, but somewhat related.  I'm running the latest cumulative update (version 12.0.2342).

Basically, I have a simple table that I partition and create a clustered columnstore index on.  Then, I create an indexed view with some of the columns.  The actual creation of the index fails with:

"Internal Query Processor Error: The query processor could not obtain access to a required interface."

If I reverse the order (i.e. create the indexed view on the table first, then create the columnstore index), it works fine.

Secondly, with or without partitions, if I create a clustered columnstore indexed table, then create an indexed view that contains an NVARCHAR column in the view, bulk inserts will fail with:

"SQL Server Assertion: File: <valrow.cpp>, line=415 Failed Assertion = '*((ULONG*)(pb + x_ibLengthInBuffer)) <= m_cbMaxLen'. This error may be timing-related. If the error persists after rerunning the statement, use DBCC CHECKDB to check the database for structural integrity, or restart the server to ensure in-memory data structures are not corrupted."

Of course, I have done a DBCC CHECKDB to no success.

The script to reproduce the former is below.  To test the bulk insert, simply create the structure without the partitioning and then use an SSIS package or what not to try to bulk load some data.

SET NOCOUNT ON

CREATE PARTITION FUNCTION [SalesByDate](datetime2(7)) AS RANGE LEFT FOR VALUES (N'1970-01-01T00:00:00.000', N'2013-01-01T00:00:00.000', N'2014-01-01T00:00:00.000')
CREATE PARTITION SCHEME [SalesByDate] AS PARTITION [SalesByDate] TO ([PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY])

CREATE TABLE [dbo].[Test](
	[TestId] [bigint] NOT NULL IDENTITY(1,1),
	[Key] nvarchar(50) NOT NULL,
	[Date] [datetime2](7) NOT NULL,
	[Num] [int] NOT NULL
) ON SalesByDate (Date)
GO

DECLARE @i INT = 0

WHILE @i < 100000
BEGIN
INSERT INTO dbo.Test
SELECT 'Blah!', DATEADD(DAY, CAST(RAND() * 720 as INT), '2013-01-01'), CAST(RAND() * 100 as INT)
UNION ALL
SELECT 'Blah!', DATEADD(DAY, CAST(RAND() * 720 as INT), '2013-01-01'), CAST(RAND() * 100 as INT)
UNION ALL
SELECT 'Blah!', DATEADD(DAY, CAST(RAND() * 720 as INT), '2013-01-01'), CAST(RAND() * 100 as INT)
UNION ALL
SELECT 'Blah!', DATEADD(DAY, CAST(RAND() * 720 as INT), '2013-01-01'), CAST(RAND() * 100 as INT)
UNION ALL
SELECT 'Blah!', DATEADD(DAY, CAST(RAND() * 720 as INT), '2013-01-01'), CAST(RAND() * 100 as INT)
UNION ALL
SELECT 'Blah!', DATEADD(DAY, CAST(RAND() * 720 as INT), '2013-01-01'), CAST(RAND() * 100 as INT)
UNION ALL
SELECT 'Blah!', DATEADD(DAY, CAST(RAND() * 720 as INT), '2013-01-01'), CAST(RAND() * 100 as INT)
UNION ALL
SELECT 'Blah!', DATEADD(DAY, CAST(RAND() * 720 as INT), '2013-01-01'), CAST(RAND() * 100 as INT)
UNION ALL
SELECT 'Blah!', DATEADD(DAY, CAST(RAND() * 720 as INT), '2013-01-01'), CAST(RAND() * 100 as INT)
UNION ALL
SELECT 'Blah!', DATEADD(DAY, CAST(RAND() * 720 as INT), '2013-01-01'), CAST(RAND() * 100 as INT)

SET @i = @i + 10
END

GO

CREATE CLUSTERED COLUMNSTORE INDEX PK_Test ON dbo.Test ON SalesByDate (Date)
GO

CREATE VIEW [dbo].[TestView]  WITH SCHEMABINDING
AS

SELECT [Date],
	[Key],
	[TestId]
  FROM [dbo].[Test]
GO

CREATE UNIQUE CLUSTERED INDEX PK_TestView ON dbo.TestView (Date, TestId) ON SalesByDate (Date)
GO

Spread one table across multiple data files

$
0
0

Hello

Is there a way to spread the data of one table across multiple data files? As far as I know we cannot really achieve it unless we have table partitioning and place the indexes on multiple filegroups/files.

Please confirm this and let me know if there is a way to spread the data of one non-partitioned table across multiple data files.

- Satya

Can we create columnstore Index in index view

$
0
0

Hi All,

i want to create columnstore  Index  in index view is possible in SQL Server.

Regards,

Manish

Can't see the query plan for a cached plan

$
0
0

Hi all,

I've the plan_handle of an execution plan, when I try to see the plan itself with the following query:

SELECT * FROM sys.dm_exec_query_plan(0x050008004928A14A301E412B0C00000001000000000000000000000000000000000000000000000000000000)

I get this output

dbidobjectidnumberencryptedquery_plan
81252075593 10NULL

why can't I see the plan?

Appdomain Memory messages in SQL Errorlog

$
0
0
Hi Experts

Need help and guidance on an on-going memory issue on an SQL 2014 SSIS server. I am not sure how to isolate things here or where to start to avoid below memory warnings in the errorlog.

Brief Problem description :
========================
We have an Datawarehouse environment wherin a lot of ssis packages run every 15 mins as a part of SQL Agent jobs which are scheduled every 15 mins/4hours depending on source system availability.
Having said that, I am seeing some memory related messages from SQL Server ERRORLOG. More importantly, I would like to know why am I seeing appdomain errors on 64-bit servers.
Based on my knowledge, usually we used to see appdomain errors on 32 bit systems when MTL (mem-to-leave) portion is less.
Could anybody please explain why we are seeing these errors and how can I avoid or minimise such errors.

Enviroment
===========

SQL Server details
====================
Microsoft SQL Server 2014 (SP1-CU5) (KB3130926) - 12.0.4439.1 (X64)     Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)

OS information and Memory information
========================================
OS Name                    Microsoft Windows Server 2012 R2 Datacenter
Version                         6.3.9600 Build 9600
System Manufacturer    Microsoft Corporation
System Model                   Virtual Machine
System Type                      x64-based PC
Processor                            Intel(R) Xeon(R) CPU E5-4650L 0 @ 2.60GHz, 2600 Mhz, 8 Core(s), 8 Logical Processor(s)
Time Zone                           Pacific Daylight Time
Installed Physical Memory (RAM)             56.0 GB
Total Physical Memory                  56.0 GB
Available Physical Memory          21.1 GB
Total Virtual Memory                     75.9 GB
Available Virtual Memory             38.2 GB
Page File Space                                 19.9 GB


From Errorlog ( i see a lot of below errors getting repeated every now and then)
========================
2016-09-19 07:13:40.79 spid9s      AppDomain 186 (master.sys[runtime].418) is marked for unload due to memory pressure.
2016-09-19 07:13:40.79 spid9s      AppDomain 185 (mssqlsystemresource.dbo[runtime].417) is marked for unload due to memory pressure.
2016-09-19 07:13:40.79 spid36s     AppDomain 186 (master.sys[runtime].418) unloaded.
2016-09-19 07:13:40.79 spid9s      AppDomain 184 (SSISDB.dbo[runtime].416) is marked for unload due to memory pressure.
2016-09-19 07:13:40.79 spid9s      AppDomain 185 (mssqlsystemresource.dbo[runtime].417) unloaded.
2016-09-19 07:13:40.79 spid9s      AppDomain 184 (SSISDB.dbo[runtime].416) unloaded.
2016-09-19 07:14:18.92 spid92      AppDomain 187 (SSISDB.dbo[runtime].419) created.
2016-09-19 07:14:19.02 spid92      Unsafe assembly 'microsoft.sqlserver.integrationservices.server, version=12.0.0.0, culture=neutral, publickeytoken=89845dcd8080cc91, processorarchitecture=msil' loaded into appdomain 187 (SSISDB.dbo[runtime].419).

select * from sys.assemblies
name                                                   principal_id         assembly_id       clr_name                             permission_set                permission_set_desc     is_visible              create_date       modify_date      is_user_defined
Microsoft.SqlServer.Types          4                              1                              microsoft.sqlserver.types, version=12.0.0.0, culture=neutral, publickeytoken=89845dcd8080cc91, processorarchitecture=msil             3              UNSAFE_ACCESS                1              2012-02-10 20:16:00.850                2012-02-10 20:16:01.437                0

select * from sys.dm_clr_appdomains
appdomain_address      appdomain_id   appdomain_name           creation_time   db_id    user_id state                strong_refcount               weak_refcount cost        value     compatibility_level          total_processor_time_ms                total_allocated_memory_kb      survived_memory_kb
0x00000002EC1E0200      196         SSISDB.dbo[runtime].429             2016-09-21 23:31:36.770                6              1                E_APPDOMAIN_SHARED             1              5              406918  7109194                110         2875       2125677                1118
0x0000001877BDC200     113         master.sys[runtime].233              2016-08-26 12:44:34.450                1              4                E_APPDOMAIN_SHARED             48           1              8192       168820727           120         0              643         362

select * from sys.dm_clr_loaded_assemblies
assembly_id       appdomain_address            load_time
65537                 0x00000002EC1E0200      2016-09-21 23:31:37.183

 
-- perfmon counter values
counter_name                        Mem_GB
Target Server Memory (KB)       23GB
Total Server Memory (KB)        23GB


- highest memory consumers
-- Memory Clerk Usage for instance  (Query 43) (Memory Clerk Usage)
-- Look for high value for CACHESTORE_SQLCP (Ad-hoc query plans)
SELECT TOP(10) mc.[type] AS [Memory Clerk Type],
CAST((SUM(mc.pages_kb)/(1024.0 *1024)) AS DECIMAL (15,2)) AS [Memory Usage (GB)],
       CAST((SUM(mc.pages_kb)/1024.0) AS DECIMAL (15,2)) AS [Memory Usage (MB)]
FROM sys.dm_os_memory_clerks AS mc WITH (NOLOCK)
GROUP BY mc.[type]
ORDER BY SUM(mc.pages_kb) DESC OPTION (RECOMPILE);
go

Memory Clerk Type                   Memory Usage (GB)              Memory Usage (MB)
MEMORYCLERK_SQLBUFFERPOOL           17.32                                       17738.16
MEMORYCLERK_SQLQERESERVATIONS         5.43                                        5555.73
USERSTORE_DBMETADATA                1.51                                        1550.21
CACHESTORE_SQLCP                    1.40                                        1435.45
OBJECTSTORE_LOCK_MANAGER            0.41                                        423.16
MEMORYCLERK_SQLSTORENG              0.17                                        175.15
MEMORYCLERK_SOSNODE                 0.05                                        55.57
MEMORYCLERK_SQLCLR                  0.03                                        33.36
CACHESTORE_OBJCP                    0.03                                        31.02
USERSTORE_SCHEMAMGR                 0.02                                        17.00

 

--Buffer pool distribution
-- Per database DataCache usage inside buffer pool
SELECT
CASE database_id WHEN 32767 THEN 'ResourceDB' ELSE DB_NAME(database_id) END as "DatabaseName",
COUNT(*) PageCount,
CAST(COUNT(*) * 8 / 1024.0 AS NUMERIC(10, 2))  as "Size (MB)-Only DataCache-in-BufferPool"
From sys.dm_os_buffer_descriptors
--WHERE database_id = DB_ID('DUMMY')
GROUP BY db_name(database_id),database_id
ORDER BY "Size (MB)-Only DataCache-in-BufferPool" DESC  OPTION (RECOMPILE);
go

DatabaseName PageCount          Size (MB)-Only         DataCache-in-BufferPool
SSISDB                         2004259                15658.27
Alerting                 155376                 1213.88
tempdb                           52595                  410.90
demoConfig                    34753                  271.51
msdb                             20619                  161.09
ResourceDB                       2338                   18.27
master                           370                    2.89
db1                              242                    1.89
model                            97                     0.76
db3                              32                     0.25

-- See external dll's or modules getting loaded into sql server address space
select base_address,convert(varchar(20),file_version) file_version,convert(varchar(20),product_version) product_version,convert(varchar(30),company) company,convert(varchar(42),[description]) [description],name
from sys.dm_os_loaded_modules
where company not like '%Microsoft%'
--no output

SELECT name, value_in_use
FROM sys.configurations WITH (NOLOCK)
where name in ('max server memory (MB)','min server memory (MB)','optimize for ad hoc workloads','xp_cmdshell','priority boost','lightweight pooling','clr enabled','affinity I/O mask','affinity64 I/O mask','affinity mask','affinity64 mask','max degree of parallelism','cost threshold for parallelism','fill factor (%)','network packet size (B)')
ORDER BY name OPTION (RECOMPILE);


name                                                    value_in_use
affinity I/O mask                              0
affinity mask                                      0
affinity64 I/O mask                          0
affinity64 mask                                 0
clr enabled                                          1
cost threshold for parallelism     5
fill factor (%)                                      0
lightweight pooling                         0
max degree of parallelism            1
max server memory (MB)                            24000
min server memory (MB)                             16
network packet size (B)                4096
optimize for ad hoc workloads   0
priority boost                                     0
xp_cmdshell                                      0
 

Thanks,
Sam

Faulting on SQL Server Database

$
0
0

Hi,

I recently encounter Faulting problem in my SQL Database Engine and cause the services off after the faulting. I try look for the good answer for find out the cause of the faulting but I can't find any good answer..

I wonder if there is someone help me figure it out what is the cause of my sqlservr.exe Fault and how to fix it coz it happen serveral time in a day.

here is the complete error in event viewer..

Log Name:      Application
Source:        Application Error
Date:          9/23/2016 5:00:05 PM
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      RESPECT
Description:
Faulting application name: sqlservr.exe, version: 2011.110.6020.0, time stamp: 0x5626ed31
Faulting module name: combase.dll, version: 6.3.9600.18202, time stamp: 0x569e6ee3
Exception code: 0xc0000005
Fault offset: 0x000000000003baa2
Faulting process id: 0x710
Faulting application start time: 0x01d215799368fc52
Faulting application path: D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\sqlservr.exe
Faulting module path: C:\Windows\SYSTEM32\combase.dll
Report Id: 7ffd4153-8174-11e6-80c7-0050569f44b6
Faulting package full name:
Faulting package-relative application ID:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>100</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2016-09-23T10:00:05.000000000Z" />
    <EventRecordID>45920</EventRecordID>
    <Channel>Application</Channel>
    <Computer>RESPECT</Computer>
    <Security />
  </System>
  <EventData>
    <Data>sqlservr.exe</Data>
    <Data>2011.110.6020.0</Data>
    <Data>5626ed31</Data>
    <Data>combase.dll</Data>
    <Data>6.3.9600.18202</Data>
    <Data>569e6ee3</Data>
    <Data>c0000005</Data>
    <Data>000000000003baa2</Data>
    <Data>710</Data>
    <Data>01d215799368fc52</Data>
    <Data>D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\sqlservr.exe</Data>
    <Data>C:\Windows\SYSTEM32\combase.dll</Data>
    <Data>7ffd4153-8174-11e6-80c7-0050569f44b6</Data>
    <Data>
    </Data>
    <Data>
    </Data>
  </EventData>
</Event>

Log Name:      Application
Source:        Application Error
Date:          9/23/2016 8:08:22 PM
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      RESPECT
Description:
Faulting application name: sqlservr.exe, version: 2011.110.6020.0, time stamp: 0x5626ed31
Faulting module name: ntdll.dll, version: 6.3.9600.18438, time stamp: 0x57ae642e
Exception code: 0xc0000374
Fault offset: 0x00000000000f1b70
Faulting process id: 0xebc
Faulting application start time: 0x01d21581ec9ee0f4
Faulting application path: D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\sqlservr.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: cd4af016-818e-11e6-80c7-0050569f44b6
Faulting package full name:
Faulting package-relative application ID:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>100</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2016-09-23T13:08:22.000000000Z" />
    <EventRecordID>46490</EventRecordID>
    <Channel>Application</Channel>
    <Computer>RESPECT</Computer>
    <Security />
  </System>
  <EventData>
    <Data>sqlservr.exe</Data>
    <Data>2011.110.6020.0</Data>
    <Data>5626ed31</Data>
    <Data>ntdll.dll</Data>
    <Data>6.3.9600.18438</Data>
    <Data>57ae642e</Data>
    <Data>c0000374</Data>
    <Data>00000000000f1b70</Data>
    <Data>ebc</Data>
    <Data>01d21581ec9ee0f4</Data>
    <Data>D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\sqlservr.exe</Data>
    <Data>C:\Windows\SYSTEM32\ntdll.dll</Data>
    <Data>cd4af016-818e-11e6-80c7-0050569f44b6</Data>
    <Data>
    </Data>
    <Data>
    </Data>
  </EventData>
</Event>

Check point messages in error log

$
0
0

I am seeing below message related to check points in error log, can some help to to understand this log

FlushCache: cleaned up 3194 bufs with 1259 writes in 148817 ms (avoided 485 new dirty bufs) for db 5:0
            average throughput:   0.17 MB/sec, I/O saturation: 92, context switches 765
            last target outstanding: 6880, avgWriteLatency 12


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
------------------------------

it seems to affect all SPs



???


Can I ask you a question

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

Restore failed for Server 'LAPTOP\SQLEXPRESS'.  (Microsoft.SqlServer.SmoExtended)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=12.0.2000.8+((SQL14_RTM).140220-1752)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476

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

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

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

The database was backed up on a server running version 8.00.0194. That version is incompatible with this server, which is running version 12.00.2000. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server.
RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3169)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=12.00.2000&EvtSrc=MSSQLServer&EvtID=3169&LinkId=20476

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

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

Can't find SQL Server on my machine....

$
0
0

Hello DB professionals, 

I am just starting to load my SQL Server 2012 Express version (fully updated) and I receive the message below. I can see the SQL server database engine when I hit "browse" on the login page of SQL Server, so its on my machine. 

What gives? 

Respectfully, 

Farmer_John-1

TITLE: Connect to Server
------------------------------

Cannot connect to JOHNSDELLLAPTOP\SQLEXPRESS.

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

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476

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

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


Problem with installing SQL Server 2016 Developer edition.

$
0
0

After 3 - 4 trials with different approaches, I am still unable to figure out the issue with installation.

Below is my report log.

Overall summary:
  Final result:                  Failed: see details below
  Exit code (Decimal):           -2061893606
  Start time:                    2016-09-24 13:38:24
  End time:                      2016-09-24 13:53:20
  Requested action:              Install

Setup completed with required actions for features.
Troubleshooting information for those features:
  Next step for Polybase:        Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Next step for SQLEngine:       Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Next step for FullText:        Use the following information to resolve the error, uninstall this feature, and then run the setup process again.


Machine Properties:
  Machine name:                  PRAMAN
  Machine processor count:       4
  OS version:                    Microsoft Windows 10 Home Single Language (10.0.14393)
  OS service pack:               
  OS region:                     United States
  OS language:                   English (United States)
  OS architecture:               x64
  Process architecture:          64 Bit
  OS clustered:                  No

Product features discovered:
  Product              Instance             Instance ID                    Feature                                 Language             Edition              Version         Clustered  Configured

Package properties:
  Description:                   Microsoft SQL Server 2016 
  ProductName:                   SQL Server 2016
  Type:                          RTM
  Version:                       13
  SPLevel:                       0
  Installation location:         C:\Users\PrachiManoj\Downloads\en_sql_server_2016_developer_x64_dvd_8777069\x64\setup\
  Installation edition:          Developer

Product Update Status:
  None discovered.

User Input Settings:
  ACTION:                        Install
  ADDCURRENTUSERASSQLADMIN:      false
  AGTSVCACCOUNT:                 NT Service\SQLSERVERAGENT
  AGTSVCPASSWORD:                *****
  AGTSVCSTARTUPTYPE:             Manual
  ASBACKUPDIR:                   Backup
  ASCOLLATION:                   Latin1_General_CI_AS
  ASCONFIGDIR:                   Config
  ASDATADIR:                     Data
  ASLOGDIR:                      Log
  ASPROVIDERMSOLAP:              1
  ASSERVERMODE:                  MULTIDIMENSIONAL
  ASSVCACCOUNT:                  <empty>
  ASSVCPASSWORD:                 <empty>
  ASSVCSTARTUPTYPE:              Automatic
  ASSYSADMINACCOUNTS:            <empty>
  ASTELSVCACCT:                  <empty>
  ASTELSVCPASSWORD:              <empty>
  ASTELSVCSTARTUPTYPE:           0
  ASTEMPDIR:                     Temp
  BROWSERSVCSTARTUPTYPE:         Disabled
  CLTCTLRNAME:                   <empty>
  CLTRESULTDIR:                  <empty>
  CLTSTARTUPTYPE:                0
  CLTSVCACCOUNT:                 <empty>
  CLTSVCPASSWORD:                <empty>
  CLTWORKINGDIR:                 <empty>
  COMMFABRICENCRYPTION:          0
  COMMFABRICNETWORKLEVEL:        0
  COMMFABRICPORT:                0
  CONFIGURATIONFILE:             C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20160924_133743\ConfigurationFile.ini
  CTLRSTARTUPTYPE:               0
  CTLRSVCACCOUNT:                <empty>
  CTLRSVCPASSWORD:               <empty>
  CTLRUSERS:                     <empty>
  ENABLERANU:                    false
  ENU:                           true
  EXTSVCACCOUNT:                 <empty>
  EXTSVCPASSWORD:                <empty>
  FEATURES:                      SQLENGINE, FULLTEXT, POLYBASE, CONN, BC, SDK, BOL, SNAC_SDK
  FILESTREAMLEVEL:               0
  FILESTREAMSHARENAME:           <empty>
  FTSVCACCOUNT:                  NT Service\MSSQLFDLauncher
  FTSVCPASSWORD:                 <empty>
  HELP:                          false
  IACCEPTROPENLICENSETERMS:      false
  IACCEPTSQLSERVERLICENSETERMS:  true
  INDICATEPROGRESS:              false
  INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
  INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
  INSTALLSQLDATADIR:             <empty>
  INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
  INSTANCEID:                    MSSQLSERVER
  INSTANCENAME:                  MSSQLSERVER
  ISSVCACCOUNT:                  NT AUTHORITY\Network Service
  ISSVCPASSWORD:                 <empty>
  ISSVCSTARTUPTYPE:              Automatic
  ISTELSVCACCT:                  <empty>
  ISTELSVCPASSWORD:              <empty>
  ISTELSVCSTARTUPTYPE:           0
  MATRIXCMBRICKCOMMPORT:         0
  MATRIXCMSERVERNAME:            <empty>
  MATRIXNAME:                    <empty>
  MRCACHEDIRECTORY:              
  NPENABLED:                     0
  PBDMSSVCACCOUNT:               NT AUTHORITY\NETWORK SERVICE
  PBDMSSVCPASSWORD:              <empty>
  PBDMSSVCSTARTUPTYPE:           Automatic
  PBENGSVCACCOUNT:               NT AUTHORITY\NETWORK SERVICE
  PBENGSVCPASSWORD:              <empty>
  PBENGSVCSTARTUPTYPE:           Automatic
  PBPORTRANGE:                   16450-16460
  PBSCALEOUT:                    false
  PID:                           *****
  QUIET:                         false
  QUIETSIMPLE:                   false
  ROLE:                          
  RSINSTALLMODE:                 DefaultNativeMode
  RSSHPINSTALLMODE:              DefaultSharePointMode
  RSSVCACCOUNT:                  <empty>
  RSSVCPASSWORD:                 <empty>
  RSSVCSTARTUPTYPE:              Automatic
  SAPWD:                         <empty>
  SECURITYMODE:                  <empty>
  SQLBACKUPDIR:                  <empty>
  SQLCOLLATION:                  SQL_Latin1_General_CP1_CI_AS
  SQLSVCACCOUNT:                 NT Service\MSSQLSERVER
  SQLSVCINSTANTFILEINIT:         false
  SQLSVCPASSWORD:                *****
  SQLSVCSTARTUPTYPE:             Automatic
  SQLSYSADMINACCOUNTS:           PRAMAN\PraMan
  SQLTELSVCACCT:                 NT Service\SQLTELEMETRY
  SQLTELSVCPASSWORD:             <empty>
  SQLTELSVCSTARTUPTYPE:          Automatic
  SQLTEMPDBDIR:                  <empty>
  SQLTEMPDBFILECOUNT:            4
  SQLTEMPDBFILEGROWTH:           64
  SQLTEMPDBFILESIZE:             8
  SQLTEMPDBLOGDIR:               <empty>
  SQLTEMPDBLOGFILEGROWTH:        64
  SQLTEMPDBLOGFILESIZE:          8
  SQLUSERDBDIR:                  <empty>
  SQLUSERDBLOGDIR:               <empty>
  SUPPRESSPRIVACYSTATEMENTNOTICE: false
  TCPENABLED:                    0
  UIMODE:                        Normal
  UpdateEnabled:                 true
  UpdateSource:                  MU
  USEMICROSOFTUPDATE:            false
  X86:                           false

  Configuration file:            C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20160924_133743\ConfigurationFile.ini

Detailed results:
  Feature:                       Client Tools Connectivity
  Status:                        Passed

  Feature:                       Client Tools SDK
  Status:                        Passed

  Feature:                       Client Tools Backwards Compatibility
  Status:                        Passed

  Feature:                       PolyBase Query Service for External Data
  Status:                        Failed: see logs for details
  Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
  Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Component name:                SQL Server Database Engine Services Instance Features
  Component error code:          0x851A001A
  Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
  Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=13.0.1601.5&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026

  Feature:                       Database Engine Services
  Status:                        Failed: see logs for details
  Reason for failure:            An error occurred during the setup process of the feature.
  Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Component name:                SQL Server Database Engine Services Instance Features
  Component error code:          0x851A001A
  Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
  Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=13.0.1601.5&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026

  Feature:                       Full-Text and Semantic Extractions for Search
  Status:                        Failed: see logs for details
  Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
  Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Component name:                SQL Server Database Engine Services Instance Features
  Component error code:          0x851A001A
  Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
  Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=13.0.1601.5&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026

  Feature:                       SQL Browser
  Status:                        Passed

  Feature:                       Documentation Components
  Status:                        Passed

  Feature:                       SQL Writer
  Status:                        Passed

  Feature:                       SQL Client Connectivity
  Status:                        Passed

  Feature:                       SQL Client Connectivity SDK
  Status:                        Passed

  Feature:                       Setup Support Files
  Status:                        Passed

Rules with failures:

Global rules:

Scenario specific rules:

Rules report file:               C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20160924_133743\SystemConfigurationCheck_Report.htm

Please help.

Thanks in advance!

Regards

Link Address in Stored Procedure to Send Email

$
0
0

I've this link address "<a href="http://81.84.23.213:80/NewUsers.aspx?UserId='+@CodigoMem+'" target="_blank">USERS | INPT</a>".

I want to use @CodigoMem as a local variable to use in the link address as a parameter, but now I don't know any other way to use it correctly.

Any help will be welcomed.

Thank You.

Nilson João O Producer

ilbjoaoproducer@hotmail.com

SQL Database corrupted , what next ?

$
0
0

HI Team,

One of our Production Server DB seems corrupted. When we tried to restore from the old backups , restored failed.

I performed DBCC CHECKDB , i get the below error. 

There are 527 rows in 8 pages for object "tbl_nodes".

CHECKDB found 0 allocation errors and 0 consistency errors in database 'Tfs_BackOffice2'.

DBCC execution completed. If DBCC printed error messages, contact your system administrator.

Msg 602, Level 21, State 30, Line 3

Could not find an entry for table or index with partition ID 72057597105340416 in database 11. This error can occur if a stored procedure references a dropped table, or metadata is corrupted. Drop and re-create the stored procedure, or execute DBCC CHECKDB.

Please advise. 

The things we tried out till now. 

1) Restoring on SQL 2014 version. 

2) https://support.microsoft.com/en-in/kb/2995352 ( couldnt apply the hotfix as the fix was for different SQL Version) 

We need fix for 

Enterprise Edition (64-bit)SP1STANDALONEMicrosoft SQL Server 2012 (SP1) - 11.0.3000.0 (X64) 
Oct 19 2012 13:38:57 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)

Why does a shrunken database get "blown up" when restoring from a full backup?

$
0
0

Hi,

We create anonymized copies of our production database for test purposes. Since it contains some data not interesting during test we delete data (approx 15 GB) from a number of tables. After that the database is shrunk with the DBCC SHRINKDATABASE command and both database and log files are shrunk on disk. Finally we make a full (copy-Only) backup of that database.

The backup file is copied to a test server. Now the strange thing. When we restore from the backup file the size of the database files are set to its pre-shrunk sizes. When looking at the Files tab in the Database Properties form for the anonymized and shrunken database it reports the shrunken file sizes for both ROWS data and LOG.

Why are the database files set to their pre-shrunk sizes by the restore command? And can we change this behaviour?

We are using SQL Server 2014, version 12.0.4213.0.

Sincerely,
Mats-Ove


LOG SHIPPING 'Copy' Job getting failed

$
0
0

Hi Technet,

I had successfully configured Log Shipping in a domain.

In configuration manager, The SQL Server account (Both sql server and agent) are domain administrator account only.

The Primary and Secondary Shared folders are given full permissions of Read Write access to Everyone.


Now, the 'COPY' Job getting failed due to error:

Message
2016-09-26 06:53:43.12*** Error: The password for this account has expired.
(mscorlib) ***
2016-09-26 06:53:43.20*** Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping) ***

Can someone help me there.?

Using certificate and private key to encrypt and decrypt sensitive data

$
0
0

Hi all,

I need to be able to encrypt and decrypt data as secure as possible, but considering also the following requirements:

- Be able to export keys/certificates in order to install them in other servers (I'm not sure if this makes sense);

- Hide details such as the private key password

This is a topic where I'm not so confortable with, I'm not sure where should I begin and how certificates and private keys relate in sql server, where to create them (I have nothing), how to relate certificate and private key, how to encrypt, how to decrypt.

So far I did this and I believe is not correct (at least decrypt returns NULL):

CREATE CERTIFICATE
  MyCertificate
  ENCRYPTION BY PASSWORD = 'MyPassword.123'
  WITH SUBJECT='My precious certificate'

CREATE SYMMETRIC KEY MyKey
WITH ALGORITHM = AES_256
ENCRYPTION BY CERTIFICATE MyCertificate

DECLARE @cipherText VARBINARY(128) = ENCRYPTBYCERT(CERT_ID('MyCertificate'), 'ABCDEFG')
DECLARE @clearText VARCHAR(128) = DECRYPTBYCERT(CERT_ID('MyCertificate'), @cipherText)
SELECT @cipherText, @clearText

I'm sorry if my topic seems not too specific, but I'm not sure what am I doing wrong here and what should I be exactly doing.

Surprisingly super-fast

$
0
0

This is really just an observation about good performance, better than hoped for.

I had a complex query that would sometimes run ten seconds, sometimes two minutes.  Then it started running mostly two minutes.  Looking at it, I realized I was already giving SQL Server about all the hints I could, but it was still looking at a lot of data that it didn't have to, apparently.  So I did it old school, took it apart, selecting rows into #temps and using several simpler queries instead.

And now the thing just flies!  I mean, I do this a lot, but this one is amazing me.  I first pull about 20k rows (ranges from under 8k to over 40k, maybe 20k average) from a big table, just four or five ints and dates and bits and even better they come from an (nonclustered) index, which I guess is generally already in buffers.  It then does a cross-join on these rows and puts the results, generally just a dozen or two, into another #temp, and then does some more stuff with that.

This is now running under 200ms, with correspondingly few reads, often under 100ms.

That just strikes me as crazy fast for what does after all involve pulling 20k values, persisting them to tempdb, and doing a cross-join on the unindexed temp.

So, thank you SQL Server, also thank you Intel for processor chips with big caches, because I have to figure that's a good part of what makes this run so fast.

(also, the history of this code is that it was previously written row-at-a-time cursors and would run for hours, so this is already a second rewrite ... and I just realized I could do a third and probably make it that much more efficient, it doesn't really have to be a cross-join all of the time, but we've got to be in the area of diminishing returns now, it's typically called a few times an hour with varying workloads)

This is also without benefit of memory-optimized tables or even column indexes, either of which should, in principle, help even more, if used.

Josh

when does sql optimizer uses stream aggregate or hash aggregate

$
0
0

Hi,
Just want to know when does sql optimizer uses stream aggregate or hash aggregate, as per my understanding cardinality estimation play a vital role in choosing this, so when i test using 2014 CE it  chooses stream aggregate (memory highly used because of sort before stream) if i check in 2012 CE is uses hash aggregate, which is more efficient comparable to former.
even the choice doing index seek and scan is also different as different CE which is understandable..
but the choice of stream aggregate or hash aggregate is different in another server with same environment.
so just want to know how sql server chooses stream aggregate or hash aggregate based on what?

thanks


Best Regards Moug

Apply XSLT to transform XML

$
0
0

Hi,

I have a stored procedure that receives an XML parameter as input. The XML is stored on a table.

I'd like to, inside the SP, be able to apply some kind of transformation to the XML before storing it on the database.

For example, consider this is my input:

<Data><Items><Item ID="1" Name="Name1" SensitiveData="SensitiveData1"/><Item ID="2" Name="Name2" SensitiveData="SensitiveData2"/></Items></Data>

I'd like to apply for example some kind of XSLT that would encrypt all SensitiveData attributes by applying a function or a stored procedure, is this possible?

Viewing all 15889 articles
Browse latest View live


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