![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-11 19:21 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS批处理 & 脚本技术(批处理室) » Batch processing automatic database backup |
| Printable Version 1,436 / 14 |
| Floor1 sugarjh | Posted 2007-06-17 14:05 |
| 新手上路 Posts 7 Credits 14 | |
|
d:\data is the address of the database, e:\baksql\ is the address of the backup. Students who need to use it should change it themselves!
After each backup, it is automatically named with the backup time and written to the record file! If the important data can also be transferred to another FTP machine Create jh520.mmp under the C root and write the following code. Some things need to be changed by yourself! Dear seniors, take a look. Where can it be optimized? Please give some suggestions! |
|
| Floor2 joshualaw | Posted 2007-06-17 15:26 |
| 初级用户 Posts 62 Credits 132 | |
|
Here are several questions:
1》Is there a size limit for the mdf file? Suppose there are several gigabytes of data under D:\data, can it also be written into the MDF file. 2》Can the same file be used as a backup file? Only write the changed and added ones each time, and don't generate too many files. 3》When putting it on FTP, do you need to manually enter the username and password each time? If so, can it be made into an automatic way because I want to use "Task Manager" to complete it automatically. |
|
| Floor3 HAT | Posted 2007-06-17 16:22 |
| 版主 Posts 5,017 Credits 9,023 | |
|
//When putting it on the FTP, do you need to manually enter the username and password each time?
No, the username and password are placed in the jh520.mmp file. |
|
| Floor4 sugarjh | Posted 2007-06-17 21:09 |
| 新手上路 Posts 7 Credits 14 | |
|
Thanks!Senior brother's suggestion. Since I need to back up this mdf which is only 30M and it's on the server, I run it only once a month through task scheduling, which is relatively stable! I have modified the following and implemented a batch script to solve all problems!
|
|
| Floor5 sugarjh | Posted 2007-06-17 21:22 |
| 新手上路 Posts 7 Credits 14 | |
|
@echo@cls There is something wrong here!
|
|
| Floor6 ealton | Posted 2007-06-17 22:07 |
| 新手上路 Posts 1 Credits 2 | |
|
Learn and learn...
|
|
| Floor7 joshualaw | Posted 2007-06-18 14:26 |
| 初级用户 Posts 62 Credits 132 | |
|
What program can open .mdf, .ldf files, and what code is included in jh.exe
|
|
| Floor8 sugarjh | Posted 2007-06-19 21:58 |
| 新手上路 Posts 7 Credits 14 | |
|
.mdf, .ldf are for MSSQL databases
jh.exe can actually be opened with Notepad, it's not a WIN32 program at all I made it like this to prevent others from opening it! |
|
| Floor9 joshualaw | Posted 2007-06-19 23:47 |
| 初级用户 Posts 62 Credits 132 | |
|
.mdf, .ldf are for MSSQL databases.
jh.exe can actually be opened with Notepad; it's not a WIN32 program at all. I made it like this to prevent others from opening it! Can it be converted into common formats like ZIP, RAR? I still don't understand the meaning of this sentence. jh.exe can actually be opened with Notepad; it's not a WIN32 program at all. I made it like this to prevent others from opening it! |
|
| Floor10 sugarjh | Posted 2007-06-20 18:33 |
| 新手上路 Posts 7 Credits 14 | |
|
Of course it's okay to reply to the upstairs. It's just a problem of the file extension! If you change *.txt to *.rar and then open it with Notepad, you can still see the content inside the txt.
|
|
| Floor11 duanml | Posted 2007-06-20 19:02 |
| 中级用户 Posts 112 Credits 231 | |
|
Haha, when I was a network administrator in the past, I also did this kind of thing for recording backup times. But at that time, I was only given a few minutes, and the database was too large, about 1G per month, so there was no continuous saving function named by time.
Use the method of stopping operation to stop the reading and writing of the database file? Actually, you can use the backup tool of mssql itself~ |
|
| Floor12 zhaonimm | Posted 2007-06-20 19:06 |
| 新手上路 Posts 3 Credits 8 | |
|
Learned, thanks, expert!
|
|
| Floor13 sugarjh | Posted 2009-04-23 14:33 |
| 新手上路 Posts 7 Credits 14 | |
|
I've been writing batch scripts for 2 years, and the computer has been formatted N times. Fortunately, I found the old posts I posted online before!
|
|
| Floor14 sugarjh | Posted 2009-04-23 14:40 |
| 新手上路 Posts 7 Credits 14 | |
|
How to write with SQL Server's own backup tool?
|
|
| Floor15 yishanju | Posted 2009-04-23 14:45 |
| 银牌会员 Posts 1,357 Credits 1,488 | |
|
Just search for the usage of OSQL and SQLCMD.
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |