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

Clustered Index

$
0
0

Hi,

I went through many articles and most of the articles are saying that when we create Clustered index on any column, it stores whole row data at leaf node. for example if I have a table with columns ID, Name, Dept, Edu, Sal, Location and if I create clustered index on ID column then when server created B-Tree, Is it stores whole row data at each leaf node as per b-tree structure and if it stores the whole records then where it stores all those records. 


Aniruddha http://aniruddhathengadi.blogspot.com/


SQL Server 2012 Performance Problem

$
0
0

We have migrated our company database from SQL Server 2000 to SQL Server 2012 (big jump!).  We haven't gone live yet on 2012.  Something is wrong in our setup of 2012 because queries that run in 5 seconds on 2000 are taking 10 minutes or more on 2012.  We restarted the 2012 server and checked memory before we run any queries.  Memory looks good.  Then we run a big query and memory usage starts climbing about 1 GB every 10 seconds.  We kill the stored procedure, but memory usage stays high.  We finally have to kill the entire SQL Server process to re-claim the memory.

Can you suggest where we might look for a solution to this problem?  (I'm not a DBA, just a developer)


MCSD .NET developer in Dallas, Texas

Remove Dead Lock

$
0
0

Hi,

I want to enable a setting or write a script to kill/clear a dead lock if it exists more than 5 sec.

Is it possible?


Ghost session stuck in Killed/Rollback status

$
0
0

A step in an SSIS package failed - it was a file load and the load process was verified complete. We killed the process and it has been in Killed/Rollback for 13 days. The spid is not using any resources, but it does trigger alerts from our monitoring system(Spotlight).

While composing this we fixed it - so I'll post the solution for historical purposes. A .Net component threw an unhandled exception while running in an SSIS package. When I logged on to the server with /admin switch to kick someone off(both sessions were in use), I was presented with an error dialog. Once I clicked it away, the session disappeared. 

This may be quite obscure, but may help another harried dba down the road.

John

  


SMBGuy

Inserting into replicated table

$
0
0

I have a peculiar problem here. I have a table MasterDB.Employee and its being replicated in ReplicationDB.Employee.

I have a .Net screen which has boxes to key in information about an employee and when they hit save, it gets inserted into the MasterDB.Employee table and it takes about let's say 30 secs for it to get to ReplicationDB.Employee. As soon as they save and exit out it shows a screen with all employees along with their information. The storedproc that loads the employees is only on the ReplicationDB because it has more information than what's on MasterDB. So as soon as one saves and exits out of that screen, that employee is not loaded on the list since there is a latency.

I  need some help here on how to tackle this issue.

not able to retrieve dead lock infor from sql server 2008 using extended events

$
0
0

I recently encountered a deadlock:

Transaction (Process ID 57) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction

I tried to get some details using the below query :

;WITH SystemHealth
AS (
SELECT CAST(target_data AS xml) AS SessionXML
FROM sys.dm_xe_session_targets st
INNER JOIN sys.dm_xe_sessions s ON s.address = st.event_session_address
WHERE name = 'system_health'
)
SELECT Deadlock.value('@timestamp', 'datetime') AS DeadlockDateTime
,CAST(Deadlock.value('(data/value)[1]', 'varchar(max)') as xml) as DeadlockGraph
FROM SystemHealth s
CROSS APPLY SessionXML.nodes ('//RingBufferTarget/event') AS t (Deadlock)
WHERE Deadlock.value('@name', 'nvarchar(128)') = 'xml_deadlock_report';

But don't get any results back. Server version:

Microsoft SQL Server 2008 (SP2) - 10.0.4064.0 (Intel X86)   Feb 25 2011 14:22:23   Copyright (c) 1988-2008 Microsoft Corporation  Standard Edition on Windows NT 6.0 <X86> (Build 6001: Service Pack 1)

Any ideas ?


Ranga

Block transactions into sql server database for some time

$
0
0

Hello All,

I want to block transactions into sql server database for particular interval of time. Means if any user entering something from user interface using the .aspx page , so for particular interval of time it should not be saved into the database and user should be notified with a message like "the database is down for sometime". ...

Please let me know solution for this.

Thanks,

Sushil


sushil sahu

Best index structure for table that holds a large amount of log data

$
0
0
Folks
I have a ASP.NET solution that needs to log every time a method is invoked.(that part I have done)
I am logging this activity into a table
I had constructed a table that has a identity filed that is also  the Clustered Primary Key

When we do load testing and the number of clients is greater than 20 I get errors (which I also log to another table).
The error is "The underlying provider failed on Commit"
Inner Exception is: "Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding"

I also SQL profile these tests

Under 10 users inserts are under 1500 msecs
Over 20 users inserts are about  6000-9000 msecs
At 50 users inserts are over 30000 msecs

This table is never read by the application and it has only one index the clustered index.

So how can Index this table to reduce the insert time and avoid this exception?
Or should the table have no index?

regards

GregJF

DBCC SHRINKFILE Does Not Work

$
0
0
All,

I have a database that has 30% unallocated space for the data file.  This file is taking up almost my entire disk space so I simply need to shrink it down; however when I attempt to run DBCC SHRINKFILE it does nothing.  I am trying to shrink the file past its initialized size but from my understanding DBCC SHRINKFILE will allow you to do this.  I am not trying to shrink less that what it needs to hold the data just enough to get me by a little longer until I can allocate some more SAN storage.  I am running SQL Server 2005 EE X64 CU 10.

I have run DBCC UPDATEUSAGE and then run sp_updatestats thinking the numbers may be off causing it not to shrink the file but this did not help.  I have tried making backups of the database with no luck.  I have also tried just releasing the unused space with no luck.  I don't receive any errors it just will not change the size of the data file. 

My only other thoughts are that I do have two tables that have indexes that take up ~12 GB worth of space.  Could it be possible if these indexes are terribly fragmented they are keeping the file from shrinking?

Thanks,

C

Sqlserver VS Postgres sql?

$
0
0

Does postgre Sql replacing sqlserver?

Thanks,

Ron.

How to back up database on expired SQL enterprise 2008 R2 evaluation ? HELP !

$
0
0

Hi Guys,

can you guys show me how to back-up the databases manually on the expired SQL evaluation without using the SQL server management studio as i got error on it. your reply is much appreciated. i hope you guys can show me the steps one by one.

thanks.....

Why SQL Generate this execution Plan

$
0
0

Basically we have a stored procedure runs daily with less than a minute, but occasionally this will take 15 minutes to run.  Ran a trace and it turned out one of its insertion command causes this problem. On  a normal day (< 0.5 minute ) its execution plan is :-

On a problematic day ( = around 15 minutes) its execution plan is :-

The number of records to be processed do not vary too much ( +/- 2% ) . The tables in the query are all staging tables for one-off use. I understand that I may need to create index on them, but this is a concern later on.  I can see the long duration is down to SQL tries to spool records to tempdb, but why the number of records suddenly rocket from 4,947 to 4,071,381 (the black bold data flow).  Can anyone cast light on this ? This is SQL 2005 + SP3 and Win 2003 .

Database Mail Issue

$
0
0

Hi,

Database mail is configured on sql sever 2005 (9.0.5000). Profile and accounts are created and configured.

When I try to send test message, message never delivered. Don't know where it stuck up. In database mail log there is error:

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account x (2012-10-31xxx:xx:xx). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Unable to relay).

