Linux ORCLE數(shù)據(jù)庫增量備份腳本建站知識(shí)
導(dǎo)讀:1建站知識(shí)Linux下ORCLE數(shù)據(jù)庫增量備份腳本 (基礎(chǔ)篇) ,需要的朋友可以參考下。網(wǎng)站seo優(yōu)化診斷工具網(wǎng)站建設(shè)制作。
ORCLE數(shù)據(jù)庫備份策略 1.通過使用exp和imp命令實(shí)現(xiàn)數(shù)據(jù)庫導(dǎo)出和導(dǎo)入。 有三種模式: a. 用戶模式: 導(dǎo)出(導(dǎo)入)用戶所有對象以及對象中的數(shù)據(jù); b. 表模式: 導(dǎo)出(導(dǎo)入)用戶所有表或者指定的表; c. 整個(gè)數(shù)據(jù)庫: 導(dǎo)出(導(dǎo)入)數(shù)據(jù)庫中所有對象。 如: 普通導(dǎo)出 a.導(dǎo)出一個(gè)完整數(shù)據(jù)庫 exp system/manager file=f.dmp full=y b.導(dǎo)出數(shù)據(jù)庫定義而不導(dǎo)出數(shù)據(jù) exp system/manager file=f.dmp full=y rows=n 普通導(dǎo)入: a.完全導(dǎo)入 imp system/manager file=f.dmp full=y b.數(shù)據(jù)庫結(jié)構(gòu)存在時(shí),只導(dǎo)入數(shù)據(jù) imp system/manager file=f.dmp full=yseo網(wǎng)站優(yōu)化培訓(xùn) ignore=y 2.每周進(jìn)行數(shù)據(jù)庫備份,以防數(shù)據(jù)庫被意外破壞后恢復(fù)數(shù)據(jù) 安排如下: 周一: 完全備份(f1) exp xxx/xxx inctype=complete file=f1.dmp 周二: 增量備份(f2) exp xxx/xxx inctype=incremental file=f2.dmp 周三: 增量備份(f3) exp xxx/xxx inctype=incremental file=f3.dmp 周四: 增量備份(f4) exp xxx/xxx inctype=incremental file=f4.dmp 周五: 累積備份(f5) exp xxx/xxx inctype=cumulative file=f5.dmp 周六: 增量備份(f6) exp xxx/xxx inctype=incremental file=f6.dmp 周日: 增量備份(f7) exp xxx/xxx inctype=incremental file=f7.dmp 比如數(shù)據(jù)庫在周日被破壞,則可用以下方式恢復(fù): 1.創(chuàng)建網(wǎng)站建設(shè)公司空的數(shù)據(jù)庫,同之前的結(jié)構(gòu)。 2.imp xxx/xxx inctype=RESTORE FULL=y FILE=f1.dmp 3.imp xxx/xxx inctype=RESTORE FULL=y FILE=f5.dmp 4.imp xxx/xxx inctype=RESTORE FULL=y FILE=f6.dmp 說明: 完全導(dǎo)出:對整個(gè)數(shù)據(jù)庫的備份 增量導(dǎo)出:是備份上一次完全導(dǎo)出后改變的數(shù)據(jù)。 累積導(dǎo)出:是備份自上次完全導(dǎo)出后改變的數(shù)據(jù)。 EXAMPLE:LINUX下備份數(shù)據(jù)庫 BACKUP_DIR=/home/oracle/backups if [ ! -d $BACKUP_DIR ]; then mkdir -p $BACKUP_DIR fi DAYS=(Sun Mon Tue Wed Thu Fri Sat) #創(chuàng)建數(shù)組 TYPES=(incremental complete incremental incremental incremental cumulative incremental) day=`date +%w` #取得本周天數(shù),0代表周日,1代表周一 DAY_NAME=${DAYS[$day]} #取得數(shù)組的網(wǎng)站推廣優(yōu)化seo值 TYPE=${TYPES[$day]} DATE_NAME=`date +%F` FILE_NAME=${DATE_NAME}-${DAY_NAME}-${TYPE}.dmp #2008-12-8-Mon-complete.dmp exp xxx/xxx inctype=$TYPE file=${BACKUP_DIR}/${FILE_NAME} > /dev/null gzip ${BACKUP_DIR}/${FILE_NAME} find $BACKUP_DIR -mtime +7 -delete #刪除七天前更改過的文件相關(guān)網(wǎng)站seo優(yōu)化診斷工具網(wǎng)站建設(shè)制作。
聲明: 本文由我的SEOUC技術(shù)文章主頁發(fā)布于:2023-05-23 ,文章Linux ORCLE數(shù)據(jù)庫增量備份腳本建站知識(shí)主要講述增量,腳本,Linux網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請保留鏈接: http://www.bifwcx.com/article/web_5423.html
為你推薦與Linux ORCLE數(shù)據(jù)庫增量備份腳本建站知識(shí)相關(guān)的文章
-
通王TWCMS 2.0.3網(wǎng)站模板程序下載
(126)人喜歡 2024-01-15 -
Windows官方原版在哪里下載
(175)人喜歡 2024-01-15 -
WordPress網(wǎng)站模板發(fā)帖標(biāo)題顏色設(shè)置
(131)人喜歡 2024-01-07 -
修改discuz論壇帖子標(biāo)題80字符的長度限制
(249)人喜歡 2024-01-07 -
wordpress程序調(diào)用不帶超鏈接的Tag標(biāo)簽
(234)人喜歡 2024-01-05 -
網(wǎng)站在不同時(shí)期需調(diào)整內(nèi)容更新的方向
(112)人喜歡 2023-08-12