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

Trouble shooting sick SQL server

$
0
0

I have an SQL server that's ill with something but it's not obviouse enough for me to see it.

This server has been up and running pretty good for the last 18 months. Has all the latest updates as of last week. But all of a sudden it's come down with something.

Last thursday the SQL server came to an almost frozen state. I could log onto the server but could not open a (local) session to the SQL services. CPU was OK, server was responsive and I was able to open a configuration manager and restart the SQL services. Mind you it took 3 min to stop the old services and at one point the CPU spiked for 10 sec near the end but it did start and stop by it's self.

When it came back i was able to open a session and look around. I had 2 reindexing jobs that should have finished 4 hours earlier that were killed during the Service restart. I also could see the backup ran 1 hour longer then normal and had produced a backup of about 3x it's normal size (prob because the reindex was working way past it's usual schedule). But nothing eventful in the logs. I had a job fail earlier in the morning with "failed with the following error: "Query timeout expired"”" and a lot of connection timeouts due to the SQL services grinding to a hault.

Since then i have've been seeing a lot of "Process ID XXXX was killed by hostname [ServerName], host process ID XXXX."

And this morning (Monday) we almost had a repeat. The backups failed alerting me to the issue. The SQL server was still responsive and i could open a session no problem but a lot of connections were failing and it had these errors in the agent logs

- [298] SQLServer Error: 233, Shared Memory Provider: No process is on the other end of the pipe. [SQLSTATE 08S01] (LogToTableWrite)

- [298] SQLServer Error: 233, Communication link failure [SQLSTATE 08S01] (LogToTableWrite)

- [298] SQLServer Error: 10004, Communication link failure [SQLSTATE 08S01] (LogToTableWrite)

- [298] SQLServer Error: 16389, Communication link failure [SQLSTATE 08S01] (LogToTableWrite)

The server logs were just a bunch of "Process ID XXXX was killed by hostname [ServerName], host process ID XXXX."

Error from the automated script was

[AutoBackup]
Msg 3204, Level 16, State 1, Server NS623822, Line 1
The backup or restore was aborted.
Msg 3013, Level 16, State 1, Server NS623822, Line 1
BACKUP DATABASE is terminating abnormally.
[/AutoBackup]

I tried 2 manual backups the second worked but the first failed with this error

[ManualBackup]
Msg 3204, Level 16, State 1, Line 1
The backup or restore was aborted.
Msg 3013, Level 16, State 1, Line 1
VERIFY DATABASE is terminating abnormally.
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command.  The results, if any, should be discarded.
[/ManualBackup]


I'm scanning the disks now but these are a bunch of RAID 5s drives and there are no sign of trouble in the RAID controller logs. I'm going to scan the RAM this evening but as it is now i can not tell where the source of this is comming from.



connection time out error

$
0
0

hi

we are getting connection time out in our application for 2-3times intially when we use,after this the application is working fine for whole day.this is getting repeated for  everyday.

application is hitting our test db server,no of users are also very less

my observations

->i can't see any time out error in log

->no blockings

->remote login timeouts &remote query timeout run value are set to 1000

->in application connection time out is set to zero

->cpu and memory utilization are also normal

server is on SQL 2012

could some one help me on this to overcome the initial time out error in application and the things which need to be modified or monitored from DB end

how to change domain name in SSMS

$
0
0

Hi all,

  I have been with SSMS in windows authentication in my company domian. but,now i have to work in client domain through windows authentication(vpn is connected) .i don't want to use remote desktop connection.

Client\domain\username should be coming as per my screenshot.how can i change my domain name in SSMS.

please help..

thanx in advance..


lucky

Sql Server 2012:Full Text Catalog taking up all the disk space

$
0
0

We have created full text catalog and index for a pretty large table. The column on which the index is being created has a datatype of varchar(max). The problem started as soon as we started populating the catalog. It almost grew to 835GB and Population status stuck to "Processing Notification". I think is status code 9 which corresponds with the "Change tracking" status in the SQL. It gets stuck in this status almost for ever.

Is there a way to deal with this huge catalog size, may be shrink it or move it to a different location. 

