Restore Transaction Log Wipes Out Procedure Cache For The Instance

May 30, 2008

from BOL:
"
Restoring a database clears the plan cache for the instance of SQL Server.

"
i'm seeing this behavior after log restores as well.

what's the reason the whole procedure cache is flushed?

thanks.

View 2 Replies


ADVERTISEMENT

Transaction Log Restore Procedure

Oct 18, 2007

Hi

We have a database on sqlserver 2005 on a schedule for transaction log backups is in place already which is happening at interval of 30mins.All these transaction logs are appended to file called 'BKP' on E drive of our server. Now i have to configure logshipping for this database.Normally logshipping process will backup the transaction log,stores it in a shared folder on primary server and then copies the backupfile to another folder on secondary server and then restored ..plz correct me till now if im wrong.Now let us say our normal trans log backup schedule is as follows
T1 at 9.30am
T2 at 10.00am
T3 at 10.30am
T4 at 11.00 am
Now i decided to schedule the log shipping transaction log backup interval once in 30mins and start transaction log backup at following intervals
T11 AT 9.45am
T22 AT 10.15AM
T33 at 10.45AM
T44 AT 11.15AM
So T11,T22 etc these backups are restored on standby server sequentially.

Now if Primary database goes down at 11.25am , then do i have to restore the Tlogs T1,T2,T3,T4 and make the Primary database up or i should restore T1,T11,T2,T22,T3,T33,T4,T44 for making my primary database UP..


Regards
Arvind L

View 14 Replies View Related

SQL2K - Clean Buffer Cache And Procedure Cache.

May 31, 2007

Is there a way to drop clean buffers at the database level instead of the server/instance level like the undocumented €œDBCC FLUSHPROCINDB (@dbid)€??
Is there a workaround for €œdbo€? to be able to flush procedure and data cache without being elevated to €œsysadmin€? server role?

PS: I am aware of the sp_recompile option that can be used to invalidate cached execution plans.
Thx.

View 1 Replies View Related

SQL Server Admin 2014 :: Restore Lost Transaction From Transaction Log File

Jun 10, 2015

I have Full database backup upto previous day and transaction logfile of Today transaction. my database has crashed. I have restored previous day's Full backup. I have faced difficulty to restore today's transaction from today's transaction log. What are the steps to restore full database back and one day's transaction log file. Note: there is no differential database backup and transaction backup.

View 8 Replies View Related

SQL 2012 :: Clear Procedure Cache Of A Single Procedure?

Sep 12, 2014

Is there anyway to clear the procedure cache of a single procedure?

View 9 Replies View Related

Procedure Cache ?

Nov 1, 1999

I know this might be a dumb one, but what the heck. My new 7.0 server's procedure cache
stays at 100%. After researching this looks like what I want. Nay response appreciated.

View 1 Replies View Related

Procedure Cache

Jul 28, 1999

Ours is a MSSQL Server Client server application with very minimal usage of Store procedures.
The proc cache is configured at 5%.I execute "dbcc proccache" to keep track of the proc cache.
I have seen that the "proc cache size" reduces to a very small a amount when there is peak usage.
It starts at 42,000 and comes down to 400, though it is always greater than "proc cache used".
I am worried if this causes crashes.
Please advise why this happens and solutions if any.
Thanks in advance,
Ramakrishna seelam.

View 1 Replies View Related

Procedure Cache

Feb 11, 1999

Hello folks!
We are going to install SQL server 6.5 with MSMQ.
And set 128M memory for SQL Server.
What % Procedure cach do you recomend to set?

Thanks,
Alona

View 1 Replies View Related

Procedure Cache Percentage

Apr 26, 2000

Hi Everybody!

In the application I have, database interaction is mainly through stored procedures.

Currently the setting for procedure cache is 30%. Does anyone have experience with having had changed this and effect on performance?

Thanks!
- Manoj

View 1 Replies View Related

Procedure Cache Hit Rate

