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

Fixing a broken FILESTREAM table + EXCEPTION_ACCESS_VIOLATION

$
0
0

I've been sent this database by someone as raw files (that I tricked SQL Server into attaching as it wouldn't attach it normally) because they had no backup available.  I'm using SQL Server version 10.50.4000.0 (SQL Server 2008 R2) and the files come from the same version.  I can't seem to be able to get my FILESTREAM table working properly.  I ran DBCC CHECKDB with no errors reported.  Then I ran DBCC CHECKTABLE ("Images"), also with no errors reported.  

When I run the following query:

SELECT [ID]
      ,[ID_Adjacency]
      ,[Image]
      ,[_Timestamp]
      ,[_Guid]
FROM [MyDatabase].[dbo].[Images]

I get:

Msg 233, Level 20, State 0, Line 0
A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)

Looking at the logs, it seems this query is causing an access violation:

2013-12-06 13:58:22.89 Server      Error: 17310, Severity: 20, State: 1.
2013-12-06 13:58:22.89 Server      A user request from the session with SPID 52 generated a fatal exception. SQL Server is terminating this session. Contact Product Support Services with the dump produced in the log directory.
2013-12-06 13:58:23.83 spid52      Starting up database 'ManageTTX'.
2013-12-06 13:59:25.07 spid52      Using 'dbghelp.dll' version '4.0.5'
2013-12-06 13:59:25.07 spid52      ***Stack Dump being sent to C:\Data\MSSQL10.MyServer\MSSQL\LOG\SQLDump0006.txt
2013-12-06 13:59:25.07 spid52      SqlDumpExceptionHandler: Process 52 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
2013-12-06 13:59:25.07 spid52      * *******************************************************************************

When I run this query, all is fine:

SELECT [ID]
      ,[ID_Adjacency]
      ,[_Timestamp]
      ,[_Guid]
  FROM [MyDatabase].[dbo].[Images]

, i.e. excluding the Image field (which is a filestream blob).  So it seems my filestream data is somehow corrupt, but after spending all afternoon googling I can't seem to find a way to resolve this, find where the errors are and fix them.

Can anybody assist me here please?





SQL Server 2012 tempdb - multiple files still recommended as well as TF 1118?

$
0
0

Hi,

Can you tell me if its still recommended that tempdb be allocated across multiple data files in SQL Server 2012?  Is the use of TF 1118 also still recommended?

Thanks in advance,

Ed

SQL server process Processor Time (CPU Utilization) over 100%

$
0
0

 

We are seeing that the %Processor Time for the sqlservr process in Perfmon is over 100%. I am trying to understand how can the percentage of use be over 100%, and why it is over 100%. Someone told me that if the machine has multiple processors, that it will be over 100%. If that is the case, how can I determine what the maximum and normal values are? If I have 4 processors, does that mean 400% is the max? Does not make sense since it is suppose to be a percentage value...

 

Could someone explain to me how the CPU Utilization value is being measured, and if it is going over 100%, why that is and how I can determine what the threshold should be for monitoring?

 

SQL 2005 on Windows 2003 cluster.

 

Thanks!

Help defining index to help performance of Update query

$
0
0

I'm having difficulty coming up with an index for this update query. 

UPDATE MarketInsight
SET G_ULT_CNTRY = b.COUNTRY_CD
FROM MarketInsight INNER JOIN MarketInsight AS b ON MarketInsight.G_ULT_DUNS = b.DUNS
WHERE MarketInsight.G_ULT_CNTRY is null;

The table has approximately 90 million records with each record having about 80 fields. It is a recursive join. The only thing on the table is the primary key which is the DUNS field. All the fields are text based. DUNS and G_ULT_DUNS are 9 characters, and COUNTRY_CD and G_ULT_CNTRY are 2 characters. With this setup it takes the update query 65-70 minutes to run

I have tried an index on G_ULT_DUNS with an included field of G_ULT_CNTRY; however, this only reduced the processing time by about 5 to 6 minutes.

Not sure if I need to include country_cd or move g_ult_cntry from included field to actual index field.

Any suggestions or insight would be appreciated.

Thanks,


SQL Server can't see 80 CPU

$
0
0

I have a server with 4*20 CPU.  Windows 2008 R2 Ent., SP1.  The OS sees 80 CPU (16*5)  in TSK MGR.   SQL Server 2008 SP3 CU9  only sees 40 .....

