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

MSDTC unavailable

$
0
0

Hi,

I need to use transaction support with linked server. Linked Server is created for SQL Express 2008 R2 Express.

MSDTC is enabled on Linked Server (Windows 7 PC) as per http://technet.microsoft.com/en-us/library/cc753510(v=ws.10).aspx.

While connecting the SQL server, I get an error : "MSDTC unavailable.."

Is there any guideline for configuring transactions for Linked Server?

Thanks.


2008R2 SQL Agent error 14258

$
0
0

Hi,

I recently enabled database mail in SQL (2008R2), setup a mail profile, set SQL Agent to use it and restarted SQL Agent.  SQL Agent starts ok but when trying to look at job properties or history I get the error:

Error 14258: Cannot perform this operation while SQLServerAgent is starting. Try again later.

I have checked lightweight pooling mode is not enabled and also that no databases are in recovery mode. I have also disabled database mail and unticked the SQL Agent mail option and restarted, to no avail.

The SQL Agent service was running quite happily as an unpriveleged domain user.  The only way I have found to get SQL Agent running correctly again is to set the service to run using a domain admin account.  Running as local system gives the same error.

Please can someone advise?

Thanks,

Edd Parsons

incorrect cpu_count reported after installing SQL2012 SP2 (x64)

$
0
0

installed SQLExpress 2012 with advanced services on my new Win 8.1 laptop. Since windows update is allowed to update all microsoft products, SP2 was installed also. After the update, i noticed 2 strange things:

  1. SQL Agents appears in the configuration manager (not able to start)
  2. Reporting about number of logical and physical CPU is changed (screwed up).

The laptop has an 'AMD A6-6310 APU with AMD Radeon R4 Graphics' which was identified as 1 physical en 4 logical CPUs. Now it's 4 Physical and 1 logical CPUs. Adding CU1 doesn't fix the problem either. MSinfo32 is reporting the correct values:

here's the output of sys.dm_os_sys_info (with version info):

On the properties screen in SSMS it says 4 processors.

I am sure it did report the correct logical/physical cpu, because I collected this data.

So why is dm_os_sys_info reporting wrong values?

2012 SP 2 Issue

$
0
0

I have a warehouse that was running perfectly under 2012 SP1, it uses CDC with net enabled on the source tables to do incremental loads into the warehouse.

We migrated the databases over to a new SQL 2012 SP2 build (also later applied the hot fix for index rebuild), we are using SSIS and the CDC components for our integration.

So once we migrated a few of our tables were hanging on the CDC Source component beyond our timeout (around 10 minutes), typical CDC source time is 15 seconds.

I then tested the query output in the sis output in management studio and boom it works in under 15 seconds as expected,

I then did a Perlman on it and captured the real queries from SSIS, and the get_net_changes TVF call was wrapped in an sp_execute call, I copied it out and ran it in a SSMS window and it hangs, so I've eliminated everything but the query engine and how it behaves with sp_executesql, if I modify the sp_Executesql to include option (recompile) the sp_executesql for the TVF works in under 15 seconds as well.

Running a dbcc freeproccache just prior to running sp_executesql has no effect either.

What I'm believing is that either plan cache utilization or the plan being created is so horrid that the query never finishes, I've let ssms run for over 30 minutes and still not got a plan back.

Since I can't change the SSIS component to use option (recompile) nor is option recompile valid in a TVF (inline) as they are currently written, I'm more concerned that the behavior is the sign of a larger problem in the optimizer with SP2.

Any guidance in resolving this would be appreciated, at the moment we are considering downgrading the new box to SP1.

Additional information:

Tables giving us trouble are fairly wide, have fairly large PK (from a JDE system), and are fairly high volume change wise, if there are no records or very low records in the CT tables then the functions still perform fast, they also perform as expected when using the ALL instead of Net option.

Thanks

John


John Gooding

DBCC SHRINKFILE command in maintenance plan job works manually, but not on schedule

$
0
0

In an attempt to release log file empty whitespace, we've added the following t-sql statement task as part of a weekly maintenance plan job:

