DB2 automatic database backup-(DB2 task center configuration)

Source: Internet
Author: User

DB2 database automatic backup explanation-(DB2 task center is configured) 1) ensure that your DB2 database is installed and runs properly 2) Start-> Run, enter the command db2cmd, open a new db2 command window: in the "command window" of DB2, execute the following statement to create a backup and run the database db2 create tools catalog cc create new database toolsdb to create a database named toolsdb to store task information. 3) open the "task Center" window, for example, 4) create a task

Note that for "type" and "DB2 instance and partition", enter the Script: backup database JM_DAJ online to "D: \ DB2_BAK "WITH 2 buffers buffer 1024 PARALLELISM 1 compress include logs without prompting; this means to COMPRESS the database JM_DAJ and back it up to the D: \ DB2_BAK directory (premise: D: \ DB2_BAK directory already exists) then go to the "Schedule" tab page to add a time start point and select "reschedule". Note that the "RunTime permission" should also be filled in, generally administrator, the password is the password used to log on to the windows system, and then you can click "OK" to go To the DB2 Automatic Backup Settings, which are backed up once a day, to "D: \ DB2_BAK "directory to find the backup file. 5) delete a database when database backup increases day by day, the hard disk capacity will become smaller and smaller until the hard disk space is full, and automatic backup cannot be performed at this time. Therefore, we must delete redundant database backup files within a certain period of time. Create a bat file in the root directory of the C drive, such as db2autodel. bat, content: C: \ WINDOWS \ system32 \ forfiles/p D: \ DB2_BAK/m *. */d-7/c "cmd/c del @ file". In this way, files in the D: \ DB2_BAK directory will be retained for seven days to create a new task plan: browse and find the db2autodel created in the C root directory. execute this task on a daily basis in the bat file, click Next: select the start time, and click Next: Click Finish. The system displays the information you set, redundant historical database backup files are automatically deleted every day. Since then, the automatic backup and timed clearing of the DB2 database have been completed. For Scheduled Backup of oa files, we can also create a bat file to complete: (this command needs to call WinRAR, please ensure that the system has installed WinRAR software) cd C: \ Program Files \ WinRARwinrar a-r-ibck-y d: \ DB2_BAK \ % date :~ 4,102.16.rar e: \ DAJ_OA \ Tomcat5.0 \ jmoa \*. * It means to compress the oa package file and store it in the d: \ DB2_BAK directory. In this example, E: \ DAJ_OA \ atat5.0 \ jmoa is the oa package directory, the directories of different units may be different. Please modify the directory according to the actual path and add the bat file to the scheduled task to complete automatic backup of the oa file. If the server is inserted with a mobile hard disk, you can create a new bat file to regularly copy the automatically backed up file to the mobile hard disk: xcopy d: \ db2_bak F: \ db2_bak/s/I/y means to copy the files in d: \ db2_bak to F: \ db2_bak and add the bat file to the scheduled task.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.