신문지한장

expdp crontab 설정 본문

Oracle/Backup&Recovery

expdp crontab 설정

신문지한장 2024. 4. 4. 07:42

- expdp 스크립트 작성

[test11]dbtest:/oracle/app/oracle/product/11.2.0.4/truin> :vi crontab.sh
#!/bin/bash

export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0.4
export ORACLE_SID=test11
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH

# backup date
DATE=`date '+%Y%m%d'`

# backup destination
DMPFILE=${DATE}_table.dmp
LOGFILE=${DATE}_table.log

expdp scott/1234 directory=datapump dumpfile=${DMPFILE} logfile=${LOGFILE} tables=emp

 

2. 스크립트 권한 부여

[test11]dbtest:/oracle/app/oracle/product/11.2.0.4/truin> :chmod 775 crontab.sh

 

3-1. crontab 설정 (oracle os 유저) - 새벽 1시 수행

[test11]dbtest:/oracle/app/oracle/product/11.2.0.4/truin> :crontab -e

0 1 * * * /oracle/app/oracle/product/11.2.0.4/truin/crontab.sh

 

3-2. crontab 설정 (root os 유저) - 새벽 1시 수행

0 1 * * * su - oracle -c /oracle/app/oracle/product/11.2.0.4/truin/crontab.sh

'Oracle > Backup&Recovery' 카테고리의 다른 글

[B&R] oracle LOGMINER (11g 이하)  (0) 2024.05.10
[B&R] oracle Migration [ 11g to 19c (PDB) ]  (0) 2024.05.10
[B&R] oracle RMAN  (0) 2024.05.10
[B&R] oracle CSScan  (0) 2024.05.10
[B&R] oracle parameter file 손실  (4) 2024.01.04