Re: db backups

From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 04/30/04


Date: Fri, 30 Apr 2004 21:43:59 +0530

Add on:-
To Look into existing backup schedules look into:

Enterprise manager -- Management -- SQL Agent - Jobs - There you will be
able to see all the existing schedules. You can doble clik and modify the
schedules.

Thanks
Hri
MCDBA

"Hari Prasad" <hari_prasad_k@hotmail.com> wrote in message
news:ecuGW3sLEHA.3016@tk2msftngp13.phx.gbl...
> Hi,
>
> Execute the below procedure inMaster database and schedule it using
> Management -- SQL Agent-- Jobs -- Add jobs with TSQL type option.
> THis procedure will backup all the databases except
> 'model','pubs','tempdb','northwind'.
>
>
> CREATE PROCEDURE BACKUP_SP @PATH VARCHAR(200) AS
> BEGIN
> SET NOCOUNT ON
> DECLARE @NAME VARCHAR(100),
> DECLARE @DBNAME VARCHAR(100)
> DECLARE BACKUP_CUR CURSOR FOR
> SELECT name FROM master..Sysdatabases where name not in
> ('model','pubs','tempdb','northwind')
>
> OPEN BACKUP_CUR
> FETCH NEXT FROM BACKUP_CUR INTO @DBNAME
>
> WHILE @@FETCH_STATUS=0
>
> BEGIN
>
> SELECT NAME=@PATH+@DBNAME+'_'+ltrim (rtrim (convert
> (char,getdate(),105)))+'Dump.bak'
> BACKUP DATABASE @DBNAME TO DISK = @NAME WITH INIT , NOUNLOAD
,NAME
> = @DBNAME, NOSKIP, STATS = 10, NOFORMAT
> FETCH NEXT FROM BACKUP_CUR INTO @DBNAME
>
> END
>
> CLOSE BACKUP_CUR
> DEALLOCATE BACKUP_CUR
> END
>
>
> How to Execute
> This procedure will take @PATH as the input parameter, Say you have to
> backup the database to D:\SQLBACKUP folder then the execution will be
>
>
> EXEC BACKUP_SP 'D:\SQLBACKUP\'
>
>
> This will backup all the databases to backup files based on database name
> and date . So arrange a purging mechanism to delete the old files.
>
> Thanks
> Hari
> MCDBA
>
>
>
>
>
> "cp" <anonymous@discussions.microsoft.com> wrote in message
> news:30D847D7-C3CF-419E-9D7F-90AE558321D9@microsoft.com...
> > I am creating a backup process for several db's in sql server. I have
> created a backup device for each db I want to backup. I then create a
> scheduled backup for the individual db's. My question is how do I look at
an
> existing schedule and edit it. Each time I bring up the backup dialogue it
> acts as though I'm creating a new one (and I believe that in some cases if
I
> create a new one it doesn't overwrite the old one). Basically I want to
> manage my existing backup schedules but can't find a place to do it. I've
> looked through the sp's and don't see anything that looks helpful. Any
> suggestions or leads would be appreciated,
> >
> > thx,
> > cp
>
>



Relevant Pages

  • Re: Error from sp_getmessage
    ... if that resolves your problem ... It is a good idea to take backup your database before you execute the ...
    (comp.databases.sybase)
  • Re: Backup/Restore question
    ... > I pass the backup statement. ... >> No need to create a "blank database" first. ... >> when you execute the RESTORE command. ... >> execute your restore command from there. ...
    (microsoft.public.sqlserver.programming)
  • Re: Daily Backup Filename
    ... Execute the below procedure inMaster database and schedule it using ... procedure will backup all the databases except ... DECLARE @DBNAME VARCHAR ...
    (microsoft.public.sqlserver.programming)
  • Re: NtBackup hangs during scheduled backups
    ... Same scenario for me on two different SBS 2003 boxes. ... scripts and logs related to backup with no luck. ... >Really clueless as there are no other backup schedules. ...
    (microsoft.public.windows.server.sbs)
  • Re: Making security backups with ado
    ... I suppose you're right that's the best solution, but I wanted to store the ... > The best solution seems to use backup database instead ... You should create new database and copy ... Most DBMS will let you execute SELECT .. ...
    (borland.public.delphi.database.ado)