Is switching off Change Tracking going to improve the situation.

Any help regarding this will be highly appreciated.

Thanks,

Saikat


minimum account permissions for service broker

$
0
0

Hi Friends,

SQL 2008

We are using SQL Service Broker, the account is SA on development server and when we moved the process to production server, we can't grant SA to the account that uses service broker. what are the minimum retirements for account to be able to execute service broker ?

thanks in advance,

Pat

 


Patrick Alexander

SQL 2012 Memory Usage

$
0
0

Hi,

We have a core sql database  server, which have 256 GB physical memory ,and give maximum physical memory to sql server 240000 MB, sql server service startup account  has locked memory privilege.

We found that the free memory is 12094108 KB,but the Page Life Expectancy counter is low,about 300.

Does anybody give some advice why sql server don't (or can't) use free memory, and how to find which parts inside sql server took up these free memory?

Many thanks.

SQL Server Version:

Microsoft SQL Server 2012 - 11.0.5532.0 (X64) 
Jul 14 2014 15:00:27 
Copyright (c) Microsoft Corporation
Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

And this is a clustered sql instance and as a primary node of ag.

Attachments are some dmv results.

sys.dm_os_sys_memory

sys.dm_os_process_memory

Database engine not found

$
0
0

SQL SERVER 2005 IS SUCCESSFULLY INSTALLED ON WINDOWS 8 PRO 64 BIT OS BUT DATABASE ENGINE IS NOT CREATED.

After installation when we open to connect to database engine with windows authentication no database engine shown in the drop down list. While installation we tried with both default and name instance. Both giving the same result.

Question about backup devices

$
0
0

Hi, 

SQL 2008 R2. 

I created a backup device to hold three days worth of system databases (master, model & msdb).  I'm backing up using this command (for the master)

BACKUP DATABASE [master] TO  [BD__SystemDatabases] WITH  RETAINDAYS = 3, 
	NOFORMAT, NOINIT,  NAME = N'master', SKIP, NOREWIND, NOUNLOAD,  
	COMPRESSION, STATS = 10

but the media contents show all the files from position=1. 

IS it possible for the old entries to "fall off the end" after three days? 



Trusted connection from IIS to SQL server

$
0
0

Hi All..

May I know if there are details configuration procedure for this ?

SQL Server NTFS allocation unit size for SSD disk

$
0
0

Hi,

I have read that the recommended NTFS allocation unit size for SQL Server generally is 64 kb since data pages are 8 kb and SQL Server usually reads pages in extents which are 8 pages = 64 kb.

Wanted to check if this is true also for SSD disks or if it only applies to spinning disks?

Also would it make more sense to use an 8 kb size if wanting to optimize the writes rather than reads?

Please provide some additional info or reference instead of just a yes or no :)

Thanks!

Permanently deleting data from SQL Server

$
0
0

Hi,

I have a quick question. I have always been under the impression that using DELETE FROM statements in SQL server deletes the data permanently and makes the data unrecoverable, other than from the backups. But recently someone asked me that if we purge some data, will it be recoverable? I said "no" but he did not seem convinced because of all the HDD recovery tools over the internet.

I have been looking over the internet for some official documents on this but I can not find it anywhere.I would really appreciate it if someone could point me to any official documents (MSDN/technet) that says that deleted data from SQL tables are unrecoverable (after shrink / index rebuild). 

The only info I found was: Does SQL's DELETE statement truly delete data?



Where does the parameters taking values

$
0
0

