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

DBMIRROR_EVENTS_QUEUE wait Type but mirroring is not configured

$
0
0

Hello,

While checking the databases in Activity monitor, i wonder that a database is not configured for mirroring but still its showing DBMIRROR_EVENTS_QUEUE in wait_type.

I also Use DMV sys.dm_os_wait_stats, for Checking wait percentage, There more than 30% DBMIRROR_EVENTS_QUEUE is there and not even for single database mirroring is configure


how to transfer the logins from one instance to another instance in sql2008r2

$
0
0

how to transfer the logins from one instance to another instance in sql2008r2

Ring Buffers and IndicatorsSystem = 3 meaning?

$
0
0

Im trying to add a step to a admin script that checks various sever and database-level metrics, including any evidence of low memory.  Using the ring buffers I see some results that include values for Process and some for System.

The article I was just reading as well as others never mention a meaning for a System value of 3

http://blogs.msdn.com/b/psssql/archive/2009/09/17/how-it-works-what-are-the-ring-buffer-resource-monitor-telling-me.aspx

I have seen mention for values of 1 , 2 and 4, but not 3

Anyone know what a value of 3 would indicate?

IDX_MEMPHYSICAL_HIGH = 1
IDX_MEMPHYSICAL_LOW = 2
IDX_MEMVIRTUALL_LOW = 4

On some of the results against one of my instances, Im getting a value of 3, others are either 2 or 0

How to increase the server machine performance

$
0
0

Hi,

i have server machine it is very slow in whenever open the sql server in user machine at that time server also very slow for open the sql server.

Server Details

OS - Windows server 2008R2

SQL server version - Sql server 2008R2

Type - 64 bit

RAM - 24 GB

Processor - I3

users - 90 users access the server database 

How to increase the server performance whenever open the sql server at that time.

Regards,

Abdul

Error: Process generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION

$
0
0

Hi all,

I got the error "Process <spid> generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is
terminating this process." on SQL Server 2014 Standard and I found below link which fix for 2012 and backward. I could not see any hot fix for Sql server 2014. Do someone know there is any fix for this in Sql server 2014?

https://support.microsoft.com/en-us/kb/972936?wa=wsignin1.0

--error details---------------------------------  

This file is generated by Microsoft SQL Server version 12.0.2000.8
...                                                                                                       
Computer type is Intel(R) Xeon(R) CPU E5-......                                                                
                                     
Memory                               
MemoryLoad = 86%                     
Total Physical = 62499 MB            
Available Physical = 8554 MB         
Total Page File = 74659 MB           
Available Page File = 19814 MB       
Total Virtual = 134217727 MB         
Available Virtual = 134079599 MB     
***Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\LOG\SQLDump0004.txt  
SqlDumpExceptionHandler: Process 58 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is
terminating this process.                                                                                       
* *************************

.......................................

Many Thanks,

Renaming Sql Server 2008 r2 enterprise edition security roles

$
0
0

Hello All,

We got a requirement to rename existing  SQL SERVER 2008 R2 ENTERPRISE EDITION security roles.

We are unaware of the impact on the existing users with these roles.

Can anybody advise us if we rename the role name manually,

We have to restart the sql server services to reflect the role name change to the users with these roles?

Thanks In Advance 


SQL connection error ( probably ) due to Internal battery changed?

$
0
0

Hi

We have an application written in C# 2005 that use an Sql Server 2005 database with Windows authentication mode

Our customer with Windows XP sp3 used our software for a long time without any problem but he needs to change the PC internal battery and after this operation the application is not able to connect with database. I tried to uninstall all SQL server componets and instance, and reinstall them again but it doesn't work. I think is something related to the clock time of last access to database that is in some ways influencing the connection.

What can we do?

Regards


SQLSERVER 2012 LOG SIZE INCREASE EXTENSIVELY

$
0
0

Hi Friends,

I want to inquire, as our sqlserver 2012 in full  recovery mode , I notices whenever we are executing rebuild indexes maintenancejob the logfile grown up extensively every time.  h

thank you.

regards,


asad


