Oracle程序备份

 --使用root用户备份
su - root
mkdir -p /oracle/data_dump/backup_soft
nohup tar -cvf /oracle/data_dump/backup_soft/oracle_`date +\%Y\%m\%d`.tar /oracle/app/oracle >/oracle/data_dump/backup_soft/oracle.tar.log &
nohup tar -cvf /oracle/data_dump/backup_soft/12.1.0_`date +\%Y\%m\%d`.tar /oracle/app/12.1. >/oracle/data_dump/backup_soft/12.1..tar.log &
nohup tar -cvf /oracle/data_dump/backup_soft/grid_`date +\%Y\%m\%d`.tar /oracle/app/grid >/oracle/data_dump/backup_soft/grid.tar.log &
nohup tar -cvf /oracle/data_dump/backup_soft/oraInventory_`date +\%Y\%m\%d`.tar /oracle/app/oraInventory >/oracle/data_dump/backup_soft/oraInventory.tar.log &
nohup tar -cvf /oracle/data_dump/backup_soft/etc_`date +\%Y\%m\%d`.tar /etc >/oracle/data_dump/backup_soft/etc.tar.log &
--当前数据库程序目录
drwxrwxrwx grid oinstall Jul : 12.1.
drwxrwxrwx grid oinstall Jul : grid
drwxrwxrwx grid oinstall Jul : oraInventory
drwxrwxrwx oracle oinstall Jul : oracle --修改程序目录名
su - root
mv 12.1. 12.1.0_20180727
mv grid grid_20180727
mv oraInventory oraInventory_20180727
mv oracle oracle_20180727 --解压备份的程序文件,解压后权限都在,直接启集群即可(AIX环境会解压到原路径,Linux则不会解压到原路径!)
tar -xvf /oracle/data_dump/backup_soft/oracle.tar
tar -xvf /oracle/data_dump/backup_soft/12.1..tar
tar -xvf /oracle/data_dump/backup_soft/grid.tar
tar -xvf /oracle/data_dump/backup_soft/oraInventory.tar

mkdir -p /data/backup_soft

nohup tar -cvf /data/backup_soft/`date +\%Y\%m\%d`_oracle.tar            /oracle/app/oracle            >/data/backup_soft/`date +\%Y\%m\%d`_oracle.tar.log &

nohup tar -cvf /data/backup_soft/`date +\%Y\%m\%d`_12.2.0.tar            /oracle/app/12.2.0            >/data/backup_soft/`date +\%Y\%m\%d`_12.2.0.tar.log &

nohup tar -cvf /data/backup_soft/`date +\%Y\%m\%d`_grid.tar              /oracle/app/grid              >/data/backup_soft/`date +\%Y\%m\%d`_grid.tar.log &

nohup tar -cvf /data/backup_soft/`date +\%Y\%m\%d`_oraInventory.tar      /oracle/app/oraInventory      >/data/backup_soft/`date +\%Y\%m\%d`_oraInventory.tar.log &

nohup tar -cvf /data/backup_soft/`date +\%Y\%m\%d`_etc.tar               /etc                          >/data/backup_soft/`date +\%Y\%m\%d`_etc.tar.log &

上一篇:[转]gitlab cicd (二)系列之安装git-runner rpm安装方式


下一篇:php curl post