ORACLE RAC 手動建庫
環境
11.2.0.1 RAC
前提條件
Grid Infrastructure已經安裝 ASM已經建立 DB軟體已經安裝
透過手動建立RAC可以更深的理解單例項DB和RAC DB 的一些區別,在DBCA無法使用的場景中,也需要手動的方式建立,建立步驟如下:
大概思路:先建立單例項DB再轉為RAC DB
1. 建立目錄
mkdir -p /u01/app/oracle/admin/orcl/adump
2. 編輯引數檔案
*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'
*.audit_trail='db'
*.control_files=’+DATA/orcl/controlfile/control01.ctl’, ‘+DATA/orcl/controlfile/control02.ctl’
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_name='orcl'
*.db_recovery_file_dest='+DATA'
*.db_recovery_file_dest_size=10737418240
*.diagnostic_dest='/u01/app/oracle'
*.memory_target=1658847232
*.open_cursors=300
*.processes=150
*.remote_listener='scanip:1521'
*.remote_login_passwordfile='exclusive'
3. 建立ASM目錄和建立spfile
[oracle@node1 ~]$ export ORACLE_SID=orcl1
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Dec 12 08:03:22 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> create spfile='+DATA/orcl/spfileorcl.ora' from pfile='/home/oracle/orcl.ora';
create spfile='+DATA/orcl/spfileorcl.ora' from pfile='/home/oracle/orcl.ora'
*
ERROR at line 1:
ORA-17502: ksfdcre:4 Failed to create file +DATA/orcl/spfileorcl.ora
ORA-15056: additional error message
ORA-17502: ksfdcre:4 Failed to create file +DATA/orcl/spfileorcl.ora
ORA-15173: entry 'orcl' does not exist in directory '/'
ORA-06512: at line 4
SQL> exit
Disconnected
[oracle@node1 ~]$ su - grid
Password:
su: incorrect password
[oracle@node1 ~]$ su - grid
Password:
[grid@node1 ~]$ asmcmd
ASMCMD> ls
CRS/
DATA/
ASMCMD> cd DATA
ASMCMD> ls
RACDB/
ASMCMD> mkdir ORCL
ASMCMD> exit
[grid@node1 ~]$
[grid@node1 ~]$
[grid@node1 ~]$ exit
logout
[oracle@node1 ~]$ export ORACLE_SID=orcl1
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Dec 12 08:05:10 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> create spfile='+DATA/orcl/spfileorcl.ora' from pfile='/home/oracle/orcl.ora';
File created.
SQL>
建立init檔案
節點1
vi initorcl1.ora
SPFILE='+DATA/orcl/spfileorcl.ora'
節點2
vi initorcl2.ora
SPFILE='+DATA/orcl/spfileorcl.ora'
4. 建立密碼檔案
cd $ORACLE_HOME/dbs
節點1
orapwd file=orapwORCL1 password=oracle
節點
orapwd file=orapwORCL2 password=oracle
5. 建立DB
CREATE DATABASE orcl
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE GROUP 1 SIZE 100M,
GROUP 2 SIZE 100M,
GROUP 3 SIZE 100M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE SIZE 325M
SYSAUX DATAFILE SIZE 325M
DEFAULT TABLESPACE users
DATAFILE
SIZE 500M AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE
SIZE 20M
UNDO TABLESPACE undotbs1
DATAFILE
SIZE 200M AUTOEXTEND ON MAXSIZE UNLIMITED;
6. 建立undo 和新增redo
CREATE UNDO TABLESPACE UNDOTBS2 DATAFILE SIZE 200M;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 4 SIZE 100M;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 5 SIZE 100M;
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 6 SIZE 100M;
(以下轉單例項db到RAC DB)
7. 新增rac 引數
*.cluster_database=true
orcl1.instance_number=1
orcl2.instance_number=2
orcl2.thread=2
orcl1.thread=1
orcl1.undo_tablespace='UNDOTBS1'
orcl2.undo_tablespace='UNDOTBS2'
8. 啟動所有節點例項
[oracle@node1 ~]$ sqlplus / as sysdba
SQL> startup
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size 2213896 bytes
Variable Size 956303352 bytes
Database Buffers 687865856 bytes
Redo Buffers 7135232 bytes
Database mounted.
Database opened.
SQL> ALTER DATABASE ENABLE PUBLIC THREAD 2;
Database altered.
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$ ssh node2
Last login: Thu Dec 12 09:43:51 2013 from node1
[oracle@node2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Dec 12 10:00:33 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size 2213896 bytes
Variable Size 956303352 bytes
Database Buffers 687865856 bytes
Redo Buffers 7135232 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL>
SQL> select instance_name from gv$instance;
INSTANCE_NAME
----------------
orcl2
orcl1
9. 執行建立資料字典指令碼
@$ORACLE_HOME/rdbms/admin/catalog.sql
@$ORACLE_HOME/rdbms/admin/catproc.sql
@$ORACLE_HOME/rdbms/admin/catclust.sql
--rac 相關字典
@$ORACLE_HOME/rdbms/admin/utlrp.sql
10. 註冊資料庫到Clusterware
[oracle@node1 ~]$ srvctl add database -d orcl -o $ORACLE_HOME
[oracle@node1 ~]$ srvctl add instance -d orcl -i orcl1 -n node1
[oracle@node1 ~]$ srvctl add instance -d orcl -i orcl2 -n node2
[oracle@node1 ~]$ srvctl enable database -d orcl
PRCC-1010 : orcl was already enabled
[oracle@node1 ~]$ srvctl start database -d orcl
[grid@node1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS.dg
ONLINE ONLINE node1
ONLINE ONLINE node2
ora.DATA.dg
ONLINE ONLINE node1
ONLINE ONLINE node2
ora.LISTENER.lsnr
ONLINE ONLINE node1
ONLINE ONLINE node2
ora.asm
ONLINE ONLINE node1 Started
ONLINE ONLINE node2
ora.eons
ONLINE ONLINE node1
ONLINE ONLINE node2
ora.gsd
OFFLINE OFFLINE node1
OFFLINE OFFLINE node2
ora.net1.network
ONLINE ONLINE node1
ONLINE ONLINE node2
ora.ons
ONLINE ONLINE node1
ONLINE ONLINE node2
ora.registry.acfs
ONLINE ONLINE node1
ONLINE ONLINE node2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE node2
ora.node1.vip
1 ONLINE ONLINE node1
ora.node2.vip
1 ONLINE ONLINE node2
ora.oc4j
1 OFFLINE OFFLINE
ora.orcl.db
1 ONLINE ONLINE node1 Open
2 ONLINE ONLINE node2 Open
ora.scan1.vip
1 ONLINE ONLINE node2
11. 兩個節點配置tnsnames.ora
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15747463/viewspace-1063160/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle RAC手動配置互信Oracle
- Oracle RAC DG手動切換Oracle
- Oracle 11g RAC手動新增serviceOracle
- Oracle RAC自啟動Oracle
- 【BUILD_ORACLE】Oracle 19c RAC搭建(六)建立RAC資料庫UIOracle資料庫
- 簡單介紹Oracle 19c RAC 手工建庫的過程Oracle
- vgant 安裝oracle資料庫racOracle資料庫
- Oracle搭建rac到單庫的adgOracle
- oracle rac資料庫的安裝Oracle資料庫
- Oracle 12c 使用RMAN搭建物理備庫(RAC to RAC)Oracle
- oracle RACOracle
- Oracle資料庫(RAC)巡檢報告Oracle資料庫
- 靜默安裝and手動建庫
- Oracle RAC Cache Fusion 系列十七:Oracle RAC DRMOracle
- Oracle RAC啟動失敗(DNS故障)OracleDNS
- Oracle 11.2 DataGuard RAC To RAC搭建Oracle
- Oracle RAC CacheFusion 系列十五:Oracle RAC CRServer Part TwoOracleServer
- oracle建庫指令碼Oracle指令碼
- Oracle 12C RAC CDB資料庫部署Oracle資料庫
- 拋開dbca,手動建庫步驟
- ORACLE RAC clusterwareOracle
- Oracle RAC Cache Fusion系列十八:Oracle RAC Statisticsand Wait EventsOracleAI
- Oracle RAC的自定義service自啟動Oracle
- Oracle 19c RAC on Linux 7.6安裝手冊OracleLinux
- oracle rac dg庫報錯ORA-01031: insufficient privilegesOracle
- jdbc連線oracle rac資料庫的寫法JDBCOracle資料庫
- ORACLE 12C RAC資料庫的啟停Oracle資料庫
- Oracle RAC Cache Fusion 系列十四:Oracle RAC CR Server Part OneOracleServer
- Oracle RAC Cache Fusion 系列十:Oracle RAC Enqueues And Lock Part 1OracleENQ
- Oracle OCP(36):DBCA建庫Oracle
- 【RAC】Oracle RAC如何修改心跳網路Oracle
- oracle rac 增加磁碟Oracle
- Oracle RAC Wait EventsOracleAI
- Oracle RAC常見啟動失敗故障分析Oracle
- 【RAC】Oracle rac 如何修改公網及vipOracle
- Oracle DG備庫手動管理新增資料檔案Oracle
- Oracle RAC Cache Fusion 系列九:Oracle RAC 分散式資源管理(二)Oracle分散式
- Oracle RAC Cache Fusion 系列八:Oracle RAC 分散式資源管理(一)Oracle分散式
- Oracle RAC啟動因CTSS導致的異常Oracle