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

Failed to initialize MSDB database for tuning (exit code: -1073741819). (DTAClient)

$
0
0

Hello,

This is the first time I am using this forum. I am stuck and need some help. I received this error message both on SQL 2005 and 2008. I am currently using SQL 2008 DEV for testing purposes and I am experiencing this error message when trying to connect to Database Engine Tuning Advisor. I am using the SA account so I should not have any security issues. Also this is a fresh install of SQL 2008 DEV on a fresh install of Windows XP Pro with all SP. Can some please help.

Error:

"Failed to initialize MSDB database for tuning (exit code: -1073741819). (DTAClient)"

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

Failed to open a new connection.

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

Failed to initialize MSDB database for tuning (exit code: -1073741819). (DTAClient)

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.DTA.Client.TuningServer.InitializeTuningParametersDatabase()
   at Microsoft.SqlServer.Management.DTA.Client.TuningServer.InitializeConnection()
   at Microsoft.SqlServer.Management.DTA.Client.TuningServer.Connect()
   at Microsoft.SqlServer.Management.DTA.Shell.SessionMonitor.AddServerInternal(SqlConnectionInfo connectionInfo, SqlConnection connection)
   at Microsoft.SqlServer.Management.DTA.Shell.SessionMonitor.AddServer(SqlConnectionInfo connectionInfo, SqlConnection connection)
   at Microsoft.SqlServer.Management.DTA.Shell.SessionMonitor.OnConnect(Object sender, EventArgs e)

 


MSDB keeps growing...

$
0
0

SQL Server 2008 R2, SP2 (64bit) - I have an issue where MSDB keeps growing. I have applied SP2 to see if this resolves the issue and it still continues to grow. I have to keep truncating it by following the directions below. Will SP3 resolve this MSDB issue or is there a hotfix I can apply? Sorry for being MIA for a while, I got assigned to a windows cloud project and virtualization. Although fun, I had to fight to get back to my SQL Servers! I missed them. Thanks for your help everyone.

TRUNCATING MSDB:

ALTER TABLE [dbo].[sysmaintplan_log] DROP CONSTRAINT [FK_sysmaintplan_log_subplan_id];
ALTER TABLE [dbo].[sysmaintplan_logdetail] DROP CONSTRAINT [FK_sysmaintplan_log_detail_task_id];
Truncate table msdb.dbo.sysmaintplan_logdetail;
Truncate table msdb.dbo.sysmaintplan_log;
ALTER TABLE [dbo].[sysmaintplan_log] WITH CHECK ADD CONSTRAINT [FK_sysmaintplan_log_subplan_id] FOREIGN KEY([subplan_id]) REFERENCES [dbo].[sysmaintplan_subplans] ([subplan_id]);
ALTER TABLE [dbo].[sysmaintplan_logdetail] WITH CHECK ADD CONSTRAINT [FK_sysmaintplan_log_detail_task_id] FOREIGN KEY([task_detail_id]) REFERENCES [dbo].[sysmaintplan_log] ([task_detail_id]) ON DELETE CASCADE;


--So, we altered and truncated the logs, and that data, now we are going to shrink it. In this case we will use:

USE MSDB
GO
DBCC SHRINKFILE(MSDBLog, 512)
GO
DBCC SHRINKFILE(MSDBData, 512)
GO

--The underneath query will rebuild all existing indexes and statistics.


--The next query will rebuild all the indexes…
USE MSDB
GO
EXEC sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?', ' ', 80)"
GO
-- UPDATE STATISTICS
EXEC sp_updatestats
--EXEC sp_helpdb @dbname= 'MSDB'

 


A SQL Server MVP or MSFT Eng should be replying soon as well. Hope this helps. Frank Garcia *** Please select "Vote As Helpful" if the information provided was helpful to you. If an answer to your issue solved the problem then please mark it as"Propose As Answer" located at the bottom. Thank you. ***

Length specified in network packet payload did not match number of bytes read; the connection has been closed.

$
0
0

 Hello every one
I am getting this in my event log from time to time . not sure what is that ?
Is this a hacker trying to send rubbish data to SQL through the port ?
Any help is appreciated .

Length specified in network packet payload did not match number of bytes read; the connection has been closed. Please contact the vendor of the client library. [CLIENT: someip]

Why doesnt xp_logininfo fail if it run as 'dbo'

$
0
0

Dear All

I have come across an odd problem that I would like your advice on.

I have the following code

CREATE PROCEDURE tstXPLogin

WITH EXECUTE AS 'dbo'

BEGIN

EXEC xp_logininfo '<ANY AD GROUP>', 'members'

END

I know after reading various comments/BOL ect that this will not work, but what confuses me is that it doesn't error, instead it returns no rows, so I was wondering why?

Thanks

Peter

Investigating Deadlocks

