Showing posts with label plan. Show all posts
Showing posts with label plan. Show all posts

Monday, March 26, 2012

Problems deleting transaction log files older than x days

Hi,
I have a problem with maintainance plans an deleting
transaction log files older than x days. I have made one
maintainance plan for databases and that one works.
But the one made for the transaction log doesn't delete
the old files. They remain and aren't deleted
automatically.
brgds
PeterBelow KB might help:
http://support.microsoft.com/defaul...2&Product=sql2k
Also, check out below great troubleshooting suggestions from Bill H at MS:
-- Log files don't delete --
This is likely to be either a permissions problem or a sharing violation
problem. The maintenance plan is run as a job, and jobs are run by the
SQLServerAgent service.
Permissions:
1. Determine the startup account for the SQLServerAgent service
(Start|Programs|Administrative tools|Services|SQLServerAgent|Startup). This
account is the security context for jobs, and thus the maintenance plan.
2. If SQLServerAgent is started using LocalSystem (as opposed to a domain
account) then skip step 3.
3. On that box, log onto NT as that account. Using Explorer, attempt to
delete an expired backup. If that succeeds then go to Sharing Violation
section.
4. Log onto NT with an account that is an administrator and use Explorer to
look at the Properties|Security of the folder (where the backups reside)
and ensure the SQLServerAgent startup account has Full Control. If the
SQLServerAgent startup account is LocalSystem, then the account to consider
is SYSTEM.
5. In NT, if an account is a member of an NT group, and if that group has
Access is Denied, then that account will have Access is Denied, even if
that account is also a member of the Administrators group. Thus you may
need to check group permissions (if the Startup Account is a member of a
group).
6. Keep in mind that permissions (by default) are inherited from a parent
folder. Thus, if the backups are stored in C:\bak, and if someone had
denied permission to the SQLServerAgent startup account for C:\, then
C:\bak will inherit access is denied.
Sharing violation:
This is likely to be rooted in a timing issue, with the most likely cause
being another scheduled process (such as NT Backup or Anti-Virus software)
having the backup file open at the time when the SQLServerAgent (i.e., the
maintenance plan job) tried to delete it.
1. Download filemon and handle from www.sysinternals.com.
2. I am not sure whether filemon can be scheduled, or you might be able to
use NT scheduling services to start filemon just before the maintenance
plan job is started, but the filemon log can become very large, so it would
be best to start it some short time before the maintenance plan starts.
3. Inspect the filemon log for another process that has that backup file
open (if your lucky enough to have started filemon before this other
process grabs the backup folder), and inspect the log for the results when
the SQLServerAgent agent attempts to open that same file.
4. Schedule the job or that other process to do their work at different
times.
5. You can use the handle utility if you are around at the time when the
job is scheduled to run.
If the backup files are going to a \\share or a mapped drive (as opposed to
local drive), then you will need to modify the above (with respect to where
the tests and utilities are run).
Finally, inspection of the maintenance plan's history report might be
useful.
Thanks,
Bill Hollinshead
Microsoft, SQL Server
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Peter Junell" <peter.junell@.silverhuset.se> wrote in message
news:9b0601c405c2$d5967c20$a101280a@.phx.gbl...
> Hi,
> I have a problem with maintainance plans an deleting
> transaction log files older than x days. I have made one
> maintainance plan for databases and that one works.
> But the one made for the transaction log doesn't delete
> the old files. They remain and aren't deleted
> automatically.
> brgds
> Peter

Friday, March 9, 2012

PROBLEM: Database Mainence plan "All user Databases" missing database

If I select "All user Databases" and click T-SQL, 3 our of 4
databases are listed- and the missing database has not been backed up
via the plan. All databases are listed, however, when I select
"Selected Databases"- they are shown in the drop downbox.
This is for SQL 2005 Service Pack 2 with Hotfix 3175.
My guess: The missing database was restored and not restored to
overwrite an existing database. Since the CREATE DATABASE command was
not executed, maybe there is system info in master that doesn't get
set'
Help please. Thanks
Erik> My guess: The missing database was restored and not restored to
> overwrite an existing database. Since the CREATE DATABASE command was
> not executed, maybe there is system info in master that doesn't get
> set'
No, that should not be the reason. The same meta-data would exist regardless of how the database was
created (CREATE DATABASE, attach or by RESTORE). Perhaps the database is in 70 compatibility mode?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<info@.onlyhd.tv> wrote in message
news:25261d77-880b-4b83-9e9a-94866e14af6e@.e6g2000prf.googlegroups.com...
> If I select "All user Databases" and click T-SQL, 3 our of 4
> databases are listed- and the missing database has not been backed up
> via the plan. All databases are listed, however, when I select
> "Selected Databases"- they are shown in the drop downbox.
> This is for SQL 2005 Service Pack 2 with Hotfix 3175.
> My guess: The missing database was restored and not restored to
> overwrite an existing database. Since the CREATE DATABASE command was
> not executed, maybe there is system info in master that doesn't get
> set'
> Help please. Thanks
> Erik|||Thanks. No, i've seent that 7.0 Compat mode issue before, it is
actually set to 9.0.|||Do the plan do both db and log backup? Is this missing backup a db or a log backup? Perhaps there's
a difference in the recovery model setting.
If not, then I'd check other database options, just doing a quick visual compare:
SELECT * FROM sys.databases
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<info@.onlyhd.tv> wrote in message
news:42c70b00-ac98-4d82-b150-69d1dbc3bf29@.i29g2000prf.googlegroups.com...
> Thanks. No, i've seent that 7.0 Compat mode issue before, it is
> actually set to 9.0.|||Thanks for suggstions. I found that Auto Update Statistics was
different and I turned it on and also set to FULL RECOVER MODE and it
got listed in View t-SQL preview !!
THAN I turned everything back to the previous settings for my missing
databses and the All Databases support still was fixed and in tact! t-
SQL Preview showed my previously missing database.
Updating sys.databases seems to fix the problem. maybe there is some
trigger in the background or something.
Thank you for all of your help.
Erik

