您好,登錄后才能下訂單哦!
管理部分
如果沒(méi)有啟用database force logging,則備庫(kù)對(duì)/*+ append */操作,nologging操作,會(huì)報(bào)壞塊;
建議表空間force logging或者database force logging;
--force logging /nologging 測(cè)試
alter database force logging; select force_logging from dba_tablespaces; select force_logging from v$database; alter tablespace test force logging; select logging,table_name,tablespace_name from user_tables where table_name ='TEST'; alter tablespace test no force logging; select tablespace_name,logging,force_logging from dba_tablespaces;
##配置主庫(kù)的歸檔刪除策略
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
--傳過(guò)去就刪除
CONFIGURE ARCHIVELOG DELETION POLICY TO SHIPPED TO STANDBY;
備庫(kù)刪除腳本
vi delete_archive.sh
#!/bin/sh source /home/oracle/.bash_profile export ORACLE_SID=standby TABLE='v$archived_log' $ORACLE_HOME/bin/sqlplus -silent "/ as sysdba" <<EOF set heading off; set pagesize 0; set term off; set feedback off; set linesize 199; set trims on ; set verif off; spool /home/oracle/scripts/del_arch.sh; select 'rm -rf '||name from v\$archived_log where DELETED='NO' and APPLIED='YES'; spool off; exit; EOF chmod +x /home/oracle/scripts/del_arch.sh sh /home/oracle/scripts/del_arch.sh rman target / <<EOF crosscheck archivelog all; delete noprompt expired archivelog all; exit; EOF
增加定時(shí)任務(wù):crontab -e
0 1 * * * su - oracle -c /home/oracle/scripts/delete_archive.sh 1
備庫(kù)自啟動(dòng)腳本:
vi /etc/rc.local
su - oracle -c /home/oracle/scripts/start_db.sh vi start_db.sh source /home/oracle/.bash_profile lsnrctl start export ORACLE_SID=standby sqlplus / as sysdba <<EOF startup; recover managed standby database using current logfile disconnect from session; exit
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。