EXEC master.sys.sp_MSforeachdb
'DECLARE @ln varchar(max)
SET @ln=(SELECT name FROM [?].dbo.sysfiles WHERE fileid=2)
USE [?]

BEGIN TRY
DBCC SHRINKFILE (@ln);
END TRY

BEGIN CATCH
END CATCH'

If I 'Start job at step' that single job manually, it seems to run fine and release quite a bit of unused whitespace.  We have another domain user that runs the agent service, which has full rights to the log files themselves as well as sysadmin server role and seemingly random user mappings.  When checking the job history, it shows that the job completed successfully, but when we view the history of the size of the drive, there is no change at that time.  I'm wondering if anyone has any idea about what might be happening here.

Thanks
jt

Security fix -MS14-044

$
0
0

Hi,

   I have a SQL 2008 R2 SP2 ( 10.50.4000.0 ) and in order to apply the fix for the above vulnerability (MS14-044).  Please

let me know if i need to go with QFE or GDR fix.  I just want to make sure i install the right file.

Thanks

Murali A


Mli.a | Mark the answers if it helps to solve your problem |

SQL Server Shuts Down randomly on big data loads on Windows 8

$
0
0

I am responsible for the data processing and analysis for two identical spacecraft for a NASA science mission. I am running one SQL instance for the first spacecraft on a Windows 7 machine and another instance for the second spacecraft on a Windows 8 machine. Both installations were done the same and both have been configured with the same scripts and use the same login credentials.

The issue that I am having is that the SQL Server on the Windows 8 machine randomly fails and shutsdown when I am submitting a large amount of data into the database tables.  When I do this exact same operation on the Windows 7 machine I have never had any issues.  This of course causes a significant amount of issues in regards to overall data processing since there are up to three difference processing systems working with each of the SQL Instances.

I am not a SQL DBA nor have significant training in SQL but have used it for a decade or so and write a significant amount of C# code interfacing with the system.  As a note, the code that I'm currently using interfaces with the SQL servers via LINQ.

Does anyone have any thoughts on what might cause the issue for the Windows 8 machine and not for the Windows 7 machine?

I would greatly appreciate your help.
In the meantime I've written a small service that looks at the system every minute and if it is shutdown it restarts the service but this is NOT an optimal solution.


Jerry W. Manweiler, Ph.D.

common issues in log shipping

$
0
0

appreciate it if dbas can list the common issues they have faced in log shipping.

I understand that we can have space issues in directory or user rights issues or sql server agent being down.

any other issues that you might have faced?


Symantec on your SQL server in an Internet facing farm

$
0
0

I'm sure we are all familiar with how SQL will grab just about all available ram on a server to use for itself.  Normally this isn't a problem, but lately we've been having problems with Symantec that when it does it's scans on that server it is spiking the CPU up to 50% of it's total capacity.  When we opened a ticket with Symantec they told us that was because there was so little memory left over to run that it was causing problems for Symantec.  

We explained that that's how SQL works, and they told us that there wasn't anything they could do for us unless we limited the amount of ram that SQL was using like in this article:   

http://technet.microsoft.com/en-us/library/ms191144(v=sql.105).aspx

We have 32gb in the SQL box, and it's an internet facing farm with 5 different sites on it that get around 750k hits a month on the 3 WFE's.  

What I'm not sure of is how to handle this.  Obviously on an internet facing farm we need AV going, (even on the SQL server I guess), but I'm not sure if I want to restrict the memory on that server just for the occasional AV scan.  The Security guy is telling me that I should just add more ram and then restrict it back to 32gb for SQL to give me basically what I got now, but that seems like a waste to me, (FYI servers are on VMWare).

Does anyone have any suggestions on how I should handle this?

Thanks.

Ted

https://usercenter.ncodesolutions.com/lraext/login.asp problem in login on this site

$
0
0

nCodeSolution

I want to login on this web site but when I open this site then problem show that "there is a difference between server and clients dates" so I can't secure login on this please solve this problem

 

SQL Server 2008R2 vs 2012 OLTP performance difference - log flushes size different