Monday, February 20, 2012

Problem with UpdatePanel with Trigger, using MasterPage

Hi all,

I have a MasterPage with Calendar Control, and a content page with ListBox control.
My plan is to have a post back on the ListBox, when the Calendar control "SelectionChanged" event fires.
Both the Calendar control and the ListBox control are child elements of separate UpdatePanel controls.

I have this code fragment in the content page "Load" event handler.

if (!IsPostBack)
{
Microsoft.Web.UI.AsyncPostBackTrigger trigger = new
Microsoft.Web.UI.AsyncPostBackTrigger();
trigger.ControlID = master.CalendarStartDate.ClientID.ToString();
trigger.EventName = "SelectionChanged";
UpdatePanelItemMovers.Triggers.Add(trigger);
}

But when the page loads, I get this error:

A control with ID 'ctl00_ctl00_RightSidePlaceHolder_calendarStartDate' could not be found for the trigger in UpdatePanel 'UpdatePanelItemMovers'

Can someone tell me why?

Any luck on this. I'm having the exact same problem.|||I get the same problem using markup. This is the complete page, which uses a very simple master page that has just 2 content areas.

<%@. Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager id="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:Button ID="Button1" runat="server" Text="Click" /><br />
Time: <%= DateTime.Now.ToLongTimeString() %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<asp:UpdatePanel id="UpdatePanel1" runat="server">
<contenttemplate>
Time: <%= DateTime.Now.ToLongTimeString() %>
</contenttemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>

If I move the button into the Content2 placeholder, it works fine.|||One answer is to add the trigger using code:

protected void Page_Init()
{
Microsoft.Web.UI.AsyncPostBackTrigger trigger = new Microsoft.Web.UI.AsyncPostBackTrigger();
trigger.EventName = "Click";
trigger.ControlID = Button1.UniqueID.ToString();
UpdatePanel1.Triggers.Add(trigger);
}

see:
http://forums.asp.net/thread/1456042.aspx|||

I don't use Triggers any more, I just manually call UpdatePanel.Update() whenever I need to update a section of the page, and the result is exactly the same as using triggers. I believe the error can be traced to the MasterPage/Content relationship, where controls are assigned some strange-looking ID's.

|||Use the ChildrenAsTriggers="false" attribute in UpdatePanel for using AsyncPostBackTrigger.

Code Snippet

<asp:UpdatePanel ID="general" runat="server" UpdateMode="conditional" ChildrenAsTriggers="false">

<Triggers>
<asp:AsyncPostBackTrigger ControlID="bt_envia" EventName="Click" />
</Triggers>

Problem with UpdatePanel with Trigger, using MasterPage

Hi all,

I have a MasterPage with Calendar Control, and a content page with ListBox control.
My plan is to have a post back on the ListBox, when the Calendar control "SelectionChanged" event fires.
Both the Calendar control and the ListBox control are child elements of separate UpdatePanel controls.

I have this code fragment in the content page "Load" event handler.

if (!IsPostBack)
{
Microsoft.Web.UI.AsyncPostBackTrigger trigger = new
Microsoft.Web.UI.AsyncPostBackTrigger();
trigger.ControlID = master.CalendarStartDate.ClientID.ToString();
trigger.EventName = "SelectionChanged";
UpdatePanelItemMovers.Triggers.Add(trigger);
}

But when the page loads, I get this error:

A control with ID 'ctl00_ctl00_RightSidePlaceHolder_calendarStartDate' could not be found for the trigger in UpdatePanel 'UpdatePanelItemMovers'

Can someone tell me why?

Any luck on this. I'm having the exact same problem.|||I get the same problem using markup. This is the complete page, which uses a very simple master page that has just 2 content areas.

<%@. Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager id="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:Button ID="Button1" runat="server" Text="Click" /><br />
Time: <%= DateTime.Now.ToLongTimeString() %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<asp:UpdatePanel id="UpdatePanel1" runat="server">
<contenttemplate>
Time: <%= DateTime.Now.ToLongTimeString() %>
</contenttemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>

If I move the button into the Content2 placeholder, it works fine.
|||One answer is to add the trigger using code:

protected void Page_Init()
{
Microsoft.Web.UI.AsyncPostBackTrigger trigger = new Microsoft.Web.UI.AsyncPostBackTrigger();
trigger.EventName = "Click";
trigger.ControlID = Button1.UniqueID.ToString();
UpdatePanel1.Triggers.Add(trigger);
}

see:
http://forums.asp.net/thread/1456042.aspx

|||

I don't use Triggers any more, I just manually call UpdatePanel.Update() whenever I need to update a section of the page, and the result is exactly the same as using triggers. I believe the error can be traced to the MasterPage/Content relationship, where controls are assigned some strange-looking ID's.

|||Use the ChildrenAsTriggers="false" attribute in UpdatePanel for using AsyncPostBackTrigger.

Code Snippet

<asp:UpdatePanel ID="general" runat="server" UpdateMode="conditional" ChildrenAsTriggers="false">

<Triggers>
<asp:AsyncPostBackTrigger ControlID="bt_envia" EventName="Click" />
</Triggers>