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

Sys.dm_os_sys_info bpool_commited bpool_visible

$
0
0

BOL states:

bpool_commited The total number of buffers with pages that have associated memory. This does not include virtual memory. --Here no doubt, Sql server Physical memory consumption

bpool_visible The number of 8-KB buffers in the buffer pool that are directly accessible
in the process virtual address space. When not using AWE, when the buffer pool has
obtained its memory target (bpool_committed = bpool_commit_target), the value of
bpool_visible equals the value of bpool_committed.

When using AWE on a 32-bit version of SQL Server, bpool_visible represents the size of the AWE mapping window used to
access physical memory allocated by the buffer pool. The size of this mapping window is bound by the process address space and, therefore, the visible amount will be smaller than the committed amount and can be reduced further by internal components consuming memory for purposes other than database pages. If the value of bpool_visible is too low, you might receive out-of-memory errors.

--What Does this meant?


Manish


Checkpoint on Readonly db

$
0
0

1) Are there checkpoints issued on Readonly database as there's no modification done?

2) Internal Sql 2008 book

....." most writing to disk doesn’t actually happen during checkpoint operations. Checkpoints are just a way to guarantee that all dirty pagesnot written by othermechanisms are still written to the disk in a timely manner."

Here i think LAZY Writer she's referring in memory pressure case to, but is there any other process also which writes to Disk other than CHECKPOINT, LZYwrtr process?


Manish



SQL 2012 SP1 system_health security_error_ring_buffer_recorded Events

$
0
0

Hello,

I recenlty upgraded My SQL 2005 server to SQL 2012 SP1. The system_health in Extended Events is now continuously reporting the event listed below.

After upgrading to SQL 2012 SP1 I installed a second instance on the same server.  This instance does not report the same event.

Any help would be welcome.

name: security_error_ring_buffer_recorded  

timestamp:2012-12-20 15:37:22.0779695

id: 968697679

session_id: 84

error_code: 5023

api_name:ImpersonateSecurityContext

calling_api_name:NLShimImpersonate

call_stack: 0x0657506CF815306CDF88C26B4BC1956BE1C6956B9CCF956BEE39966BC8D4C26B4D05966B4EE60F6D7AEA0F6DABE80F6D41090E6D3E080E6D48060E6DA70B0E6D

SQL 2012 database stuck in Recovery Pending status

$
0
0

Hey all.  Thanks in advance to anybody that can please help me.  I have a SQL cluster which ran out of disk the other day.  I threw plenty more disk at the SAN.  However, 1 of the databases came back with Recovery Pending and has been over 24 hours.  I have tried to backup the database with no success.  I don't have a clean backup from the day it occured so would have a good amount of work missing.

Running a dbcc check returns the following:

Msg 945, Level 14, State 2, Line 1
Database 'sqldb' cannot be opened due to inaccessible files or insufficient memory or disk space.  See the SQL Server errorlog for details.

I have not tried a dbcc check with REPAIR_ALLOW_DATA_LOSS as there seems to be a high risk of losing whatever was going on.  Does anybody have an idea of how I can get the db back online?

How The Query display the resul

$
0
0

HI ALL,

How the query give the result.

select * from Branch

Table data is

DENABANK1 1900-01-01 00:00:00.000
ANDHRABANK2 1900-01-01 00:00:00.000
ICICIBANK       3        1900-01-01 00:00:00.00

--1--

declare @n varchar(20)
set @n='denabank'
select * 
from Branch 
where (Name=@n or @n='ALL')

O/p is

DENABANK1 1900-01-01 00:00:00.000

--2--

declare @n varchar(20)
set @n='all'
select * 
from Branch 
where (Name=@n or @n='ALL')

o/p

DENABANK1 1900-01-01 00:00:00.000
ANDHRABANK2 1900-01-01 00:00:00.000
ICICIBANK3 1900-01-01 00:00:00.000

How it show all the records.

Please help me.

Regards,

S.Krishna.

Blob data pages have a lot of unused space.

$
0
0

I have a table with blob data that has a truckload of unused space that I can't get rid of.  

SELECT * FROM sys.dm_db_index_physical_stats

    (DB_ID(N'Test_dbname'), OBJECT_ID(N'tableName'), NULL, NULL , 'DETAILED');
GO

Shows:

  

alloc_unit_type_descavg_page_space_used_in_percentrecord_countghost_record_count
IN_ROW_DATA  99.0901902643934125490720
IN_ROW_DATA  99.81305905609092272150
IN_ROW_DATA  50.17296763034354780
IN_ROW_DATA  0.39535458364220420
LOB_DATA63.1606004447739629731630

Thus I'm wasting huge amounts of space.  If I select all the data into another table it compacts at 100% give or take.  

SQL 2008, spk1.  I don't believe the table ever held text data.   Varbinary and Image are in the table.  

how to get OS available memory & total memory in sql server 2005 & 2000

$
0
0

how to get OS available memory & total memory in sql server 2005 & 2000.

sys.dm_os_sys_memory is only working for sql server 2008.

Running DTS package through job in SQL Server 2008

$
0
0

Hi,

I have imported DTS packages from SQL Server 2000 to 2008. Under Management-Legacy they show there. I already changed connection strings before importing. I want to run these dts packages through job or command line. Please help.

Thanks


SELECT statement leaving open transaction causes blocking

$
0
0

Hi all,

I'll be interested to see if I get any responses on this at all, but here goes.

I have a user that runs a very simple statement from SSMS:

select  ContactID, AddressID, * from dbo.Contact where ContactID in (1152257893,1239910365)
select * from dbo.[Address]where ADDRESSID in (114371741, 114371741)
select * from dbo.HistoryDetail where Contact_ID in ('1152257893','1239910365')

They run it every day and most 95% of the time everything is fine.  Once every couple of weeks though, i start to see blocking of other users caused, apparently, by this particular session (according to Idera SQLdm).  Idera claims there is still an open transaction, although when I run dbcc opentran it returns no open transactions.  We do see some timeout errors from our front-end application as a result of the blocking, so it's not just idera getting things wrong, there really is some kind of blocking occurring. 

This ONLY happens for this one user - they are the only one that cause this. When it happens they can tell because that code takes a long time to execute.

I'm really quite perplexed because there are no begin tran... commits in the statement, and they are select statements so unless i'm mistaken they shouldn't be taking any kind of non-shared lock anyway, so why would they cause blocking.

Does anybody have any suggestions?

Thanks,

Reinis

Inserts taking longer time

$
0
0

Hello,

I am noticing that the inserts are slow on our production. I started a sql profiler trace to see which inserts are taking longer time to complete. A bunch of inserts appear to complete around 700 milliseconds and other than those all look well. At this point of time I am assuming it may not be the length of inserts but the quantity of inserts that are actually slowing things down. Is there a way that I can group by the profiler results based on duration? These are the columns that I captured from trace:

Duration
ObjectName
TextData
CPU
Reads
Writes
IntegerData
DatabaseName
ApplicationName
StartTime
EndTime
SPID
LoginName
EventSequence
BinaryData

Thanks


Display Synonym names

$
0
0

Hi,

In SSMS, query analyzer, when I write select * from .... it does not display tables/synonym. I think it should display table/synonym name when I start writing select * from then it should show table or synonym where I have access in that database? Is there any setting on server or database level? It pop ups database names but not tables/synonym. (Windows 2008 R2, SQL Server 2008 R2)

Thanks

SQL 2005 Jobs randomly fail with authentication error?

$
0
0

I dump the tran logs every hour and  am getting random failures of the job to authenticate? Owner is sa, so how can it fail? No system or application event errors related to this. We have already recreated the job, didn't help. It is a maint plan for transaction dumps with all DB's selected. We have also recreated the maint plan.

"The job failed.  Unable to determine if the owner (sa) of job DB Maintenance.Hourly backup of Transaction Logs has server access."

SQL Server Agent Schedule Job to run every 3 months

$
0
0

I am trying to create a schedule for a job to run on the 8th day every 3 months.  However, when i look at the Job Activity Monitor, the "next run" column shows the job as running the 8th day of the following month.

For example the job is to run on 1/8/2013.  If the job is schedule properly, the next time the job should run is on 4/8/2013.  But in the job activity monitor it is showing up to run the job on 2/8/2013.

If I I change the schedule from "Day" to "The" in the Frequency section, then the schedule seems to work but I can't run it in on the 8th day of the month

How can i get the job schedule to run on the 8th day of the month and run every 3 months?

2K8R2: Merge statement bug? A severe error occurred on the current command. The results, if any, should be discarded.

$
0
0

version is:

Microsoft SQL Server 2008 R2 (SP1) - 10.50.2811.0 (X64)   Apr  6 2012 01:59:29   Copyright (c) Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)

I'm just playing around with the merge statement to see if i can get it to work on a CTE that includes computed fields/constants/groupings and aggregates. And yes it does! BUT it craps itself if you try to look at the output clause

Has anybody come across this or have a way around it? anyone on later versions of 2k8r2 or 2012 that can give it a test?

create table #src (id int, val decimal(18,9))
go
create table #dest (id int, val decimal(18,9))
go
-- ignore complexity, i was trying to test something else when i noticed this issue... this is just generating 10 rows with a random decimal value
insert into #src
SELECT top 10 
ROW_NUMBER() over (order by getdate())
,right(reverse(stuff(reverse(abs(cast(CAST(NEWID() AS varbinary) as bigint))),10,1,'.')),13)
FROM sysobjects
-- merge here
-- first cte that generates the aggregate
;with cte as (select id, SUM(val) val from #dest group by id)
-- 2nd cte that we use as the target
,cte2 as (select x.*, cte.val AS summedval from #dest x inner join cte on x.id = cte.id)
MERGE cte2 AS Target
USING #src as Source
ON (Target.id = Source.id)
WHEN NOT MATCHED BY TARGET THEN
INSERT (id, val)
values (Source.id, Source.Val)
WHEN MATCHED AND Target.summedVal <> source.val THEN
update SET val = 1
OUTPUT
INSERTED.id,inserted.val;

Works fine without the output clause. Add the output clause and get booted/disconnected with the following message:

Msg 0, Level 11, State 0, Line 0

A severe error occurred on the current command. The results, if any, should be discarded.

Msg 0, Level 20, State 0, Line 0

A severe error occurred on the current command. The results, if any, should be discarded.

SQL Server Maintenance Plan on a Network Drive

$
0
0

Hi,

I am using SQL Server 2008 R2 and trying to do Maintenance Plan for database backup on a network drive.

The network drive is based on CIFS that required us to login with username and password. I am getting two error messages from the history :

Executing the query "BACKUP DATABASE [dsta] TO  DISK = N'Y:\\sql\\dsta\\ds..." failed with the following error: "Cannot open backup device 'Y:\\sql\\dsta\\dsta_backup_2013_01_15_103341_4941165.bak'. Operating system error 3(The system cannot find the path specified.).
BACKUP DATABASE is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Executing the query "EXECUTE master.dbo.xp_create_subdir N'Y:\\sql\\dsta'..." failed with the following error: "xp_create_subdir() returned error 3, 'The system cannot find the path specified.'". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

I believe this must be a permission problem or network drive issue because I have tested that the backup is working on my local drive. I even set the folder permission for "Everyone" and give full access. However I am still getting the error.

And also i have used UNC for the folder path "\\192.168.1.66\XDataStore_Data_Office_Bk_Office\sql". In my configuration manager, I can check that my SQL Server service account is log on asLocalSystem.

Please advise on how to solve the problem.

Thanks,

Rudy


script level upgrade for database 'master' failed because upgrade step 'sqlagent100_msdb_upgrade.sql' encountered error 3906

$
0
0

Greetings.

I recieved this error when attempting to restart SQL Server 2008R2 after installing SP2. The install claimed it was successful upon completion, but then wouldn't restart.

There are many posts similar to this one, but very few having this precise error number of 3906, and those don't really explain what the solution is (at least that I've found).

I queried the messages view:

Select * from sys.messages where message_id = 3906

And the message is:

"Failed to update database "%.*ls" because the database is read-only."

This is odd, as there are no read-only DB's on this instance. There is however a mirror in suspened/ restoring state. I suspect this may be related, but would like some insight before re-attempting.

Another fun fact is that I did this on another instance at the same time. That instance really does have a read-only DB.

Thanks!


TIA, ChrisRDBA

sys.dm_os_wait_stats

$
0
0

Sometimes i had problem with slow working of sql server.After reading some article i find about running sys.dm_os_wait_stats. In my sql server i ran query 

select * fromsys.dm_os_wait_stats
order by wait_time_ms desc

The top 20 rows of output is as shown below

So is this a normal condition or do i have any performance problem with sql server.

Please help me on this.

Clustered index on a varbinary column

$
0
0

Hi,

I just wanted to ask if there are any consequences to using a varbinary(120) column on a table and having a clustered index on it. How does this affect inserts etc.

This column is used in a checksum like manner, and the checksum values are unique.

Many thanks.

SQL Agent Jobs Fails

$
0
0

Hi All,

The job failed.  Unable to determine if the owner (BI\Dev) of job FirstDataCreditCardCBC has server access (reason: Could not obtain information about Windows NT group/user 'BI\Dev', error code 0x5. [SQLSTATE 42000] (Error 15404)).

I have done the changes in the SQL server configuration manger eventhough the job has failed.

Thanks

Thiru

SQL-Server 2008 memory

$
0
0

Hello,

i need to limit the memory of the sql-server. I configured the needed limit in the management studio but after one day the sql-server uses the complete memory again. We have to run an other application on this server which need some memory. Thank you in advance!

Viewing all 15872 articles
Browse latest View live


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