$
0
0

Hi all,

I'm doing some performance test against 2 identical virtual machine (each VM has the same virtual resources and use the same physical hardware).

The 1° VM has Windows Server 2008R2 and SQL Server 2008R2 Standard Edition

the 2° VM has Windows Server 2012R2 and SQL Server 2012 SP2 + CU1 Standard Edition

I'm using hammerDB (http://hammerora.sourceforge.net/) has benchmark tool to simulate TPC-C test.

I've noticed a significative performance difference between SQL2008R2 and SQL2012, 2008R2 does perform better. Let's explain what I've found:

I use a third VM as client where HammerDB software is installed, I run the test against the two SQL Servers (one server at a time), in SQL2008R2 I reach an higher number of transaction per minutes.

HammerDB creates a database on each database server (so the database are identical except for the compatibility level), and then HammerDB execute a sequence of query (insert-update) simulating the TPC-C standard, the sequence is identical on both servers.

Using perfmon on the two servers I've found a very interesting thing:

In the disk used by the hammerDB database's log (I use separate disk for data and log) I've monitored the Avg. Disk Bytes/Write and I've noticed tha the SQL2012 writes to the log with smaller packet (let's say an average of 3k against an average of 5k written by the SQL 2008R2).

I've also checked the value of Log flushes / sec on both servers and noticed that SQL2012 do, on average, more log flushes per second, so more log flushes of less bytes...

I've searched for any documented difference in the way log buffers are flushed to disk between 2008r2 and 2012 but found no difference.

Anyone can piont me in the correct direction?

DTC account

$
0
0

Hi all. I would like to know how to choose a proper account to run DTC?

 DTC logon account

The SQL Server (Instance Name) service terminated unexpectedly. It has done this 4 time(s).

$
0
0

Our SQl server 2012 instance terminated unexpectedly many times in last two months. We had a look the error log but there is nothing details in the log. And there is nothing in the Windows event viewer. And i did run checkdb to all databases and there is no corrupt database. And it is happing in a random time, Could anyone advice on this, please.

Many thanks

Help for Resource Governer

$
0
0

Hi, can anyone share what is the pros and cons for using Resource Governer

Is there a way to create a plan guide for this query?

$
0
0

How can i create a plan guide for this query,suppose i can't change the query text:

USE AdventureWorks2008R2;
GO
SET NOCOUNT ON;
GO

-- query plan statement starts

DECLARE @Group nvarchar(50), @Sales money;
SET @Group = N'North America';
SET @Sales = 2000000;
SET NOCOUNT OFF;
SELECT FirstName, LastName, SalesYTD
FROM Sales.vSalesPerson
WHERE TerritoryGroup = @Group and SalesYTD >= @Sales;

-- query plan statement ends

AdventureWorks2008R2's parameterization option is simple, i want this type of query can reuse plan:

DECLARE @Group nvarchar(50), @Sales money;
SET @Group = N'Other Country';
SET @Sales = 88;
SET NOCOUNT OFF;
SELECT FirstName, LastName, SalesYTD
FROM Sales.vSalesPerson
WHERE TerritoryGroup = @Group and SalesYTD >= @Sales;

I tried many times ,but it didn't work:

declare @xml nvarchar(max)-- the plan i want to reuse
set @xml = (select cast (query_plan as nvarchar(max)) 
from sys.dm_exec_query_plan (0x060006001464570B405D92620200000001000000000000000000000000000000000000000000000000000000))
-- create plan guide 
exec sp_create_plan_guide 
@name ='Test'
,@stmt=N'SELECT FirstName, LastName, SalesYTD
FROM Sales.vSalesPerson
WHERE TerritoryGroup = @Group and SalesYTD >= @Sales;'
,@type =N'sql'
,@params =N'@Group nvarchar(50), @Sales money'
,@hints = @xml;

Thanks.




Distributed transactions not working

$
0
0

Hi.

Please read this post carefully as I believe this is going to be a complex issue to resolve and I trust we've eliminated all commonly known causes while troubleshooting. We've had two DBAs and two infrastructure analysts working on this problem for more than a week with no progress.