Feb 9, 2007

I have installed a SQL Server diagnose tool for evaluation. It prompts and warns me that "Procedure Cache hit rate is for example 15%. Its help indicates:

The Procedure Cache Hit Rate alarm is raised when the ratio between the number of times SQL Server looks for a plan in the procedure cache and the number of times it does not find a required plan in the procedure cache falls below a threshold.

A low procedure cache hit rate indicates that SQL Server is finding fewer of the query execution plans it needs already in memory and therefore has to perform more compiles. These extra compilations will degrade SQL Server performance by causing extra CPU load.

What can I do to increase the rate?

Canada DBA

View 2 Replies View Related

How Always Keep Specific Query In Procedure Cache ?

Jun 1, 2001

Is any way we can tell sql server to keep specific (long runing) query in procedure Cache.
I already tried to do this by creating job (run every 1 hr from 8 am to 6 pm)
but is not enough

Thanks

View 1 Replies View Related

Increasing The Size Of The Procedure Cache

Jul 15, 2002

Is there a way to increase the size of the procedure cache. Or is it only a auto configuring option.
I have 2gb of memory, and when I check the size of the procedure cache it is just 10mb. I would like to increase this to around 50mb. Not sure if there is an setting to do this. Had a look on BOL could not find anything.

thanks
Jane

View 1 Replies View Related

T-SQL (SS2K8) :: Procedure Cache Hit Ratio

Jun 20, 2014

I'm putting together some monitor scripts, have buffer cache ratio etc etc but struggling to get an accurate script for the current procedure cache hit ratio...

View 1 Replies View Related

Procedure Cache Hit Rate Is Low - Need Advice

Mar 18, 2008

I have a 32 bit SQL 2005 EE clustered installation with 10GB of physical memory and AWE enabled. Our monitoring tool, Spotlight, is reporting the Procedure Cache to be 384MB and a Hit Rate of 75% on a fairly regular basis. Sometimes the Procedure Cache increases to 495MB and a Hit Rate of 82%.

(1) With 2005 can the Procedure Cache be increased?

(2) What is the max size of Procedure Cache?

(3) How do I increase the Hit Rate to a higher percentage?

I do not encounter the issue on any other SQL Server installation, however this is our only cluster.

DBCC PROCCACHE
num proc buffs = 64889
num proc buffs used = 1135
num proc buffs = 1135
active proc cache size = 2896
proc cache used = 364
proc cache active = 364

Thanks, Dave

View 1 Replies View Related

When Is Procedure Cache Flushed Or Cleared?

Jul 23, 2005

Using SQL Server 2000. When does SQL flush or clear the procedurecache? I am dynamically creating and dropping stored procedures (SP).Does SQL clear the cache for the SP that has been dropped? If not,when the SP is recreated (with the same name), does SQL use theexecution plan from cache?Thank you in advance.Jack

View 2 Replies View Related

Procedure Cache Usage Drops... Why?

Apr 28, 2008

My server (SQL 2005 SP2) typically runs with a procedure cache usage of about 92% or higher... lately it seems like at some point in time during the day it just drops to anywhere between 50% and 65%... with this comes horrible server performance and many snowball effects. If I clear the procedure cache it will go up only about 10% for a minute or two. The only way I can get it to recover completely seems to be restarting the SQL service. Then it will be fine till the next incident. The database is a read only (not set to read only but no updates other than replication). and the same SPs are run over and over and over throughout the day. also did notice that the compiles of the SPs goes up drastically at this point also. not sure if this is part of the cause or part of the effect.

CPU is normal. response from anything (even sp_who) is slow.

i do not understand the way procedure cache works completely so I thought I would ask for some direction.

Any ideas where to look or where to start???
Any thing I can do to catch this when it happens would be great.

thanks a head of time.

View 34 Replies View Related

Is The Transaction Context Available Within A 'called' Stored Procedure For A Transaction That Was Started In Parent Stored Procedure?