$
0
0

Hi everybody,

I am looking into Deadlocks problem in our application. I have a trace and in this trace I can see that there are several connections. Our applications use 'Transaction Isolation Level Read Uncommitted'. Other applications use Read Committed Isolation Level. So, my first question - is it somehow possible to have other application to also use Read Uncommitted Level? I found one blog post where it indicated there is no way to set it server side, I want to confirm this.

What should be my first steps in figuring out the problems?

I included the image of the trace file I got.

Thanks in advance.


For every expert, there is an equal and opposite expert. - Becker's Law


My blog


My TechNet articles



clustered column store index - insert

$
0
0

why does bulk insert into clustered column stored index with partition slower than non-partition clustered column stored index? I have 100 ML record fact table, as part of POC I was able to insert 100 ML records with non-partitioned column stored index in 10 min while partitioned clustered column stored index took me 38 min. 

I can see from  sys.column_store_row_groups table is I have too many delta store with less than 1048576 records and with every partition has on an average 2-3 ML records. 

Best Regards

Shrikant Kulkarni 

Driver SCSI returned invalid ID for a child device

$
0
0

Hi,
We are having a Sql Clustered instance of SqlServer 2008 R2 with 2 nodes running
on windows server 2008 R2. We have about 90 databases in the instance.
Our servers(Dell PowerEdge m610) runs on 2 Intel Xeon(R) CPU X5670 @2.94 GHz with
6 cores(12 logical processor) and 12 GB RAM. The mdf and ldf files are stored in
a single drive which actually is lun of 2TB in EMC vnx5330 san storage system connected
through fibre optic channel.For the heartbeat between the 2 servers we have Broadcom BCM57095
netextreme 11 1GB Ethernet adapters. The SQL Servers are connected to the SAN and LAN using
2 QLogic 10Gb Ethernet NICs(which are teamed) through 2 Cisco Nexus
5010 switches which are operating in ‘active-active’ mode.


 
On 12th instance there was server(active node) reboot. The instance automatically failed
over to the second node with out any problem. Checking the event viewer the following
critical event(kernel power) was registered.
The system has rebooted without cleanly shutting down first. This error could be caused
if the system stopped responding, crashed, or lost power unexpectedly.
Prior to it there were several event(application pop up) whose descriptions are given below -:
a)Driver SCSI returned invalid ID for a child device (000200).
b)Driver SCSI returned invalid ID for a child device (000129).
c)Driver SCSI returned invalid ID for a child device (000128).
d)Driver SCSI returned invalid ID for a child device (000127).
e)Driver SCSI returned invalid ID for a child device (000100).
f)Driver SCSI returned invalid ID for a child device (000029).
g)Driver SCSI returned invalid ID for a child device (000028).
h)Driver SCSI returned invalid ID for a child device (000027).
i)Driver SCSI returned invalid ID for a child device (000000).

Also on the chasis indicator the following error was displayed-:
Critical bus fatal error was detected on a component at bus 0 device 0 function 0.

Before the reboot on 12th of January the server had rebooted on 6th of January with the
same sequents of error events registered ie Driver SCSI returning invalid Id for child
device followed system rebooting.

On investigation the server had rebooted 3 times during the year 2014 with the same events
with the same sequence.

We are also logging 30 perfmon counters which showed no significant variation from the
daily pattern. However the counters which shows values over the threshold values recommnded
by Quest software are given below-:

Counter Name                  Min     Max     Average    At time of reboot
Processor Queue lenght        0       8       0.015      0
%processor time sql process   0       481     5          32
Sql buffer page reads per sec 0       17596   280        325
Memory Pages per sec          0       8217    1063       1800
Full scans per sec            0       192     9.567      26
Index searches per sec        0       12111   177        457
Batch requests per sec        0       509     12.673     28
Compilations per sec          0       258     2.266      19

The cpu usage was well below 20% and avg disk sec/read & write well below 8 ms.

What could be the reason for the problem? What exactly is the reason that the 'driver
SCSI returned invalid ID for a child device' error is getting registered in the event log.
Is it a Sql Server cluster configuration problem or an hardware problem?
How could the server reboot's in future be avoided?

Thanking you in advance,
Binny Mathew.

***************

Session went Killed / Rollback state in sql server

$
0
0

Hi ,

I have sql server 2008 on my infra.

There one backup job was running more than a day, so i killed the session and it went to killed/rollback state.

And it was consuming more resources in terms of CPU and Disk I/O. I have restarted the sql server service to free the resources.

I just want to know,

Is there any way to clear the session without restarting the sql services ?

Or Is there any way to free the resources on the server or terminate the session ?

Regards,


Vinodh Selvaraj


Fragmentation %

$
0
0
What is the impact of fragmentation when my tables fragmentation is 99% but page count is 300 only?

