本篇內(nèi)容介紹了“怎么部署Oracle19c dataguard”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠?qū)W有所成!
成都創(chuàng)新互聯(lián)公司專注于涼山州企業(yè)網(wǎng)站建設,響應式網(wǎng)站,商城建設。涼山州網(wǎng)站建設公司,為涼山州等地區(qū)提供建站服務。全流程按需制作,專業(yè)設計,全程項目跟蹤,成都創(chuàng)新互聯(lián)公司專業(yè)和態(tài)度為您提供的服務
oracle19c
通過自動將還原點從主節(jié)點復制到備用節(jié)點,簡化了將物理備用節(jié)點閃回在主節(jié)點上捕獲的時間點的過程.
在主數(shù)據(jù)庫上執(zhí)行閃回或時間點恢復時,處于mount模式的備用數(shù)據(jù)庫可以自動遵循在主數(shù)據(jù)庫上執(zhí)行的相同恢復過程
可以在活動數(shù)據(jù)防護備用數(shù)據(jù)庫上同時啟用 Oracle 數(shù)據(jù)庫內(nèi)存列存儲和數(shù)據(jù)保護多實例重做應用。
DML操作可以在活動數(shù)據(jù)保護備用實例上執(zhí)行。當在ADG備用數(shù)據(jù)庫上運行無效的PL/SQL對象時,該對象將自動重新編譯。
Fast-Start-Failover (FSFO) 新特性.主庫掛了,備庫快速啟動
oracle18c
在角色更改期間,數(shù)據(jù)庫緩沖區(qū)緩存狀態(tài)現(xiàn)在保持在Oracle活動數(shù)據(jù)保護備用服務器上
現(xiàn)在可以在Oracle Active Data Guard備用數(shù)據(jù)庫上動態(tài)創(chuàng)建全局臨時表.
一個新的初始化參數(shù)ADG_ACCOUNT_INFO_TRACKING擴展了對用戶帳戶安全的控制,以防止登錄攻擊跨生產(chǎn)數(shù)據(jù)庫和所有Oracle活動數(shù)據(jù)保護備用數(shù)據(jù)庫。參見Oracle數(shù)據(jù)庫參考
一個新的視圖V$DATAGUARD_PROCESS(替代V$MANAGED_STANDBY)提供了可查詢的信息,以驗證重做是否從主數(shù)據(jù)庫傳輸并應用于備用數(shù)據(jù)庫.
私有臨時表(也稱為本地臨時表)的元數(shù)據(jù)可以存儲在內(nèi)存中。這允許在只讀數(shù)據(jù)庫上啟用專用臨時表,從而允許報表應用程序在Oracle活動數(shù)據(jù)保護備用數(shù)據(jù)庫上運行。
數(shù)據(jù)庫取消記錄已擴展為兩種新模式:用于負載性能的備庫Nologging和用于數(shù)據(jù)可用性的Standby Nologging。這些模式為在Oracle活動數(shù)據(jù)保護環(huán)境中使用提供了更好的支持,而不會顯著增加生成的重做量
現(xiàn)在可以使用一個RMAN命令RECOVER standby database通過網(wǎng)絡刷新備用數(shù)據(jù)庫。
對使用DBMS_ROLLING PL/SQL包執(zhí)行的升級的Data Guard代理支持進行了增強。
多實例重做應用現(xiàn)在支持塊更改跟蹤
select name,log_mode,force_logging from gv$database; alter database force logging;
從Oracle Database 18c開始,引入了以下兩個新的nologging子句,它們可以執(zhí)行非日志記錄操作,同時可以使Active Data Guard備用數(shù)據(jù)庫接收到所有數(shù)據(jù),從而防止FORCE 方式生成大量重做日志導致性能下降。
ALTER DATABASE SET STANDBY NOLOGGING FOR DATA AVAILABILITY; —模式使批量加載操作通過其自身與備用數(shù)據(jù)庫的連接將加載的數(shù)據(jù)發(fā)送到每個備用數(shù)據(jù)庫。提交會延遲,直到所有Active Data Guard備用數(shù)據(jù)庫通過 recover 方式將數(shù)據(jù)應用完成。
ALTER DATABASE SET STANDBY NOLOGGING FOR LOAD PERFORMANCE;
—模式與先前的模式類似,不同之處在于,如果網(wǎng)絡無法跟上數(shù)據(jù)加載到主數(shù)據(jù)庫的速度,則加載過程可以停止將數(shù)據(jù)發(fā)送到備用數(shù)據(jù)庫。在此模式下,備用數(shù)據(jù)庫可能缺少數(shù)據(jù),但每個Active Data Guard備用數(shù)據(jù)庫都會在recover過程中自動從主數(shù)據(jù)庫中提取數(shù)據(jù)。
show parameter db_unique_name ALTER SYSTEM SET LOG_ARCHIVE_CONFIG='DG_CONFIG=(mydb19c,mydbdg)' SID='*'; ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=mydb19c' SID='*'; ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=mydbdg LGWR ASYNC REOPEN NET_TIMEOUT=300 VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) DB_UNIQUE_NAME=mydbdg' SID='*'; alter system set LOG_ARCHIVE_DEST_STATE_1=enable; alter system set LOG_ARCHIVE_DEST_STATE_2=enable; ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT =AUTO SID='*'; ALTER SYSTEM SET FAL_SERVER='MYDBDG' SID='*'; alter system set DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/MYDBDG','/u01/app/oracle/oradata/MYDB19C','/u01/app/oracle/oradata/MYDBDG','/u01/app/oracle/oradata/mypdb' scope=spfile; alter system set LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/MYDBDG','/u01/app/oracle/oradata/MYDB19C' scope=spfile; ALTER SYSTEM SET LOG_ARCHIVE_FORMAT='%t_%s_%r.arc' SCOPE=SPFILE; ALTER SYSTEM SET LOG_ARCHIVE_MAX_PROCESSES=30;
select group#,thread#,bytes/1024/1024,members from v$log; col member for a50 select group#,member from v$logfile alter database add standby logfile group 4 ('/u01/app/oracle/oradata/MYDB19C/stdbredo1.log') size 200m; alter database add standby logfile group 5 ('/u01/app/oracle/oradata/MYDB19C/stdbredo2.log') size 200m; alter database add standby logfile group 6 ('/u01/app/oracle/oradata/MYDB19C/stdbredo3.log') size 200m; alter database add standby logfile group 7 ('/u01/app/oracle/oradata/MYDB19C/stdbredo4.log') size 200m; --查看standby log select group#,thread#,bytes/1024/1024,status from v$standby_log;
--primary and standby --vi $ORACLE_HOME/network/admin/tnsnames.ora MYDB19C = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.80.216)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = mydb19c) (UR = A) ) ) MYDBDG = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.80.217)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = mydbdg) (UR = A) ) ) --standby vi $ORACLE_HOME/network/admin/listener.ora SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = mydbdg) (ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1) (SID_NAME = mydbdg) ) )
create user c##dgmima identified by dgmima2019; grant sysoper to c##dgmima; alter system set redo_transport_user=c##dgmima sid='*';
create pfile='/home/oracle/pfile2020.ora' from spfile; scp /home/oracle/pfile2020.ora 192.168.80.217:/home/oracle scp $ORACLE_HOME/dbs/orapwmydb19c 192.168.80.217:/u01/app/oracle/product/19.0.0/dbhome_1/dbs/orapwmydbdg
*.audit_file_dest='/u01/app/oracle/admin/mydbdg/adump' *.audit_trail='none' *.compatible='19.0.0' *.control_files='/u01/app/oracle/oradata/MYDBDG/control01.ctl','/u01/app/oracle/oradata/MYDBDG/control02.ctl' *.db_block_size=8192 *.db_file_name_convert='/u01/app/oracle/oradata/MYDB19C','/u01/app/oracle/oradata/MYDBDG','/u01/app/oracle/oradata/mypdb','/u01/app/oracle/oradata/MYDBDG' *.db_files=200 *.db_name='MYDB19C' *.db_unique_name='MYDBDG' *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=mydbdgXDB)' *.enable_pluggable_database=true *.fal_server='MYDB19C' *.local_listener='' *.log_archive_config='DG_CONFIG=(mydb19c,mydbdg)' *.log_archive_dest_1='LOCATION=/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=mydbdg' *.log_archive_dest_2='SERVICE=mydb19c LGWR ASYNC REOPEN NET_TIMEOUT=300 VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) DB_UNIQUE_NAME=mydb19c' *.log_archive_dest_state_1='ENABLE' *.log_archive_dest_state_2='ENABLE' *.log_archive_format='%t_%s_%r.arc' *.log_archive_max_processes=30 *.log_file_name_convert='/u01/app/oracle/oradata/MYDB19C','/u01/app/oracle/oradata/MYDBDG' *.nls_language='AMERICAN' *.nls_territory='AMERICA' *.open_cursors=300 *.pga_aggregate_target=200m *.processes=300 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=1178m *.standby_file_management='AUTO' *.undo_tablespace='UNDOTBS1'
mkdir -p /u01/app/oracle/admin/mydbdg/adump mkdir -p /u01/app/oracle/oradata/MYDBDG
export ORACLE_SID=mydbdg create spfile from pfile='/home/oracle/pfile2020.ora'; startup nomount;
rman target sys/oracle@mydb19c auxiliary sys/oracle@mydbdg run { allocate channel prmy1 type disk; allocate channel prmy2 type disk; allocate channel prmy3 type disk; allocate channel prmy4 type disk; allocate auxiliary channel stby1 type disk; allocate auxiliary channel stby2 type disk; allocate auxiliary channel stby3 type disk; allocate auxiliary channel stby4 type disk; duplicate target database for standby from active database nofilenamecheck; }
--備端啟動恢復進程mrp0 alter database recover managed standby database using current logfile disconnect from session; --備端查詢是否有mrp0進程 select name,pid,role,action,group#,thread#,sequence#,delay_mins from v$dataguard_process; --切換主庫歸檔,觀察備庫歸檔日志同步是否正常。 alter system archive log current; --關閉介質(zhì)恢復的方法: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; --啟動數(shù)據(jù)庫 alter database open; alter pluggable database all open;
--注意,備庫如果不提交,主庫及其他備庫無法查看,備庫可以查看。提交后都可以查看 ALTER SESSION ENABLE ADG_REDIRECT_DML; --系統(tǒng)級別 alter system ENABLE ADG_REDIRECT_DML;
克隆數(shù)據(jù)庫必須為只讀模式
遠程克隆參考:
create database linkconnect to system identified by xxxxxxxx using ' '; alter systm set STANDBY_PDB_SOURCE_FILE_DBLINK='db_link'; alter pluggable database open read only; create pluggable database from @ ;
--裝載,必須使用xml方式,參數(shù)才生效 --其他庫卸載 alter pluggable databaseunplug into '/home/oracle/ / .xml'; backup as copy pluggable database format '/backup/ '; --備庫,設置以下參數(shù),備端設置路徑與主端原有文件一致 alter system set standby_pdb_source_file_directory='/backup/ '; --主庫 create pluggable database as clone using '/ / .xml' copy; --or create pluggable database as clone using '/home/oracle/ / .xml' copy source_file_directory='+sparse/ /DATAFILE';
“怎么部署Oracle19c dataguard”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關的知識可以關注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實用文章!