declare @L varchar(max)= NULL, @R varchar(4000), @P int=0 SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED SET NOCOUNT ON Declare @Max int Declare @Min int Select rar+raw+rad+rfd AS WAX INTO #cd From [salary] WHERE col='AMD' AND m1=@Period GROUP BY rar+raw+rad+rfd OPTION (HASH GROUP) if(len(ltrim(rtrim(@R)))=0) SET @R= NULL if(len(ltrim(rtrim(@L)))=0) SET @L= NULL Select L=item into #L from dbo.FN_SP(@L, ',') Select R=item into #R from dbo.FN_SPLIT(@R, ',') If @P=0 SELECT Isnull(s.l, 'No L') AS l, isnull(s.r, 'No R') as r, [New]=SUM(ISNULL(GC,0)), Amout=Sum(Convert(float, ISNULL(Amout,0))), CB=ISNULL(Count(DISTINCT CASE WHEN col1='CAN' AND col2<>'CANCELFEE' THEN a+ b+ c+ d END),0), FROM table S LEFT JOIN #L AS PL ON PL.L=S.L LEFT JOIN #R AS PR ON PR.r=S.r LEFT JOIN #cd on cd.AGR=a+ b+ c+ d WHERE ISNULL(Pl.l, s.l) = CASE WHEN @L IS NULL THEN s.l ELSE Pl.l END AND ISNULL(Pr.r, s.r) = CASE WHEN @R IS NULL THEN s.R ELSE PR.R END GROUP BY s.L , s.R

OPTION(HASH GROUP) Else SELECT Isnull(s.l, 'No L') AS lob, isnull(s.RR, 'No R') as R, [New]=SUM(ISNULL(GC,0)), AmOUt=Sum(Convert(float, ISNULL(Amout,0))), CB=ISNULL(Count(DISTINCT CASE WHEN COL1='CAN' AND COL1<>'CANCELFEE' THEN A+ B+ C+ D END),0), FROM [TABLE1] S LEFT JOIN #L AS PL ON PL.L=S.LO

LEFT JOIN #R AS PRON PR.R=S.R LEFT JOIN #CD CD on CD.AGR=A+ B+ C+ D WHERE ISNULL(PL.l, s.l) = CASE WHEN @L IS NULL THEN s.l ELSE PL.l END AND ISNULL(PR.R, s.R) = CASE WHEN @R IS NULL THEN s.R ELSE PR.R END AND S.COLUMN=@P

GROUP BY s.l , s.R

OPTION(HASH GROUP) Drop table #CD Drop table #L Drop table #R



Hi all,

  Can any one explain me the proc..like from where there parameters are taking values and FROM WHERE column values ARE GETTINg from which table..

thanx in advance..


lucky

Data transfer into partition table took more time

$
0
0

Scenario: We have a Staging table (consider it as Table A) which is refreshed Every month. Every month table A is truncated and inserted with 6 million records approx. Once the mandatory update done on Table A we have to move the records to main table (Table B). Table B is Partitioned by month wise, which contains the complete history of records from the year 2010. Table B has 1 clus. index(month column) and 3 non clustered index. Currently table B has 180,562,235 records. While transfer i didn’t disable the index, because it was taking more time for enabling the index again.

Question: Data transfer from table A to table B took 2.30 hours approx. Is there any way to reduce transfer time.

Any Suggestion to reduce the time will be helpful.

xQuery method SET options?

$
0
0

The documentation for ALTER DATABASE Compatibility Level includes an item in the level 90 to level 100 list that states that:

In level 90:

"The SET options required for an xQuery method are not validated when the method is contained in a view or inline table-valued function."

In level 100:

"The SET options required for an xQuery method are validated when the method is contained in a view or inline table-valued function. An error is raised if the SET options of the method are set incorrectly."

I have so far been unable to determine what this actually means, because I have not found any information about which SET options apply to which xQuery methods.

I need to understand this in preparation for an upgrade of a client's database (which has been running in compatibility level 90 - i.e. SQL 2005) to SQL 2014 (which no longer supports level 90).

If anyone can throw any light on this, I would be most grateful.

String to Date Conversion

$
0
0

Hi

I have a string MMMM-YYYY(January-2015). I have to convert it to dd\MMM\yyyy.

please help me


Thanks, Subrat Kumar


Data Compression

$
0
0

Good morning guys,

Actually I have this table: RFH010, more information about it:

rows: 280556155, reserved: 132538664 KB, data: 132026456 KB, index_size: index_size, unused: 25552 KB.

using : exec sp_estimate_data_compression_savings 'dbo','RFH010',1, NULL, 'none'

