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

SQL Server not using enough memory

$
0
0

Hi,

I have a machine running SQL Server 2008 R2 on Windows Server 2008 Enterprise R2 (64 bit).  The server has 30GB RAM, with SQL Server max memory set at 24GB and min memory at 0.  Whatever demands are placed on the server, total server memory does not rise further than 9GB, even though CPU and page life expectancy both appear to be suffering as a result. 

SQL Server is the only major process running on the server.  Neither task manager nor process explorer reveal any other major processes, but task manager shows 29.8 GB physical memory usage.

Is there anything further at the OS or SQL Server configuration level that I should do to prompt it to use more memory?

Any help greatly appreciated,

Ed.


EDIT:  Setting min server memory above 9GB has no effect.

Server going to Single User mode

$
0
0

Hi guys,

I am having a database which we refresh every night with same back up where it is used for testing purposes. we will refresh the database thorough job. every time it refreshes it goes to single user mode, I should manually go and change the process using following steps:

1) to execute sp_dboption

sp_dboption 'testdb01', 'single user', 'FALSE';
 go

2) to retrieve client session per database

select d.name, d.dbid, spid, login_time, nt_domain, nt_username, loginame
  from sysprocesses p inner join sysdatabases d on p.dbid = d.dbid
 where d.name = 'testdb01'
go

3) kill the particular session

kill 51
go

4)Now I can ‘remove’ the database from Sinlge user mode.

exec sp_dboption 'testdb01', 'single user', 'FALSE'
go

Is there any way to write a query  in which if the session goes to single user mode  kill that session and start the restore process again? can you guys  help in implementing that code.

thanks,

aravind.


Why activity monitor showing different wait statistics then DMV directly?

$
0
0

Hello,

Why activity monitor showing completly different wait statistics compared to statistics coming from DMV directly? I cleared statistics first with DBCC command then run for a minute or so and now if I look at statistics in Activity Monitor top wait is Logging and yet it's number 5 coming from DMV

Errorlog filling with changed language setting and changed database context messages

$
0
0

On one of my servers, the ERRORLOG is filling with messages for "Changed language setting to..." and "Changed database context..." for every single connection.  They are generated for any kind of connection--such as Management Studio. How did this get turned on?  How do I suppress the messages in the errorlog?  This is the only server that's having the problem.

Example at the bottom.

SQL is: SQL 2008 R2 SP2 

Trace flags set on this server are 3226, 1118, 1117

Date,Source,Severity,Message
01/24/2014 11:23:14,spid65,Unknown,Changed language setting to us_english.
01/24/2014 11:23:14,spid65,Unknown,Changed database context to 'master'.
01/24/2014 11:23:14,spid64,Unknown,Changed language setting to us_english.
01/24/2014 11:23:14,spid64,Unknown,Changed database context to 'master'.
01/24/2014 11:23:13,spid64,Unknown,Changed language setting to us_english.
01/24/2014 11:23:13,spid64,Unknown,Changed database context to 'master'.
01/24/2014 11:23:13,spid55,Unknown,Changed language setting to us_english.
01/24/2014 11:23:13,spid55,Unknown,Changed database context to 'master'.
01/24/2014 11:23:11,spid55,Unknown,Changed language setting to us_english.
01/24/2014 11:23:11,spid55,Unknown,Changed database context to 'master'.
01/24/2014 11:23:05,spid61,Unknown,DBCC execution completed. If DBCC printed error messages<c/> contact your system administrator.
01/24/2014 11:23:05,spid61,Unknown,The error log has been reinitialized. See the previous log for older entries.
01/24/2014 11:23:05,spid61,Unknown,Logging SQL Server messages in file 'F:\SysDB\Program Files\Microsoft SQL Server\MSSQL10_50.ETL\MSSQL\Log\ERRORLOG'.
01/24/2014 11:23:05,spid61,Unknown,Authentication mode is MIXED.
01/24/2014 11:23:05,spid61,Unknown,System Manufacturer: 'HP'<c/> System Model: 'ProLiant DL580 G5'.
01/24/2014 11:23:05,spid61,Unknown,Server process ID is 20096.
01/24/2014 11:23:05,spid61,Unknown,All rights reserved.
01/24/2014 11:23:05,spid61,Unknown,(c) Microsoft Corporation.
01/24/2014 11:23:05,spid61,Unknown,Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (X64) <nl/>Jun 28 2012 08:36:30 <nl/>Copyright (c) Microsoft Corporation<nl/>Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

