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

Logical Reads vs. Physical Reads

$
0
0
- What is the difference between logical and physical reads? Does tempDB come into picture? And can high logical reads cause performance issues?

Restoration failure :- backup set holds a backup of a database

$
0
0

Hi All, 

Really need your assistance and help, I have problem and issue on Data Warehouse environment, where when doing a restoration received error as below 

Error :- 

The backup set holds a backup of a database other than the existing 'XXX' database 

Restore database is terminating abnormal .

Was tried few solution such as WITH MORE, detach, create back and run restoration database still nowt work.

Need your suggestion and solution for this issue .

Appreciate your kind assistance. 

Environmnt : SQL Server 2008 Enterprise . 

Thank you

Amy Badri 


DBCC CHECKDB issue in Azure. - MSSQL_DBCC22". Operating system error 80: "80(The file exists.)".

$
0
0

I have an issue running DBCC CHECKDB on one of our SQL Server Azure wm's .

DBCC CHECKDB are runing just fine on all databases on the server except one, which fails with the error below.

The one database that fails has it's data files in Azure premium storage (https:\xxx.xxxxx.blob.core.windows.net\xxxx), the rest is on classic storage, as is the Azure VM server itself.

While running the DBCC Check db against the failing database, it seems that the DBCC snapshot file generated, does not get cleaned up correctly which I believe to be the cause of the error.(https://xxxxxxxx.blob.core.windows.net/xxxx/xxxxxxxmdf_MSSQL_DBCC22) The file can be see from the Azure storage interface. 

 I cannot find a solution for this, so any help will be much appreciated! 

Error message:---------------------------------------------------------------------------- 

Msg 1823, Level 16, State 2, Line 1
A database snapshot cannot be created because it failed to start.
Msg 1823, Level 16, State 8, Line 1
A database snapshot cannot be created because it failed to start.
Msg 5120, Level 16, State 144, Line 1
Unable to open the physical file "xxxxxx.xxxxxxx.xxxxxx/xxxx/xxxxxx.mdf_MSSQL_DBCC22". Operating system error 80: "80(The file exists.)".
Msg 7928, Level 16, State 1, Line 1
The database snapshot for online checks could not be created. Either the reason is given in a previous error or one of the underlying volumes does not support sparse files or alternate streams. Attempting to get exclusive access to run checks offline.
Msg 5030, Level 16, State 12, Line 1
The database could not be exclusively locked to perform the operation.
Msg 7926, Level 16, State 1, Line 1
Check statement aborted. The database could not be checked as a database snapshot could not be created and the database or table could not be locked. See Books Online for details of when this behavior is expected and what workarounds exist. Also see previous errors for more details.


Database size increase

$
0
0

Hi All

Is there any way, to lower the increase in DB size after re-indexing, if we can't resist completely increasing size of database.

how to count number of lines in a row for particular column

$
0
0

Hi all,

 i have a table with column reference of type nvarchar(MAX)

a single row of it has data splitted into many lines .data is as follwos:

"jb 12000 paid
jb 700 paid
jb 700 paid
this is a toy
a car
i10 is a car
turkey is a country
golf is a game
12123141255
12345678910
movie is cinema"

the single cell has the above data spliited into more than 10 lines.now, how can i count the number of lines per in particular row

so that i can use that number of lines count in ssrs report.please help..

thanx in advance


lucky

high CPU utilization of sqlserver.exe

$
0
0

Hi Team

We have SQL server 2008 running on the OS Win server 2008 R2.

configuration : 32 GB RAM / 8 CORE

The SQLserver.exe process is taking the high cpu utilization. How to improve this.

recently we have upgraded from 16 GB/ 4core to 32GB/8 core.

Please suggest

Thanks

rameena

SQL Server Update error message. (Standard 2014 -> Sql Server 2016 RC1)

$
0
0

Good Afternoon,

I am testing a SQL Server Update Path(Standard 2014 -> Sql Server 2016 RC1).

An error popup box occurs on the "Feature Rules" page. The message states "The specified edition upgrade from Standard edition to target Evaluation edition is not supported......"

I did some online research for Sql 2016 upgrade paths. One of the links states "2014 standard" can be upgraded to "2016 standard".

Do I need to wait for a newer released version of SQL 2016 or is there some other reason for the message which prevents the upgrade?

Thanks

Joe

Why Can I Connect To Aerver But Not Link To It

$
0
0

This makes no sense to me, so I hope that someone can provide an explanation.

I'm working with databases on several servers via SSMS 2014. I have been able to link to other servers. For my current project, I need to work with data from LanSweeper. I am able to connect to the database on the server, see all the various database objects, do queries, etc.

Since I will need to join data from the LanSweeper database to data in other databases, I went to set it up as a linked database.  I know I gave the right server name and that it is SQL Server.  For security I chose Be made using the login's current security context.  If I read the documentation correctly, that means Windows authentication.  When I hit OK, I get the infamous Logon failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

HELP...please.

TIA,

John


Execution plan "estimated number of rows" display value

$
0
0

hi,

1.execution plan for query "estimated number of rows" display 9.333. why is that

2. tried with trace QueryTraceOn 9130  and return 19614.

hope this is issue with index scan.

how to resolve this please 

Backup Job Failure Issue

$
0
0

Hope everybody is doing good.

Could you help me out to fix the following issue ?

we have created a maintenance plan followed with verify backup integrity for backing up the databases.

But the job is getting failed with the following error at times.

Error:

Executing the query "declare @backupSetId as int

select @backupSetId =..." failed with the following error: "The backup or restore was aborted.
VERIFY DATABASE is terminating abnormally.
A severe error occurred on the current command. The results, if any, should be discarded.".
Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or
connection not established correctly.

-----End---

surprisingly, after completion of backup for all databases the job is getting hung and throwing the above error when it is aborted.

your response on this is greatly appreciated.

How to know the detail information of all buffer pages (like the address, timestamp ...) for a database

$
0
0
I have kept searching for the answers of this problem on the internet. But I can only found the answers of getting the total number of pages for a database. What I want to know is to list the address and time stamp of all pages for a database. I think there might be a DMV which stores those information but I can not figure out which DMV it is. Anyone can help?  

SQL Server on Hyper-V performance issue

$
0
0

Hi,
We've switched to using Hyper-V as our primary virtualization engine for hosting VM's about 3-4 years ago (switching from VMWare) and haven't had any noticable issues since then.

But now a hosted customer noticed performance issues when running SQL-server on the virtualized Machines, I don't think this is a "new" problem but no one ever "complained" about performance so therefore we haven't done any real testing and measuring of this particular problem before.

When testing this on the SQL-server we are running a normal Select query selecting 1 000 000 rows from a table.

If the VM has 1 vCPU this Query takes about 15-17 seconds, but if we add processors (2,4,8 doesn't matter) it takes about 27-29 second, no other changes done.

We have tried just about anything we can think of to speed up the Query with multiple vCPU's, but no matter what we do we get the same result, 1 vCPU is always a lot faster than using more cpu's.

The VHDx files of the VM are placed on SSD disk in our SAN and we get good Iops (about 60-70 000) so there should be no problem there.

The SQL version is 2014 Standard with all hotfixes and patches applied, the database doesnt really seem to matter either since we have tested in several different db's. We also tried to move the VM to a new host where it was the only VM without luck.

Anyone seen the same problem and possibly have a solution or idea of what to do now??


_____________________________________ /Michael R

Informations missing in Extended events compared to profiler trace

$
0
0

Hi all,

I know that profiler trace are "old style" and sooner or later they will become deprecated, the new way is extended events so, we have to use them.

I have a simple server side trace running on my server, this is the definition:

-- Create a Queue
declare @rc int
declare @TraceID int
declare @maxfilesize bigint
set @maxfilesize = 1024 

exec @rc = sp_trace_create @TraceID output, 0, N'c:\fsroot\cpu', @maxfilesize, NULL 
if (@rc != 0) goto error

declare @on bit
set @on = 1
exec sp_trace_setevent @TraceID, 10, 3, @on
exec sp_trace_setevent @TraceID, 10, 12, @on
exec sp_trace_setevent @TraceID, 10, 16, @on
exec sp_trace_setevent @TraceID, 10, 17, @on
exec sp_trace_setevent @TraceID, 10, 18, @on
exec sp_trace_setevent @TraceID, 12, 3, @on
exec sp_trace_setevent @TraceID, 12, 12, @on
exec sp_trace_setevent @TraceID, 12, 16, @on
exec sp_trace_setevent @TraceID, 12, 17, @on
exec sp_trace_setevent @TraceID, 12, 18, @on


-- Set the Filters
declare @intfilter int
declare @bigintfilter bigint

-- Set the trace status to start
exec sp_trace_setstatus @TraceID, 1

-- display trace id for future references
select TraceID=@TraceID
goto finish

error: 
select ErrorCode=@rc

finish: 
go

The server side trace caputeres databaseid, CPU time, pages red and pages written for every single statement executed against the database engine, my goal is to have the exact cpu consumption (and page I/O) grouped by database, I need this information to apply a chargeback policy.

I have tried to replicate the same with exetnded evets:

CREATE EVENT SESSION [CPU] ON SERVER 
ADD EVENT sqlserver.rpc_completed(SET collect_statement=(1)),
ADD EVENT sqlserver.sql_batch_completed
GO

but in the output .xel file the databaseid is always null...

SQL Disk Dependency problem on SQL 2008 cluster including errors

$
0
0

Hi All,

I have a SQL 2008 cluster running with 2 nodes, and what I have recently noticed is that a snapshot creation code has been failing. I checked the cluster dependency property on the SQL instance

and I noticed that the dependency wasn’t set on the backup drive, I took SQL offline, set the dependency and then brought it back online and yet the create snapshot code doesn’t work.

Please note that the drive is a mount point.

Any ideas please

CREATE DATABASE [DBNAME] ON (NAME = [DBNAME], FILENAME = 'X:\BackupMount\Snapshot\DBNAME_Snapshot.ss') AS SNAPSHOT OF [DBNAME]; Msg 5184, Level 16, State 2, Line 1 Cannot use file 'X:\BackupMount\Snapshot\DBNAME_Snapshot.ss' for clustered server. Only

on formatted files on which the cluster resource of the server has a dependency can be used. Either the disk resource containing the file is not present in the cluster group or the cluster resource of the Sql Server does not have a dependency on it.

Error


Msg 5184,Level 16,State 2, Line 1

Cannot

usefile'X:\BackupMount\Snapshot\DBNAME_Snapshot.ss'forclusteredserver. Only formatted files on which the clusterresourceof theserver has a dependency can be used. Either the diskresource containing thefileisnot presentin the clustergroupor the clusterresourceof theSqlServer doesnot have a dependencyon it.

Cannot change SQL 2008 R2 Service account from local System to any account

$
0
0

Windows 7 64 Bit Developer Edition of SQL Server 2008 R2

Successfully changed SQL Server Agent, SQL Server Reporting Services, SQL  Analysis Services, SQL Server Integeration Services and SQL Full-Text Filter Daemon Launcher from Local System Account to Domain account.  Howerver,  I cannot change the SQL Server Account.  The SQL Server Configuration Manager generates the below error:

WMI Provider ERROR (in window title bar)

Big red X followed by "The parameter is incorrect. [0x80070057].

I have tried many things with no luck:

Tried using a different local administrator account

Tried putting the Domain account I want to change to in the local admin group

Tried adding the Domain account I want to change to in all of the SQL created local groups

I think im going to have to reinstall to change the account.  What up!@!!

 

-thanks for any help in advance.  Its probably something dumb i did or did not do.

 

 

 


scott

Get WMI error 0x80070057 When change sql server service account from local system to domain account

$
0
0
Hi, When I changed the sql server engine account from local system to a domain account on sql server 2012 standard edition 32 bit with SP2, I keep getting WMI error :

The parameter is incorrect. [0x80070057] 

I did the change through SQL server configuration manager.

Even I changed to use "network service" account, it is same error.

Please help. thanks

FlushCache:clean up and I/O requests taking longer

$
0
0
Recently lot of messages gets logged in sql server as

12:01 -> SQL Server has encountered  x occurrence(s) of I/O requests taking longer than 15 seconds to complete on file

12:00 PM -> FlushCache: cleaned up bufs with writes in ms (avoided new dirty bufs) for db


I understand that the flush cache will be logged if it cross the  checkpoint interval,
but does I/O request taking longer to complete relates to Flushcache cleanup?

because at the time of I/O request taking longer complete I did not see any heavy query running, Also want to know does alwayson can be responsible for this ? as noted there is no delay in AOAG dashboard(Synchronized)

Best Regards Moug

SQL Agent - Error Authenticating Proxy

$
0
0

I am having an issue when scheduling an SSIS package on a Production environment (via SQL Agent, utilizing a Credential/Proxy). I have worked through the steps below in a Test environment and have not had any problems. Here's what I've done in Production (on a SQL Server 2008 R2 non-clustered environment):

- Copied SSIS package to file system (NTFS permissions are set properly)

- Created a Credential and Proxy (for a Windows user)

- Created SQL Agent job to execute the SSIS package

- Executed the job and receive the following error: 

"Unable to start execution of step 1 (reason: Error authenticating proxy DOMAIN/user, system error: Logon failure: unknown user name or bad password.).  The step failed."

Can someone help me work through this? I have tested the process above with a blank SSIS package, so I know it has nothing to do with access to the source systems. The issue resides specifically on the SQL Server box that is running SSIS and SQL Agent.

I have done some reading and found the following:

- Delegate permissions to SQL Agent account...

- Provide "Log on as a batch job" permissions to AD user

- Install a KB to fix...

Not sure what to puruse at this point. Also, the Job will run just fine using the SQL Agent service account; however, I need to run this user as a different account.

Please advise.


What is Exact Difference between USER_NAME(),CURRENT_USER,SYSTEM_USER,SUSER_NAME(),SUSER_SNAME() functions in SQL Server

$
0
0

Hi,

I have executed the query as following.

 select USER_NAME(),CURRENT_USER,SYSTEM_USER,SUSER_NAME(),SUSER_SNAME()

But I am getting the same result. Can any one explain what is the exact difference between these functions which are used to get session user information.

Thanks in advance!!!!!

Regards,

Rajesh Ch

What's the difference betwen Affinity I/O and Processor affinity?

$
0
0

Hi all of you,

In Sql Server 2008 you can define for every logical processor both Processor Affinity and I/O affinity features.
From 2012 on, you only can choose one at the same time per logical processor or it so seems, don't know from SSMS T-SQL the same restriction.

All of this is bringing me to think over about these features. What's the difference between one or another? From where on you need to worry about?  In our live and "preproduction" servers such configuration remain untouched since the beginning. We have got 8 CPUs as a maximum.

But imagine that tomorrow instead of 8 I'd have 32 and one of this machines would run my DWH. Which would be the properly feature for my DW? I/O? less updates and inserts, more reads,?¿

Apart of that, in my virtualized servers (2014 and 2016) I can only as a maximum the same number or virtual processors than physical ones.

Thanks a lot for your comments!


Viewing all 15694 articles
Browse latest View live