A applied: ALTER TABLE [dbo].[myTable] REBUILD PARTITION = ALL WITH (DATA_COMPRESSION =  PAGE)

and after that my database growth 20 gb... that's normally? is necessary i do shrinkdatabase after data compression?

size_with_current_compression_setting(KB): 77192872 KB,  size_with_requested_compression_setting(KB): 132023032 KB, sample_size_with_current_compression_setting(KB) 40152, sample_size_with_requested_compression_setting(KB): 68672.


sqlcmd logon failure

$
0
0

I have a windows 2008 R2 Standard 64 bit server with sqlexpress 2005 installed. I logon the server and use windows authentication to launch Microsoft SQL Server Manangement Studio Express with no problem. I can run a backup there as well.

When I attempt to run an sqlcmd batch file to run a backu it fails to logon:

Msg 4060, Level 11, State 1, Server SVR-TIMECLOCK\SQLEXPRESS, Line 1
Cannot open database "TimeClockPlus" requested by the login. The login failed.
Msg 18456, Level 14, State 1, Server SVR-TIMECLOCK\SQLEXPRESS, Line 1
Login failed for user '<domain>\scdpadmin'.

My batch file has the following:

sqlcmd -E -S SVR-TIMECLOCK\SQLEXPRESS -d TimeClockPlus -Q "BACKUP DATABASE [TimeClockPlus] TO  DISK = N'D:\SqlBackup\TimeClockFull.bak' WITH NOFORMAT, NOINIT,  NAME = N'TimeClockPlus-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10"

The eventlog has an informational event:

Soure MSSQL$$SQLEXPRESS

event id 18456

Login failed for user '<domain>\scdpadmin'. Reason Failed to open the explicitly specified database. [CLIENT:<local macine>]

I have also used 

sqlcmd -E -S .\SQLEXPRESS

with the same results.

I am trying to get the batch file to run so I can do a nightly backup of my database.

Any ideas?


Karon W

Login failed for user 'domain\laptopid$'. Reason: Token-based server access validation failed with an infrastructure error

$
0
0
This one has me banging my head against the wall ... Login fails once every second as long as my laptop is logged in (docked or VPN'd) ... Login attempts stop once machine is shut down ... It's a state 11 error ... We have 60+ sql servers (single nodes, virtuals, and clusters) and it's only happening on this one box that I have found so far ... What would be attempting a login using my laptop id? When I query ring buffers it says it's a call from NLShimImpersonate but I can't track it down ... We access servers via a windows group with sysadm permissions ...  

Enable disable trigger blocking

$
0
0
I have a 3rd party app that has code that disables a trigger than enables it. Well why it does this it locks that table and blocks a lot of queries. Is there a way to prevent the blocking? Maybe in the query that disables/enables the trigger is set the isolation level? Any help would be appreciated.

Alan

Linux sqlcmd - inline sql script issue

$
0
0

I am migrating an existing Sybase DB to MS SQL 2012 server. Also, I need to migrate no. of unix batch scripts - written in “Sybase isql”. I have modified unix shell scripts  using “sqlcmd” and scripts are working fine. But it throws unwanted sql newlines in output. Please see below.

1> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16

Is there any way to hide these ?  Thanks.

Sample script :

==========

#!/bin/ksh

export input=step_exec

export JOBLOG=/tmp/logs

sqlcmd -S mysqlserver.com -U uname -P pass -o$JOBLOG'/jobparm.'$$ << !!

set nocount on

go

declare @jobcode int

declare @error int

declare @id_value int

exec @jobcode=mydb..sp_Ident $input, @id_value output

select @error=@@error

if @jobcode < 0

begin

  select 'ERR_NUM|' + convert(char(15),@error)

end

else if @jobcode >= 0

begin

  select 'ERR_NUM|' + convert(char(15),@jobcode)

  select 'IDENT|'+ convert(char(15),@id_value)

end  

go

exit

!!

SQLCMD Version :

==============

Microsoft (R) SQL Server Command Line Tool - Version 11.0.1790.0 Linux


Viewing all 12963 articles
Browse latest View live


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