Amit kr mishra, IT Consltant

Log file restore takes long time

$
0
0

Hi,

My log file restore takes very long time to complete, for 128 MB it takes around 3-4 hours, most of the time it is in suspended state and wait type is 'SLEEP_BPOOL_FLUSH' 

I checked for virtual logs its around 534 files, also there is not disk IO issues as the other DB using the same drive restore faster than this DB...

Am using lg shipping and the backup/restore schedule is 5 mins.. by surfing i feel this could be a checkpoint issue so i manually tried to issue a checkpoint but can not as the DB is in restoring state most of the time.

Please advise on what could be the possible scenarios?


Best Regards Moug

ALTER DATABASE/MODIFY FILE issue

$
0
0

Greetings to all --

We are running SQL Server 2008 R2 (SP3) - 10.50.6000.34 (X64), and running into what seems like a bug. One of the largest tables was moved to a separate file group a while ago, and now a large percentage of the rows from that table (about 50GB) , need to be removed.

We wanted to reduce the amount of transaction log growth and the duration required for the delete. Recovery model was set to BULK_LOGGED before executing the following steps:

1. create a new filegroup

2. create a new file in that filegroup

3. set the new filegroup to be the DEFAULT filegroup

4. SELECT INTO new_table from original_table WHERE filter_condition

5. drop original_table

6. rename new_table to original_table

7. remove original file from original filegroup

8. remove original filegroup

9. MODIFY the logical name of the new file to be the same as the logical name of the original logical name.

ALTER DATABASE myDB
MODIFY FILE ( NAME = new_logicalname, NEWNAME = original_logicalname)
This fails:

Msg 1828, Level 16, State 3, Line 1
The logical file name "original_logicalname" is already in use. Choose a different name.

I noticed that the original filegroup still persisted until I did a transaction log backup, but after that , there is no entry for that file in sys.databasefiles for that database.

Checking sp_helpdb for that database shows only the new logical file name.

Any thoughts would be much appreciated.

HOW RESTORE WITHOUT OVERWRITE EXISTING DATABASE ???????

$
0
0

I create a test database named TESTONE

USE MASTER
GO

if DB_ID('testone') IS NOT null
drop database TESTONE
GO

CREATE DATABASE TESTONE
GO

and change recovery model to simple

alter database TESTONE set recovery simple
GO

so I create a sample table

use TESTONE GO create table table1( id int identity primary key, descr varchar(10) ); go

I take a full backup of that database

USE master
GO

BACKUP DATABASE TESTONE
TO DISK=N'c:\TEMP\testone.bak'
WITH NOFORMAT, INIT,  NAME = N'TESTONE', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO

after that i do something bad :-)

USE TESTONE
GO

drop table table1
go

USE master
GO

USE [master]
RESTORE DATABASE [TESTONE] FROM  DISK = N'C:\TEMP\testone.bak' WITH  RECOVERY, FILE = 1,  NOUNLOAD,  STATS = 5
GO

the restore command doesn't contains  WITH REPLACE clause and ....

if you expand the tables tree you'll find your deleted table

the database has been overwritten

Why?

Log File after fix KB3024815

$
0
0

Hi,

hot fix http://support.microsoft.com/kb/3024815
RESOURCE_SEMAPHORE_QUERY_COMPILE..............

After I placed this fix on SQL 2014 Cluster, the compilation time was okay, but the following issue occured. 
When rebuilding an index with a size of 10MB in the log fail are recorded 70MB which caused the rebuild time to increase x7 because of the x7, an increase of x7 is required to the I/Ops and HDD for the log. 

For example:

Size before rebuild this index
index: 24544.00KB
Log File: 833024.00KB
 
Size after rebuild this index
index: 24592.00KB
Log File: 1008000.00KB
 
So log increase 7.1151594 times from index size.

Am I the only one experiencing this issue or is there a bug when this fix is placed on the cluster ?

Regards,

Jeff


How to convert from SQL Server table to Flat file (txt file)

$
0
0
I need To ask question how convert from SQL Server table to Flat file txt file

how to know if any new recored insterd in database my job will run

$
0
0

Hi All,

i want to create a polling mechanism, if any new record inserted in a database table  my SP show be run.

Regards,

Manish



Datetime and datetime2 conflict between servers

$
0
0

Hi Everyone,

I was copying some data from a single table between 2 servers using the Export Data feature (very handy!). In the Export Data wizard, at one of the last steps, the Wizard warned that there could be rounding errors due to mismatched types. I thought this was very odd as the database on the second server is a copy of the one on the first. Looking at the error more closely, the wizard said the source DB had datetime2 fields, and the destination db had datetime.

I checked the definition of the table in the source database and it said it was datetime... not datetime2, so I'm confused! This might also explain why when data is exported from another DB, and the date has a value of 0 (which equates to 1899 in the other DB), this DB (which is playing as the source in this situation) imports those dates as 1753 (or something like that).

Is there some sort of database level config for defaulting datetime to datetime2? What else could explain this. As I said, the destination DB in this instance is a restoration of the backup of the source DB so they should be the same.

Thanks in advance!

Login issue into SQL Named instance

$
0
0

Hi All,

I was able to log in to one of our named SQL instance and never had a problem. Now all of a sudden, it gave me an error saying

"Login failed.The login is from an untrusted domain and cannot be used with windows authentication. 

(Microsoft SQL server,Error: 18452).

And then i waited for a while and tried it, then am in. But keeps giving me this error time and again.

To give you more information,

The SQL sevre is using Mixed mode and is 2008(SP3). 

The user am trying to login into as - is windows user(its in the AD)

Am pretty sure the SPN is set correctly.

Any idea?

Please and thank you.

Auditing OPEN SYMMETRIC KEY by dbo user

$
0
0

I am trying to find a way to audit when a database owner opens a symmetric key. According to Books Online, adding DATABASE_OBJECT_ACCESS_GROUP to a database audit spec should cover this event. I tried testing this by creating a new database and running the below transact sql. I was surprised to see the audit log was empty. Am I approaching this correctly or is there no way to audit this event?

/* AUDITING */
USE master
GO

CREATE SERVER AUDIT PCIAuditLog
TO FILE (FILEPATH = 'C:\Temp', MAXSIZE = 1024MB )
WITH (ON_FAILURE = continue)
ALTER SERVER AUDIT [PCIAuditLog] WITH (STATE = ON)

USE Test
GO

CREATE DATABASE AUDIT SPECIFICATION [TestAuditSpec] FOR SERVER AUDIT [PCIAuditLog] ADD (DATABASE_OBJECT_ACCESS_GROUP) WITH (STATE = ON)
GO

CREATE CERTIFICATE PasswordsCert WITH SUBJECT = 'Passwords Cert'

CREATE SYMMETRIC KEY PasswordsKey
    WITH ALGORITHM = AES_256
    ENCRYPTION BY CERTIFICATE PasswordsCert
GO

-- Create a column in which to store the encrypted data.
CREATE TABLE AlertRoute (
 AlertRouteId INT,
 AlertRouteDescr NVARCHAR(50),
 UserName NVARCHAR(100),
 Password VARBINARY(128)
)
GO


-- Insert Encrypted Row
OPEN SYMMETRIC KEY PasswordsKey DECRYPTION BY CERTIFICATE PasswordsCert
INSERT INTO AlertRoute VALUES (1, 'Encryption Test', 'billp', ENCRYPTBYKEY(KEY_GUID('PasswordsKey'), 'PasswordClearText'))
CLOSE SYMMETRIC KEY PasswordsKey
GO

SELECT * FROM AlertRoute
GO

OPEN SYMMETRIC KEY PasswordsKey DECRYPTION BY CERTIFICATE PasswordsCert
SELECT *, CONVERT(VARCHAR(MAX), DECRYPTBYKEY(Password)) DecryptedPassword FROM AlertRoute
CLOSE SYMMETRIC KEY PasswordsKey
GO

-- View Audit file
SELECT
 AuditFile.*
FROM
 sys.dm_server_audit_status AS AuditStatus
 CROSS APPLY sys.fn_get_audit_file ('C:\Temp\PCIAuditLog_67FCC904-4F9B-4D21-AEB6-BB6DB6CE4E86_0_130662204682920000.sqlaudit', default, default) AS AuditFile

Are you using AlwaysOn or replication for scale?

$
0
0

One of the attractions of the current "big data" fad is scalability - you can throw ten or a hundred servers at the problem of persisting data and then (mostly) selecting from it.

Seems to me that we could do that with SQL Server - have a single (cluster) host where data is inserted and updated, and have multiple read-only copies to support scalability to thousands of simultaneous select/SP transactions.

But I haven't seen it done.  This may or may not involve sharding, where a copy contains only a part of the data, and may or may not - but mostly not - involve letting the clients do any data modification.

"Scaling out" and sharding were somewhat more popular ten years and more ago, before SQL Server and Wintel got so good at multiple processors per server.  Anybody doing any of that now?

Outside of log shipping to DR and replication to a report server, I haven't seen any recently.

Shipping data from an OLTP system to a data warehouse or data mart via an operational data store does not count, that's changing the shape of the data as it moves and not using the destinations homogenously.

Thanks,

Josh

SQL server support or can store data in multiple languages? If so, how is it done

$
0
0

Hi All,

Can you please let me know If SQL server support or can store data in multiple languages? If so, how is it done..

Thanks,

Subbu


Thanks, Subbu

Viewing all 15264 articles
Browse latest View live


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