sp_dropserver Hyper V Image

$
0
0

Hello. Since I do not post unless I have something useful to say, I was wondering if I missed a thread for how to image SQL Server 2012 with Hyper V. I am a sysadmin looking to setup an image of SQL server, use the sp_dropserver procedure to help.

Scenario specifics:

1 server

1 SQL Server, default instance

Any ideas or suggestions would be greatly appreciated and voted upon ;)

EF6 Code First w/Migrations: Creating localdb Database In User-Defined Location...and User Login Failures

$
0
0

I am running into what I think are two related problems.

I want to create a localdb database for an ASP.NET project in a user-defined location. I do not want the database files put under C:\Users\Mark (for one thing, it's an SSD; for another, I'd never think to look there).

This turns out to be unbelievably, amazingly difficult to do. Which it shouldn't be. Note to MS: it's my computer, >>I<< decide where the files I create go, not you.

I can create databases using migrations and update-database. But they always show up under C:\Users\Mark. If I try to move them where I want them, and specify a full path location in the connection string, I get a "login failed for user Mark". Which is a ridiculously, amazingly unhelpful error message, and the cause of truly astounding amounts of frustration among developers (note to MS: please, someday, make it a priority to include useful error messages in your products).

One other thing: in the course of experimenting, I deleted the database files from an earlier test. That now seems to be keeping me from creating a new database with the same name, even under C:\Users\Mark. I get the same "login failed" message. But if I change the name of the connection string in appconfig to something new (e.g., Council2015 -> Council2015xyz), a database will be created under C:\Users\Mark when I run update-database. It's as if something somewhere is remembering the old databases and refusing to let me use the names over again. How do I clear that out?

It also seems like the >>name<< of the connection string is what's used to name the database, regardless of the connection string also specifying Initial Catalog or AttachDBFile. That doesn't appear to be documented anywhere, but then again, half the stuff MS releases these days isn't documented. So now that I think about it I wouldn't mind a link to a good discussion of just what goes into an EF6 code first connection string and how the parameters get used.

Here's the connection string I'm using in appconfig:

        <add name="Council2015" connectionString="Data Source=(LocalDb)\\v11.0;Integrated Security=True;AttachDbFilename=E:\\Programming\\Council2015\\Council2015\\App_Data\\Council2015.mdf;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient"/>

- Mark

Waiting resources

$
0
0

Hi ~ I am looking in to a blocking case.

LCK_M_IX             TAB: 7:693     INSERT  is blocked by

PAGELATCH_EX         7:1:487304    UPDATE

but I find in the database I can't find object ID which has 693.....

Windows Server 2003 March,15 patches causing SQL issue

$
0
0


After the recent patching activity, we are unable to restart the MS SQL services and get 'Error 1053: The service did not respond to the start or control request in a timely fashion.' Rebooting the server did not help. Could it be caused by these patches? Has anyone else also faced the same issue? If yes, kindly let me know the fix.

Thanks in advance.

Full Text crawl task permanently writes huge amount of data to disk - slowing down PC

$
0
0

Hi, all!

I asked that question already in Sql Express forum.

SQL server full text crawler on my machine permanently reads/writes a lot of data without visible reason. There are no modifications to databases made at the time. And this doesn't stop for several days already.

Recently i've noticed that my PC became very unresponsible. When I looked in resource monitor's Disk Activity tab i've found that Disk Queue Length column has value of 3 to 6, wich I think is a reason why computer became slow.

Here is to snapshots for values

Logical Disk Physical Disk  Active Time (%)    Available Space (MB) Total Space (MB)  Disk Queue Length
C: D:          0                   81.48                   137 450                    476 838              2.82
....
C: D:          0                   100.00                 137 450                    476 838               6.00

The process used disk so much was sqlserver.exe. Here is numbers for disk Read/Write activity for it:

Image          PID      Read (B/sec)   Write (B/sec)  Total (B/sec)
sqlservr.exe 1568    1 627 930        2 172 101      3 800 031

I'm using Sql Server only for development and not very often at all. There are 20 small databases in the instance. Most of them has size 25 MB, some 50 MB and a few 100 MB.

I tried to find out what sql server is doing and looked in

select * from sys.dm_exec_requests order by reads+writes desc

first 35 rows of result are FT CRAWL command running in background for more than 24 hours.

Now I wonder what SQL Server can be doing? With 1 MB per second read rate it can easy read all its databases in a couple of hours not to mention writing 3MB data per second.

Any ideas where I should look to find out what is the reason for that?

Thanks.

search for 2 different words.

$
0
0

i have small requirement.
In our project we using the search term(for Example based on the word or term, we have give on search tad accordingly i have to search the result)

now my requirement got changed, i have to search based on the two terms
EX: john, barn............. here i have to search for "john"+"barn"
    ganesh,batta.............here i have to search for "ganesh"+"batta"
like this i have to search,

I am using full text search for searching in terms.. 

how can i implement this..

EX:

DECLARE @term nvarchar(1000) = 'raj,sundar' ,
 @personid INT = 0

 declare @one nvarchar(100)
 declare @two nvarchar(100)

Result is like below..

 print @one =-------> raj
 print @two --------> sundar

sp_send_dbmail doesn't work in SQL 2014 when specifying @query_no_truncate

$
0
0