Mar 31, 2008

I have  a stored procedure 'ChangeUser' in which there is a call to another stored procedure 'LogChange'. The transaction is started in 'ChangeUser'. and the last statement in the transaction is 'EXEC LogChange @p1, @p2'. My questions is if it would be correct to check in 'LogChange' the following about this transaction: 'IF @@trancount >0 BEGIN Rollback tran' END Else BEGIN Commit END.
 Any help on this would be appreciated.

View 1 Replies View Related

Unable To Connect To SQL Database 'MySite-Cache' For Cache Dependency Polling.

Dec 27, 2007

 Im getting this error when trying to set up a cache dependency...are there any special permissions etc?From CS:SqlCacheDependency dep = new SqlCacheDependency("MySite-Cache", "Products");Cache.Insert("Products", de.GetAllProductsList(), dep); From connectionStrings.config:<add name="SiteDB"         connectionString="Data Source=localhost,[port]SQLEXPRESS;Integrated Security=true;User Instance=true; AttachDBFileName=|DataDirectory|ASPNETDB.MDF" providerName="System.Data.SqlClient" />Also tried this using my machinename<add name="SiteDB"         connectionString="Data
Source=<machinename>,[port]SQLEXPRESS;Integrated Security=true;User
Instance=true; AttachDBFileName=|DataDirectory|ASPNETDB.MDF"
providerName="System.Data.SqlClient" /> From web.config:       <caching>          <sqlCacheDependency enabled="true" pollTime="10000">              <databases>                  <add name="MySite-Cache" connectionStringName="SiteDB" pollTime="2000"/>              </databases>          </sqlCacheDependency>                </caching> EDIT: So making progress I can't seem to get the table registered for cache dependency:The sample i have says"aspnet_regsql.exe -E -S .SqlExpress -d aspnetdb -t Customers -et"and the command line response is "Enabling the table for SQL cache dependency..An error has happened.  Details of the exception:The table 'Customers' cannot be found in the database."Where does this "Customers" table come from? There is obviously not an application specific "Customers" table in aspnetdb I'm confused probably more by the example than anything.... 

View 3 Replies View Related

SQL Cache Dependency Invalidation - Can It Work On The Procedure Based Command?

Dec 19, 2005

I was wondering if SQL Cache Dependency would be in fact invalidated if:
1.  it was created based on a procedure type command.
2. if the select statement retrieves the data from multiple database tables
 Any help would be more appreciated.  I am stuck with the fact that none of the data bases on sql dependency is invalidated. I spent literally hours to understand what i am doing incorrectly.
 
Thanks

View 1 Replies View Related

WARNING: Clearing Procedure Cache To Free Contiguous Memory.

Dec 6, 2000

We see the following message in our error log.
WARNING: Clearing procedure cache to free contiguous memory.
It is accomonpanied by fairly intensive CPU activity.
We get this roughly once per working day.

Anyone have any idea why, and what we can do to stop this?

Regads,

Jim Plant

View 2 Replies View Related

SQL Server Admin 2014 :: How To Analyze Large Procedure Cache

Jun 15, 2015

I want to analyze procedure cache, to find inefficient plans and parameter issues.

I do it trow DMV But my requests to DMV are very slow and demand resources because procedure cache is about several GB Actually I dont need on-line analysis.

Is it possible to have fast snapshot of procedure cache?

View 0 Replies View Related

SQL 2012 :: Restore 2 Database Simultaneously In Same Instance?

Apr 10, 2014

Is it possible to restore two databases simultaneously in same sql instance?

View 3 Replies View Related

Sys.dm_os_memory_cache_counters Vs. SQL Server:Plan Cache Cache

Feb 15, 2008

Hi guys,

I am looking at the plan caches/cached pages from the perspective of
sys.dm_os_memory_cache_counters and sql serverlan Cache - Cache Pages

For the first one I am using

