Showing posts with label page. Show all posts
Showing posts with label page. Show all posts

Friday, March 23, 2012

schedules web page problem

hi all,

first of all i'm sorry for my bad english, i hope someone understand me.

i have a problem with schedules in reporting services.
i create a new one and i had no problem doing it.
the creation of the schedules make a new job in the sql server.
the job in the sql server works right.
instead the schedule's informartion in the reporting services web page doesn't refresh.
the schedule web page always reports the column "last execution" = never and the "next execution" = the first value.
any subscriptions set on the schedule doesn't work.

above some information about the installation:

- sql\report server is in another intranet. I manage the site from a different intranet.
- i restore on the main server the ReportServer and the ReportServerTempDB from the deployment server. i read the microsoft msdn to restore the db.

hope someone could help me
thanks
nicola

The microsoft article to restore reportserver db is very incomplete.. I do the following:
in ReportServer - Database

EXEC dbo.sp_AlterOwnerOfAgentJob @.username='ASPNET'
GO
EXEC dbo.sp_AlterOwnerOfSubscriptions 'ITEMOwner'
GO

where ASPNET is the assount of iis / application pool and ITEMOwner is a user from your domain. (usually this name has to be fullqualified domain\username)

The stored procedures are:
USE [ReportServer]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[sp_AlterOwnerOfSubscriptions] ( @.username nvarchar(128))
AS
BEGIN
/* ?ndert den Besitzer der Abonnements, da sonst die Fehlermeldung:
"Benutzer XY wurde nicht gefunden"
Beim nachtr?glichen ?ndern eines Abos auftreten kann
*/

SET NOCOUNT ON;
declare @.UserID uniqueidentifier
/* ID aus Benutzertabelle holen */
select top 1 @.UserID=userid from users where username=@.username
if @.UserID is null
begin
print '======================================================='
print 'ERROR: The given user was not found'
print 'Check if''' + @.username + ''' is correct!'
print '======================================================='
end
else
begin
print 'Changing subscription user to: ' + @.username
update dbo.Subscriptions set OwnerID=@.UserID,ModifiedByID=@.UserID,ModifiedDate=getDate();
update dbo.Schedule set CreatedById=@.UserID;
end
END

GO

/* =========================================================================== */

CREATE PROCEDURE [dbo].[sp_AlterOwnerOfAgentJob] ( @.username nvarchar(128))
AS
BEGIN
/*
Diese SP ?ndert den Besitzer der SQL-Server Agent-Jobs, diese werden
f?lschlicherweise auf SYSTEM gesetzt, sollten aber ASPNET sein!
*/
SET NOCOUNT ON;
declare @.jobname nvarchar(128),@.servername nvarchar(128),@.UserID uniqueidentifier
/* Cursor zum auslesen der aktuellen Jobs */
DECLARE job_cursor CURSOR FOR select name from msdb.dbo.sysjobs
OPEN job_cursor

/* Resultset durchgehen und Besitzer jedes Jobs setzen */
FETCH NEXT FROM job_cursor INTO @.jobname
WHILE @.@.FETCH_STATUS = 0
BEGIN
PRINT 'Changing owner to: ''' + @.username + ''' for job ' + @.jobname
EXEC msdb.dbo.sp_update_job @.job_name=@.jobname,
@.owner_login_name=@.username
FETCH NEXT FROM job_cursor INTO @.jobname
END
/* Resultset / Cursor wieder schlie?en und Freigeben */
CLOSE job_cursor
DEALLOCATE job_cursor
END

GO

/* =========================================================================== */

Usually it works after that.. If not rebooting is a good choice ;) I was trying for 2hours to get the subscriptions work, after rebooting all went fine ;)

Friday, March 9, 2012

Schedule SQL Express back up from ASP Page

Hello,

I need to schedule SQL Express backup from ASP Page. I was trying to use SQLDMO to schedule jobs but found that SQL Agent is not supported in Sql Express. I tried to use Scheduler.SchedulingAgent.1 to add task in schedular but getting Invalid class string error. Schedular dll is only supported in site server. What would be the best solution for me to schedule back for SQL Express?

hi,

as you already noticed, SQLExpress does not provide the native SQL Server Agent to support scheduled jobs like backups..

you have then to rely on third party scheduler, like http://www.valesoftware.com/products-express-agent.php, http://www.codeproject.com/useritems/SQLAgent.asp (free code)

personally I do recommend relying on the native OS scheduler (AT/SCHTASK) where you can define your standard schedules to execute cmd file including SQLCmd.exe calls, like
[cmd file]
SQLCmd -E -S(Local) -Q"BACKUP DATABASE [Pubs] TO DISK = N'D:\folder\Pubs.bak' WITH FORMAT, INIT, NAME = N'Pubs-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10" >>d:\folder\BckOutput.txt
[/cmd file]

which backups the Pubs database to the d:\folder\Pubs.bak file, outputting the backup execution to a text file, d:\folder\BckOutput.txt, you can later inspect for results...

additional info about this can be found at http://www.sqldbatips.com/showarticle.asp?ID=27 and http://www.sqldbatips.com/showarticle.asp?ID=29, where another free tool by an MVP fellow, Jasper Smith, is available for download to help performing backup tasks..

regards

Tuesday, February 21, 2012

schedule a backup?

I'm reading Stanek's SQL 2k5 pocket ref and on page 447 #11 he says
"To schedule a backup, click schedule".
I don't see a "schedule" button anywhere.
I created a schedule under the agent (I didn't create a job, just a
schedule) but I still don't see an option to schedule the backup.
Any ideas?
ThxHello,
For database backup use maintenance plan from SQL Server management studio.
Connect to SQL Server from management studio, expand and choose the
management option,
Maintenance plans.. right click and choose maintenance plan Wizard. This
will help you to do the step by step process to define a backup procedure
and schedule it.
Thanks
Hari
"Tmack" <Terry.McKenna@.gmail.com> wrote in message
news:1173916162.338108.140150@.n59g2000hsh.googlegroups.com...
> I'm reading Stanek's SQL 2k5 pocket ref and on page 447 #11 he says
> "To schedule a backup, click schedule".
> I don't see a "schedule" button anywhere.
> I created a schedule under the agent (I didn't create a job, just a
> schedule) but I still don't see an option to schedule the backup.
> Any ideas?
> Thx
>|||On Mar 14, 10:09 pm, "Hari Prasad" <hari_prasa...@.hotmail.com> wrote:
> Hello,
> For database backup use maintenance plan from SQL Server management studio.
> Connect to SQL Server from management studio, expand and choose the
> management option,
> Maintenance plans.. right click and choose maintenance plan Wizard. This
> will help you to do the step by step process to define a backup procedure
> and schedule it.
> Thanks
> Hari
> "Tmack" <Terry.McKe...@.gmail.com> wrote in message
> news:1173916162.338108.140150@.n59g2000hsh.googlegroups.com...
>
> > I'm reading Stanek's SQL 2k5 pocket ref and on page 447 #11 he says
> > "To schedule a backup, click schedule".
> > I don't see a "schedule" button anywhere.
> > I created a schedule under the agent (I didn't create a job, just a
> > schedule) but I still don't see an option to schedule the backup.
> > Any ideas?
> > Thx- Hide quoted text -
> - Show quoted text -
Thanks, this is what I needed.

schedule a backup?

I'm reading Stanek's SQL 2k5 pocket ref and on page 447 #11 he says
"To schedule a backup, click schedule".
I don't see a "schedule" button anywhere.
I created a schedule under the agent (I didn't create a job, just a
schedule) but I still don't see an option to schedule the backup.
Any ideas?
Thx
Hello,
For database backup use maintenance plan from SQL Server management studio.
Connect to SQL Server from management studio, expand and choose the
management option,
Maintenance plans.. right click and choose maintenance plan Wizard. This
will help you to do the step by step process to define a backup procedure
and schedule it.
Thanks
Hari
"Tmack" <Terry.McKenna@.gmail.com> wrote in message
news:1173916162.338108.140150@.n59g2000hsh.googlegr oups.com...
> I'm reading Stanek's SQL 2k5 pocket ref and on page 447 #11 he says
> "To schedule a backup, click schedule".
> I don't see a "schedule" button anywhere.
> I created a schedule under the agent (I didn't create a job, just a
> schedule) but I still don't see an option to schedule the backup.
> Any ideas?
> Thx
>
|||On Mar 14, 10:09 pm, "Hari Prasad" <hari_prasa...@.hotmail.com> wrote:
> Hello,
> For database backup use maintenance plan from SQL Server management studio.
> Connect to SQL Server from management studio, expand and choose the
> management option,
> Maintenance plans.. right click and choose maintenance plan Wizard. This
> will help you to do the step by step process to define a backup procedure
> and schedule it.
> Thanks
> Hari
> "Tmack" <Terry.McKe...@.gmail.com> wrote in message
> news:1173916162.338108.140150@.n59g2000hsh.googlegr oups.com...
>
>
>
>
> - Show quoted text -
Thanks, this is what I needed.

schedule a backup?

I'm reading Stanek's SQL 2k5 pocket ref and on page 447 #11 he says
"To schedule a backup, click schedule".
I don't see a "schedule" button anywhere.
I created a schedule under the agent (I didn't create a job, just a
schedule) but I still don't see an option to schedule the backup.
Any ideas?
ThxHello,
For database backup use maintenance plan from SQL Server management studio.
Connect to SQL Server from management studio, expand and choose the
management option,
Maintenance plans.. right click and choose maintenance plan Wizard. This
will help you to do the step by step process to define a backup procedure
and schedule it.
Thanks
Hari
"Tmack" <Terry.McKenna@.gmail.com> wrote in message
news:1173916162.338108.140150@.n59g2000hsh.googlegroups.com...
> I'm reading Stanek's SQL 2k5 pocket ref and on page 447 #11 he says
> "To schedule a backup, click schedule".
> I don't see a "schedule" button anywhere.
> I created a schedule under the agent (I didn't create a job, just a
> schedule) but I still don't see an option to schedule the backup.
> Any ideas?
> Thx
>|||On Mar 14, 10:09 pm, "Hari Prasad" <hari_prasa...@.hotmail.com> wrote:
> Hello,
> For database backup use maintenance plan from SQL Server management studio
.
> Connect to SQL Server from management studio, expand and choose the
> management option,
> Maintenance plans.. right click and choose maintenance plan Wizard. This
> will help you to do the step by step process to define a backup procedure
> and schedule it.
> Thanks
> Hari
> "Tmack" <Terry.McKe...@.gmail.com> wrote in message
> news:1173916162.338108.140150@.n59g2000hsh.googlegroups.com...
>
>
>
>
>
>
> - Show quoted text -
Thanks, this is what I needed.