I'm having problems sending email from SQL 2014 12.0.2480 (CU6). I found some other people with the same issue and understand it should have been fixed in CU4 but from what I'm seeing the problem is still there :-(.

EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'Profile',
@recipients = 'a@a.com',
@subject = 'Memory Values',
@query = N'set nocount on; SELECT top 10 creation_time, last_execution_time, execution_count, total_rows
FROM sys.dm_exec_query_stats
for xml auto',
@attach_query_result_as_file = 1,
@query_attachment_filename = 'Stats.xml',
@query_result_header = 0,
@exclude_query_output = 1,
@query_result_width = 32767,
@query_no_truncate = 1

When @query_no_truncate = 1 no email is sent and otherwise it will cut the result at 834 bytes


SQL 2008 r2 Upgrade Advisor, interpret results

$
0
0

We are updating an old production database server to a more current structure. Old is Server 2003 (x86) running SQL 2000 product version 8.00.760. The plan is to update the database to SQL 2008r2 then on to SQL 2012.

Downloaded and installed the SQL Server 2008r2 upgrade advisor on a workstation(Win7 pro 64) with SQL Server 2008r2 sp2 installed. Took a backup of the 2000 database and moved the .bak file to the workstation and restored the bak file, leaving it in the original compatibility mode, DBCC returned no errors.

Ran the Upgrade Advisor against the old server and receive a list of 19 method errors.. all PreUpgrade labeled. (I didn't install UA on the old server as it's still running production jobs and is Seriously under powered.)

Message"Method not found: 'System.Collections.Generic.IEnumerable`1<Microsoft.SqlServer.Management.SqlParser.Parser.Error> Microsoft.SqlServer.Management.SqlParser.SqlCodeDom.SqlCodeObject.get_Errors()'." the methods are:

DROPSYSOBJ
OLDSYSTEMTABLES
FTCATALOGNAMERESTRICTION
ORDERBYORDINALS
VIEWFORBROWSE
FTPROPS
DUMPLOAD
SPHELPTRIGGERNEWCOL
MERGE
FTCATPROPITEMCOUNT
SYSPERFINFO
INVALIDCHAR
NONANSIOUTER
XPAGENTPROXY
SPCONFIGURE
HOSTIDRETURN
DEPRECATEDSP
OLDDBCC
ORDERBYALIAS
DBCCCONCURRENCYVIOLATION
INFOSCHEMATA
TRACEFLAGS
BACKUPRESTORETRANSACTION
DBCOMPTLEVEL
BACKUPLOG
LARGECONSTTYPE
VIEWCHECKOPT
SYSLOCKINFO

FORXMLAUTO

Still haven't found a way to address these, not sure they have to be (??). Came across some posts that seemed to indicate these are generated by running Upgrade Advisor remotely against older targets.

Just for fun ran the upgrade advisor against the backup that was restored onto theWin7 box and received one error which is DEPRECIATEDSP method. I updated the compatability level to 100 ran Upgrade Advisor again with same results, the subsequent DBCC CheckDB would indicate no errors. From what I have been able to find in the forums, it looks like all is well for this part of it (maybe). Are these issues/errors really no longer of concern or are they just ignored(?) masked by the new version of SQL and still in play? ( I don't know if that makes sense it's the best way I can word it at this time)?   


Update SQL Server 2008 R2 CLUSTER To SP1 With TFS 2010

$
0
0

Hi,

I have Cluster SQL Server 2008 R2 configured to store  Team Foundation Server 2010 DBs

I want to Update this Cluster to SP1 to support Sharepoint DBs 

So i want to see if this update can impact my TFS DBs 

Thnx


vote if you think useful

xp_smtp_sendmail file size is larger than allowed max sizer of 65536 bytes

$
0
0

Hi,

We have a daily routine which generates a text file and runs xp_smtp_sendmail with the @messagefile argument to use the text file in the body of the email.

It has always worked fine but recently we have been receiving the following error when trying to run it:

  Error: @messagefile "Drive\Filename.txt" file size is larger then allowed max size of 65536 byte

Funnily enough the file in question is 66,220 bytes so only just big enough to exceed this limit. The file in question is created from scratch on a daily basis so maybe this limit has always been in place and we are now exceeding it. My question is can we increase this limit somewhere and if so where? The SQL Statement I'm running is:

EXEC master.dbo.xp_smtp_sendmail
@To = 'recipients@domain.com',
@From =  'sender@domain.com',
@messagefile = 'Filepath\Filename.txt',
@subject='Test please ignore',
@server='smtp.servername.domain'

Thanks in advance for any suggestions anyone has!


Need guidance to prevent database corruption

$
0
0
I have developed a software using C# (.Net 4.0) and SQLExpress 2008 Edition. The problem I am facing is that the database is corrupted too frequently. I need guidance why the database is corrupted and How it can be prevented from corruption. There are three scenarios of corruption:
  • Case 1: Database is corrupted with following error or similar: Error: 9003, Severity: 20, State: 9. The log scan number (180:371:2) passed to log scan in database 'MyDatabase' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup. This type of corruption can be repaired and data is recovered. In most case, the similar corruption occurred.
  • Case 2: One of the system database like master or tempdb is corrupted with error similar to above error. In this case the sql service is stopped. I need to replace the files of system databases. Sometime the sql service is started and sometimes it do not. Then I have to re-install the SQLExpress server. This problem is rarely occured.
  • Case 3: Database is corrupted with following error: Error: 824, Severity: 24, State: 2. SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0xb956dcc; actual: 0xb956d68). It occurred during a read of page (1:337) in database ID 5 at offset 0x000000002a2000 in file '[MDF File Path]'.  Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe 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. DBCC CHECKDB ([MyDatabase]) WITH all_errormsgs, no_infomsgs executed by d-PC\d terminated abnormally due to error state 5. Elapsed time: 0 hours 0 minutes 1 seconds. Setting database option AUTO_CLOSE to OFF for database MyDatabase. This type of corruption can not be repaired and data is not recovered. This type of corruption is most rare.
I need guidance why these situations arise and how can these situations be prevented so that I can add preventive measures in software.

How to extract a tagged string using XML in sql server 2014?

$
0
0
A column stores the string data with tag as below.I have to retrieve the value of ATRB_C1 as val1234 through xml

Query:
CREATE TABLE #test (col varchar(500))
INSERT INTO #test VALUES('< ATRB_C value ="val1" />< ATRB_C1 value ="val234" />')
SELECT * FROM  #test FOR XML RAW

Output:
<row col="&lt; ATRB_C value =&quot;val1&quot; /&gt;&lt; ATRB_C1 value =&quot;val234&quot; /&gt;" />

Since the format is incorrect, not able to extract using xml.value

Any help would be appreciated!!
Viewing all 15889 articles
Browse latest View live


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