Created a contained database but unable to connect

$
0
0

Using scripts provided here:

http://blogs.msdn.com/b/sqlsecurity/archive/2010/12/08/contained-database-authentication-in-depth.aspx

Created a contained database in SQL Server Management Studio and a user <domain\user>. and a password.

When trying to look at its properties got this messge,

 

After fixing the above, I could get the properties and the Select query for the View

sys.dm_db_uncontained_entities

When I try to connect using SQL Server Login;

Server: localhost  username & password that of contained database and the default database in login options changed to ContainedDatabase. The authentication is mixed mode.

How do I login?


Jayaram Krishnaswamy

The transaction log for database is full due to 'ACTIVE_TRANSACTION'

$
0
0

Hello team,

One of the my database was in Recovery Pending state and we are trying to restore that database again with latest full backup  but I am unable to do so I am getting below error.

The transaction log for database <db Name> is full due to 'ACTIVE_TRANSACTION'.

Now database is in Recovery pending state and when I try to restore it goes to 99% and and getting failed.

Even I tried to bring db online by

ALTER DATABASE MyDB SET ONLINE but no luck. I have also put my database in emergency mode

The log cannot be rebuilt because there were open transactions/users when the database was shutdown, no checkpoint occurred to the database, or the database was read-only. This error could occur if the transaction log file was manually deleted or lost due to a hardware or environment failure.

Msg 1813, Level 16, State 2, Line 1

My suspicion is that the max growth size was reached and it can’t grow to complete the active transaction. 


Rahul

Request for comment on this Deadlock.....

$
0
0

I have a question regarding this deadlock (names changed to protect the innocent) that I hope you can comment on. The facts as I see them:

Victim = process ending in  6d8

Victor = process ending in  ac8

Two processes, from different hosts, are trying to update the same 18-column table (“MyTable”). From the “owner-list” section it appears the victor has an Exclusive lock on the table’s PK yet is waiting for an Update lock too. It also appears that the victim owns an Exclusive lock on the same key and is also requesting an update lock.

Can two process both have an exclusive lock on the same item?

TIA,

edm2

P.S To make things crazier the PK is the only index defined on that table! Need to look into that.

deadlock-list
 deadlock victim=process72356d8
  process-list
   process id=processeb9ac8 taskpriority=0 logused=528 waitresource=KEY: 5:72057616125788160
  
     frame procname=MyDB.dbo.MyProc1 line=238 stmtstart=17208

UPDATE MyTable 
      SET MyField1 = 0
      WHERE MyField2 = @MyField2 
       AND MyField3 = @MyField3
       AND MyField4 = @MyField4
       AND MyField1 = 1
       AND MyField5 = @MyField5
       AND MyField6 < @MyField6    
    inputbuf
Proc [Database Id = 5 Object Id = 907006858]   
   process id=process72356d8 taskpriority=0 logused=236 waitresource=KEY: 5:72057616125788160
     executionStack
     frame procname=MyDB.dbo.MyProc2 line=95 stmtstart=6034
     ..
UPDATE MyTable 
   SET MyField7 = @MyField7 ,
    MyField8 = @MyField8
   WHERE 
    MyField2   = @MyField2 
    AND MyField8  = @MyField8
    AND MyField10   = @MyField10 
    AND MyField3 = @MyField3 
    AND MyField4 = @MyField4 
    AND MyField11  = @MyField11 
    AND MyField1   = 1    
    AND MyField5   = @MyField5
 ...
   
   resource-list
   keylock hobtid=72057616125788160 dbid=5 objectname=MyDB.dbo.MyTable indexname=PK_myIndex id=lock8014a180 mode=X associatedObjectId=72057616125788160
    owner-list
     owner id=processeb9ac8 mode=X
    waiter-list
     waiter id=process72356d8 mode=U requestType=wait
   keylock hobtid=72057616125788160 dbid=5 objectname=MyDB.dbo.MyTable indexname=PK_myIndex id=lock268753280 mode=X associatedObjectId=72057616125788160
    owner-list
     owner id=process72356d8 mode=X
    waiter-list
     waiter id=processeb9ac8 mode=U requestType=wait

rebuild/reorganize index failed and i post log. Any idea? thanks

$
0
0

One job is to rebuild/reorganize index weekly. This job runs fine before and it fails this morning.

Here is error log:

Msg 8115, Sev 16, State 2, Line 213 : Arithmetic overflow error converting expression to data type int. [SQLSTATE 22003]
Msg 3621, Sev 16, State 1, Line 213 : The statement has been terminated. [SQLSTATE 01000]

What could happen and how to fix it?


What have to be be run after upgrade from SQL 2008 to SQL 2012

$
0
0

I'm upgrading with an in-place strategy from SQL 2008 to SQL 2012, Data size is over 6 TB.

I'm planning to run after the upgrade DBCC CHECKDB with physical_only and update statistics with sample 4 percentage.

Is it enough? Do I take a risk if I don't run a complete DBCC CHECKDB and Update statistics?

Do I have to run also DBCC UPDATEUSAGE?

I'm planning to run the complete set (DBCC CHECKDB with no restrictions, Update statistics with no sample and updateusage ) a week after the upgrade.

Should it be run before or after the change of the compatibility level?

A day before the upgrade, run DBCC with NOINDEX on all DBs

Upgrade partner A

Run DBCC with Physical_only

Failover to partner B

Run DBCC Checkdb with physical_only

Resume Mirror.

2 days of regular work

Weekend - Run full DBCC checkDB

Sql server upgrade from 2005 to 2008 R2 server

$
0
0

Hi Team,

Can please give me the steps for Sql server upgrade from 2005 to 2008 R2 server ,

How we can run sql server upgrade advisor 2008 R2. 

Become our FIRST Microsoft TechNet SS DBE Guru of 2014!!

$
0
0

Happy New Year!

Time for a fresh start!

We're looking for the first Gurus of 2014!!

This is your chance to make your mark on the Microsoft developer community.

All you have to do is add an article to TechNet Wiki from your own specialist field. Something that fits into one of the categories listed on the submissions page. Copy in your own blog posts, a forum solution, a white paper, or just something you had to solve for your own day's work today.

Drop us some nifty knowledge, or superb snippets, and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!

This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!

HOW TO WIN

1) Please copy over your Microsoft technical solutions and revelations toTechNet Wiki.

