Solaris10下安裝Oracle10203RAC環境 (zt)
首先是建立使用者:
在第一個節點:
root@ahrac1 # groupadd oinstall
root@ahrac1 # groupadd dba
root@ahrac1 # mkdir -p /export/home/oracle
root@ahrac1 # useradd -g oinstall -G dba -d /export/home/oracle oracle
root@ahrac1 # chown oracle:oinstall /export/home/oracle
root@ahrac1 # mkdir /data
root@ahrac1 # chown oracle:oinstall /data
root@ahrac1 # passwd oracle
root@ahrac1 # id nobody
uid=60001(nobody) gid=60001(nobody)
root@ahrac1 # id oracle
uid=101(oracle) gid=101(oinstall)
root@ahrac1 # more /etc/group
root::0:
other::1:root
bin::2:root,daemon
sys::3:root,bin,adm
adm::4:root,daemon
uucp::5:root
mail::6:root
tty::7:root,adm
lp::8:root,adm
nuucp::9:root
staff::10:
daemon::12:root
sysadmin::14:
smmsp::25:
gdm::50:
webservd::80:
nobody::60001:
noaccess::60002:
nogroup::65534:
test::100:
oinstall::101:
dba::102:oracle
在節點二:
root@ahrac2 # groupadd -g 101 oinstall
root@ahrac2 # groupadd -g 102 dba
root@ahrac2 # mkdir -p /export/home/oracle
root@ahrac2 # useradd -u 101 -g oinstall -G dba -d /export/home/oracle oracle
root@ahrac2 # chown oracle:oinstall /export/home/oracle
root@ahrac2 # mkdir /data
root@ahrac2 # chown oracle:oinstall /data
root@ahrac2 # id nobody
uid=60001(nobody) gid=60001(nobody)
root@ahrac2 # passwd oracle
設定兩個節點的環境變數,注意節點二的環境變數中的ORACLE_SID是tradedb2:
# su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ vi .profile
umask 022
ORACLE_SID=tradedb1
export ORACLE_SID
ORACLE_BASE=/data/oracle
export ORACLE_BASE
ORACLE_HOME=/data/oracle/product/10.2/database
export ORACLE_HOME
NLS_LANG='SIMPLIFIED CHINESE_CHINA.ZHS16GBK'
export NLS_LANG
PATH=$PATH:$ORACLE_HOME/bin
export PATH
DISPLAY=172.25.6.201:1.0
export DISPLAY
再上一篇文章中,介紹了透過rcp的方式配置遠端訪問方式,這篇給出配置ssh的方式。首先在兩個節點上執行下面的操作,產生ssh命令所需的key檔案:
# su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ mkdir .ssh
$ chmod 700 .ssh
$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_rsa.
Your public key has been saved in /export/home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
64:0a:45:ce:a6:de:8b:f7:ba:b3:15:87:38:46:f6:c7 oracle@ahrac1
$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_rsa):
/export/home/oracle/.ssh/id_rsa already exists.
Overwrite (yes/no)? no
$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/export/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/oracle/.ssh/id_dsa.
Your public key has been saved in /export/home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
4f:58:55:da:5a:f1:11:3c:07:bb:84:44:1b:23:96:f0 oracle@ahrac1
$ touch .ssh/authorized_keys
$ cd .ssh
$ ls
authorized_keys id_dsa id_dsa.pub id_rsa id_rsa.pub
產生了key之後,利用ssh命令將key新增到authorized_keys檔案中,並複製到節點二:
$ ssh ahrac1 cat /export/home/oracle/.ssh/id_rsa.pub >> authorized_keys
The authenticity of host 'ahrac1 (172.25.198.42)' can't be established.
RSA key fingerprint is 29:d2:ab:dc:ff:a3:24:70:14:7a:8e:70:01:f7:be:46.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ahrac1,172.25.198.42' (RSA) to the list of known hosts.
Password:
$ ssh ahrac1 cat /export/home/oracle/.ssh/id_dsa.pub >> authorized_keys
Enter passphrase for key '/export/home/oracle/.ssh/id_rsa':
$ ssh ahrac2 cat /export/home/oracle/.ssh/id_rsa.pub >> authorized_keys
The authenticity of host 'ahrac2 (172.25.198.43)' can't be established.
RSA key fingerprint is 74:55:ef:49:2b:f4:a0:2c:52:44:83:09:ac:fb:b1:1b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ahrac2,172.25.198.43' (RSA) to the list of known hosts.
Password:
$ ssh ahrac2 cat /export/home/oracle/.ssh/id_dsa.pub >> authorized_keys
Password:
$ scp authorized_keys ahrac2:/export/home/oracle/.ssh/
Enter passphrase for key '/export/home/oracle/.ssh/id_rsa':
authorized_keys 100% |*********************************************************************************| 1652 00:00
操作完成後,在節點二上重複這個步驟,將最終的authorized_keys複製回節點一。
然後在兩個節點上分別修改authorized_keys的檔案屬性:
$ chmod 600 authorized_keys
為了ssh命令執行的時候不輸入密碼驗證,在需要啟動安裝程式的節點進行如下的設定(這個操作在重啟後失效,需要重啟系統後手工執行這個步驟):
$ exec /usr/bin/ssh-agent $SHELL
$ /usr/bin/ssh-add
Enter passphrase for /export/home/oracle/.ssh/id_rsa:
Identity added: /export/home/oracle/.ssh/id_rsa (/export/home/oracle/.ssh/id_rsa)
Enter passphrase for /export/home/oracle/.ssh/id_dsa:
Identity added: /export/home/oracle/.ssh/id_dsa (/export/home/oracle/.ssh/id_dsa)
下面可以驗證一下是否不需要輸入密碼執行ssh命令:
$ ssh ahrac1 date
Mon Mar 26 15:56:06 CST 2007
$ ssh ahrac2 date
Mon Mar 26 15:55:13 CST 2007
網路配置部分完成,下面檢查系統的硬體是否滿足安裝需要:
root@ahrac1 # /usr/sbin/prtconf | grep "Memory size"
Memory size: 32768 Megabytes
root@ahrac1 # /usr/sbin/swap -s
total: 298240k bytes allocated + 60184k reserved = 358424k used, 60398552k available
root@ahrac1 # df -k /tmp
Filesystem kbytes used avail capacity Mounted on
swap 60397080 224 60396856 1% /tmp
root@ahrac1 # /bin/isainfo -kv
64-bit sparcv9 kernel modules
內容需要1G以上,如果記憶體小於2G,則swap空間至少是記憶體的1.5倍,記憶體大於2G,則swap空間最小和記憶體大小相同。/tmp目錄需要至少400M空間。安裝Oracle的目錄至少需要5.2G以上的空間。使用isainfo檢查系統的架構,當前晶片是64位SPARC。
在兩個節點下分別0修改/etc/hosts檔案,新增public ip,private ip,和vip:
root@ahrac1 # vi /etc/hosts
#
# Internet host table
#
127.0.0.1 localhost
172.25.198.42 ahrac1 loghost
172.25.198.44 ahrac1-vip
10.0.0.3 ahrac1-priv
172.25.198.43 ahrac2
172.25.198.45 ahrac2-vip
10.0.0.4 ahrac2-priv
在兩個節點上新增預設的路由:
vi /etc/defaultrouter
172.25.2.1
新增主鍵的PRIVATE IP:
root@ahrac1 # ifconfig ce1 plumb
root@ahrac1 # ifconfig ce1 10.0.0.3 netmask 255.255.255.0 broadcast 10.0.0.255 up
root@ahrac1 # vi /etc/hostname.ce1
ahrac1-priv
另一個節點執行類似的操作,新增其PRIVATE IP。
修改兩個節點的預設子網掩碼,將第二IP的掩碼資訊加入:
root@ahrac2 # vi /etc/netmasks
"/etc/netmasks" [Read only] 15 lines, 379 characters
#
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
# network-number netmask
#
# The term network-number refers to a number obtained from the Internet Network
# Information Center.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
# 128.32.0.0 255.255.255.0
#
172.25.0.0 255.255.0.0
10.0.0.0 255.255.255.0
檢查ncsd程式已經啟動:
root@ahrac1 # ps -ef|grep nscd
root 164 1 0 Mar 23 ? 0:10 /usr/sbin/nscd
root 16748 29168 0 16:24:45 pts/2 0:00 grep nscd
如果沒有啟動,可以使用/etc/init.d/nscd start來啟動。
下面檢查系統的軟體是否滿足安裝RAC的需要,檢查系統包是否安裝完畢:
root@ahrac1 # uname -a
SunOS ahrac1 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Fire-V490
root@ahrac1 # pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibm SUNWlibms SUNWsprot SUNWtoo SUNWi1of SUNWxwfnt
system SUNWarc Lint Libraries (usr)
system SUNWbtool CCS tools bundled with SunOS
system SUNWhea SunOS Header Files
system SUNWi1of ISO-8859-1 (Latin-1) Optional Fonts
system SUNWlibC Sun Workshop Compilers Bundled libC
system SUNWlibm Math & Microtasking Library Headers & Lint Files (Usr)
system SUNWlibms Math & Microtasking Libraries (Usr)
system SUNWsprot Solaris Bundled tools
system SUNWtoo Programming Tools
system SUNWxwfnt X Window System platform required fonts
下面配置系統的核心引數,在兩個節點上修改/etc/system檔案:
root@ahrac1 # vi /etc/system
set noexec_user_stack=1
set semsys:seminfo_semmni=100
set semsys:seminfo_semmns=1024
set semsys:seminfo_semmsl=256
set semsys:seminfo_semvmx=32767
set shmsys:shminfo_shmmax=21474836479
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10
下面檢查UDP協議的配置:
root@ahrac1 # ndd /dev/udp udp_xmit_hiwat
57344
root@ahrac1 # ndd /dev/udp udp_recv_hiwat
57344
Solaris在這裡進行了最佳化,這個值已經很接近Oracle的推薦值了,這裡就不修改了。
下面重啟系統,安裝的準備工作到此結束。
root@ahrac1 # init 6
這篇介紹Oracle Clusterware的安裝過程。
RAC安裝的準備工作可以參考:Solaris10下安裝Oracle10203RAC環境(一):http://yangtingkun.itpub.net/post/468/276589
首先,解開CLUSTERWARE壓縮包:
$ gunzip 10gr2_cluster_sol.cpio.gz
$ cpio -idmv < 10gr2_cluster_sol.cpio$ gunzip 10gr2_cluster_sol.cpio.gz
$ cpio -idmv < 10gr2_cluster_sol.cpio
建立安裝所需的目錄:
$ mkdir -p /data/oracle/product/10.2
$ mkdir /data/oracle/oraInventory
$ mkdir /data/oracle/product/10.2/crs
$ mkdir /data/oracle/product/10.2/database
建立ocr和voting disk所需的裸裝置,使用Veritas的Volumn Manager建立所需的裸裝置:
root@ahrac1 # cd /dev/vx/rdsk/datadg
root@ahrac1 # vxassist make ocr 300m
root@ahrac1 # vxassist make ocr2 300m
root@ahrac1 # vxassist make vot 300m
root@ahrac1 # vxassist make vot2 300m
root@ahrac1 # vxassist make vot3 300m
root@ahrac1 # chown oracle:oinstall *
利用root登陸圖形介面執行,注意,一定需要在安裝之前執行ssh的驗證工作,否則安裝過程執行一半的時候會出現錯誤:Specified Nodes Are Not Clusterable。
root@ahrac1 # xhost +
access control disabled, clients can connect from any host
root@ahrac1 # su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ ssh ahrac1 date
Enter passphrase for key '/export/home/oracle/.ssh/id_rsa':
Mon Mar 26 18:31:18 CST 2007
$ exec /usr/bin/ssh-agent $SHELL
$ /usr/bin/ssh-add
Enter passphrase for /export/home/oracle/.ssh/id_rsa:
Identity added: /export/home/oracle/.ssh/id_rsa (/export/home/oracle/.ssh/id_rsa)
Enter passphrase for /export/home/oracle/.ssh/id_dsa:
Identity added: /export/home/oracle/.ssh/id_dsa (/export/home/oracle/.ssh/id_dsa)
$ cd /data
$ cd cluster_disk
$ ./runInstaller
安裝步驟中在Cluster主目錄位置填入:OraCrs10g_home1和/data/oracle/product/10.2/crs資訊,並選擇簡體中文字元。
在Cluster配置頁面選擇預設的Cluster name:crs,並輸入節點二的資訊:ahrac2、ahrac2-priv、ahrac2-vip。
在interface的選擇介面:由於Oracle對於IP地址的解析存在bug,因此這裡將172.25.0.0的interface型別改為PUBLIC。
在orc配置介面,輸入剛才建立好的/dev/vx/rdsk/datadg/ocr和/dev/vx/rdsk/datadg/ocr2,點選確定。
在Voting disk配置介面,分別輸入剛才建立好的/dev/vx/rdsk/datadg/vot、/dev/vx/rdsk/datadg/vot2和/dev/vx/rdsk/datadg/vot3,點選確定。
檢查彈出的彙總資訊,確認無誤後,點選開始安裝。
安裝完成後,分別在兩個節點執行下面的兩個指令碼:
root@ahrac1 # . /data/oracle/oraInventory/orainstRoot.sh
Changing permissions of /data/oracle/oraInventory to 770.
Changing groupname of /data/oracle/oraInventory to oinstall.
The execution of the script is complete
root@ahrac1 # . /data/oracle/product/10.2/crs/root.sh
WARNING: directory '/data/oracle/product/10.2' is not owned by root
WARNING: directory '/data/oracle/product' is not owned by root
WARNING: directory '/data/oracle' is not owned by root
WARNING: directory '/data' is not owned by root
Checking to see if Oracle CRS stack is already configured
Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/data/oracle/product/10.2' is not owned by root
WARNING: directory '/data/oracle/product' is not owned by root
WARNING: directory '/data/oracle' is not owned by root
WARNING: directory '/data' is not owned by root
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node
node 1: ahrac1 ahrac1-priv ahrac1
node 2: ahrac2 ahrac2-priv ahrac2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /dev/vx/rdsk/datadg/vot
Now formatting voting device: /dev/vx/rdsk/datadg/vot2
Now formatting voting device: /dev/vx/rdsk/datadg/vot3
Format of 3 voting devices complete.
Startup will be queued to init within 30 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
ahrac1
CSS is inactive on these nodes.
ahrac2
Local node checking complete.
Run root.sh on remaining nodes to start CRS daemons.
另一個節點執行root.sh指令碼的時候會報錯:
root@ahrac2 # . /data/oracle/product/10.2/crs/root.sh
WARNING: directory '/data/oracle/product/10.2' is not owned by root
WARNING: directory '/data/oracle/product' is not owned by root
WARNING: directory '/data/oracle' is not owned by root
WARNING: directory '/data' is not owned by root
Checking to see if Oracle CRS stack is already configured
Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/data/oracle/product/10.2' is not owned by root
WARNING: directory '/data/oracle/product' is not owned by root
WARNING: directory '/data/oracle' is not owned by root
WARNING: directory '/data' is not owned by root
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node
node 1: ahrac1 ahrac1-priv ahrac1
node 2: ahrac2 ahrac2-priv ahrac2
clscfg: Arguments check out successfully.
NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Oracle Cluster Registry for cluster has already been initialized
Startup will be queued to init within 30 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
ahrac1
ahrac2
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
Oracle CRS stack installed and running under init(1M)
Running vipca(silent) for configuring nodeapps
The given interface(s), "ce0" is not public. Public interfaces should be used to configure virtual IPs.
這個錯誤的具體描述在Solaris8的RAC安裝文件中已經詳細描述了,解決方法是手工啟動vipca進行配置。
root@ahrac1 # cd /data/oracle/product/10.2/crs/bin
root@ahrac1 # ./vipca
在Xmanager中啟動一個終端,啟動vipca圖形介面。點選next,出現所有可用的網路介面,由於ce0配置的是PUBLIC INTERFACT,這裡選擇ce0,點選next,在出現的配置中IP Alias Name分別填入:ahrac1-vip和ahrac2-vip,IP address處填入:172.25.198.44和172.25.198.45。這裡如果你的配置是正確的,那麼你填完一個IP,Oracle會自動將剩下三個配置補齊。點選next,出現彙總頁面,檢查無誤後,點選Finish。
Oracle會執行6個步驟,Create VIP application resource、Create GSD application resource、Create ONS application resource、Start VIP application resource、Start GSD application resource、Start ONS application resource。
全部成功後點選OK,結束VIPCA的配置。
這時候返回Cluster Ware的安裝介面,點選OK,Oracle自動啟動兩個工具,並再次執行驗證,順利結束後,安裝完成。
這篇介紹Oracle Database的安裝過程。
RAC安裝的準備工作可以參考:Solaris10下安裝Oracle10203RAC環境(一): http://yangtingkun.itpub.net/post/468/276589
ORACLE CLUSTERWARE的安裝可以參考:Solaris10下安裝Oracle10203RAC環境(二): http://yangtingkun.itpub.net/post/468/277075
在Solaris8的RAC安裝過程中,採用了ASM管理磁碟的方式,這裡由於配置的Volumn Manager,可以更加方便的管理裸裝置。因此選擇採用裸裝置建立Oracle資料庫。
建立資料檔案、控制檔案、日誌檔案、引數檔案和密碼檔案所需的裸裝置:
root@ahrac1 # vxassist make tradedb_system_1 2048m user=oracle group=oinstall mode=660
root@ahrac1 # vxassist make tradedb_undotbs1_1 4096m user=oracle group=oinstall mode=660
root@ahrac1 # vxassist make tradedb_undotbs2_1 4096m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_temp_1 4096m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_sysaux_1 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_users_1 200m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_redo1_1 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_redo1_2 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_redo1_3 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_redo2_1 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_redo2_2 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_redo2_3 1024m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_control1 120m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_control2 120m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_control3 120m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_spfile 10m user=oracle group=oinstall mode=660
root@ahrac1 vxassist make tradedb_pwdfile 10m user=oracle group=oinstall mode=660
root@ahrac1 # vxassist make tradedb_flasharea 16384m user=oracle group=oinstall mode=660
然後在節點一編輯對映檔案:
# su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ vi tradedb_raw.conf
system=/dev/vx/rdsk/datadg/tradedb_system_1
undotbs1=/dev/vx/rdsk/datadg/tradedb_undotbs1_1
undotbs2=/dev/vx/rdsk/datadg/tradedb_undotbs2_1
temp=/dev/vx/rdsk/datadg/tradedb_temp_1
sysaux=/dev/vx/rdsk/datadg/tradedb_sysaux_1
users=/dev/vx/rdsk/datadg/tradedb_users_1
redo1_1=/dev/vx/rdsk/datadg/tradedb_redo1_1
redo1_2=/dev/vx/rdsk/datadg/tradedb_redo1_2
redo1_3=/dev/vx/rdsk/datadg/tradedb_redo1_3
redo2_1=/dev/vx/rdsk/datadg/tradedb_redo2_1
redo2_2=/dev/vx/rdsk/datadg/tradedb_redo2_2
redo2_3=/dev/vx/rdsk/datadg/tradedb_redo2_3
control1=/dev/vx/rdsk/datadg/tradedb_control1
control2=/dev/vx/rdsk/datadg/tradedb_control2
control3=/dev/vx/rdsk/datadg/tradedb_control3
spfile=/dev/vx/rdsk/datadg/tradedb_spfile
pwdfile=/dev/vx/rdsk/datadg/tradedb_pwdfile
然後設定oracle使用者的環境變數,新增如下內容:
DBCA_RAW_CONFIG=/export/home/oracle/tradedb_raw.conf
export DBCA_RAW_CONFIG
在節點一建立歸檔目錄:
$ mkdir -p /data/oracle/oradata/tradedb/archive1
節點二建立歸檔目錄:
$ mkdir -p /data/oracle/oradata/tradedb/archive2
下面可以解開Oracle安裝檔案,展開完畢後,使用root登陸圖形介面執行:
root@ahrac1 # xhost +
access control disabled, clients can connect from any host
root@ahrac1 # su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ exec /usr/bin/ssh-agent $SHELL
$ /usr/bin/ssh-add
Enter passphrase for /export/home/oracle/.ssh/id_rsa:
Identity added: /export/home/oracle/.ssh/id_rsa (/export/home/oracle/.ssh/id_rsa)
Enter passphrase for /export/home/oracle/.ssh/id_dsa:
Identity added: /export/home/oracle/.ssh/id_dsa (/export/home/oracle/.ssh/id_dsa)
$ cd /data/disk1
$ ./runInstaller
注意,需要設定ssh的驗證,否則安裝會失敗。
在產品介面選擇企業版,並選擇簡體中文。
檢查$ORACLE_HOME路徑是否正確,這裡的配置應該是:/data/oracle/product/10.2/database。
選擇Cluster Installation,並將節點二選上。
Oracle執行完檢測後,進入配置選項。由於不打算使用ASM,這裡選擇了Create a database。
資料庫的配置選擇都和我的要求有所差別,這裡選擇高階安裝。
檢查彈出的彙總資訊後,開始資料庫軟體的安裝。
安裝完成後,Oracle自動啟動Oracle Net Configuration Assistant和Oracle Database Configuration Assistant。
NETCA以命令列方式執行成功後,啟動圖形化DBCA:
資料庫模板選擇Custom Database。
全域性資料庫名:tradedb.us.oracle.com,SID字首:tradedb。
輸入SYS/SYSTEM/DBSNMP/SYSMAN等使用者密碼。
由於設定了DBCA_RAW_CONFIG,Oracle自動選擇裸裝置作為儲存機制,而且自動找到裸裝置對映檔案。
由於裸裝置不支援FLASH RECOVERY AREA,這裡不選擇FLASH RECOVERY AREA
選擇歸檔,選擇自動歸檔,輸入節點一和節點二上的歸檔目錄:/data/oracle/oradata/tradedb/archive1和/data/oracle/oradata/tradedb/archive2。由於裸裝置也不支援歸檔日誌,這裡將歸檔目錄放在本地硬碟上。
在Database Service介面選擇tradedb.us.oracle.com,增加例項。輸入服務名tradedb後,Oracle自動顯示tradedb1和tradedb2兩個例項的資訊。這裡可以將TAF設定為BASIC模式。
設定Oracle的內容分配、字符集、BLOCK SIZE、連線模式和引數檔案。
設定表空間、資料檔案的大小,然後開始建庫。
建庫完成後,點選EXIT。安裝完畢。
最後在兩個節點分別用root執行root.sh,結束資料庫的安裝操作。
root@ahrac1 # . /data/oracle/product/10.2/database/root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /data/oracle/product/10.2/database
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /var/opt/oracle/oratab file...
Entries will be added to the /var/opt/oracle/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
這篇文件簡單描述一下RAC環境安裝過程中碰到的問題。
RAC安裝的準備工作可以參考:Solaris10下安裝Oracle10203RAC環境(一):http://yangtingkun.itpub.net/post/468/276589
ORACLE CLUSTERWARE的安裝可以參考:Solaris10下安裝Oracle10203RAC環境(二):http://yangtingkun.itpub.net/post/468/277075
ORACLE DATABASE的安裝可以參考:Solaris10下安裝Oracle10203RAC環境(三):http://yangtingkun.itpub.net/post/468/277419
ORACLE 10203補丁安裝可以參考:Solaris10下安裝Oracle10203RAC環境(四):http://yangtingkun.itpub.net/post/468/277626
由於有了在Solaris8上安裝RAC的經驗,在Solaris10下安裝還算比較順利。
不過由於安裝的時候,採用了一些其他的配置方法,也碰到了一些問題。不過幾乎所有的問題都和作業系統版本無關,而是使用ssh、volumn manager等造成的。
首先碰到的問題是User equivalence unavailable on all the nodes.錯誤。
這個錯誤產生有兩個原因,都是由於SSH造成的。一個是由於cluvfy工具本身的問題,在尋找ssh命令時去/usr/local/bin目錄下尋找。而另一個時由於ssh驗證造成的。關於這個問題的詳細描述,可以參考:RAC User Equivalence Check Failed:http://yangtingkun.itpub.net/post/468/275147
第二個問題碰到的問題是Specified Nodes Are Not Clusterable。
產生這個問題的原因也是兩個。一個是上面提到的SSH驗證的問題。必須啟動安裝程式的會話設定SSH的驗證,否則就會造成上面的這個問題。
另外一個原因是我在檢查系統網路情況的時候,發現一臺主機的第二個網路卡雖然載入了,但是沒有UP。造成這個的原因居然是/etc/hostname.ce1檔案中,多了一個回車。
這樣,在重啟系統後,會造成網路卡沒有UP,造成PRIVATE IP之間無法訪問,從而導致上面的問題。
root@ahrac1 # vi /etc/hostname.ce1
tradedb1-priv
~
"/etc/hostname.ce1" 2 lines, 15 characters
# reboot
root@ahrac1 # ifconfig -a
lo0: flags=2001000849
inet 127.0.0.1 netmask ff000000
ce0: flags=1000843
inet 172.25.198.42 netmask ffff0000 broadcast 172.25.255.255
ether 0:14:4f:3b:56:75
ce1: flags=1000843
inet 10.0.0.3 netmask ffffff00 broadcast 10.0.0.255
ether 0:14:4f:3b:56:75
注意,由於hostname.ce1中包含了兩行記錄,因此,重新啟動後,PRIVATE網路卡沒有自動UP,造成了上面的這個問題。將空行刪除後,重新系統,錯誤消失。(當然刪除空行後,直接將ce1網路卡UP即可,重啟是為了確認問題已經解決。)
第三個問題和裸裝置有關。
首先,使用裸裝置無法啟用FLASH RECOVERY AREA,因此選擇裸裝置後,就不要在建立資料庫的時候選擇FLASH RECOVERY AREA。否則會報錯。
其次,裸裝置沒有按照標準文件格式,將其大小放到最後。所以Oracle雖然根據對映檔案找到表空間對應的裸裝置,但是其大小設定和裸裝置不一致。這裡需要手工修改。
第三,裸裝置需要一些額外的預留空間。因此表空間資料檔案的大小至少應該比裸裝置建立的空間少1M。否則會空間不足的錯誤。
第四個問題是一個bug。
在升級資料庫時碰到了ORA-600錯誤。這個問題已經在上一篇文章中進行了描述,這裡就不再重複了。
最後一個問題和VOLUMN MANAGER有關。
在安裝好資料庫之後,重啟了作業系統,結果發現資料庫沒有自動啟動。而透過手工啟動的方式也沒有效果:
root@ahrac1 # ./etc/init.d/init.crs start
Startup will be queued to init within 30 seconds.
重新啟動系統,並檢查後臺程式執行情況,結果發現:
root@ahrac1 # ps –ef|grep ora
oracle 1349 1312 0 15:05:26 ? 0:00 /data/oracle/product/10.2/crs/bin/crsctl.bin check boot
root 1511 880 0 15:05:33 pts/1 0:00 grep ora
oracle 1348 1313 0 15:05:26 ? 0:00 /data/oracle/product/10.2/crs/bin/crsctl.bin check boot
oracle 1313 1234 0 15:05:25 ? 0:00 sh -c /data/oracle/product/10.2/crs/bin/crsctl check boot > /tmp/crsctl.1234
oracle 1350 1215 0 15:05:26 ? 0:00 /data/oracle/product/10.2/crs/bin/crsctl.bin check boot
oracle 1215 1178 0 15:05:25 ? 0:00 sh -c /data/oracle/product/10.2/crs/bin/crsctl check boot > /tmp/crsctl.1178
oracle 1312 1232 0 15:05:25 ? 0:00 sh -c /data/oracle/product/10.2/crs/bin/crsctl check boot > /tmp/crsctl.1232
root@ahrac1 # more /tmp/crsctl.1234
OCR initialization failed accessing OCR device: PROC-26: Error while accessing the physical storage Operating System error [Permission denied] [13]
看這個問題,似乎是共享儲存的許可權問題。
進入共享儲存所在目錄:
root@ahrac1 # cd /dev/vx/rdsk/datadg/
root@ahrac1 # ls -l
total 0
crw------- 1 root root 308, 41000 Mar 27 14:40 ocr
crw------- 1 root root 308, 41001 Mar 27 14:40 ocr2
crw-rw---- 1 oracle oinstall 308, 41018 Mar 27 14:40 tradedb_control1
crw-rw---- 1 oracle oinstall 308, 41019 Mar 27 14:40 tradedb_control2
crw-rw---- 1 oracle oinstall 308, 41020 Mar 27 14:40 tradedb_control3
crw-rw---- 1 oracle oinstall 308, 41010 Mar 27 14:40 tradedb_example_1
crw-rw---- 1 oracle oinstall 308, 41023 Mar 27 14:40 tradedb_flasharea
crw-rw---- 1 oracle oinstall 308, 41022 Mar 27 14:40 tradedb_pwdfile
crw-rw---- 1 oracle oinstall 308, 41012 Mar 27 14:40 tradedb_redo1_1
crw-rw---- 1 oracle oinstall 308, 41013 Mar 27 14:40 tradedb_redo1_2
crw-rw---- 1 oracle oinstall 308, 41014 Mar 27 14:40 tradedb_redo1_3
crw-rw---- 1 oracle oinstall 308, 41015 Mar 27 14:40 tradedb_redo2_1
crw-rw---- 1 oracle oinstall 308, 41016 Mar 27 14:40 tradedb_redo2_2
crw-rw---- 1 oracle oinstall 308, 41017 Mar 27 14:40 tradedb_redo2_3
crw-rw---- 1 oracle oinstall 308, 41021 Mar 27 14:40 tradedb_spfile
crw-rw---- 1 oracle oinstall 308, 41009 Mar 27 14:40 tradedb_sysaux_1
crw-rw---- 1 oracle oinstall 308, 41005 Mar 27 14:40 tradedb_system_1
crw-rw---- 1 oracle oinstall 308, 41008 Mar 27 14:40 tradedb_temp_1
crw-rw---- 1 oracle oinstall 308, 41006 Mar 27 14:40 tradedb_undotbs1_1
crw-rw---- 1 oracle oinstall 308, 41007 Mar 27 14:40 tradedb_undotbs2_1
crw-rw---- 1 oracle oinstall 308, 41011 Mar 27 14:40 tradedb_users_1
crw------- 1 root root 308, 41002 Mar 27 14:40 vot
crw------- 1 root root 308, 41003 Mar 27 14:40 vot2
crw------- 1 root root 308, 41004 Mar 27 14:40 vot3
記得配置完成後,都是oracle。怎麼現在vot和ocr都變成root型別的。想起剛開始不熟悉Volumn Manager的用法,因此建立vot等三個裸裝置的時候沒有指定使用者和組資訊。最後採用作業系統命名grant進行的授權。而其他的裸裝置檔案則是透過vxassist make tradedb_spfile 10m user=oracle group=oinstall mode=660方式建立的。
莫非是這個錯誤造成的crs無法啟動?
嘗試修改這幾個檔案的屬性:
root@ahrac1 # vxedit set user=oracle group=oinstall mode=660 vot
root@ahrac1 # vxedit set user=oracle group=oinstall mode=660 vot2
root@ahrac1 # vxedit set user=oracle group=oinstall mode=660 vot3
root@ahrac1 # vxedit set user=oracle group=oinstall mode=660 ocr
root@ahrac1 # vxedit set user=oracle group=oinstall mode=660 ocr2
root@ahrac1 # ls -l ocr*
crw-rw---- 1 oracle oinstall 308, 41000 Mar 27 14:40 ocr
crw-rw---- 1 oracle oinstall 308, 41001 Mar 27 14:40 ocr2
root@ahrac1 # ls -l vot*
crw-rw---- 1 oracle oinstall 308, 41002 Mar 27 14:40 vot
crw-rw---- 1 oracle oinstall 308, 41003 Mar 27 14:40 vot2
crw-rw---- 1 oracle oinstall 308, 41004 Mar 27 14:40 vot3
下面嘗試重新啟動crs:
root@ahrac1 # /data/oracle/product/10.2/crs/bin/crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
root@ahrac1 # ps -ef|grep ora
oracle 4068 4067 0 16:06:45 ? 0:00 /bin/sh -c ulimit -c unlimited; cd /data/oracle/product/10.2/crs/log/ahrac1/css
oracle 4815 4809 0 16:07:09 ? 0:00 /data/oracle/product/10.2/crs/bin/racgmain start
oracle 4718 1 0 16:07:06 ? 0:00 /data/oracle/product/10.2/database/bin/tnslsnr LISTENER_AHRAC1 -inherit
root 3978 3917 0 16:06:43 ? 0:00 /data/oracle/product/10.2/crs/bin/oprocd run -t 1000 -m 500 -f
oracle 4940 4939 0 16:07:13 ? 0:00 /data/oracle/product/10.2/database/bin/racgmdb -s open
oracle 4321 3912 0 16:06:54 ? 0:00 /data/oracle/product/10.2/crs/bin/evmlogger.bin -o /data/oracle/product/10.2/cr
oracle 1135 1 0 15:45:27 ? 0:00 sh -c sh -c 'ulimit -c unlimited; cd /data/oracle/product/10.2/crs/log/ahrac1/e
oracle 4809 1137 0 16:07:09 ? 0:00 /bin/sh /data/oracle/product/10.2/crs/bin/racgwrap start
root 1137 1 0 15:45:27 ? 0:02 /data/oracle/product/10.2/crs/bin/crsd.bin reboot
oracle 4830 4823 0 16:07:09 ? 0:00 /data/oracle/product/10.2/database/bin/racgmain start
oracle 5559 1 0 16:07:34 ? 0:00 ora_psp0_tradedb1
oracle 4069 4068 0 16:06:45 ? 0:01 /data/oracle/product/10.2/crs/bin/ocssd.bin
oracle 4067 3918 0 16:06:45 ? 0:00 sh -c /bin/sh -c 'ulimit -c unlimited; cd /data/oracle/product/10.2/crs/log/ahr
oracle 5573 1 0 16:07:34 ? 0:00 ora_mman_tradedb1
oracle 3912 1135 0 16:06:43 ? 0:00 /data/oracle/product/10.2/crs/bin/evmd.bin
oracle 4823 1137 0 16:07:09 ? 0:00 /bin/sh /data/oracle/product/10.2/database/bin/racgwrap start
oracle 4834 1 0 16:07:09 ? 0:00 /data/oracle/product/10.2/crs/bin/racgmain ora.tradedb.db rundetach 1 crscmd c
oracle 4832 1 0 16:07:09 ? 0:00 /data/oracle/product/10.2/database/bin/racgimon startd tradedb
oracle 5031 5015 6 16:07:15 ? 0:17 oracletradedb1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 5561 1 0 16:07:34 ? 0:00 ora_lmon_tradedb1
oracle 4836 1 0 16:07:09 ? 0:00 /data/oracle/product/10.2/crs/bin/racgmain ora.tradedb.db rundetach 1 crscmd c
oracle 4906 1 0 16:07:11 ? 0:00 /data/oracle/product/10.2/crs/opmn/bin/ons -d
oracle 4939 4832 0 16:07:13 ? 0:00 /data/oracle/product/10.2/database/bin/racgeut -e _USR_ORA_DEBUG=0 -e ORACLE_SI
oracle 5555 1 0 16:07:34 ? 0:00 ora_pmon_tradedb1
oracle 5015 4940 0 16:07:15 ? 0:00 /data/oracle/product/10.2/database/bin/sqlplus
oracle 4908 4906 0 16:07:11 ? 0:00 /data/oracle/product/10.2/crs/opmn/bin/ons -d
oracle 5557 1 0 16:07:34 ? 0:00 ora_diag_tradedb1
oracle 5563 1 0 16:07:34 ? 0:00 ora_lmd0_tradedb1
oracle 5565 1 3 16:07:34 ? 0:05 ora_lms0_tradedb1
oracle 5569 1 3 16:07:34 ? 0:06 ora_lms1_tradedb1
oracle 5624 1 0 16:07:35 ? 0:00 ora_s000_tradedb1
oracle 5575 1 0 16:07:35 ? 0:00 ora_dbw0_tradedb1
oracle 5577 1 0 16:07:35 ? 0:00 ora_dbw1_tradedb1
oracle 5579 1 0 16:07:35 ? 0:00 ora_lgwr_tradedb1
oracle 5581 1 0 16:07:35 ? 0:00 ora_ckpt_tradedb1
oracle 5583 1 0 16:07:35 ? 0:00 ora_smon_tradedb1
oracle 5585 1 0 16:07:35 ? 0:00 ora_reco_tradedb1
oracle 5587 1 0 16:07:35 ? 0:00 ora_cjq0_tradedb1
oracle 5589 1 0 16:07:35 ? 0:00 ora_mmon_tradedb1
root 5741 1454 0 16:07:40 pts/1 0:00 grep ora
oracle 5607 1 0 16:07:35 ? 0:00 ora_mmnl_tradedb1
oracle 5622 1 0 16:07:35 ? 0:00 ora_d000_tradedb1
問題解決。
看來安裝過程中的任何小問題都會成為後面的陷阱。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-85098/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Solaris10下安裝Oracle10203RAC環境(五)Oracle
- Solaris10下安裝Oracle10203RAC環境(三)Oracle
- Solaris10下安裝Oracle10203RAC環境(二)Oracle
- Solaris10下安裝Oracle10203RAC環境(一)Oracle
- Solaris10下安裝Oracle1106RAC環境(五)Oracle
- Solaris10下安裝Oracle1106RAC環境(四)Oracle
- Solaris10下安裝Oracle1106RAC環境(三)Oracle
- Solaris10下安裝Oracle1106RAC環境(二)Oracle
- Solaris10下安裝Oracle1106RAC環境(一)Oracle
- Solaris10下Silent模式安裝Oracle1106RAC環境(八)模式Oracle
- Solaris10下Silent模式安裝Oracle1106RAC環境(七)模式Oracle
- Solaris10下Silent模式安裝Oracle1106RAC環境(六)模式Oracle
- Solaris10下Silent模式安裝Oracle1106RAC環境(五)模式Oracle
- Solaris10下Silent模式安裝Oracle1106RAC環境(四)模式Oracle
- Solaris10下Silent模式安裝Oracle1106RAC環境(三)模式Oracle
- Solaris10下Silent模式安裝Oracle1106RAC環境(二)模式Oracle
- Solaris10下Silent模式安裝Oracle1106RAC環境(一)模式Oracle
- Windows 環境下 Python 環境安裝WindowsPython
- Windows 環境下安裝 LaravelWindowsLaravel
- Mac環境下安裝PodMac
- Windows 環境下安裝 RedisWindowsRedis
- Windows環境下安裝RabbitMQWindowsMQ
- kali環境下安裝dvwa
- ubuntu下安裝boost環境Ubuntu
- Unbuntu下安裝Go環境Go
- Linux下安裝Go環境LinuxGo
- docker環境下安裝tensorflowDocker
- Windows環境下安裝LinuxWindowsLinux
- Docker 下安裝配置 lnmp 環境DockerLNMP
- linux環境下redis安裝LinuxRedis
- Linux環境下安裝NginxLinuxNginx
- Windows環境下安裝NexusWindows
- Mac環境下安裝配置RedisMacRedis
- windows下配置安裝YAF環境Windows
- windows環境下安裝seleniumWindows
- LINUX環境下安裝TIPTOPLinux
- Linux下Java環境安裝LinuxJava
- ubuntu環境下安裝perf工具Ubuntu