sql server数据库备份和恢复操作详解与命令(国外英文资料).doc
文本预览下载声明
sql server数据库备份和恢复操作详解与命令(国外英文资料)
Enterprise manager
- manage
- the SQL Server agent
right-right-click
New job
Enter the job name in the regular item
The step item
- new
Enter the step name in the step name
The type selects transact-sql script (TSQL)
The database selects the database to execute the command
-- command to enter the statement to execute:
Declare @ STRSQL varchar (1000).
Declare @ strdirname varchar (50)
Declare @ STRCMD varchar (50)
Declare @ strsend varchar (1000).
Declare @ strdate varchar (50)
The exec master.. Xp_cmdshell net use \ \ 192.168.0.151 \ d $Password/user: 192.168.0.151 \ administrator
Set @strsql = backup database new_his to disk = \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Set @strdirname = replace (convert (varchar (20), getdate (), 120), -, ) + 12
Set @strcmd = md \ \ 192.168.0.151 \ d $\ serverd Set @strcmd = @strcmd + @strdirname
The exec master.. Arbitrary @ STRCMD
- print @ STRSQL
Set @strsql = @strsql + @strdirname + \ new_hisbackup. Dat with init, nounload, noskip, noformat
- print @ STRSQL
The exec (@ STRSQL)
-- the IP address and the Shared directory are written, and the user changes the Password, and the Password must be correct
- make sure
-- scheduling items
New scheduling
The name is the input scheduling name
Select your job execution schedule in the scheduling type
If you choose repeat.
Click change to set your schedule
Then start the SQL Agent service and set it to start automatically, otherwise your job will not be executed
Set the method:
My computer, control panel, management tools, services, right-click SQL server - property - start type - select start automatically - sure.
A backup database
Open the SQL enterprise manager and click Microsoft SQL Server in the console root directory
The SQL Server group - double-click to open your Server - double-click to open the database directory
Select your database name (for example, BBS database Forum) - and then click on the tool in the menu above -
显示全部