2) Add a link to it on THIS WIKI COMPETITION PAGE (so we know you've contributed)

3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.

If you win, we will sing your praises in blogs and forums, similar to the weekly contributor awards. Once "on our radar" and making your mark, you will probably be interviewed for your greatness, and maybe eventually even invited into other inner TechNet/MSDN circles!

Winning this award in your favoured technology will help us learn the active members in each community.

Feel free to ask any questions below.

More about TechNet Guru Awards

Thanks in advance!
Pete Laker


#PEJL

Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over to the one and onlyTechNet Wiki, for future generations to benefit from! You'll never get archived again!

If you are a member of any user groups, please make sure you list them in the Microsoft User Groups Portal. Microsoft are trying to help promote your groups, and collating them here is the first step.


Open source database with data

$
0
0
I'm looking for a website or similiar that offer open source database containing data. Similiar database as Microsoft's adventure work.

Does somebody know about it?

Error No 26

$
0
0
TITLE: Connect to Server
------------------------------

Cannot connect to MUHAMMAD-YASIR\SQLEXPRESS.

------------------------------
ADDITIONAL INFORMATION:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------

Retrieve the Data

$
0
0

Goal:
Retrieve the data from a database.

Problem:
I cannot open a .mdf file and .ldf file in my Sql server because the file use SQL server 2000 and I use SQL server 2012.

The second problem: I do not have permission to open the file and review the data.

What should I do?

Information:
The important point is to retrieve the data for instance in a notepad etc  and it is not important what brand of tool to use in order to retrieve the data.

What will cause no lock escalation to table lock in deleting more than 300,000 rows in a table in SQL Server 2008 R2?

$
0
0

I deleted 300,000 rows in a table in SQL Server 2008 R2.   I checked the locks information by querying sys.dm_tran_locks when the delete statement was running.

delete top (300000)  from log where logdatetime < getdate(); -- there is a non-unique, non-clustered index for column logdatetime

I expected to see object/table exclusive lock but only found page and extent exclusive locks.  I have checked that the lock escalation of the table log is still set to default (table).   What are the possible reasons for no lock escalation to table lock?


Performance monitoring - capture query time with STATISTICS?

$
0
0

I realize I could use perfmon to monitor all kinds of stuff, but was thinking one simple way would be to start capturing how long a query took.  

Is there a way to select the client statistics or the length of time a query took to execute?

DBCC SHRINKFILE: Page 4:11283400 could not be moved because it is a work table page.

$
0
0

 

Hi,

 

I issued this command on Tempdb but it doesnot shrink the file.

 

dbcc shrinkfile (tempdev_3,1)

go

 

Messages:

-----------------------------------------------------------------------------------------------------------

DBCC SHRINKFILE: Page 4:11283400 could not be moved because it is a work table page.

-----------------------------------------------------------------------------------------------------------------------------------------------

 

I have  checked that there are no tables associated with any user in tempdb. Any help is appreciated.

 

Regards,

Razi

Unable to take a backup after repairing suspect database...

$
0
0

Hi All

I have recovered a database from suspect mode by the following steps.

1. EXEC sp_resetstatus '<Database Name>';

2. ALTER DATABASE <Database Name> SET EMERGENCY;

3. DBCC CHECKDB('<Database Name>');

4.  ALTER DATABASE <Database Name> SET SINGLE_USER WITH ROLLBACK IMMEDIATE;

5. DBCC CHECKDB ('<Database Name>', REPAIR_ALLOW_DATA_LOSS);
6. ALTER DATABASE <Database Name> SET MULTI_USER;

Now i am able to see tables expect the stored procedures. When am trying to take a backup throwing me an error as" A nonrecoverable I/O error occurred on file "E:\MyDB\MyDB.mdf:" 1(Incorrect function.)."

Can anyone help me on this please... I need the solution ASAP...


Navakanth

Memory dump in log file

$
0
0

Hi,

Today we had the exact scenario reported here http://support.microsoft.com/kb/974205
The
server went unresponsive and the sql service had to be restarted. This sql server is the DB server for a sharepoint farm.

We are running Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (X64)   Apr 22 2011 19:23:43   Copyright (c) Microsoft Corporation  Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)

The fix offered at Microsoft seems to pre-date R2
Any ideas what causes this and how to fix?

Msg 22832, Level 16, State 1, Procedure sp_cdc_enable_table_internal, Line 607

$
0
0

I am trying to enable cdc on one of my tables, and I get the following error and nothing I have found seems to work,

Msg 22832, Level 16, State 1, Procedure sp_cdc_enable_table_internal, Line 607
Could not update the metadata that indicates table [dbo].[Client_Types] is enabled for Change Data Capture. The failure occurred when executing the command 'insert into [cdc].[change_tables]'. The error returned was 515: 'Cannot insert the value NULL into column 'has_drop_pending', table 'BillingDb.cdc.change_tables'; column does not allow nulls. INSERT fails.'. Use the action and error to determine the cause of the failure and resubmit the request.

I am running SQL 2008 SP3 with .Net 4.5, and here is the cmmands I am running.

EXECUTE sys.sp_cdc_enable_table @source_sehema = N'dbo', @source_name = N'Client_type', @role = NULL

Any ideas?

Viewing all 15264 articles
Browse latest View live


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