I've been having trouble running distributed transactions between a clustered (WSFC 2012) and a standalone instance of SQL Server 2012 Enterprise.

Both MSDTC services are running and with all those parameters enabled in component services (allow inbound/outbound connections, network access, no authentication required, etc etc etc). Both servers are able to resolve DNS and reverse DNS of each other, even though they are in different domains. Distributed transactions are able to run fine between instances belonging to the cluster.

In both the standalone and the clustered instances, the following error is returned when attempting to run a distributed transaction:

OLE DB provider "SQLNCLI11" for linked server <LINKED SERVER NAME> returned message "No transaction is active.".
The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server <LINKED SERVER NAME> was unable to begin a distributed transaction.

When running a distributed transaction started from the clustered instance, the following error is generated in the sql server error log in the REMOTE, standalone instance:

"Recovery of any in-doubt distributed transactions involving Microsoft Distributed Transaction Coordinator (MS DTC) has completed. This is an informational message only. No user action is required."

This is NOT observed the other way around.

DTC Ping was returning the following message for either instances:

There are no more endpoints from the endpoint mapper

Acording to the link below, this sugests either a firewall problem OR the operating system running out of DCOM ports.

http://blogs.msdn.com/b/distributedservices/archive/2008/11/12/troubleshooting-msdtc-issues-with-the-dtcping-tool.aspx#Therearenomoreendpoints

However, we have already ruled out these options as there are no firewalls between these hosts and the server in which both SQL Server instances are running are dedicated to them, so there are no other running services which could cause port overlapping that i know of. Listing open sockets in command prompt confirms this. We have also tried to increase the port range for MSDTC manually, but that didn't change anything. The ONLY open socket, in both servers, that is documented for MSDTC is port 135, which is used for RPC so i believe its alright. There are no other open sockets for ports 1434 or 5100-5200.

After we installed a few aditional .net components on both servers, DTCPing test started to run successfully from the clustered instance to standalone, and clicking "run" in standalone did nothing. The error messages in SQL Server remained as they were.

One interesting remark, although I'm unsure wether this has anything to do with the problem, is that the physical machines in which the cluster nodes run have two MSDTC services, one local and one clustered. I've never seen this setup before. Strangely, the local, disabled MSDTC service displays a uniqueidentifier in services.msc that is listed as a clustered resource in regedit

This service wont start and will generate the following errors in event viewer:

MS DTC log file not found. After ensuring that all Resource Managers coordinated by MS DTC have no indoubt transactions, please run msdtc -resetlog to create the log file.

MS DTC Transaction Manager start failed. LogInit returned error 0x3. This is expected if the corresponding volume has been restored (search for kb article regarding the issue). In all other cases, contact product support.

OBS.: The clustered MSDTC service is running fine and DT works between two different active clustered instances, either on the same node or on distinct ones.

When running a distributed transaction from one of the clustered instances to the standalone instance, the transaction is listed as "active" for long period of time in the clustered server before timing out in SQL Server and aborting. It is NOT, at any time, listed as an in-doubt transaction.

Changing the server parameter "in-doubt xact resolution" to 1 in both instances didn't have any effect either.

Questions:

1. Could this problem be related to the presence of multiple MSDTC services in the clustered instance?
2. Why won't the MSDTC local service start in the clustered service?
3. Why is the in-doubt transaction message generated for the standalone instance, but not for the clustered one?
4. Does MSDTC even work between a clustered and a standalone SQL Server instance???
5. In the clustered instance, SQL Server resource is not dependant on MSDTC. Could this be interfering with transactions outside the clustered instances?

Persistancy of user account & its permission in TempDB

$
0
0

Hi,

I have observed an interesting issue in sql server 2012 (my version is 11.0.5532)

1. Create a sql server login, let's call it [Test]