Any Help?

Thanks

Join order

$
0
0

After reading volumes on join performance, join smaller tables first, yada yada... I heard a while back that it is good practice to always have left outer joins after all inner joins because having the left joins first or in between inner joins may produce un-reliable results.

Any validity in this "wives' tale" (please list a reference if possible)?

Thanks,

Michael

SQL Server 2008 Architecture Deffinition

$
0
0

Hi All,

I need small Information regarding how to tell the answer the below question in simple way.

Tell me about SQL Server 2008 Architecture?

Thanks,Prasad.


Atlas XL on SQL Server Performance

$
0
0

Hi,

Does anybody know anything about the impact of Atlas XL on SQL Server Performance? I don't have any specific issue. I'm just wondering if there are any performance related issues I should look out for with Atlas.

Cheers

Paul

How to set permissions to directory with database files.

$
0
0

Hello,

I have recently restored drive with system, and user databases files after crash. And I have to set permissions to this files, because they have been lost. Could you tell what should be the proper permissions for directory with mdf, ldf files. I have SQL Server 2008 R2.


SQL Server Memory Leakage

$
0
0

Hi All,

I have a Memory Leakage issue on our SQL Server 2008 Windows R2 , When The Re-Indexing of the Database occurs which is at 01.00 am on a daily basis, it eats up the memory and does not relaease it, the usual solution is to reboot the server, is there any other way to the Server to release the memory after the re-indexing other than rebooting the server. SQL Server is also 64 bit and has been capped at 8GB RAM out of 14 GB RAM.

Thanks

Yemi

Difference between Function and View

$
0
0

Hi,

Can you please tell me differences between Function and View.

Thanks and Regards

Kranthi

statistics

$
0
0

Hi All,

I need some clarifications on update stats.

1. I have seen in cx's scenario's where they have a maintenace plan like

  checkdb --> re-organize index -> rebuild index - > update stats 

Question 1:  I dnt thick this is correct. Either we need to go for reorg or rebuild based on fragmentation level. I dnt really understand what they are trying to achieve do so,

Question 2 : As per knowledge, the rebuild index will update the stats , then why do we need to use again update stats again ?  is there something we are missing updating stats on other columns which will updated using update stats? if so, what actually will get updated ? please correct me if i am wrong.

Question 3: if i have AUTO_UPDATEStats ON on the database , is there any chance of getting stats getting updated wrongly or in the first place is that right thing to turn ON AUTO_STATS option on the database?

Thanks in advance.

Viewing all 15694 articles
Browse latest View live


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