OGG搭建(rac到-->單例項)
開啟歸檔。
在兩個節點分別建立本地目錄/arch1
兩個節點都啟動到mount狀態然後,alter database archivelog; 執行完之後兩個節點再open,你懂得否則報錯:
因為我們在節點1配置ogg所以得配置NFS,讓節點1看到節點2的歸檔。
在節點2上 /etc/exports新增如下內容:
然後啟動NFS
在節點1上
新增NFS自啟
配置ASM動態註冊
Oracle 11g RAC的監聽是用grid使用者來管理的,所以用grid使用者來操作。
節點而一樣
配置TNS檔案
注意這裡連線ASM的配置中必須新增(UR = A),該參數列示允許遠端呼叫,這個必須有,否則ASM例項不能連線。
安裝ogg軟體
繼續... ...
安裝完成後將資料庫配置成歸檔,強制日誌,附加日誌。
建立ogg單獨的表空間及使用者這是12c必須做的。
在兩個節點分別建立本地目錄/arch1
點選(此處)摺疊或開啟
- SQL> alter system set log_archive_dest_1 ='location=/arch1' scope=both sid='*';
-
-
System altered.
-
-
SQL> archive log lsit
-
SP2-0718: illegal ARCHIVE LOG option
-
SQL> archive log list
-
Database log mode No Archive Mode
-
Automatic archival Disabled
-
Archive destination /arch1
-
Oldest online log sequence 32
- Current log sequence 34
點選(此處)摺疊或開啟
-
SQL> alter database archivelog;
-
alter database archivelog
-
*
-
ERROR at line 1:
-
ORA-01126: database must be mounted in this instance and not open in any
- instance
在節點2上 /etc/exports新增如下內容:
點選(此處)摺疊或開啟
- /arch1 *(ro)
點選(此處)摺疊或開啟
-
[root@rac2 ~]# service nfs start
-
Starting NFS services: [ OK ]
-
Starting NFS quotas: [ OK ]
-
Starting NFS daemon: [ OK ]
- Starting NFS mountd: [ OK ]
點選(此處)摺疊或開啟
-
[root@rac1 ~]# mkdir /arch2
-
[root@rac1 ~]# chown -R oracle:oinstall /arch2
-
[root@rac1 ~]# mount -t nfs 10.10.10.2:/arch1 /arch2 -o nolock
-
[root@rac1 ~]# cd /arch2
-
[root@rac1 arch2]# ls
- 1_34_876782166.dbf
配置ASM動態註冊
Oracle 11g RAC的監聽是用grid使用者來管理的,所以用grid使用者來操作。
點選(此處)摺疊或開啟
-
[root@rac1 ~]# su - grid
- [grid@rac1 ~]$ srvctl status listener
-
Listener LISTENER is enabled
-
Listener LISTENER is running on node(s): rac2,rac1
- [grid@rac1 ~]$ lsnrctl status
-
-
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 28-SEP-2015 17:07:10
-
-
Copyright (c) 1991, 2011, Oracle. All rights reserved.
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
-
STATUS of the LISTENER
-
------------------------
-
Alias LISTENER
-
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
-
Start Date 28-SEP-2015 16:30:33
-
Uptime 0 days 0 hr. 36 min. 36 sec
-
Trace Level off
-
Security ON: Local OS Authentication
-
SNMP OFF
-
Listener Parameter File /u01/11.2.0/grid/network/admin/listener.ora
-
Listener Log File /u01/app/oracle/diag/tnslsnr/rac1/listener/alert/log.xml
-
Listening Endpoints Summary...
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.6.101)(PORT=1521)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.6.103)(PORT=1521)))
-
Services Summary...
-
Service "+ASM" has 1 instance(s).
-
Instance "+ASM1", status READY, has 1 handler(s) for this service...
-
Service "prod" has 2 instance(s).
-
Instance "prod1", status READY, has 2 handler(s) for this service...
-
Instance "prod2", status READY, has 1 handler(s) for this service...
-
Service "prodXDB" has 2 instance(s).
-
Instance "prod1", status READY, has 1 handler(s) for this service...
-
Instance "prod2", status READY, has 1 handler(s) for this service...
- The command completed successfully
點選(此處)摺疊或開啟
-
SID_LIST_LISTENER =
-
(SID_LIST =
-
(SID_DESC =
-
(GLOBAL_DBNAME = ASM)
-
(ORACLE_HOME = /u01/11.2.0/grid)
-
(SID_NAME = +ASM1)
-
)
- )
點選(此處)摺疊或開啟
-
[grid@rac1 ~]$ lsnrctl status
-
-
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 28-SEP-2015 17:07:10
-
-
Copyright (c) 1991, 2011, Oracle. All rights reserved.
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
-
STATUS of the LISTENER
-
------------------------
-
Alias LISTENER
-
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
-
Start Date 28-SEP-2015 16:30:33
-
Uptime 0 days 0 hr. 36 min. 36 sec
-
Trace Level off
-
Security ON: Local OS Authentication
-
SNMP OFF
-
Listener Parameter File /u01/11.2.0/grid/network/admin/listener.ora
-
Listener Log File /u01/app/oracle/diag/tnslsnr/rac1/listener/alert/log.xml
-
Listening Endpoints Summary...
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.6.101)(PORT=1521)))
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.6.103)(PORT=1521)))
-
Services Summary...
-
Service "+ASM" has 1 instance(s).
-
Instance "+ASM1", status READY, has 1 handler(s) for this service...
-
Service "prod" has 2 instance(s).
-
Instance "prod1", status READY, has 2 handler(s) for this service...
-
Instance "prod2", status READY, has 1 handler(s) for this service...
-
Service "prodXDB" has 2 instance(s).
-
Instance "prod1", status READY, has 1 handler(s) for this service...
-
Instance "prod2", status READY, has 1 handler(s) for this service...
-
The command completed successfully
-
[grid@rac1 ~]$ echo $ORACLE_HOME
- /u01/11.2.0/grid
-
[grid@rac1 home]$ cd $ORACLE_HOME
-
[grid@rac1 grid]$ ls
-
assistants crf dbs evm install jlib mdns ologgerd osysmond racg slax wwg
-
auth crs dc_ocm gipc instantclient JRE mesg OPatch oui rdbms sqlplus xdk
-
bin csmig deinstall gns inventory ldap network opmn owm relnotes srvm
-
cdata css demo gpnp javavm lib nls oracore perl root.sh sysman
-
cfgtoollogs ctss diagnostics has jdbc log oc4j oraInst.loc plsql rootupgrade.sh usm
-
clone cv eons hs jdk md ohasd ord precomp scheduler utl
-
[grid@rac1 grid]$ pwd
- /u01/11.2.0/grid
- [grid@rac1 grid]$ cd network/admin
-
[grid@rac1 admin]$ ll
-
total 72
-
-rw-r--r-- 1 grid oinstall 182 Apr 8 19:34 endpoints_listener.ora
-
-rw-r--r-- 1 grid oinstall 184 Apr 8 19:34 listener1504087PM3409.bak
-
-rw-r--r-- 1 grid oinstall 350 May 20 12:04 listener15052012PM0404.bak
-
-rw-r--r-- 1 grid oinstall 350 Apr 8 19:34 listener.ora
-
-rw-r--r-- 1 grid oinstall 184 Apr 8 19:20 listener.ora.bak.rac1
-
drwxr-xr-x 2 grid oinstall 4096 Apr 8 18:44 samples
-
-rw-r--r-- 1 grid oinstall 205 May 11 2011 shrept.lst
-
-rw-r--r-- 1 grid oinstall 210 May 20 12:04 sqlnet15052012PM0404.bak
- -rw-r--r-- 1 grid oinstall 210 Apr 8 19:34 sqlnet.ora
-
[grid@rac1 admin]$ cat listener.ora
-
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
-
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
-
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
-
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
-
[grid@rac1 admin]$ vim listener.ora
-
[grid@rac1 admin]$
- [grid@rac1 admin]$ lsnrctl reload
-
-
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 28-SEP-2015 17:25:09
-
-
Copyright (c) 1991, 2011, Oracle. All rights reserved.
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
-
The command completed successfully
-
[grid@rac1 admin]$ lsnrctl status
-
-
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 28-SEP-2015 17:25:12
-
-
Copyright (c) 1991, 2011, Oracle. All rights reserved.
-
-
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
-
STATUS of the LISTENER
-
------------------------
-
Alias LISTENER
-
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
-
Start Date 28-SEP-2015 16:30:33
-
Uptime 0 days 0 hr. 54 min. 39 sec
-
Trace Level off
-
Security ON: Local OS Authentication
-
SNMP OFF
-
Listener Parameter File /u01/11.2.0/grid/network/admin/listener.ora
-
Listener Log File /u01/app/oracle/diag/tnslsnr/rac1/listener/alert/log.xml
-
Listening Endpoints Summary...
-
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
-
Services Summary...
-
Service "ASM" has 1 instance(s).
-
Instance "+ASM1", status UNKNOWN, has 1 handler(s) for this service...
- The command completed successfully
點選(此處)摺疊或開啟
-
SID_LIST_LISTENER =
-
(SID_LIST =
-
(SID_DESC =
-
(GLOBAL_DBNAME = ASM)
-
(ORACLE_HOME = /u01/11.2.0/grid)
-
(SID_NAME = +ASM2)
-
)
- )
配置TNS檔案
點選(此處)摺疊或開啟
-
RAC_11G =
-
(DESCRIPTION =
-
(ADDRESS_LIST =
-
(LOAD_BALANCE = yes)
-
(FAILOVER = ON)
-
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.6.103)(PORT = 1521))
-
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.6.104)(PORT = 1521))
-
)
-
(CONNECT_DATA =
-
(SERVICE_NAME = prod)
-
(failover_mode=(type=select)(mothod=basic))
-
)
-
)
-
-
ASM =
-
(DESCRIPTION =
-
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.6.103)(PORT = 1521))
-
(CONNECT_DATA =
-
(SERVCE = DEDICATED)
-
(SERVICE_NAME = ASM)
-
(INSTANCE_NAME = +ASM1)
-
(UR = A)
-
)
- )
安裝ogg軟體
繼續... ...
安裝完成後將資料庫配置成歸檔,強制日誌,附加日誌。
點選(此處)摺疊或開啟
-
SQL> select log_mode,supplemental_log_data_min,force_logging from v$database;
-
-
LOG_MODE SUPPLEME FOR
-
------------ -------- ---
-
ARCHIVELOG NO NO
-
-
SQL> alter database force logging;
-
-
Database altered.
-
-
SQL> alter database add supplemental log data;
-
-
Database altered.
-
-
SQL> select log_mode,supplemental_log_data_min,force_logging from v$database;
-
-
LOG_MODE SUPPLEME FOR
-
------------ -------- ---
- ARCHIVELOG YES YES
點選(此處)摺疊或開啟
-
SQL> create tablespace ggs datafile '+DATA_MORMAL' size 100M autoextend on;
-
-
Tablespace created.
-
-
SQL> create user ggs identified by ggs default tablespace ggs temporary tablespace temp;
-
- User created.
-
-
SQL> grant connect ,resource to ggs;
-
-
Grant succeeded.
-
-
SQL> grant execute on utl_file to ggs;
-
- Grant succeeded.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15797451/viewspace-2120333/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 搭建RAC到單例項DG單例
- Oracle 11g RAC到單例項OGG同步Oracle單例
- rac恢復到單例項單例
- RAC asm恢復到單例項ASM單例
- rac到單例項的rman恢復單例
- rac asm 恢復到 單例項 1ASM單例
- rac asm 恢復到 單例項 2ASM單例
- duplicate搭建DG最大效能(rac-單例項)單例
- RMAN異機恢復:RAC到單例項單例
- RAC恢復到單例項節點上單例
- 恢復rac db(raw)到單例項下單例
- 單例項備份集恢復到RAC單例
- RAC從帶庫到單例項的恢復單例
- 恢復RAC資料庫到單例項(ASM)資料庫單例ASM
- RAC起單例項make單例
- oracle單例項轉RACOracle單例
- 10g rac asm 恢復到 單例項(二)ASM單例
- 10g rac asm 恢復到 單例項(一)ASM單例
- 9204RAC到單例項的SWITCHOVER切換單例
- RAC 例項 遷移到 單例項 -- 使用RMAN Duplicate單例
- RAC資料庫恢復到單例項資料庫資料庫單例
- RAC+DG(asm單例項)ASM單例
- 單例項恢復至RAC單例
- 使用RMAN將RAC+ASM複製到單例項+ASM上ASM單例
- 單例項opatch出現RAC資訊單例
- 從單例項資料庫轉換到RAC環境——RAC的建立和配置單例資料庫
- Oracle 11.2.0.4 從單例項,使用RMAN 異機恢復到RACOracle單例
- RAC+單例項DG的切換單例
- 單例項備份恢復成RAC單例
- Oracle DataBase單例項遷移到Oracle RACOracleDatabase單例
- 【kingsql分享】將RAC資料庫異機恢復到單例項(Ⅰ)SQL資料庫單例
- Oracle搭建rac到單庫的adgOracle
- 單例項Primary快速搭建Standby RAC參考手冊(19.16 ADG)單例
- 單例項資料遷移到RAC補充單例
- oracle rac及單例項開啟歸檔Oracle單例
- Oracle 11g RAC 配置單例項 DataGuardOracle單例
- 單例項和RAC打造的ORACLE STREAM(完)單例Oracle
- 單例項和RAC打造的ORACLE STREAM(四)單例Oracle