1. Overview
In general, we often useOracleDatabaseExportThe tool regularly backs up the database. For commonExpBackup, whether it is a full backup database, a slave database, or a single backup table, the command is relatively simple.
The following describes how to regularly back up a partition in a partition table every day.
2. Environment Description
Hardware environment:IBMP570
Operating System: AIX5.3
Database Version: Oracle9.2.0.6
Business scenario: the t_sms table in the database contains all the historical data (about 700 million messages per day) sent by SMS every day. Due to the large data volume and the need for query, therefore, a partition is created based on the day of the month (one partition per day, for example, P01_01 represents the data for the first day of the month) (t_sms Script :)
Backup requirements: million data is stored in one table every day, resulting in a huge amount of data in this table, which is prone to index failure and other side effects. Therefore, we decided to migrate the historical data of this table, the migration policy is to retain the data from the day before yesterday to the current table, and migrate other data to the historical archive database. If necessary, you can directly connect to the archive database for text message data query. In this way, the data volume of the t_sms table can be reduced, and the query data can be migrated to the archive database to reduce the load on the production database.
3. Backup Policy
1. Execute the exp script using crontab at every day to generate the dmp file for the data in the partition the day before yesterday;
2., ftp to archive
3. At, the archive database executes the imp script to import the archive data.
4. Procedure
1. log on to the minicomputer as an Oracle user;
2. Copy the exp. sh script to the minicomputer/sms directory.
3. chmod 755/sms/exp. sh
4. run crontab-e and enter 30 00 ***/sms/exp. sh.
5. Create an ftp user
6. Set automatic tasks on the archive database, regularly download dmp files from ftp to the minicomputer, and import imp to the archive database.
- 2 pages in total:
- Previous Page
- 1
- 2
- Next Page