RE: backup over server

RE: backup over server

 

  

Jumma,

Here you go...my Network Admin assists with this script. We also backup
our Database via Veritas Backup Exec. The downfall to that backup is
that if you want to restore it to another server the hierarchy needs to
be identical. (meaning if data is on D and log on E then the restore
server needs to have the same path...yes this should be the 'norm' but
when you walk into the job you inherit messes)

We use kix to run this...

- Kix is needed
- Winzip command line
- Blat for E-mail status.


$LogFile = "c:\batch\sqlcopy.log"
$subject = '"SQL COPY FULL @day @date"'
IF EXIST ($logfile)
? "Deleting Old Log File"
Del $logfile
If @error<>0
$LogItem = Log("Error Deleting $logfile Error number
@error","$logfile")
ENDIF
sleep 2
endif

? "Today is @DAY"
$LogItem = Log("@day @date @time Begin SQL Copy","$logfile")
$LogItem = Log("@day @date @time Start to Compress Files","$logfile")
? "@time Compressing Files"
shell ("c:\progra~1\winzip\wzzip -a -ex -P -r
d:\ss-full-@day-@ydayno.zip D:\MSSQL7\BACkup\*.*")
$LogItem = Log("@day @date @time End to Compress Files","$logfile")
Sleep 3
$LogItem = Log("@day @date @time Started Copying Files","$logfile")
? "@time Copying Files"
sleep 8
copy "d:\ss-full-@day-@ydayno.zip" "\\server" /h/c
? "@Time Done Copying"
$LogItem = Log("@day @date @time Ended Copying files Error number
@error","$logfile")
$LogItem = Log("@day @date @time END SQL Copy","$logfile")
del ("d:\ss-full-@day-@ydayno.zip")
shell "@scriptdir\blat.exe $logfile -to [Email Address Removed] -f
[Email address protected] -subject $subject -server xx.x.x.xx -q"
? "DONE"
sleep 40
exit

Function Log($Message,Optional $LogFile)
Dim $LogFile
; Check parameters.
$Log=''
$LogFile=''+$LogFile
If 0=VarType($Message) Exit(1) EndIf

If $LogFile
; Check if logfile directory exists..
If RedirectOutput($LogFile,0)=0
? "$Message"
$=RedirectOutput("")
Else Exit(3) EndIf
EndIf
EndFunction


Jeff

-----Original Message-----
From: Jumma Salim
[mailto:mssqldba-ezmlmshield-x59395272.[Email address protected]
Sent: Tuesday, January 31, 2006 3:44 PM
To: LazyDBA Discussion
Subject: RE: backup over server

Yes I am trying to do the same

Here is my script running on remote server Original file is drive W
(source) To be moved to drive D (destination)

How do I get the name of zip file same as the .bak file

C:\>"c:\winzip\WZZIP" "d:\Microsoft SQL Server\MSSQL\BACKUP\" -t -ee
w:\Microsoft SQL Server\MSSQL\BACKUP\*.bak"


2 question
Can you share your script?

Do you run 2 Database Maintenance plan to back up database ?

-----Original Message-----
From: Sheldon Jeff [mailto:[Email address protected]
Sent: Tuesday, January 31, 2006 3:24 PM
To: Jumma, Salim
Subject: RE: backup over server

**A LazyDBA.com subscriber has responded to your lazydba.com post**
**LazyDBA.com mail shield has forwarded you this email, **and removed
any attachments, and kept your email address secret **from this person,
and any viruses/trojans.
**If you reply to this email, the person will see your email address as
normal **Anything below this line is the original email text


Jumma,

Backing up to a remote server will crap out even using UNC path. When
the size of the file reaches a certain point you will receive a message
like 'Unable to apply /837483438.TRN or .BAK' the reason is that the
destination server 'times out' when the backup is occuring. (this is
the cliff note version of it)

What we do is backup files/trans logs to the same server (different
drive) and then run a script to zip up the files. Then send the files
to the remote server. On the remote server we then unzip the files then
continue to restore a database as you would if you didn't zip.

It has worked for us for over a year.....


Jeff

-----Original Message-----
From: Jumma Salim
[Email address protected]
Sent: Monday, January 30, 2006 10:32 AM
To: LazyDBA Discussion
Subject: backup over server

Can I make a backup plan to backup to a different server by mapping a
drive to database server say T drive



Mapped drive does not show when I make Maintenance plan?





If I do through query analyzer it will not do all step that I can easily
do in maintenance plan?





---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY Website :
http://www.LazyDBA.com To unsubscribe:
http://www.lazydba.com/unsubscribe.html





---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY Website :
http://www.LazyDBA.com To unsubscribe:
http://www.lazydba.com/unsubscribe.html


MS Sql Server LazyDBA home page