using the following query: 

SELECT cpu_count AS [Logical CPU Count]
, hyperthread_ratio AS [Hyperthread Ratio]
,cpu_count/hyperthread_ratio AS [Physical CPU Count]
, physical_memory_in_bytes/1048576 AS [Physical Memory (MB)]
, sqlserver_start_time
FROM sys.dm_os_sys_info OPTION (RECOMPILE);

Why ?

sgb

 

manage partition wizard is not highlighted

$
0
0

I have done partition for BBC Table on "modified_on" column having datetime data type.

All partitioning steps i have done using query not GUI. process completed without any error. But when i go to Manage parition wizard then I received below message.

"You will not be able to switch out or switch in data in this table since the table has non storage aligned indexes on it."

What is the meaning of this error, I don't understand the "non storage aligned index ".

Is this mean my partition will not work or is there something wrong ? if its wrong then how to resolve this?

Please help

I used below steps.

1.CREATE PARTITION FUNCTION

2.create partition scheme

3. drop cluster index & then create cluster index as below.

ALTER TABLE [dbo].[BBC] ADD  CONSTRAINT [BBC_PK_EventId] PRIMARY KEY CLUSTERED
([Event_Id] ASC)
WITH (PAD_INDEX  = ON, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF,ONLINE = OFF,
ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 100) ON EventScheme (Event_id)

KPID SPID state ?

$
0
0
If KPID=0 and Open_tran>0 for a SPID what does it signify; How is it possible. Does it mean KPID is assigned for Running spid.

Changing Alert.PagerSendSubjectOnly property to True.

$
0
0

Hi everyone,

"Property PagerSendSubjectOnly is not available for AlertSystem '[SVRNAME]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights.  (Microsoft.SqlServer.Smo)"

error while starting the SQL Server Agent 2012.

Please tell me how to change the above mentioned Property.

Thanks.


SQL Server 2012 Data import tool loading quotes from CSV file.

$
0
0

Hi,

I am trying to load a CSV file into SQL 2012 using the data import tool.

It has the format of:

"xxx","xxx","xxx" etc (The first row contains the column headings).


So all character fields. The problem is though that the data
comes in and load the double quotes into the field as well.

So in the CSV file if it says: "John" I get it loaded as "John"
instead of John.

So I can I configure the tool to process this so the (")'s are ignored
and not loaded.

Thanks,

Ward.

How to connect to the database added in the Server Explorer?

$
0
0

I changed the Connection Strings to "Data Source=(localdb)\\Projects;" and now I can connect to the database created in the (localdb)\Projects. But I still cannot connect to the database in the (LocalDB)\v11.0.

The database added in the Server Explorer -> Data Connections by using mdf file only can be showed in the (LocalDB)\v11.0 and I cannot connect to it.

Coping backup files from one location to another location of a particular date

$
0
0

Hi,

I have a folder contains last 5 days backup, I'm using the below command for copying 

use master

EXECUTE [dbo].[xp_cmdshell] 'Copy C:\commandTestCopy\*.BAK C:\commandTestPaste','NO_OUTPUT';

The command works fine for copying all files in the folder. Is there any condition to copy only one day or the present backups to other location.

Thanks,


From Harish

I cannot attach MDF samples from ASP .NET project

$
0
0

My RDBMS is Sql2k8:

CREATE DATABASE [Enrico] ON
( FILENAME = N'C:\Inma\AplicacionWeb_Cuina\WebApplication1\App_Data\aspnet-WebApplication1-20131208171104.mdf' ),
( FILENAME = N'C:\Inma\AplicacionWeb_Cuina\WebApplication1\App_Data\aspnet-WebApplication1-20131208171104_log.ldf' )
 FOR ATTACH
GO

Msg 1813, Level 16, State 2, Line 1
Could not open new database 'Enrico'. CREATE DATABASE is aborted.
Msg 948, Level 20, State 1, Line 1
The database 'Enrico' cannot be opened because it is version 706. This server supports version 662 and earlier. A downgrade path is not supported.


Primary platform is Windows 7 Ultimate 64 bit along with VS 2012/Sql2k8 for WPF/SilverLight projects.

SQL server agent- agent Xps disabled

$
0
0

I followed the instruction suggested in this post:

Code Snippet

sp_configure 'show advanced options',1

go

reconfigure with override

go

sp_configure 'Agent XPs',1

go

reconfigure with override

go

sp_configure 'show advanced options',0

go

reconfigure with override

go


But it didn't work properly and SQLAgent service stops again:

log:

2013-12-11 11:49:32 - ? [100] Microsoft SQLServerAgent version 11.0.2218.0 (X64 unicode retail build) : Process ID 9440
2013-12-11 11:49:32 - ? [495] The SQL Server Agent startup service account is IT\SPAdmin.
2013-12-11 11:49:32 - ? [000] Configuration option 'Agent XPs' changed from 0 to 1. Run the RECONFIGURE statement to install. [SQLSTATE 01000] (Message 15457)
2013-12-11 11:49:32 - ? [101] SQL Server SPQC version 11.00.2218 (0 connection limit)
2013-12-11 11:49:32 - ? [102] SQL Server ODBC driver version 11.00.2218
2013-12-11 11:49:32 - ? [103] NetLib being used by driver is DBNETLIB; Local host server is 
2013-12-11 11:49:32 - ? [310] 4 processor(s) and 8088 MB RAM detected
2013-12-11 11:49:32 - ? [339] Local computer is SPQC running Windows NT 6.1 (7601) Service Pack 1
2013-12-11 11:49:32 - ? [432] There are 12 subsystems in the subsystems cache
2013-12-11 11:49:42 - ! [364] The Messenger service has not been started - NetSend notifications will not be sent
2013-12-11 11:49:42 - ? [129] SQLSERVERAGENT starting under Windows NT service control
2013-12-11 11:49:42 - ! [298] SQLServer Error: 22022, Usage:  EXECUTE xp_sqlagent_notify 'A', NULL, NULL, <alert_id>, <action type> [SQLSTATE 42000] 
2013-12-11 11:49:42 - ! [442] ConnConnectAndSetCryptoForXpstar failed (0).
2013-12-11 11:49:42 - ? [000] Configuration option 'Agent XPs' changed from 1 to 0. Run the RECONFIGURE statement to install. [SQLSTATE 01000] (Message 15457)
2013-12-11 11:49:42 - ? [098] SQLServerAgent terminated (normally)

Please help me to solve this issue.

Enterprise 2012 Evaluation

$
0
0

Hi guys, I'm thinking to download the trial version of Sql 2012 Enterprise. Anyone know if there are limitation compare the full licensed? I mean, can I develop this edition without any restriction?

Another issue for me is that, after having developed all my stuff ( packages, cubes, stored, etc) I think ( cause the price) to buy a licence for Business Intelligence and not Enterprise. That's could be a problem, I mean do you think eventually I need to migrate the data from an instance to another instance or I can keep the structure simply updating the version  of SQL?

Thank you

Unable to open physical file - Operating system error 5: 5(error not found) Microsoft SQL Server: Error 5120

$
0
0

I am trying to attach a database to SQL 2005. This database has not previously been attached. I have only just installed SQL.

 

I get the following message: Unable to open physical file "C:\ArrowSQL\Arr@Data\Arrow_data.mdf" Operating system error 5: "5(error not found)" (Microsoft SQL Server: Error 5120)".

 

I have loaded SQL and the database fiel and directory with the same user acccount which is a local adminstrator ont hsi machine. I have checked that I have read/write access to the file.

 

The machine runs Windows Vista Business. SQL has SP 2 loaded.

 

What causes this?


Requested memory for execution plan information

$
0
0

Hello,

May I have some information regarding the memory parameters that appear into the execution plan ? here is an example of what I see on a XML Execution plan:

"

MemoryGrantInfo / SerialRequiredMemory="1536" SerialDesiredMemory="2160" RequiredMemory="1536" DesiredMemory="2160" RequestedMemory="2160" GrantWaitTime="0" GrantedMemory="2160" MaxUsedMemory="0"
"

I have noticed that sometimes those informations are available, sometimes they aren't. Can you please explain me this ? And when this information are available (I mean during compile time ? execution time ? After the end of the execution ?)

Another point is that some execution of an execution plan requests 85Mb of memory and some others executions resquest 190Gb (yes, Giga Bytes!) of memory. I've captured thoses inforamtions whith the requested_memory_kb column on the sys.dm_exec_query_memory_grants DMV. Do you know what can justified such difference between two execution ?

Many thank's for your answer, any informations regarding this part (requested_memory) would be usefull.

Olivier MAITRE

Partitioning

$
0
0

Hi all

I am new to partitioning and it's something that I have started looking at.

Most of the explanations that I have seen for partitioning incudes the sentence "The data of partitioned tables and indexes is divided into units that can be spread across more than one filegroup in a database"

Does this mean that I will only see the benefit of partitioning if I have more that one filegroup in my database?

When my data is partitioned and I query the table, does SQL Server know which partition it needs to go to get the data?

Are there any performance downfalls with inserting/updating data in a partitioned table?

Thanks

Low SQL Server Memeory shown in the task manager

$
0
0

Hi Fellow.

I have two physical HP servers with 64GB ram. The SQL-DB1 is a primary production server and SQL-DB2 is a stand-by server. Both are configured on Always on High Availability. On both servers, I have configure the maximum and minimum memory utilized by SQL Engine are Given below

Min: 20480 MB (20GB)

Max: 30720 MB (30GB)

The problem is that in the task manager, The primary SQL-DB1 shows that the Sql engine is occouping 300MB RAM while the second sql engine shows that it has occupied 23 GB of RAM.

What is going on in this case I am not getting it. Can any body explain? I want to increase the RAM size of SQL-DB1 to at least 20 GB in the RAM permanently.



Azwar

What are the most important perfmon counters to tract to create a baseline for your servers in a Central Management Server?

$
0
0

I am currentlly collecting perfmon counters for my Central Management Server to create a base line.  Years ago, I had a manager that had me collecting the following counters
        "\LogicalDisk(*)\Avg. Disk Queue Length",
        "\LogicalDisk(*)\Avg. Disk Read Queue Length",
        "\LogicalDisk(*)\Avg. Disk Write Queue Length",
        "\LogicalDisk(*)\Current Disk Queue Length",
        "\LogicalDisk(*)\Disk Bytes/sec",
        "\Memory\Available MBytes",
        "\Memory\Pages/sec",
        "\Paging File(*)\% Usage",
        "\Paging File(*)\% Usage Peak",
        "\PhysicalDisk(*)\% Disk Time",
        "\PhysicalDisk(*)\Avg. Disk Queue Length",
        "\PhysicalDisk(*)\Avg. Disk sec/Read",
        "\PhysicalDisk(*)\Avg. Disk sec/Write",
        "\PhysicalDisk(*)\Disk Bytes/sec",
        "\PhysicalDisk(*)\Disk Reads/sec",
        "\PhysicalDisk(*)\Disk Transfers/sec",
        "\PhysicalDisk(*)\Disk Writes/sec",
        "\Processor(*)\% Idle Time",
        "\Processor(*)\% Interrupt Time",
        "\Processor(*)\% Privileged Time",
        "\Processor(*)\% Processor Time",
        "\Processor(*)\% User Time",
        "\System\Context Switches/sec",
        "\System\Processor Queue Length",
        "\System\Threads"

I have the Task Scheduler running every 5 minutes.  With all these counters, I am inserting a lot of rows for 33 servers.  I am currious, are any of these counters less important than others on this list?  Are all of these counters important to track?  Can I eliminate any of them?  What are the most important perfmon counters to tract to create a baseline for your servers in a Central Management Server? 


lcerni

Recent transactions missing from current transaction log backup

$
0
0

Hello all,

I've got a strange situation that I've had a hard time getting to the bottom of. The issue is that I have a web app that writes to a SQL 2008 (R1) database. If I query the database directly then all of the recent writes show up fine. However if I restore the database to a different server (starting with last full backup + last differential + any transaction log backups that have happened since then), I seem to be missing the most recent data written to the database.

The database is in full recovery mode and the transaction log backups are done hourly via a scheduled maintenance plan. During the restore I get no errors, and the restore indicates that it has restored log backup files up to well after the missing transactions have occurred.

Things I have done to troubleshoot include issuing a checkpoint manually before the log backup occurs. No change in behavior. I also queried the production database for the missing records using query hints like READCOMMITTED to make sure that they have actually been committed and it looks like they have.
The missing records will eventually show up in the restored database but when is a variable. Looks like they always do when the next differential is run.

The database is a small one, so it wouldn't surprise me if the whole thing was in memory. Still it seems like the committed transactions should go to the log when the transaction log backup is run...maybe I've been betrayed by the maintenance plan wizard?

All thoughts on this situation are welcome. Thanks in advance for reading!

Viewing all 12963 articles
Browse latest View live


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