In CentOS6.4 environment, the solution of backing up a user database at every night is implemented: using the scheduled task mechanism in linux, the command is crontab; using the exp tool to export the database
In the CentOS 6.4 environment, you can back up your database at every night. Solution: Use the scheduled task mechanism in linux and run the crontab command to export the database using the exp tool.
Objective: To back up a user database at every night in CentOS 6.4: Use the scheduled task mechanism in linux and run the crontab command to export the database using the exp tool; then, let crontab call exp regularly to implement automatic backup.
Steps:
1. log on with an oralce user --"
Compile the sh file -- oracle_backup.sh for backing up the Oracle database;
Content: su-oracle c "$ bin/exp $ username/$ password file = $ date_backup.dmp owner = $ user log = $ date_log"
Sh: rq = 'date + "% Y % m % d" 'of the dynamically spliced date "'
Create a folder for the above command
Mkdir backup_data; stores backup files
Mkdir back_log; stores logs.
After that, remember to grant the writable permission to the file: chmod 777 $ path/oracle_backup.sh
2. Use the root user to log on and execute the command --"
# Crontab-e
Content:
0 23 *** "$ path/oracle_back.sh" (minutes, days, months, and weeks)
This command generates a root file under/var/spool/cron with the input in the previous line.
3. check whether it is successful
Crontab-l allows you to view periodic tasks of the current user.
Crontab-r removes periodic tasks of the current user
Related reading:
Scheduled Oracle backup in Ubuntu 11.04
Implementation of regular Oracle Database Backup in Ubuntu
,