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

Just curious which answer in this scenario is correct and why ?

$
0
0

You administer a Microsoft SQL Server 2012 server. One of the databases on the server supports a highly active OLTP application. Users report abnormally long wait times when they submit data into the application. You need to gather blocking data over an extended period of time. You also need to ensure minimum impact to server performance. What should you do?

A. Run the DBCC TRACEON 1222 command from a query window and review the SQL Server event log.

B. Use sp_configure to set a value for blocked process threshold. Create an extended event session.

Which one of the 2 is correct and why please?


Was MSDE supported on POSReady 2009?

$
0
0

I need to migrate a system off XP and onto POSready 2009 so it is on a "supported" platform.

The application on this system also uses the MSDE SQL DB and is not going to be updated.  A replacement project is in progress.

Does anyone know if MSDE was ever "supported" on POSReady 2009


Jim

Database Shrink Error: 8985

$
0
0

Hi All,

Version: Microsoft SQL Server 2008 (SP3) - Enterprise Edition.

While performing the DB Shrink, I get the following error on both the editionsEnterprise and Developer. Recently I have upgraded the Service pack from SP2 to SP3. From then this issue has started.

I have verified the log logical name and physical path which is available and its correct.

The Command that I use to Shrink is below:

USE XXX
GO
DBCC SHRINKFILE (XXX_Log, 0);
GO

Error Message: Could not locate file 'XXX_Log' for database 'XXX' in sys.database_files. The file either does not exist, or was dropped. [SQLSTATE 42000] (Error 8985).  The step failed.

Please suggest or help me to sort out this issue.

Service Account for SQL Server Agent on SQL Server 2008

$
0
0

This SQL Server instance is SQL Server 2008 (10.50.4000).  We had Active Domain Service accounts created to run the service accounts for SQL Server and SQL Server Agent.

It has become company policy to alter the service accounts that run SQL Server and SQL Server Agent.  Currently, both were running under the Local System Accounts.  We have altered the SQL Server but we are having issues with the SQL Server Agent.  I am told by another DBA that

"The agent is requiring elevated rights.  It will startup if it has local admin rights, but not with domain accounts without admin rights."

So I was wondering if anyone has come across this issue and how did they resolve it.


lcerni

Get query result in E-mail

$
0
0

Hi Everyone,

I am trying to get SQL Query Result in e-mail with proper format.

I tired DB mail but result is not in proper format . It's hard to read from attachment. 

From Below Query HTML format showing first 3 columns good after that all getting mixed up. 

Select Ticktsno,customer_Id,Phone,Open date-time,OpenedBy,Assign_to,Category,Support_level,Incident_type,Description from dbo.query_result. 

HTML Code: 

                                   


 if @@ROWCOUNT > 0
begin
declare @emailSubject varchar(100),
  @columnHeaders varchar(1000),
  @tableHTML nvarchar(max)

select @emailSubject = 'My Results Email',      -- Subject of Email
  @columnHeaders = 'tickets</th><th>Customer</th><th>Phone</th><th>Open Date/Time</th><th>OpenedBy</th><th>Assign_To</th><th>Category</th><th>Support_Level</th><th>Incident_Type</th><th>Status</th><th>DEscription'   -- Column headers (must put </th><th> between each header)

set @tableHTML =
  '<div><b>My Email Header</b></div><br>' + -- This is the bold text at the top of your email
  '<table border="1" cellpadding="5"><font face="Calibri" size=2>' +
  '<tr><th>' + @columnHeaders + '</th></tr>' +
  convert(nvarchar(max),
  (
   SELECT td =  Tickets,       '',
                    td =  Customer, '',
                    td =  Phone, '',
                    td = [Open Date/Time], '',
                    td = OpenedBy, '',
                    td = Assign_To,
                    td = Category,
                    td =  Support_Level,
                    td = Incident_Type ,
td = [Description]         

                     from master.dbo.QueryResult_2000
                      
   for xml path('tr'), type))

  +'</font></table>'

EXEC msdb.dbo.sp_send_dbmail @recipients='xxx@yy.com',
    @subject = 'Query Result',
    @body = @tableHTML,
    @body_format = 'HTML' ;
end

What changes should make in HTML code to get report in proper HTML  format


Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach A.Shah


SQL services use 100% Harddisk when queries

$
0
0
I developed  my own app to query the data from MSSQL

I use MSSQL 2008 R2

when I run the query in MSSMS, it's work fine and has very fast response

but when I run with C# application (integrated query inside).

it take about 5000ms for 1 query and when I exterminate the task manager, I found that the services of my database engine using disk load about 5-7 MB/s (but the % is 100%)  

after some experiment. I found out that if I want to make the query faster in my C# app, I have to open the MSSMS "together" (and make any select top 1000) with my query in C# app

anyone know what is MSSMS do to increase the performance of any running services?


**Note that it happens only some PC not all of them. 

Problem to select

$
0
0
Hi,
I get these when trying to select from table. what should be granted to the login?
Msg 916, Level 14, State 1, Line 1
The server principal "ws_login" is not able to access the database "my_schema" under the current security context.
Msg 208, Level 16, State 1, Line 2
Invalid object name 'ite_tab'.


Many Thanks & Best Regards, Hua Min

Service Account for SQL Server Agent on SQL Server 2008 R2

$
0
0

This SQL Server instance is SQL Server 2008 R2 (10.50.4000).  We had Active Domain Service accounts created to run the service accounts for SQL Server and SQL Server Agent.

It has become company policy to alter the service accounts that run SQL Server and SQL Server Agent.  Currently, both were running under the Local System Accounts.  We have altered the SQL Server but we are having issues with the SQL Server Agent.  I am told by another DBA that

"The agent is requiring elevated rights.  It will startup if it has local admin rights, but not with domain accounts without admin rights."

So I was wondering if anyone has come across this issue and how did they resolve it.


lcerni



Help resolving connectivity Issue to SQL Server 2005 x64 SP4

$
0
0

We currently moved our Windows Server 2008 R2 Servers with SQL Server 2005 x64 SP4 to Active Directory. 

After moving the servers to Active Directory, we noticed that all of our processes that access SQL Server remotely were failing with the following error:  Update:  Processes are run via Task Scheduler.

SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed.

Used googled and found folks resolved the issue deleting deleting duplicate SPNs using setspn.  I haven't found any duplicate SPNs.  Currently, we are only using NTLM not kerberos as the protocol.

As a work around, I am looking at creating a SQL Server Account and assigning it to all databases to ensure we can have the monitor working as it should until we resolve the SSPI Issue.  Before I can move forward with this, I would need to contact our security folks, since we are required to use Windows Authentication.

Any assistance would be appreciated.

DJ


Temp db Property issue

$
0
0

Hello team,

while i am trying to see sql server temp database properties getting the bellow error message:

error message:

Note: in this server i have full permission like win level and sql server level SA permission.

Database Mail not working from SQL Agent job

$
0
0

I have SQL job setup which has query which sends the query result in e-mail. This query works fine from SSMS and send query result in e-mail using Database Mail. But when I am running this job , job get succeeded but not getting query result in e-mail. 

Running on SQL Server 2008R2 

DB mail profile created and set to default. 

SQL Agent properties using same database default mail profile. 

Any solution for this?

Thanks


Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach A.Shah

SQL Server Editions for Columnstore Indexes

$
0
0
I am trying to find out what editions of SQL Server 2012 will allow the use of columnstore indexes.  Can I create and use columnstore indexes on the standard edition or do I have to have the BI or Enterprise editions?

Lee Markum


Plan Cache size for SQL Server EXPRESS.

$
0
0
I use SQL EXPRESS on some of our servers. It has a limitation of 1.5GB for memory. How to find Plan Cache size for EACH database in SQL Express?

SQL Restarting Automatically by something or someone

$
0
0

Hi,

I have encountered a very strange issue in a Production server which is soon to be decomissioned.

I manually stop the SQL Services (DB engine, SQL Agent, SSIS, SSAS) and even set their startup type to be disabled but around 1 to 2 hours later, I check again and the DB engine and SQL Agent services are running!

I suspect this is someTHING rather than someONE restarting the services but does anyone have any ideas of what this could be?

We have SCOM monitoring s/w looking at this server but I have gone into SCOM ops console and set this server to be in maintenance mode. Still the SQL and SQL Agent services are restarted somehow.

Does anyone have any ideas what could be restarting the services?? I should point out that it is my intention to stop the services permanently!

Many Thanks,

Phil

User Executes Stored Procedure That Executes sp_send_dbmail; receives email but also gets error Cannot alter the queue 'ExternalMailQueue', because it does not exist or you do not have permission.

$
0
0

Using SQL Server 2012 SP1

I have a user that is submitting a procedure that uses sp_send_dbmail.  I have also noticed that they have the following code in their procedure

DECLARE @rc INT
IF NOT EXISTS (SELECT * FROM msdb.sys.service_queues
WHERE name = N'ExternalMailQueue' AND is_receive_enabled = 1)
EXEC @rc = msdb.dbo.sysmail_start_sp

The user submits the procedure and she gets the email but she also gets the following error message:

Msg 15151, Level 16, State 1, Procedure sysmail_start_sp, Line 8
Cannot alter the queue 'ExternalMailQueue', because it does not exist or you do not have permission.
Mail (Id: 2402) queued.

(1 row(s) affected)

I have granted execute to sp_send_dbmail and sysmail_start_sp.  I have also granted select to service_queues.

Does anyone have any solutions for the above error message?


lcerni


SQL Server 2005 Receiving Error every second

$
0
0

I am not a SQL expert by any means, so I hope the community can help me on this.

We are receiving the error "A user request from the session with SPID 61 generated a fatal exception. SQL Server is terminating this session. Contact Product Support Services with the dump produced in the log directory."

