Recently, you need to regularly back up Oracle databases in Ubuntu using cron. The specific steps are as follows:
1. Configure the environment variable/home/oracle/. profile for oracle users.
# For oracle
Export ORACLE_HOME =/opt/ora10
Export ORACLE_SID = orcl
Export ORACLE_OWNER = oracle
Export PATH = $ PATH: $ ORACLE_HOME/bin
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/lib32:/usr/lib
Export DISABLE_HUGETLBFS = 1
Export NLS_LANG = AMERICAN_AMERICA.ZHS16GBK
2. Write the data export script to expdb. sh.
Source/home/oracle/. profile
Exp xx/xx file =/usr/local/aaa. dmp
Grant script authorization
Chmod 777 expdb. sh
3. Write the scheduled task crontab-u oracle-e
00 17 ** 1-5/usr/local/cjd/expdb. sh # indicates that the instance runs at every day from Monday to Friday.
4. view the scheduled task of this user
Crontab-u-l
5. Everything is finished.