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

messages in error log (sql server 2012)

$
0
0

hi

I am getting logs like following in the sql server alert logs almost every 20 to 30 minutes 

last target outstanding: 4806, avgWriteLatency 78
average throughput:   0.66 MB/sec, I/O saturation: 5241, context switches 17775
FlushCache: cleaned up 10191 bufs with 9324 writes in 119907 ms (avoided 5356 new dirty bufs) for db 5:0

I read many articles, some are saying it is not much harmful as there is trace flag enabled by default to trace long checkpoints while some are referring to check the underlying storage. 

Any advise from the experts whether to ignore these or how to fix the issue if any.



Linked Server Query throws truncated data message

$
0
0

Hi,

I am running a query over Linked server to bring data from external Vendor Cache database. I need to configure the linked server provider to run 'Out of Process' due to issue with Cache database SQLprovider.

Recently I have started receiving message regarding data truncation from openquery. The query returns status of Execute successfully but message windows shows few errors...

select clientno,companyno,homecity,homecounty,homehouse,homepostcode,homestreet,poststreet
FROMOPENQUERY(exact, 'SELECT clientno,companyno,homecity,homecounty,homehouse,homepostcode,homestreet,poststreet
fromExtVendor.client_master') 

Message returned is:
OLE DB provider 'MSDASQL' for linked server 'exact' returned truncated data for column '[MSDASQL].homehouse'. The actual data length is 51 and truncated data length is 50.

I tried inserting data into table but cannot locate any problematic row.

Any suggestions ?

Thanks in advance.


Shady

Sqldiag.exe from SQL2k14

$
0
0

Hi there,

What is it really for? it produces a .sql file named MSDiagProcs.sql that bring stored procedures on TEMPDB.

I would thank any link or comment on that?

SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.

$
0
0

Hi All

Today i was working on impact of change in max server memory so  I have  changed max server memory from 100 to 16 MB and I get below in error log

/******************************************************/
Configuration option 'max server memory (MB)' changed from 100 to 16. Run the RECONFIGURE statement to install.
FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
/******************************************************/

But when I changed from 16 to 100 or to 1000 MB i get below again
/******************************************************/
Configuration option 'max server memory (MB)' changed from 16 to 100. Run the RECONFIGURE statement to install.
FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations. 
/**************************************************/

My question is why does flush of cache plans / SQL plans / bound trees happening when I am increasing max memory in sql server

SQLSERVERAGENT requires manual start when starting computer

$
0
0
I have SQL Server 2014 installed locally on a Windows 10 64-bit computer. Lately I have to go in to the Task Manager and start the SQLSERVERAGENT each time I start up my computer. Is there a setting I can set to make it start when I start up the computer?

SQL Server 2012 changes its time to some future date when restoring database

$
0
0
I have a pair of clustered servers that are a development environment.  They are on a pair of HP GL380P servers and we weekly restore our production database to this environment.  We have found that for some reason when we do the restore on the primary in the cluster it will start having time problems and eventually the time gets so out of whack that Kerberos on that machine fails and networked accounts cant log into it.  Looking at the event viewer I see where it goes through a process of trying to correct the time about 12 times with in a few seconds then sets itself to some odd interval from the current date.  Some times it two days and 12 hours we have had it go as much as a week.  We have done some testing and find that it follows the cluster because we have never had a time/date issue on Box 2 but when it was made primary in the cluster the problem started occurring there.  I had saw where there was a fix for a similar issue in SQL 2008 but cannot find anything for 2012, anybody else encounter this?  Any suggestions?

Cost of threshold of parallelism for estimated plan

$
0
0

Hi there, I've changed the current value in UAT from 5 to 250 I am still seeing how the subtree cost remains the same

I just was discussing with a friend of mine who has 200 as value in live. In all our live servers we run with the default value (5)

What values do you have in live?

SELECT COUNT(*) FROM MYTABLE

--Subtree cost in my case is 421

EXEC  sys.sp_configure N'cost threshold for parallelism', N'250'

RECONFIGURE WITH OVERRIDE

--After applying new values that is the same

Apart or that, I got some messages in my SQL log:

SQL

Serverhas encountered 1 occurrence(s)ofcachestore flush forthe'Object Plans'cachestore(partofplancache)duetosomedatabasemaintenanceorreconfigureoperations.


Serverhas encountered 1 occurrence(s)ofcachestore flush forthe'SQL Plans'cachestore(partofplancache)duetosomedatabasemaintenanceorreconfigureoperations.

Serverhas encountered 1 occurrence(s)ofcachestore flush forthe'Bound Trees'cachestore(partofplancache)duetosomedatabasemaintenanceorreconfigureoperations.

Express version on live

$
0
0

Hi there, we run 2014 Express on live. No kidding you...

how is the best way to apply some maintenance peak-off hours? I don't want to use a linked server.

do scheduling .BAT files on Window Task Scheduler?

It seems a blunder


Problem with linked server to DB2

$
0
0

We have 3 SQL servers. 2 are Enterprise Edition, 1 is Standard Edition. On the 2 Enterprise servers, I have linked servers to DB2 that are working fine. On the Standard server, I have a linked server to DB2 that worked at one time, but now does not work. I am not sure when it stopped working.

All 3 servers have DB2 Connect installed on them, and have ODBC DSNs to the DB2 instances. I am using the provider 'Microsoft OLE DB Provider for ODBC Drivers' in SQL Server to connect to the DB2 databases on all 3. I have verified on all 3 servers that ODBC settings match. I have verified that 'Allow in process' is set for the provider in SQL Server. I am able to connect to DB2 through DB2 Connect command line utilities and query the database, so I know the connection to DB2 is good. However, when I try to create the linked server in SQL Server Management Studio, I get the following error:

Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "TEST-LINK".
OLE DB provider "MSDASQL" for linked server "TEST-LINK" returned message "[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed".
OLE DB provider "MSDASQL" for linked server "TEST-LINK" returned message "[IBM][CLI Driver] SQL1031N  The database directory cannot be found on the indicated file system.  SQLSTATE=58031
". (.Net SqlClient Data Provider)

Any help is greatly appreciated.

Error 1450 nonrecoverable I/O error occured on file when running dbcc or backup - bluescreen every night

$
0
0

Hi All

I have a SQL 2005 instance with a db attached that is bluescreening every night when a SQL job runs.

If I run:


Backup database ACU_ABL_DW
to disk='\\xxxxx\temp\ACU_DW.bak' with stats = 1

I get the error

Msg 3271 Level 16 state 1 line 1
A nonrecoverable I/O error occurred on file "F:\mssql\data\acu_dw.mdf:" 1450(error not found)

I also get a very similar 1450 error if I try to run:

DBCC CHECKDB ('ACU_ABL_DW') WITH PHYSICAL_ONLY


It sits for around 12-14minutes then returns the error:



Msg 823, Level 24, State 10, Line 1 The operating system returned error 1450(error not found) to SQL Server during a write

at offset 0x0000000ff80000 in file 'E:\MSSQL\Data\tempdb4.ndf'.

Additional messages in the SQL Server error log and system event log may provide more

detail. This is a severe system-level error condition that threatens database

integrity and must be corrected immediately. Complete a full database consistency

check (DBCC CHECKDB). This error can be caused by many factors; for more information,

see SQL Server Books Online.

I have searched high and low and nowhere can I find a solution to this problem.

You can connect to the db, write items to the tables or select any of them - the files do actually exist on the disk and do have full read/write access

If anyone has some suggestions as to what we can try, the db will not back up and will not complete a successful dbcc check so it seems impossible to diagnose the fault

Thanks


J

New COMPRESS Function in SQL Server 2016 RTM Using More Logical IO

$
0
0

Hi,

We are looking to upgrade one of our systems to 2016 and so I've been looking into the COMPRESS function and I'm a bit puzzled. I assumed given two tables with one defined with a column that is "compressed" would have different numbers of logical I/Os for a given SELECT with the table that has the compressed column using less. That's not what I am finding.

We have identical tables (no indexes) defined as:


CREATE TABLE [dbo].[TradeDataPrimary](
[Id] [int] NOT NULL,
[Trade] [varbinary](max) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

and

CREATE TABLE [dbo].[TradeDataPrimaryComp](
[Id] [int] NOT NULL,
[Trade] [varbinary](max) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

TradeDataPrimary has 1,000,000 rows and TradeDataPrimaryComp also has 1,000,000 million rows populated as:

INSERT INTO [dbo].[TradeDataPrimaryComp]
           ([Id]
           ,[Trade])
SELECT [Id]
      ,COMPRESS([Trade])
  FROM [dbo].[TradeDataPrimary]
GO

The TradeDataPrimary table is 10,602 MB and TradeDataPrimaryComp is 2,120 MB - which is great.

The average/max LEN() on the Trade column is:

TradeDataPrimary 10058/16986

TradeDataPrimaryComp 1889/2772

So far so good. But if I SET STATISTICS IO ON and run a simple SELECT COUNT(*) FROM TABLE e.g. 

select count(*) from [dbo].[TradeDataPrimary] I get more logiacl IOs for the compressed table:

Table 'TradeDataPrimary'. Scan count 7, logical reads 33743, physical reads 0, read-ahead reads 33756, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

Table 'TradeDataPrimaryComp'. Scan count 7, logical reads 271297, physical reads 0, read-ahead reads 269888, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

Note I did a dbcc dropcleanbuffers before each test.

I'm sure I'm doing something stupid here but can't see what - can anyone spot the reason for the greater logical IOs please? Should I be worried?

Cheers




Ken E

SQL Server 2016 Dynamic Data Masking Partial Function BUG

$
0
0

Below are my results when trying to mask a string column by showing only the first 5 characters.

When the string contains 5 characters, and I am masking it usingFUNCTION='partial(5,"xxxx",0)',it does not show anything. I believe it should show 5 characters plus the xxxx.

Is this a bug or am I doing something wrong?

If it is not a bug, then how do I mask the string column such that it always shows the first 5 characters?

NOTE: it would be quite a usual item to mask a zip column to hide the last 4 digits only - i.e. to show only the first 5 characters of zip. 

Thank you for your help,

Janet nelson

CREATETABLE dbo.CustomerZip(

CustomerIDINTIDENTITYPRIMARYKEY,

Zip9 varchar(10),

Zip9Mask4 varchar(10)MASKEDWITH (FUNCTION='partial(4,"xxxx",0)')NULL,

Zip9Mask5 varchar(10)MASKEDWITH (FUNCTION='partial(5,"xxxx",0)')NULL

);

INSERTINTO dbo.CustomerZip(Zip9,Zip9Mask4,Zip9Mask5)

VALUES

('12345','12345','12345'),

('123456789','123456789','123456789'),

('023451234','023451234','023451234'),

('02345123','02345123','02345123'),

('0234512','0234512','0234512'),

('123451','123451','123451'),

('02345','02345','02345'),

('98765','98765','98765')

go

-- AnyUser does NOT have UNMASK privileges

GRANTSELECTON dbo.CustomerZipTO AnyUser;

GO

EXECUTEASUSER='AnyUser'

SELECT*FROM dbo.CustomerZip

GO

REVERT

GO

/*

CustomerID Zip9 Zip9Mask4 Zip9Mask5

1 12345 1234xxxxxxxx

2 123456789 1234xxxx 12345xxxx

3 023451234 0234xxxx 02345xxxx

4 02345123 0234xxxx 02345xxxx

5 0234512 0234xxxx 02345xxxx

6 123451 1234xxxx 12345xxxx

7 02345 0234xxxxxxxx

8 98765 9876xxxxxxxx

*/

SQL - Connecting 10 remote SQL Servers to a main Master SQL Database through Proficy Historian Enterprise

$
0
0

SCADA System, question is, Can you get all information developed from a SCADA server (Alarms and Events / Analog Values) to a master historian SQL Database?

I understand you can do a cluster.. But sounds undependable with failover script routines.

What is the Max number or SQL databases that can be interconnected, or all pointed to one Master?

Is this possible?

<input autocapitalize="off" autocomplete="off" autocorrect="off" id="extension-saferpass-input-field" spellcheck="false" style="box-sizing:border-box;height:55px;width:100%;text-align:center;text-indent:10px;padding-right:10px;outline:0px;border:0px;font-family:inherit;font-size:14px;" />

SQL database in status SUSPECT

$
0
0

I had a database in status SUSPECT (No items).  I have not Backup. I've only .mdf and .ldf files. After reading all answer regarding thi topic, I executed all commands to fix this status, but without success. I also executed the following comands for recovering my database : sp_detach_db 'Mydb'  (and the following message: "Successfully detached database 'Mydb'." )  then executed sp_attach_db @dbname = N'Mydb',    @filename1 = N'E:\MSSQL7\Data\Mydb_Data.MDF',   @filename2 = N'E:\MSSQL7\Data\Mydb_Log.LDF' and the following error message : ("Server: Msg 823, Level 24, State 1, Line 1 I/O error 38(Reached end of file.) detected during read of BUF pointer = 0x11c01980, page ptr = 0x1f6bc000, pageid = (0x1:0x7bea01), dbid = 7, status = 0x801, file = E:\MSSQL7\Data\Mydb_Data.MDF. Connection Broken " I executed command with the Service Manager stopped (I don't know if it's important) Please I'm desperate. What can I do to recover my db. I'm not expert in SQL Server and it would be appreciate if the answers were very clear

SQL Server agent program name show as Microsoft SQL Server Management Studio

$
0
0
When i ran select program_name from sys.sysprocess when my shceduled backup job run i could see that program name is shown as Microsoft SQL Server Management Studio   where it should be SQLAgent , what will be the reason for this?

Rename Linked Server and provide access to another user

$
0
0

Hi, 

I am trying to recreate a linked server on SQL server 2008 R2 but I am unable to create and them the error as follows; 

EXEC master.dbo.sp_addlinkedserver @server = N'TESTDBSERVER', @srvproduct=N'SQL Server'

EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'TESTDBAPPS',@useself=N'False',@locallogin=NULL,@rmtuser=N'tstusr',@rmtpassword='tstusr'

But I get an error 

Msg 15015, Level 16, State 1, Procedure sp_addlinkedsrvlogin, Line 49The server 'TESTDBAPPS' does not exist. Use sp_helpserver to show available servers.


When I try to create as 

EXEC master.dbo.sp_addlinkedserver @server = N'TESTDBSERVER', @srvproduct=N'sql_server', @provider=N'SQLNCLI', @datasrc=N'TESTDBAPPS

Then I am unable to add remote user, please can you advise what am I missing here?

Thanks! 


SQL Server 2012 syspolicy_purge_history fails step 3 "Erase Phantom System Health Records."

$
0
0

I recently installed SQL Server 2012 Ent (x64). The install is a stand alone default instance.

The syspolicy_purge_history job fails on step three with the following error:

Executed as user: <DomainName>\sql_xxx_agt_svc. A job step received an error at line 1 in a PowerShell script. The corresponding line is 'set-executionpolicy RemoteSigned -scope process -Force'. Correct the script and reschedule the job. The error information returned by PowerShell is: 'Security error.  '.  Process Exit Code -1.  The step failed.

Here is the code that is in the step:

if ('$(ESCAPE_SQUOTE(INST))' -eq 'MSSQLSERVER') {$a = '\DEFAULT'} ELSE {$a = ''};
(Get-Item SQLSERVER:\SQLPolicy\$(ESCAPE_NONE(SRVR))$a).EraseSystemHealthPhantomRecords()

The domain user is the account that SQL Agent is running as.

What permissions need to be granted to this account?



Here is the link to the Connect post:

https://connect.microsoft.com/SQLServer/feedback/details/754063/sql-server-2012-syspolicy-purge-history-job-step-3-fails-with-security-error

How to restore a .BAK from another domain

$
0
0

We are trying to restore a .BAK from another domain. There are no trusts created and we are told it will stay that way. We don't have enough room to copy the backup file to within the other domain. Is there another way to restore a database using a .BAK from another domain? 

Is there any possibility using storedprocedure.

Please help me.

Database in recovery pending state

$
0
0
I have 10 database in one of my 2 node clustered instance when i failover to a node i could see that the biggest database (850GB) in that instance is shown as recovery pending , but when i failback it is in online state what will be the possible issue in this

Table has been Renamed.

$
0
0

One of our table has been renamed in prod DB by someone.we are not sure when it was renamed and by whom/login.

Please let me know if there is any chance to find the login name.


Viewing all 12963 articles
Browse latest View live


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