SPID 61 shows as Windows Sharepoint Services.

The Event Viewer shows it as Event ID 17310.

The server is a Sharepoint 2007 server.

This error relates to the dbghelp.dll version 4.0.5 process. This error generates literally every second. 

If more information is necessary, I will be more than happy to provide it.

Cumulative update patch 9 for SQL 2012 SP1 doesn't update SQL version number from 11.0.3000 to 11.0.3412

$
0
0

I have applied CUP9 to the SQL2012 SP1 server. Update went through successfully and I restarted the server. However, SQL version didn't change to 11.0.3412 as expected, but still shows 11.0.3000.

It shows HOtFix 3412 for SQL Server 2012 (64-bit) installed in Installed Updates in Programs installed on the server.

Did anybody else experienced this or has any insight on this? How can I be sure that CUP9 is actually installed?

I appreciate any response!

Login failed for user. Microsoft SQL Server, Error: 18456

$
0
0

Hi,

I have a windows 2008 with SQL Server 2008 R2 VM on Azure. I am trying to connect to the SQL server for the first time using SSMS, but have not been able it. I have a VPN tunnel, so I am connecting using Windows authentication. The error I get back from SSMS is:

Login failed for user 'domain\username'. (Microsoft SQL Server, Error: 18456)

In the event viewer I see this error message:

Login failed for user 'domain\username'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: <local machine>]

I have done the following:

- created an endpoint for port 1433

- opened port 1433 in the firewall

- Ran the MSSQLSERVER service as the build-in users Network Services, Local System, and Local Service, and as a local and domain administrator, with the same exact result each time.

- I get the same result trying to connect locally or remotely.

- I get the same result trying to connect using sqlcmd.

- None of the suggestions in the related worked.

Any thoughts on how I can resolve this issue?

Thanks,

MH

SQL Server 2012: Can't start database after it crashed with millions of uncommitted transactions

$
0
0

Hi All,

A long running query with millions of uncommitted transactions was running when the server crashed. When I try to restart SQL Server 2012, I get the following messages in ERRORLOG:

2014-03-10 14:32:09.77 spid20s     Recovery of database 'SQL2012' (5) is 0% complete (approximately 6501 seconds remain). Phase 1 of 3. This is an informational message only. No user action is required.
2014-03-10 14:32:09.77 spid20s     Recovery of database 'SQL2012' (5) is 0% complete (approximately 11055 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
2014-03-10 14:32:29.76 spid20s     Recovery of database 'SQL2012' (5) is 0% complete (approximately 6381 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
2014-03-10 14:33:16.03 spid20s     Recovery of database 'SQL2012' (5) is 1% complete (approximately 6405 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
2014-03-10 14:33:36.03 spid20s     Recovery of database 'SQL2012' (5) is 1% complete (approximately 6361 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
2014-03-10 14:33:56.03 spid20s     Recovery of database 'SQL2012' (5) is 1% complete (approximately 6320 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
2014-03-10 14:34:00.11 spid20s     Recovery of database 'SQL2012' (5) is 1% complete (approximately 6225 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
2014-03-10 14:34:00.11 spid20s     22347 transactions rolled forward in database 'SQL2012' (5:0). This is an informational message only. No user action is required.
2014-03-10 14:34:00.11 spid20s     Recovery of database 'SQL2012' (5) is 1% complete (approximately 6225 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
2014-03-10 14:34:00.19 spid6s      Recovery of database 'SQL2012' (5) is 32% complete (approximately 230 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
2014-03-10 14:34:11.67 spid6s       Failed allocate pages: FAIL_PAGE_ALLOCATION 8
2014-03-10 14:34:11.67 spid6s     
Process/System Counts                         Value
---------------------------------------- ----------
Available Physical Memory                11810967552
Available Virtual Memory                    9752576
Available Paging File                    14068871168
Working Set                              3860353024
Percent of Committed Memory in WS               100
Page Faults                                 1168332
System physical memory high                       1
System physical memory low                        0
Process physical memory low                       0
Process virtual memory low                        1
2014-03-10 14:34:11.67 spid6s     

Pages of errors like the block above follow. This seems to be related to the bug described in kbase entry 2769594 but I have installed SP1 cumulative patches 2 and 3 with no success.

Thanks in advance

Zane

Monitors: SQL Server: Access Methods: Full Scans/sec

$
0
0

Hello,

I created a Monitor:

Monitors: SQL Server: Access Methods: Full Scans/sec

It appears in Heath explorer on the servers

ut is not available in the Performance Data for the Views...

What did I miss? I need to create a rule but which type ? linked to the monitor?

Should I use a Rule or a Monitor or a combination?

Thanks,
Dom


System CenterOperations Manager 2007 / System CenterConfiguration Manager 2007 R2 /Forefront Client Security / ForefrontIdentity Manager






Viewing all 15872 articles
Browse latest View live


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