91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

oracle備份策略

發布時間:2020-07-03 20:11:12 來源:網絡 閱讀:505 作者:viking714 欄目:關系型數據庫

RMAN>  CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
RMAN>  CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;
啟用控制文件自動備份及備份存放位置配置
RMAN> configure controlfile autobackup on;
查看配置信息
RMAN> show all;


-------------------------------------------------
--創建文件夾
$mkdir /home/oracle/backup
mkdir /home/oracle/backup/script
mkdir /home/oracle/backup/log
mkdir /home/oracle/backup/export

--備份目的地
mkdir /home/oracle/rman_backup

創建備份表空間

create tablespace rman_tbs datafile '/u01/app/oracle/oradata/orcl11g/rman_tbs01.dbf'
size 1024M autoextend on next 50M maxsize 10240M
extent management local segment space management auto;

創建備份用戶
create user rman identified by rman default tablespace rman_tbs temporary tablespace temp;


     grant connect,resource ,recovery_catalog_owner to rman;
SQL> grant unlimited tablespace to rman;
SQL> grant sysdba to rman;

 

rman catalog rman/rman
create catalog tablespace rman_tbs;
connect target sys/Oracle123@orcl11g
register database;
report schema;


-------------------------------------------------------

--倒出RMAN用戶數據腳本exp_rman.par (即備份catalog庫)


userid=rman/rman
file=/home/oracle/backup/export/rman.dmp
log=/home/oracle/backup/log/rman.log


-- 倒出RMAN數據SHELL腳本exp_rman.sh
#!/bin/bash
cd $HOME
. .bash_profile
cd $HOME/backup/script
exp parfile=exp_rman.par

--------------

---零級備份RMAN腳本level0_backup.rcv
connect catalog rman/rman
connect target sys/Oracle123@orcl11g
run { 
allocate channel d1 type disk;
allocate channel d2 type disk;
backup incremental level 0 database format '/home/oracle/rman_backup/level0_%d_%s_%p_%u.bak'
tag='level 0' include current controlfile;
sql 'alter system archive log current';
backup archivelog all format '/home/oracle/rman_backup/arc_%d_%s_%p_%u.bak' ;
release channel d2;
release channel d1;
}
crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete;
crosscheck archivelog all;
delete noprompt archivelog all completed before 'sysdate-15';
resync catalog;

--零級備份SHELL腳本的level0_backup.sh
#!/bin/bash
backtime=`date +"%y%m%d%H"`
#cd $HOME
. /home/oracle/.bash_profile
cd $HOME/backup/script
rman cmdfile=level0_backup.rcv msglog=$HOME/backup/log/level0_${backtime}.log
. /home/oracle/backup/script/exp_rman.sh

 

一級差異增量備份RMAN腳本 level1_backup.rcv
connect catalog rman/rman
connect target sys/Oracle123@orcl11g
run {
allocate channel d1 type disk;
backup incremental level 1 format '/home/oracle/rman_backup/level1_%d_%s_%p_%u.bak' tag = 'level 1'cumulative database;
sql 'alter system archive log current';
backup archivelog all format '/home/oracle/rman_backup/log_%d_%s_%p_%u.bak' ;
release channel d1;
}
crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete;
crosscheck archivelog all;
delete noprompt archivelog all completed before 'sysdate-15';
resync catalog;

--一級差異增量備份SHELL腳本level1_backup.sh

#!/bin/bash
backtime=`date +"%y%m%d%H"`
#cd $HOME
. /home/oracle/.bash_profile
cd /home/oracle/backup/script
rman cmdfile=level1_backup.rcv msglog=$HOME/backup/log/level1_${backtime}.log
. /home/oracle/backup/script/exp_rman.sh


linux下定時執行備份腳本

crontab -e -u oracle
SHELL=/bin/bash --以下腳本在bash下執行
MAILTO=oracle --執行日志以郵件形式郵給oracle用戶,可以/var/spool/mail/oracle下查收
5 12 * * 1 nohup /home/oracle/backup/script/level0_backup.sh >/home/oracle/backup/cron.log 2>&1 &
5 12 * * 3 /home/oracle/backup/script/level1_backup.sh
5 12 * * 5 /home/oracle/backup/script/level1_backup.sh

 

一周差異備份策略:
備份目標庫和catalog庫
周一0級全備,周三周五為1級。
每天12點5分開始備份

 

 

 

 

 

 

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

阳西县| 文登市| 莱西市| 墨玉县| 镇康县| 三亚市| 怀集县| 调兵山市| 全南县| 梨树县| 东乡族自治县| 麦盖提县| 宜兴市| 兴业县| 康乐县| 鸡东县| 阳信县| 武鸣县| 澄江县| 永福县| 嘉鱼县| 潮安县| 周宁县| 九江县| 卢龙县| 东乡县| 迁安市| 石嘴山市| 乐都县| 砚山县| 云霄县| 武乡县| 仙游县| 海城市| 蓬溪县| 常熟市| 文山县| 蒙阴县| 吉木萨尔县| 张掖市| 海伦市|