2.Create a user (let's call it TestUser) in TEMPDB with the following script

USE [tempdb]
GO
CREATE USER [TestUser] FOR LOGIN [Test] WITH DEFAULT_SCHEMA=[dbo]
ALTER ROLE [db_datareader] ADD MEMBER [TestUser]
ALTER ROLE [db_datawriter] ADD MEMBER [TestUser]
GO

Now reboot the server, and since TempDB will be recreated during sql service restarts, I expect the newly created TestUser in tempdb to be disappeared. But it does not, it is still there.

Now, let's create another user, this user will matching an existing Windows Login account in the sql server, 

USE [tempdb]
GO
CREATE USER [TestUser2] FOR LOGIN [MyDomain\XXX] WITH DEFAULT_SCHEMA=[dbo]
ALTER ROLE [db_datareader] ADD MEMBER [TestUser2]
ALTER ROLE [db_datawriter] ADD MEMBER [TestUser2]
GO

and reboot the server again, this time, in TempDB, TestUser2 disappears (as expected) while the original TestUser still persists.

In summary, in TempDB, if I create a user with a regualr sql login and also create another user with a windows login, after sql server restarts, the user with the sql login will still exist in tempdb while the one with the windows login will disappear.

Does anyone know why this is the case?

Thanks,

Jeff_yao

Disable Shared memory & Named Pipes protocols - Post implementation issues

$
0
0

Hi,

 As per security guidelines, we disabled Shared memory & Named Pipes protocols and enabled "TCP/IP" only. Also, we changed the port# from 1433 to 1533 and after that, in management studio, SQL Server Error logs is not openning up and SQL Agent Service doesn't start.

 Error while opening SQL Server Error Logs in SSMS:

The description for Event ID 17052 from source MSSQLSERVER cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Severity: 16 Error:10061, OS: 10061 [Microsoft][SQL Server Native Client 11.0]TCP Provider: No connection could be made because the target machine actively refused it. 

the message resource is present but the message is not found in the string/message table

Error while trying to start SQL Agent Service from the configuration manager:

SQLServerAgent could not be started (reason: Unable to connect to server '(local)'; SQLServerAgent cannot start).

 We changed the Server host in the registry by entering <ServerName>,<Port#>. This resolved SQL Agent Service startup issue. After startup, we tried to run jobs but they all are failing with the below error.

Job runtime Error:
Could not load package "Maintenance Plans\Daily DB Backups" because of error 0xC0014062.  Description: The LoadFromSQLServer method has encountered OLE DB error code 0x80004005 (Login timeout expired).  The SQL statement that was issued has failed.  Source:   Started:  4:40:45 PM  Finished: 4:41:00 PM  Elapsed:  15.547 seconds.  The package could not be loaded.  The step failed.

 Resolution: If I create an alias name then all problems are solved.

 Question: Alias name is the only one solution or is there any other turn around? For some reason, I’m not at all comfortable with alias name. I feel like cheating. :-) .

 PLEASE COMMENT


If you feel that I have answered your question then please "Mark as Answer".

SSIS package deployed in SQL2012 fails with 'SQLNCLI10.1 is not registered'

$
0
0

I deployed a package in SQL2008R2 server to a SQL2012 server without any 'Migration wizard ' changes.

When executing the package thru a job the package failed with this error

Error: 2012-07-20 13:07:32.99
   Code: 0xC0209303
   Source: bs_load_full_wcis_tbls Connection manager "EIS_STAGING"
   Description: The requested OLE DB provider SQLNCLI10.1 is not registered. If the 64-bit driver is not installed, run the package in 32-bit mode. Error code: 0x00000000.
End Error

The connections in the packages are configured with 'Package Configuration' to pick up connection information from a table .

The table uses SQLNCLI11.0 client info for connection , but somehow the package 'thinks' it still needs 'SQLNCLI10.1'.

I have hundereds of packages. I am looking for a easier way to deploy the packages to SQl2012 without manual intervention.

Any ideas ?

TIA


ramesh bala


varchar to numeric

$
0
0

Hi All..
I am writing a query to select and the stop at the middle,  and say

Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.

How can I find the problem row quickly ?

Viewing all 12554 articles
Browse latest View live


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