Unsolved
This post is more than 5 years old
4 Posts
0
875
February 22nd, 2007 22:00
SQL backup script
Hi ,
does anyone have a script to backup SQL thru RMSE to networker ?
does anyone have a script to backup SQL thru RMSE to networker ?
No Events found!



bijuashram
4 Posts
0
February 22nd, 2007 23:00
amediratta
2 Intern
•
2K Posts
0
February 22nd, 2007 23:00
JamesBEMC
257 Posts
0
March 6th, 2007 10:00
Depends, if you want to backup the database as a ;
Filesystem backup,
post mount script and add your backup script there
SQL backup,
You will need a post mount script to bring the SQL database online (attach) (I supply below) and then issue a full (cannot do incrementals) VDI SQL backup to tape via your Networker
See EMC KB solution emc87448 for more. Please extensively test this in a controlled manner, this a sample script and cannot be guarenteed to work in ALL environments.
Regards
James.
RM/SE does not provide a native "attach" client functionality within the Client/Server software. In order to mount & start a database on a mount host as part of a job, it is necessary to use a post script.
The first step is to create a script that will use the "sp_attach_db" stored procedure on the mount host. The syntax for this command is:
sp_attach_db [ @dbname = ] 'dbname'
, [ @filename1 = ] 'filename_n' [ ,...16 ]
So, create a file called "attach_db.sql". In this example, I am attaching a database called "ERM_Test". The first filename is the location of the MDF file that I have mounted, the second filename is the location of the first LDF file I have mounted:
sp_attach_db @dbname = 'ERM_test',
@filename1 = 'J:\Data\ERM_test_Data.MDF',
@filename2 = 'J:\Log\ERM_test_Log01_log.LDF'
The second step is to call the script from the mount job. In the Post Mount script path add the following entry (using the above as an example it would look like this):
C:\"Program Files"\"Microsoft SQL Server"\80\Tools\Binn\osql -E -S Win2003 -i G:\scripts\attach_db.sql -n
The "-S Win2003" is the SQL Server Name, alter this to be the SQL server you are mounting to. The script will be called via "osql".
For scripting a "detach" of the database, the following script can be used. In this example it is called "detach_db.sql":
sp_detach_db @dbname = 'ERM_test',
@skipchecks = 'true'
Then call the script:
C:\"Program Files"\"Microsoft SQL Server"\80\Tools\Binn\osql -E -S Win2003 -i G:\scripts\detach_db.sql -n