select (sum(single_pages_kb) + sum(multi_pages_kb) )
from sys.dm_os_memory_cache_counters
where type = 'CACHESTORE_SQLCP' or type = 'CACHESTORE_OBJCP'
a slight change from a query in
http://blogs.msdn.com/sqlprogrammability/

For the second just perfmon.

The first one gives me a count of about 670,000 pages only for the object and query cache and the second one gives me a total of about 100,000 pages for five type of caches including object and query.

If I am using the query from http://blogs.msdn.com/sqlprogrammability/ to determin the plan cache size

select (sum(single_pages_kb) + sum(multi_pages_kb) ) * 8 / (1024.0 * 1024.0) as plan_cache_in_GB
from sys.dm_os_memory_cache_counters
where type = 'CACHESTORE_SQLCP' or type = 'CACHESTORE_OBJCP'

it gives me about 5 GB when in fact my SQL Server it can access only max 2GB with Total and Target Server Memory at about 1.5 GB.

Does anyone have any idea what is going on?

View 2 Replies View Related

SQL Server Admin 2014 :: Procedure Plan Cache Is Cleared Automatically

Sep 17, 2015

The plan cache is cleared automatically (every 30-60 seconds) on our high load OLPT server.

Can't find a reason for it. I have been logging procedure cache thru dm_exec_cached_plans, every second for a couple of minutes.

It shows that it doesn't grow beyond 200Mb. SQLserver has 64Gb available.

DBCC FREEPROCCACHE is not executed.
dm_os_memory_clerks shows the same 200Mb max (approximately).

I disabled the SQL Agent, still happens, so it's not a job causing the problem.

I disabled the Resource Governor, still the same problem.

View 9 Replies View Related

Fail To Process Mining Structure With The OLEDB Error: There Is Not Enough Procedure Cache......

Dec 6, 2007

Hi everyone,

I posted a related thread before about this error below when I process a dimension. And seems that the solution by using "ClearCache" can not fingure out the issue when I want to process a mining structure...... .


OLE DB error: OLE DB or ODBC error: There is not enough procedure cache to run this procedure, trigger, or SQL batch. Retry later, or ask your SA to reconfigure SQL Server with more procedure cache.
; Sort failed because there is insufficient procedure cache for the configured number of sort buffers. Please retry the query after configuring lesser number of sort buffers.

Could someone please give me some suggestions?
Your help will be very appreciated:-)


Thanks^_^
Winnie

View 2 Replies View Related

Help..transaction Log Restore

Feb 7, 2001

I have a db which was never backed up!!!
Yesterday a script was run on this database which deleted my existing tables and created new ones...pretty dumb i know...just one of those days when everything goes wrong...all i have is the transaction log(which had a truncate log on checkpoint enabled..)..
is there some way in which i can recover those tables again???
i tried to run dbcc log (dbname,4) which showed me the transaction log with lots of rows but i could not read it ...can anywone help me to understand that transaction log???

any help appreciated
regards,
resh

View 2 Replies View Related

How To Restore From Transaction Log?????

Aug 23, 1999

How do I restore from a transaction Log? I use 2 separate database devices for my database (Data & Log) If data is corrupted at 3PM, can I just go and do a

LOAD TRANSACTION DatabaseName
from the LogDeviceName
StopAt 2:59

When I try to run that, it doesn't work. There is no option in the REstore Interface to specify to restore from only the transaction log. Do I need to DUMP the transaction log several times a day in order to do the restore?

Thanks!

JOyce

---------------------------------------
Subject:
From:
Date: Help!!!!!!! Lost DB! (reply)
Ray Miao ()
8/20/99 8:32:18 AM

Do you backup transaction log periodically? If not, sorry for that.


------------
Joyce at 8/19/99 5:32:12 PM

I need help ASAP!

For some reason, we lost a dozen of our tables with valuable data. could be a virus or something that cleared out our data.

The last backup we have is last night at 11PM. If we recover from that backup, all the users lose all of today's work!

