Oracle 11.2.4.0 ADG 單例項安裝(COPY建立備庫)
Oracle 11.2.4.0 ADG 單例項安裝(COPY建立備庫)
規劃:
主:
OS: Linux Centos 6.5 X64
hostname:ORA11G-DG1
ipaddress:192.168.213.199
db_unique_name=netdata_pd
db_name=netdata
備:
OS: Linux Centos 6.5 X64
hostname:ORA11G-DG2
ipaddress:192.168.213.200
db_unique_name=netdata_sd
db_name=netdata
注OS平臺一致
1.主庫安裝oracle軟體(參照文件)
2.建立監聽,可以用netca,也可以直接用檔案建立
listener.ora如下
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORA11G-DG1)(PORT = 51518))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC51518))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = netdata)
(SID_NAME = netdata)
)
)
ADR_BASE_LISTENER = /u01/app/oracle
2.主庫dbca建庫,注意生產環境的一些引數SGA,PGA,PROCESS,歸檔位置,open_cursor,flash_recovery位置等等,如果要使用EM開始的時候需要建埠1521監聽
3.主庫tnames.ora配置
NETDATA_SD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.200)(PORT = 51518))
)
(CONNECT_DATA =
(SERVICE_NAME = netdata)
)
)
NETDATA_PD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.199)(PORT = 51518))
)
(CONNECT_DATA =
(SERVICE_NAME = netdata)
)
)
4.備庫安裝oracle軟體僅安裝軟體(請參照之前安裝軟體)
5.備庫配置listener.ora,tnames.ora
listener.ora如下:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORA11G-DG2)(PORT = 51518))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC51518))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = netdata)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = netdata)
)
)
ADR_BASE_LISTENER = /u01/app/oracle
tnames.ora如下:
NETDATA_SD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.200)(PORT = 51518))
)
(CONNECT_DATA =
(SERVICE_NAME = netdata)
)
)
NETDATA_PD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.213.199)(PORT = 51518))
)
(CONNECT_DATA =
(SERVICE_NAME = netdata)
)
)
6.主庫引數檔案配置
主庫強制forceloing
SQL> ALTER DATABASE FROCE LOGGING;
SQL> select FORCE_LOGGING from v$database;
YES
引數檔案配置
alter system set DB_UNIQUE_NAME=netdata_pd scope=spfile;
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(netdata_pd,netdata_sd)' scope=both;
alter
system set LOG_ARCHIVE_DEST_1='LOCATION=/oradata/archive
VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=netdata_pd'
scope=both;
alter system set
LOG_ARCHIVE_DEST_2='SERVICE=netdata_sd LGWR SYNC AFFIRM
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=netdata_sd';
alter system set standby_file_management='AUTO' sid='*' scope=both;
alter system set fal_client='netdata_pd';
alter system set fal_server='netdata_sd';
alter system set db_file_name_convert='/oradata/netdata','/oradata/netdata' SCOPE=SPFILE;
alter SYSTEM SET log_file_name_convert='/oradata/netdata','/oradata/netdata' SCOPE=SPFILE;
7.為備庫建立引數檔案
create pfile='/oradata/standby.ora' from spfile
編輯standby.ora
修改
*.db_unique_name='NETDATA_PD'
*.log_archive_config='DG_CONFIG=(netdata_pd,netdata_sd)'
*.log_archive_dest_1='LOCATION=/oradata/archive
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=netdata_pd'
*.log_archive_dest_2='SERVICE=netdata_sd ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=netdata_sd'
*.fal_client='NETDATA_PD'
*.fal_server='NETDATA_SD'
*.log_file_name_convert='/oradata/netdata','/oradata/netdata'
*.standby_file_management='AUTO'
*.db_file_name_convert='/oradata/netdata','/oradata/netdata'
8.為備庫建立控制檔案
alter database create standby controlfile as '/oradata/control01.ctl';
9.關閉主庫將資料檔案,引數檔案,密碼檔案($ORACLE_HOME/dbs/orapwnetdata linux為orapw$ORACLE_SID),admin檔案
注:備庫建立所需要目錄 用oracle使用者建立
--資料檔案目錄
mkdir -p /oradata/netdata
--recovery目錄
mkdir -p /oradata/recovery_area
--歸檔目錄
mkdir -p /oradata/archive
--admin目錄
mkdir -p /u01/app/oracle/admin/
複製資料檔案及redo檔案
scp -r /oradata/netdata/*.log oracle@192.168.213.200:/oradata/netdata/
scp -r /oradata/netdata/*.dbf oracle@192.168.213.200:c
複製admin目錄
scp -r /u01/app/oracle/admin/* oracle@192.168.213.200:/u01/app/oracle/admin/
複製引數檔案
scp -r /oradata/control01.ctl oracle@192.168.213.200:/oradata/control01.ctl
scp -r /oradata/control01.ctl oracle@192.168.213.200:/oradata/control02.ctl
scp -r /oradata/control01.ctl oracle@192.168.213.200:/oradata/recovery_area/control03.ctl
注意一定要copy全不然啟動備庫會報錯的
複製密碼檔案
scp -r $ORACLE_HOME/dbs/orapwnetdata oracle@192.168.213.200:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwnetdata
10.為主備庫建立standbylog
主:
startup
ALTER DATABASE ADD STANDBY LOGFILE group 4('/oradata/netdata/stredo01.log') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE group 5('/oradata/netdata/stredo02.log') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE group 6('/oradata/netdata/stredo03.log') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE group 7('/oradata/netdata/stredo04.log') SIZE 50M;
注意這裡大小要跟redolog一致,比redolog多一組
備:
sqlplus /nolog
create spfile from pfile='/oradata/netdata/standby.ora';
startup mount;
ALTER DATABASE ADD STANDBY LOGFILE group 4('/oradata/netdata/stredo01.log') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE group 5('/oradata/netdata/stredo02.log') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE group 6('/oradata/netdata/stredo03.log') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE group 7('/oradata/netdata/stredo04.log') SIZE 50M;
11.檢驗主庫是否同步
備操作:
shutdown immediate;
startup nomount;
alter database mount standby database;
alter database recover managed standby database disconnect from session;
檢驗主備是否一致
archive log list;
col name format A50;
col dest_name format A40
col error format A20
set line 200;
select name,sequence#,applied from v$archived_log a where a.sequence#=(select max(sequence#) from v$archived_log);
col dest_name format A40
select dest_name,status,error from v$archive_dest where rownum<3;
啟動ADG:
alter database recover managed standby database cancel;
alter database open read only;
alter database recover managed standby database using current logfile disconnect from session;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24486203/viewspace-1698668/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE 單例項完全解除安裝資料庫Oracle單例資料庫
- Oracle ADG 備庫新增備庫Oracle
- Oracle 11G資料庫單例項安裝Oracle資料庫單例
- Window下安裝Oracle ASM單例項資料庫OracleASM單例資料庫
- oracle單例項12.2.0.1安裝Oracle單例
- oracle 11g 單例項資料庫的安裝Oracle單例資料庫
- oracle 11g 單例項安裝Oracle單例
- 【Oracle】RHEL6.4-64位 安裝oracle11.2.0.3(五) dbca建立單例項資料庫Oracle單例資料庫
- Oracle 12C 單例項資料庫靜默安裝Oracle單例資料庫
- 5.6單例項安裝單例
- Redis單例項安裝Redis單例
- AIX下安裝單例項ORACLE10gR2資料庫AI單例Oracle資料庫
- 19C 單例項資料庫安裝單例資料庫
- mysql 5.7單例項安裝MySql單例
- Oracle 12C 單例項安裝文件( 官方文件)Oracle單例
- 安裝Mongodb3.0.6單例項MongoDB單例
- Oracle 10g 安裝及單例項遷移到RACOracle 10g單例
- 建立Oracle ADG standby資料庫若干方法Oracle資料庫
- 【Oracle】ASM例項安裝入門OracleASM
- Oracle JOB 建立例項Oracle
- Oracle搭建rac到單庫的adgOracle
- oracle例項安裝到 4% 不能繼續安裝Oracle
- oracle11g安裝 單例項 系統centos7Oracle單例CentOS
- ORACLE-LINUX環境字元介面單例項安裝OracleLinux字元單例
- 滴滴雲伺服器上安裝Oracle12cR2單例項資料庫伺服器Oracle單例資料庫
- 2 Day DBA-安裝Oracle資料庫並建立一個資料庫-安裝選項Oracle資料庫
- oracle 多個例項安裝監聽Oracle
- 手動建立Oracle例項Oracle
- oracle資料庫建立資料庫例項-九五小龐Oracle資料庫
- 【PSU】Oracle打PSU及解除安裝PSU(單例項)Oracle單例
- 單機環境安裝配置ASM例項ASM
- iOS單例(方便copy)iOS單例
- oracle adg備庫歸檔滿了無法同步Oracle
- VM虛擬機器下在LINUX上安裝ORACLE 11G單例項資料庫虛擬機LinuxOracle單例資料庫
- 12C 單例項-測試庫-圖形介面-安裝步驟單例
- oracle19c安裝 單例項 系統centos7 非cdbOracle單例CentOS
- 圖解 Mac+VMwareFusion+Oracle12cR1+PSU 單例項安裝圖解MacOracle單例
- 使用rman copy將資料庫遷移到ASM例項資料庫ASM