DG兼容列表:
創(chuàng)新互聯(lián)建站是專業(yè)的商河網(wǎng)站建設(shè)公司,商河接單;提供網(wǎng)站建設(shè)、成都做網(wǎng)站,網(wǎng)頁設(shè)計,網(wǎng)站設(shè)計,建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行商河網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊,希望更多企業(yè)前來合作!Data Guard Support for Heterogeneous Primary and Physical Standbys in Same Data Guard Configuration (Doc ID 413484.1)
DG在IBM和sun之間的異構(gòu)說明:
Using Oracle Data Guard between IBM AIX on Power systems and Oracle Solaris on SPARC systems (Doc ID 1982638.1)
簡單點說就是linux可以到windows/soloaris x64,IBM可以和solaris sparc異構(gòu),hp unix只能自己玩;
這里舉例linux x86_64 rac到單機之間的異構(gòu)部署。
一 檢查源端,打開歸檔
SQL>archive log list; #如果未打開,關(guān)閉數(shù)據(jù)庫 Shutdown immediate; #啟動至mount狀態(tài) Startup mount #開啟歸檔 SQL> alter database archivelog ; Database altered. #打開強制日志,不打開,使nologging選項時,備庫的表會報錯 SQL> alter database force logging; Database altered. SQL> alter database open; Database altered. #檢查 SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination /data/arch Oldest online log sequence 12 Next log sequence to archive 14 Current log sequence 14 SQL> select force_logging from v$database; FORCE --- YES二 更改參數(shù)
alter system set log_archive_config='DG_CONFIG=(db,standby)' scope=both; alter system set log_archive_dest='' scope=both; alter system set log_archive_dest_1='location=/data/arch' scope=spfile; --用歸檔傳輸 alter system set log_archive_dest_2='service=standby arch valid_for=(online_logfiles,primary_role) db_unique_name=standby' scope=spfile; --選在線日志傳輸,實時應(yīng)用 alter system set log_archive_dest_2='service=standby lgwr sync affirm valid_for=(online_logfiles,primary_role) db_unique_name=standby' scope=both; SQL> alter system set log_archive_max_processes=4 scope=both; SQL> alter system set fal_server=standby scope=both; SQL> alter system set fal_client=db scope=both; SQL> alter system set standby_file_management=auto scope=both; SQL> alter system set db_file_name_convert='+data','/data' scope=spfile; SQL> alter system set log_file_name_convert='+data','/data' scope=spfile; Sql>alter system set db_unique_name=db scope=spfile; #先不啟用 SQL>alter system set log_archive_dest_state_2=defer;三 配置tnsnames
服務(wù)端$ORACLE_HOME/network/admin/tnsnames.ora
standby = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.84.17)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = standby) ) )四 備份主庫:
rman "target / nocatalog" run{ configure default device type to disk; configure device type disk parallelism 1; backup as compressed backupset database format '/home/oracle/full_%s_%p_%T.bak' TAG fullbak_fordg; }五 創(chuàng)建standby controlfile:
創(chuàng)建standby controlfile:
SQL> alter database create standby controlfile as '/home/oracle/standby.ctl';六 創(chuàng)建pfile
create pfile='/data/backup/pfile.ora' from spfile;
主要修改db_unique_name
Fal_server
Fal_client
參考如下:
*.audit_file_dest='/opt/db/adump' *.audit_trail='none' *.cluster_database=false *.compatible='11.2.0.4.0' *.db_file_name_convert='+DATA','/data' *.log_file_name_convert='+DATA','/data' *.control_files='/u01/data/ctl_01.ctl' *.log_archive_config='DG_CONFIG=(db,standby)' *.db_block_size=8192 *.db_create_file_dest='/data' *.db_domain='' *.db_files=200 *.db_name='db' *.db_unique_name='standby' *.db_recovery_file_dest_size=53477376000 *.db_recovery_file_dest='' *.deferred_segment_creation=FALSE *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=TCIS30XDB)' *.log_archive_dest_1='location=/data/arch valid_for=(all_logfiles,all_roles) db_unique_name=standby' *.open_cursors=100 *.pga_aggregate_target=50MB *.processes=100 *.remote_login_passwordfile='exclusive' *.sessions=150 *.sga_target=100MB *.undo_tablespace='UNDOTBS1' *.fal_server=db七 創(chuàng)建密鑰文件
orapwd file=orapw$ORACLE_SID password=oracle八 創(chuàng)建備庫 listener.ora
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /opt/product/11.2) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = standby) (ORACLE_HOME = /opt/product/11.2) (SID_NAME = sid_name) ) )9 備機創(chuàng)建目錄
mkdir /data/arch
mkdir /data/dg1
mkdir –p /u01/app/oracle/admin/standby/adump
更改~/.bash_profile
Export ORACLE_SID=standby
10啟動及恢復(fù)
cp standby.ctl /data/standby/ctl01.ctl SQL> startup nomount; SQL> alter database mount standby database; rman target / catalog start with '/home/oracle/backup'; Restore database; SQL>recover managed standby database disconnect from session;11 備庫添加standby log file;
alter database recover managed standby database cancel alter database add standby logfile thread 1 group 10 '+data(flashfile)' size 50m; alter database add standby logfile thread 1 group 11 '+data(flashfile)' size 50m; alter database add standby logfile thread 2 group 12 '+data(flashfile)' size 50m; alter database add standby logfile thread 2 group 13 '+data(flashfile)' size 50m; alter database add standby logfile group 14 '/u01/data/standbyredo09.log' size 50m;#主庫啟用日志傳送
SQL>alter system set log_archive_dest_state_2=enabled;#模式為大可用
SQL>alter database set standby database to maximize availability; alter database recover managed standby database cancel; alter database open; alter database recover managed standby database using current logfile disconnect from session;12 檢查
select process,client_process,sequence#,status from v$managed_standby; col current_scn for 999999999999; select protection_mode,database_role,open_mode,current_scn from v$database col name for a50 ; col sequence# for 9999999; select name,sequence#,to_char(completion_time,'yyyy-mm-dd hh34:mi:ss') from v$archived_log order by 2; SELECT PROCESS, STATUS, THREAD#, SEQUENCE#, BLOCK#, BLOCKS FROM V$MANAGED_STANDBY; --主庫查詢 select sequence#,status from v$Log; col value for a30; col name for a13; col unit for a30; select name,value,unit,time_computed from v$dataguard_stats; SELECT * FROM V$STANDBY_EVENT_HISTOGRAM WHERE NAME = 'apply lag' AND COUNT > 0; col checkpoint_change# for 99999999999999; select name,checkpoint_change# from v$datafile; select name,checkpoint_change# from v$datafile_header; SELECT DBID, NAME, TO_CHAR(CREATED, 'DD-MON-YYYY HH24:MI:SS') CREATED, OPEN_MODE, LOG_MODE, TO_CHAR(CHECKPOINT_CHANGE#, '999999999999999') AS CHECKPOINT_CHANGE#, CONTROLFILE_TYPE, TO_CHAR(CONTROLFILE_CHANGE#, '999999999999999') AS CONTROLFILE_CHANGE#, TO_CHAR(CONTROLFILE_TIME, 'DD-MON-YYYY HH24:MI:SS') CONTROLFILE_TIME, TO_CHAR(RESETLOGS_CHANGE#, '999999999999999') AS RESETLOGS_CHANGE#, TO_CHAR(RESETLOGS_TIME, 'DD-MON-YYYY HH24:MI:SS') RESETLOGS_TIME FROM V$DATABASE; --sofar 單位為KBselect * from v$recovery_progress; --檢查歸檔應(yīng)用情況 col name for a50 ; col sequence# for 9999999; select name,sequence#,to_char(completion_time,'yyyy-mm-dd hh34:mi:ss') from v$archived_log order by 2; SELECT PROCESS, STATUS, THREAD#, SEQUENCE#, BLOCK#, BLOCKS FROM V$MANAGED_STANDBY; select thread#,max(sequence#) maxseq from gv$archived_log group by thread# order by thread#; select * from v$archive_gap; --檢查net_timeout的適當(dāng)值 select frequency,duration from v$redo_dest_resp_histogram where dest_id=2 and frequency>1; select recovery_mode from v$archive_dest_status where dest_id=2;另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。