Is there a way I can just roll back the transactions from today?????!

I'd really appreciate any help urgently
Joyce

View 1 Replies View Related

Restore DB From Transaction Log

Dec 12, 2006

Dear All,

We accidentally overwrite some data in our DB. Bad news is we never back-up our DB. However, the system are set in full-recovery mode. From website and book, i found that it's possible to recover back the data using "Recovery DB to a Point Time" but when we try it, we found that it cannot work without any backup data.

Anyone know how to resolve this issue?

Please kindly help.. Thanks alot!!

View 2 Replies View Related

Restore Transaction Log?????????

Feb 19, 2004

Hi all,
I had been made full backup, differential backup, transaction log backup. I want to create new database from these file backup.
I did it follow:
1. Create new database from full backup file, it is ok. then
2. restore this database use transaction log backup file, an message raise :
"The proceding restore operation did not specify WITH NORECOVERY or WITH STANBY. Restart the restore sequence, specfying WITH NORECOVERY or WITH SATNBY for all but the final step... "
thank for reading.

View 6 Replies View Related

Restore Transaction Log

Aug 23, 2006

dear all,

I want to restore transaction log to other server using transact-SQL.

can we restore serveral transaction log files at the same time ?

anybody have experience on this one.

thanks







View 5 Replies View Related

Restore DB Without Transaction Log

Jun 5, 2006

Hi,

How can I restore a DB without TRN log. As database transaction logs grows too much and I only want to restore the database.

Thanks

Shafiq

View 4 Replies View Related

Restore Of Transaction Log Backup

Apr 18, 2008

Hi All,
I am facing one problem.
My Testing Server is down. I have taken full backup 1 hr backup. After that i have taken additional 5 TL backups. All the backups were moved to different server.
Now DB Server is corrupted. Now i have to rebuild the Database Server from the available Backup and TLog Backup.
But i have reliased that all the Transaction Log backup are having no naming convention in File name.

I am wondering after restoring full backup, which tlog backup i should use for next restore.


Thanks in advance.
-- Chetan

View 2 Replies View Related

Restore Log To Marked Transaction

Jan 29, 2007

Simon writes "Hi

using the following syntax in SQL 2005 (win 2003) to restore a log to a marked transaction. Code runs ok but I'm never getting back to the point in time where id 13 still exists , help !

kind regards

Simon

/*backup and overwrite */
BACKUP DATABASE AdventureWorks
TO DISK = N'C:SQL Backupsadw.bak'
WITH FORMAT, INIT, NAME = N'AdventureWorks-Full Database Backup'
GO

/* verify data */
restore verifyonly
from disk = 'C:SQL Backupsadw.bak'
with file = 1
go

-- with MARK to place a marker in the tranny log
BEGIN TRANSACTION CandidateDelete13a
WITH MARK N'Deleting a Job Candidate';
GO
USE AdventureWorks;
GO
DELETE FROM AdventureWorks.HumanResources.JobCandidate
WHERE JobCandidateID = 13;
GO
COMMIT TRANSACTION CandidateDelete13a;
GO

BACKUP LOG AdventureWorks
TO DISK = N'C:SQL Backupsadw_log.bak'
with format, NAME = N'AdventureWorks-Trans Log Backup'
GO


/*
RESTORE DATABASE AdventureWorks FROM DISK = N'C:SQL Backupsadw.bak' WITH FILE = 1, RECOVERY, NOUNLOAD, REPLACE,STATS = 10
GO
*/

use master
RESTORE DATABASE AdventureWorks FROM DISK = N'C:SQL Backupsadw.bak' WITH FILE = 1, NORECOVERY, NOUNLOAD, REPLACE,STATS = 10
GO

use master
RESTORE LOG AdventureWorks FROM DISK = N'C:SQL Backupsadw_log.bak'
WITH recovery, STOPatMARK = 'CandidateDelete13a'
GO"

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved