Oracle 12cR1 RAC 在VMware Workstation上安裝(中)—圖形介面安裝
Oracle 12cR1 RAC 在VMware Workstation上安裝(中)—圖形介面安裝
1.1 圖形介面安裝
1.1.1 安裝GRID
安裝日誌:/u01/app/oraInventory/logs/installActions2014-06-05_06-12-27AM.log
首先開啟Xmanager - Passive軟體,或者直接以grid使用者登入虛擬機器,在虛擬機器裡邊進行圖形介面操作。
[grid@raclhr-12cR1-N1 ~]$ export DISPLAY=192.168.59.1:0.0 [grid@raclhr-12cR1-N1 ~]$ xhost + access control disabled, clients can connect from any host [grid@raclhr-12cR1-N1 ~]$ cd /soft/grid/ [grid@raclhr-12cR1-N1 grid]$ ll total 80 drwxr-xr-x 4 root root 4096 Jan 16 17:04 install -rwxr-xr-x 1 root root 34132 Jul 11 2014 readme.html drwxrwxr-x 2 root root 4096 Jul 7 2014 response drwxr-xr-x 2 root root 4096 Jul 7 2014 rpm -rwxr-xr-x 1 root root 5085 Dec 20 2013 runcluvfy.sh -rwxr-xr-x 1 root root 8534 Jul 7 2014 runInstaller drwxrwxr-x 2 root root 4096 Jul 7 2014 sshsetup drwxr-xr-x 14 root root 4096 Jul 7 2014 stage -rwxr-xr-x 1 root root 500 Feb 7 2013 welcome.html [grid@raclhr-12cR1-N1 grid]$ ./runInstaller Starting Oracle Universal Installer...
Checking Temp space: must be greater than 415 MB. Actual 2790 MB Passed Checking swap space: must be greater than 150 MB. Actual 2047 MB Passed Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-01-16_08-41-48PM. Please wait ...[grid@raclhr-12cR1-N1 grid]$ [grid@raclhr-12cR1-N1 grid]$
|
1.1.1.1 開始安裝Grid Infrastructure軟體
依照上圖設定好,單擊“Next”按鈕。
選擇Configure a Standard cluster,並選擇“下一步”:
1.1.1.2 選擇安裝型別
依照上圖設定好,單擊“Next”按鈕。
選擇語言
依照上圖設定好,單擊“Next”按鈕。
1.1.1.3 為叢集命名
SCAN Name和/etc/hosts檔案中設定一樣,依照上圖設定好,單擊“Next”按鈕。
1.1.1.4 定義節點
上圖顯示出安裝程式所在的節點,節點名和vip名必須小寫,先點選Edit修改,其他節點需要手工新增。按Add按鈕。Hostname、Virtual IP Name和檔案hosts中設定一樣,依照上圖設定好,單擊OK按鈕。
1.1.1.5 配置SSH使用者等價
輸入密碼,按Setup按鈕建立SSH無密碼互連線。如果在安裝準備階段手工配置了SSH連線,直接點Test按鈕測試即可。依照上圖設定好,單擊“Next”按鈕。
1.1.1.6 定義網路卡
1.1.1.7 配置OCR和Voting disk
依照上圖設定好,單擊“Next”按鈕。設定Disk group name 為OCR,Redundancy選擇External,單擊Change Discovery Path按鈕。
指定OCR和Voting disk存放位置為/dev/asm*,依照上圖設定Disk Discovery Path為實際路徑,單擊OK按鈕。
1.1.1.8 配置作業系統使用者和組
此處選擇use same passwords for these accounts
單擊Yes按鈕。
依照上圖設定好,單擊“Next”按鈕。
點選“Next”繼續安裝;
此處配置為:
Oracle ASM administrator:asmadmin
Oracle ASM DBA :asmdba
Oracle ASM Operator:asmoper
1.1.1.9 確認安裝路徑
依照上圖設定好,單擊“Next”按鈕。
依照上圖設定好,單擊“Next”按鈕。
點選“Next”繼續;
1.1.1.10 安裝前檢查
安裝程式會檢查系統環境是否符合要求,包括RPM包、磁碟空間、SWAP、時鐘同步等,任何一個條件沒有透過,都會給出提示和解決辦法。
以上幾項可忽略,選擇檢查框Ignore All,單擊“Next”按鈕。
單擊“Install”按鈕。
1.1.1.11 52%複製到節點2
[grid@raclhr-12cR1-N1 grid]$ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_rootlhr-Vol00 9.9G 4.9G 4.5G 52% / tmpfs 1000M 72K 1000M 1% /dev/shm /dev/sda1 194M 35M 150M 19% /boot /dev/mapper/vg_rootlhr-Vol01 3.0G 578M 2.3G 21% /tmp /dev/mapper/vg_rootlhr-Vol03 3.0G 70M 2.8G 3% /home /dev/mapper/vg_orasoft-lv_orasoft_u01 20G 6.7G 12G 36% /u01 .host:/ 331G 234G 97G 71% /mnt/hgfs /dev/mapper/vg_orasoft-lv_orasoft_soft 20G 11G 8.6G 54% /soft [grid@raclhr-12cR1-N1 grid]$ [root@raclhr-12cR1-N2 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_rootlhr-Vol00 9.9G 4.9G 4.5G 52% / tmpfs 1000M 72K 1000M 1% /dev/shm /dev/sda1 194M 35M 150M 19% /boot /dev/mapper/vg_rootlhr-Vol01 3.0G 80M 2.8G 3% /tmp /dev/mapper/vg_rootlhr-Vol03 3.0G 69M 2.8G 3% /home /dev/mapper/vg_orasoft-lv_orasoft_u01 20G 5.3G 14G 29% /u01 .host:/ 331G 234G 97G 71% /mnt/hgfs /dev/mapper/vg_orasoft-lv_orasoft_soft 20G 172M 19G 1% /soft [root@raclhr-12cR1-N2 ~]#
|
1.1.1.12 81% 執行root.sh
出現以上視窗時,不要關閉Execute Configuration scripts視窗,切換到節點1和節點2的root使用者,先在節點1執行以root使用者執行orainstRoot.sh,執行完後再到節點2執行:
/u01/app/oraInventory/orainstRoot.sh |
以root使用者在節點1上執行root.sh,然後再節點2上執行root.sh:
/u01/app/12.1.0/grid_1/root.sh |
若root.sh執行失敗,則重新執行root.sh的步驟如下:
---$ORACLE_HOME 為GRID_HOME的路徑,執行之前最好先手動把資料庫資源關閉 日誌地址:$ORACLE_HOME/cfgtoollogs/crsconfig/ 重置的日誌檔案:hadelete.log root.sh指令碼日誌:rootcrs_rac2.log
--------------① 指令碼方式 ---執行失敗,重新執行root.sh指令碼 $ORACLE_HOME/crs/install/rootcrs.pl -deconfig -force -verbose --$ORACLE_HOME/crs/install/rootcrs.pl -deconfig -force -verbose -lastnode -keepdg dd if=/dev/zero of=/dev/rhdiskN bs=1024k count=1024 lquerypv -h /dev/rhdisk5 $ORACLE_HOME/root.sh
$ORACLE_HOME/crs/install/rootcrs.pl -deconfig -force -verbose --$ORACLE_HOME/crs/install/rootcrs.pl -deconfig -force -verbose -lastnode -keepdg $ORACLE_HOME/root.sh
---$ORACLE_HOME/crs/install/rootcrs.pl -deconfig -force -verbose執行完成之後需要刪除如下的檔案 ls -l $ORACLE_BASE/Clusterware/ckptGridHA* find $ORACLE_HOME/gpnp/* -type f find $ORACLE_HOME/gpnp/* -type f -exec rm -rf {} \; |
[grid@raclhr-12cR1-N1 grid]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.OCR.dg ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.asm ONLINE ONLINE raclhr-12cr1-n1 Started,STABLE ONLINE ONLINE raclhr-12cr1-n2 Started,STABLE ora.net1.network ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.ons ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.MGMTLSNR 1 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.oc4j 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.raclhr-12cr1-n1.vip 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.raclhr-12cr1-n2.vip 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.scan1.vip 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE -------------------------------------------------------------------------------- [grid@raclhr-12cR1-N1 grid]$
|
1.1.1.13 91%建立MGMTDB
等到執行完root.sh,切換回Execute Configuration scripts視窗單擊“OK”按鈕。
建立MGMTDB,資料儲存在OCR磁碟組。從後臺程式(ps -ef|grep mgmt)找到了如下的SQL語句:
dbca -silent -createDatabase -createAsContainerDatabase true -templateName MGMTSeed_Database.dbc -sid -MGMTDB -gdbName _mgmtdb -storageType ASM -diskGroupName OCR -datafileJarLocation /u01/app/12.1.0/grid/assistants/dbca/templates -characterset AL32UTF8 -autoGeneratePasswords -skipUserTemplateCheck -oui_internal
|
[root@raclhr-12cR1-N2 ~]# su - grid asmcmd lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED EXTERN N 512 4096 1048576 6144 5847 0 5847 0 Y OCR/ [root@raclhr-12cR1-N2 ~]# su - grid asmcmd lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED EXTERN N 512 4096 1048576 6144 4318 0 4318 0 Y OCR/ [root@raclhr-12cR1-N2 ~]# su - grid asmcmd lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED EXTERN N 512 4096 1048576 6144 1733 0 1733 0 Y OCR/ [root@raclhr-12cR1-N2 ~]# su - grid asmcmd lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED EXTERN N 512 4096 1048576 6144 1682 0 1682 0 Y OCR/ [root@raclhr-12cR1-N2 ~]#
|
建立完成後:
[grid@raclhr-12cR1-N1 grid]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.OCR.dg ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.asm ONLINE ONLINE raclhr-12cr1-n1 Started,STABLE ONLINE ONLINE raclhr-12cr1-n2 Started,STABLE ora.net1.network ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.ons ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.MGMTLSNR 1 ONLINE ONLINE raclhr-12cr1-n1 169.254.146.43 192.1 68.2.100,STABLE ora.cvu 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.mgmtdb 1 ONLINE ONLINE raclhr-12cr1-n1 Open,STABLE ora.oc4j 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.raclhr-12cr1-n1.vip 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.raclhr-12cr1-n2.vip 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.scan1.vip 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE -------------------------------------------------------------------------------- [grid@raclhr-12cR1-N1 grid]$ [grid@raclhr-12cR1-N1 grid]$ ps -ef|grep pmon grid 21105 1 0 Jan16 ? 00:00:00 asm_pmon_+ASM1 grid 36779 1 0 00:33 ? 00:00:00 mdb_pmon_-MGMTDB grid 44574 12846 0 00:45 pts/0 00:00:00 grep pmon [grid@raclhr-12cR1-N1 grid]$ ps -ef|grep MGMTDB | wc -l 41 [grid@raclhr-12cR1-N1 grid]$
|
單擊“Next”按鈕。
單擊Yes按鈕。
單擊Close按鈕。
1.1.1.14 校驗
確認Grid安裝成功
[grid@raclhr-12cR1-N2 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.OCR.dg ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.asm ONLINE ONLINE raclhr-12cr1-n1 Started,STABLE ONLINE ONLINE raclhr-12cr1-n2 Started,STABLE ora.net1.network ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.ons ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.MGMTLSNR 1 ONLINE ONLINE raclhr-12cr1-n1 169.254.146.43 192.1 68.2.100,STABLE ora.cvu 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.mgmtdb 1 ONLINE ONLINE raclhr-12cr1-n1 Open,STABLE ora.oc4j 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.raclhr-12cr1-n1.vip 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.raclhr-12cr1-n2.vip 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.scan1.vip 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE -------------------------------------------------------------------------------- [grid@raclhr-12cR1-N2 ~]$ [grid@raclhr-12cR1-N2 ~]$ crsctl query css votedisk ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE 645b7b8eacd94fd1bfdc8466045e5c65 (/dev/asm-diskc) [OCR] Located 1 voting disk(s). [grid@raclhr-12cR1-N2 ~]$ ocrcheck Status of Oracle Cluster Registry is as follows : Version : 4 Total space (kbytes) : 409568 Used space (kbytes) : 1456 Available space (kbytes) : 408112 ID : 660744490 Device/File Name : +OCR Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check bypassed due to non-privileged user
[grid@raclhr-12cR1-N2 ~]$ [grid@raclhr-12cR1-N2 ~]$ crsctl check crs CRS-4638: Oracle High Availability Services is online CRS-4537: Cluster Ready Services is online CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online [grid@raclhr-12cR1-N2 ~]$ [grid@raclhr-12cR1-N2 ~]$ asmcmd ASMCMD> lsdg State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name MOUNTED EXTERN N 512 4096 1048576 6144 1682 0 1682 0 Y OCR/ ASMCMD> lsdsk -p --discovery Group_Num Disk_Num Incarn Mount_Stat Header_Stat Mode_Stat State Path 1 0 3915929494 CACHED MEMBER ONLINE NORMAL /dev/asm-diskc 0 1 0 CLOSED CANDIDATE ONLINE NORMAL /dev/asm-diskd 0 0 0 CLOSED CANDIDATE ONLINE NORMAL /dev/asm-diske ASMCMD>
[grid@raclhr-12cR1-N2 ~]$ $ORACLE_HOME/bin/kfod disks=all s=true ds=true -------------------------------------------------------------------------------- Disk Size Header Path Disk Group User Group ================================================================================ 1: 6144 Mb MEMBER /dev/asm-diskc OCR grid asmadmin 2: 10240 Mb CANDIDATE /dev/asm-diskd # grid asmadmin 3: 10240 Mb CANDIDATE /dev/asm-diske # grid asmadmin -------------------------------------------------------------------------------- ORACLE_SID ORACLE_HOME ================================================================================ +ASM1 /u01/app/12.1.0/grid +ASM2 /u01/app/12.1.0/grid
|
1.1.2 建立DATA和FRA磁碟組
以 grid 使用者執行 asmca 命令
使用asmca,建立DATA和FRA兩個磁碟組。
點選Create按鈕:
如上圖,點選OK:
DATA建立成功,相同步驟建立FRA磁碟組。
[grid@raclhr-12cR1-N2 ~]$ $ORACLE_HOME/bin/kfod disks=all s=true ds=true -------------------------------------------------------------------------------- Disk Size Header Path Disk Group User Group ================================================================================ 1: 6144 Mb MEMBER /dev/asm-diskc OCR grid asmadmin 2: 10240 Mb MEMBER /dev/asm-diskd DATA grid asmadmin 3: 10240 Mb MEMBER /dev/asm-diske FRA grid asmadmin -------------------------------------------------------------------------------- ORACLE_SID ORACLE_HOME ================================================================================ +ASM1 /u01/app/12.1.0/grid +ASM2 /u01/app/12.1.0/grid [grid@raclhr-12cR1-N2 ~]$ [grid@raclhr-12cR1-N2 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.FRA.dg ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.LISTENER.lsnr ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.OCR.dg ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.asm ONLINE ONLINE raclhr-12cr1-n1 Started,STABLE ONLINE ONLINE raclhr-12cr1-n2 Started,STABLE ora.net1.network ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.ons ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.MGMTLSNR 1 ONLINE ONLINE raclhr-12cr1-n1 169.254.146.43 192.1 68.2.100,STABLE ora.cvu 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.mgmtdb 1 ONLINE ONLINE raclhr-12cr1-n1 Open,STABLE ora.oc4j 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.raclhr-12cr1-n1.vip 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.raclhr-12cr1-n2.vip 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.scan1.vip 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE -------------------------------------------------------------------------------- [grid@raclhr-12cR1-N2 ~]$
|
1.1.3 停止MGMTDB
由於是在虛擬機器上,記憶體不足,所以建議先把MGMTDB庫停掉。
[grid@raclhr-12cR1-N1 ~]$ srvctl stop mgmtdb [grid@raclhr-12cR1-N1 ~]$ srvctl status mgmtdb Database is enabled Database is not running. [grid@raclhr-12cR1-N1 ~]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.FRA.dg ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.LISTENER.lsnr ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.OCR.dg ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.asm ONLINE ONLINE raclhr-12cr1-n1 Started,STABLE ONLINE ONLINE raclhr-12cr1-n2 Started,STABLE ora.net1.network ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.ons ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.MGMTLSNR 1 ONLINE ONLINE raclhr-12cr1-n1 169.254.20.104 192.1 68.2.100,STABLE ora.cvu 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.lhrrac.db 1 ONLINE ONLINE raclhr-12cr1-n1 Open,STABLE 2 ONLINE ONLINE raclhr-12cr1-n2 Open,STABLE ora.mgmtdb 1 OFFLINE OFFLINE Instance Shutdown,ST ABLE ora.oc4j 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.raclhr-12cr1-n1.vip 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.raclhr-12cr1-n2.vip 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.scan1.vip 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE -------------------------------------------------------------------------------- [grid@raclhr-12cR1-N1 ~]$ [grid@raclhr-12cR1-N2 oracle]$ ORACLE_SID=-MGMTDB [grid@raclhr-12cR1-N2 oracle]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Tue Jan 17 11:46:18 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance. |
1.1.4 Database安裝與配置
1.1.4.1 安裝資料庫
日誌:tail -f /u01/app/oraInventory/logs/installActions2014-06-05_01-30-25AM.log
以Oracle 使用者在rac1上安裝:
[oracle@raclhr-12cR1-N1 ~]$ export DISPLAY=192.168.59.1:0.0 [oracle@raclhr-12cR1-N1 ~]$ xhost + access control disabled, clients can connect from any host [oracle@raclhr-12cR1-N1 ~]$ cd /soft/database/ [oracle@raclhr-12cR1-N1 database]$ ll total 72 drwxr-xr-x 4 root root 4096 Jan 16 17:04 install -rwxr-xr-x 1 root root 34132 Jul 11 2014 readme.html drwxrwxr-x 2 root root 4096 Jul 7 2014 response drwxr-xr-x 2 root root 4096 Jul 7 2014 rpm -rwxr-xr-x 1 root root 8533 Jul 7 2014 runInstaller drwxrwxr-x 2 root root 4096 Jul 7 2014 sshsetup drwxr-xr-x 14 root root 4096 Jul 7 2014 stage -rwxr-xr-x 1 root root 500 Feb 7 2013 welcome.html [oracle@raclhr-12cR1-N1 database]$ ./runInstaller Starting Oracle Universal Installer...
Checking Temp space: must be greater than 500 MB. Actual 2783 MB Passed Checking swap space: must be greater than 150 MB. Actual 1732 MB Passed Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-01-17_09-54-27AM. Please wait ...[oracle@raclhr-12cR1-N1 database]$ [oracle@raclhr-12cR1-N1 database]$
|
安裝oracle database軟體
依照上圖設定好,單擊“Next”按鈕。
單擊Yes按鈕。
1.1.4.2 僅安裝軟體
選擇在安裝過程中是否建庫。這裡選擇僅安裝軟體,安裝完成後再建庫,建庫過程詳見第6章。
依照上圖設定好,單擊“Next”按鈕。
1.1.4.3 安裝叢集資料庫
依照上圖設定好,按SSH Connectivity按鈕。
1.1.4.4 配置SSH使用者等價
點選“Test”進行測試SSH,然後單擊“Next”按鈕。
1.1.4.5 選擇語言
依照上圖設定好,單擊“Next”按鈕。
1.1.4.6 選擇安裝企業版
依照上圖設定好,單擊“NEXT”按鈕。
1.1.4.7 確認安裝路徑
依照上圖設定好,單擊“Next”按鈕。
1.1.4.8 配置作業系統使用者和組
依照上圖設定好,單擊“Next”按鈕。
1.1.4.9 安裝前檢查
以上兩項可忽略,選擇檢查框Ignore All,單擊“Next”按鈕。
選擇“Yes”,
單擊“Next”按鈕。
1.1.4.10 44%的rman工具
44% 的rman工具的時候很慢,,,,,主要看OS的記憶體大小和機器效能了。。。
1.1.4.11 65%的時候很慢
這個時候在copy到rac2上,可以檢視大小來確定是否掛起,等待向其他節點複製。
1.1.4.12 95%執行root.sh
不要關閉Execute Configuration scripts視窗,切換到節點1和節點2的root使用者Terminal終端視窗,root.sh先在節點1執行,執行完後再到節點2執行:
/u01/app/oracle/product/12.1.0/dbhome_1/root.sh
等到執行完root.sh,切換回Execute Configuration scripts視窗單擊“OK”按鈕。
單擊Close按鈕。
1.1.5 使用DBCA建立資料庫
在Oracle 使用者下在節點一操作:
節點1執行dbca圖形化安裝程式建立資料庫:
su - oracle
export DISPLAY=$IP:0.0
cd /oracle/app/oracle/product/11.2.0/dbhome/bin
./dbca
1.1.5.1 進入歡迎介面,選擇建立RAC庫
依照上圖設定好,單擊“Next”按鈕。
也可以選擇預設配置,如下圖:
這裡選擇高階模式,單擊“Next”按鈕。
選擇使用者自定義(Custom Database)方式,採用定製的方法才建立資料庫。單擊“Next”按鈕。
1.1.5.2 確定資料庫名及資料庫例項名
根據應用需求,輸入的Database Name和SID。依照上圖設定好,單擊“Next”按鈕。Global Database Name和SID Prefix名字一致。
注意:Oracle 12c 支援Oracle_SID的長度為12位,db_name的長度為8位。
選擇需要安裝資料庫的Node節點,選擇完成後點選“Next”繼續。
1.1.5.3 選擇資料庫管理特徵和驗證特性
點選“Next”繼續。
Password=oracleMODE,依照上圖設定好,單擊“Next”按鈕。
1.1.5.4 選擇資料庫儲存特徵
設定儲存型別:選擇ASM。
設定資料存放方式:選擇"Use Common Location for All Database Files:"
Files Location:+DATA。
單擊“Next”按鈕。
1.1.5.5 選擇資料庫元件
使用者根據實際應用需要選擇元件。
點選“Next”繼續配置。
1.1.5.6 配置有關的初始化引數
注意:資料塊大小,字符集引數,在建立例項後將不能被修改。所以在安裝例項時,一定要確認設定的正確性。
設定SGA+PGA使用70-80% 的實體記憶體,對於SGA可配置(SGA+PGA)的80%,PGA為(SGA+PGA)的20%。
推薦:SGA=實體記憶體×0.7×0.8
PGA=實體記憶體×0.7×0.2
單擊“Next”按鈕。
設定 程式數量,processs設定為5000。依照上圖設定好,單擊“Next”按鈕。
設定“Database Character Set”為需求設定,“National Character Set”為“AL16UTF16”編碼(與專案組確認是否有使用nchar/nvarchar型別,確認編碼)。依照上圖設定好,單擊“Next”按鈕。
連線模式選擇“專用伺服器模式”,點選“Next”繼續。
注意:資料塊大小,字符集引數,在建立例項後將不能被修改。所以在安裝例項時,一定要確認設定的正確性。
1.1.5.7 進行安裝
檢視上圖中的報錯是由於一個SCAN IP導致,可以忽略所有,然後點選“Next”繼續安裝。DBCA已自動配置完兩個節點Database的$ORACLE_HOME/network/admin/tnsnames.ora。
1.1.5.8 日誌路徑
可以檢視dbca建庫日誌
路徑:/u01/app/oracle/cfgtoollogs/dbca/racdb
tail -f /u01/app/oracle/cfgtoollogs/dbca/racdb/trace.log
1.1.5.9 驗證
[oracle@raclhr-12cR1-N1 bin]$ crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.FRA.dg ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.LISTENER.lsnr ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.OCR.dg ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.asm ONLINE ONLINE raclhr-12cr1-n1 Started,STABLE ONLINE ONLINE raclhr-12cr1-n2 Started,STABLE ora.net1.network ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.ons ONLINE ONLINE raclhr-12cr1-n1 STABLE ONLINE ONLINE raclhr-12cr1-n2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.MGMTLSNR 1 ONLINE ONLINE raclhr-12cr1-n2 169.254.166.174 192. 168.2.101,STABLE ora.cvu 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.lhr12crac.db 1 ONLINE ONLINE raclhr-12cr1-n1 Open,STABLE 2 ONLINE ONLINE raclhr-12cr1-n2 Open,STABLE ora.mgmtdb 1 OFFLINE OFFLINE Instance Shutdown,ST ABLE ora.oc4j 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.raclhr-12cr1-n1.vip 1 ONLINE ONLINE raclhr-12cr1-n1 STABLE ora.raclhr-12cr1-n2.vip 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE ora.scan1.vip 1 ONLINE ONLINE raclhr-12cr1-n2 STABLE -------------------------------------------------------------------------------- [oracle@raclhr-12cR1-N1 bin]$ [oracle@raclhr-12cR1-N1 bin]$ crsctl check cluster CRS-4537: Cluster Ready Services is online CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online [oracle@raclhr-12cR1-N1 bin]$ srvctl status database -d lhr12crac Instance lhr12cra1 is running on node raclhr-12cr1-n1 Instance lhr12cra2 is running on node raclhr-12cr1-n2 [oracle@raclhr-12cR1-N1 bin]$ srvctl status nodeapps VIP raclhr-12cr1-n1-vip is enabled VIP raclhr-12cr1-n1-vip is running on node: raclhr-12cr1-n1 VIP raclhr-12cr1-n2-vip is enabled VIP raclhr-12cr1-n2-vip is running on node: raclhr-12cr1-n2 Network is enabled Network is running on node: raclhr-12cr1-n1 Network is running on node: raclhr-12cr1-n2 ONS is enabled ONS daemon is running on node: raclhr-12cr1-n1 ONS daemon is running on node: raclhr-12cr1-n2 [oracle@raclhr-12cR1-N1 bin]$ srvctl config nodeapps Network 1 exists Subnet IPv4: 192.168.59.0/255.255.255.0/eth0, static Subnet IPv6: Ping Targets: Network is enabled Network is individually enabled on nodes: Network is individually disabled on nodes: VIP exists: network number 1, hosting node raclhr-12cr1-n1 VIP Name: raclhr-12cr1-n1-vip VIP IPv4 Address: 192.168.59.162 VIP IPv6 Address: VIP is enabled. VIP is individually enabled on nodes: VIP is individually disabled on nodes: VIP exists: network number 1, hosting node raclhr-12cr1-n2 VIP Name: raclhr-12cr1-n2-vip VIP IPv4 Address: 192.168.59.163 VIP IPv6 Address: VIP is enabled. VIP is individually enabled on nodes: VIP is individually disabled on nodes: ONS exists: Local port 6100, remote port 6200, EM port 2016, Uses SSL false ONS is enabled ONS is individually enabled on nodes: ONS is individually disabled on nodes: [oracle@raclhr-12cR1-N1 bin]$ srvctl config database -d lhr12crac -a Database unique name: lhr12crac Database name: lhr12cra Oracle home: /u01/app/oracle/product/12.1.0/dbhome_1 Oracle user: oracle Spfile: +DATA/LHR12CRAC/PARAMETERFILE/spfile.278.933512629 Password file: +DATA/LHR12CRAC/PASSWORD/pwdlhr12crac.266.933512143 Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: Disk Groups: DATA,FRA Mount point paths: Services: Type: RAC Start concurrency: Stop concurrency: Database is enabled Database is individually enabled on nodes: Database is individually disabled on nodes: OSDBA group: dba OSOPER group: oinstall Database instances: lhr12cra1,lhr12cra2 Configured nodes: raclhr-12cr1-n1,raclhr-12cr1-n2 Database is administrator managed [oracle@raclhr-12cR1-N1 bin]$ srvctl status asm ASM is running on raclhr-12cr1-n2,raclhr-12cr1-n1 [oracle@raclhr-12cR1-N1 bin]$ srvctl config asm -a ASM home: <CRS home> Password file: +OCR/orapwASM ASM listener: LISTENER ASM is enabled. ASM is individually enabled on nodes: ASM is individually disabled on nodes: [oracle@raclhr-12cR1-N1 bin]$ srvctl status listener Listener LISTENER is enabled Listener LISTENER is running on node(s): raclhr-12cr1-n2,raclhr-12cr1-n1 [oracle@raclhr-12cR1-N1 bin]$ srvctl config listener -a Name: LISTENER Type: Database Listener Network: 1, Owner: grid Home: <CRS home> /u01/app/12.1.0/grid on node(s) raclhr-12cr1-n2,raclhr-12cr1-n1 End points: TCP:1521 Listener is enabled. Listener is individually enabled on nodes: Listener is individually disabled on nodes: [oracle@raclhr-12cR1-N1 bin]$ srvctl config nodeapps -a -g -s -l PRKO-2207 : Warning:-gsdonly option has been deprecated and will be ignored. Warning:-listener option has been deprecated and will be ignored. Network 1 exists Subnet IPv4: 192.168.59.0/255.255.255.0/eth0, static Subnet IPv6: Ping Targets: Network is enabled Network is individually enabled on nodes: Network is individually disabled on nodes: VIP exists: network number 1, hosting node raclhr-12cr1-n1 VIP Name: raclhr-12cr1-n1-vip VIP IPv4 Address: 192.168.59.162 VIP IPv6 Address: VIP is enabled. VIP is individually enabled on nodes: VIP is individually disabled on nodes: VIP exists: network number 1, hosting node raclhr-12cr1-n2 VIP Name: raclhr-12cr1-n2-vip VIP IPv4 Address: 192.168.59.163 VIP IPv6 Address: VIP is enabled. VIP is individually enabled on nodes: VIP is individually disabled on nodes: ONS exists: Local port 6100, remote port 6200, EM port 2016, Uses SSL false ONS is enabled ONS is individually enabled on nodes: ONS is individually disabled on nodes: Name: LISTENER Type: Database Listener Network: 1, Owner: grid Home: <CRS home> /u01/app/12.1.0/grid on node(s) raclhr-12cr1-n2,raclhr-12cr1-n1 End points: TCP:1521 Listener is enabled. Listener is individually enabled on nodes: Listener is individually disabled on nodes: [oracle@raclhr-12cR1-N1 bin]$ srvctl status scan SCAN VIP scan1 is enabled SCAN VIP scan1 is running on node raclhr-12cr1-n2 [oracle@raclhr-12cR1-N1 bin]$ srvctl config scan SCAN name: raclhr-12cR1-scan, Network: 1 Subnet IPv4: 192.168.59.0/255.255.255.0/eth0, static Subnet IPv6: SCAN 0 IPv4 VIP: 192.168.59.164 SCAN VIP is enabled. SCAN VIP is individually enabled on nodes: SCAN VIP is individually disabled on nodes: [oracle@raclhr-12cR1-N1 bin]$ cluvfy comp clocksync -verbose
Verifying Clock Synchronization across the cluster nodes
Checking if Clusterware is installed on all nodes... Oracle Clusterware is installed on all nodes.
Checking if CTSS Resource is running on all nodes... Check: CTSS Resource running on all nodes Node Name Status ------------------------------------ ------------------------ raclhr-12cr1-n1 passed CTSS resource check passed
Querying CTSS for time offset on all nodes... Query of CTSS for time offset passed
Check CTSS state started... Check: CTSS state Node Name State ------------------------------------ ------------------------ raclhr-12cr1-n1 Active CTSS is in Active state. Proceeding with check of clock time offsets on all nodes... Reference Time Offset Limit: 1000.0 msecs Check: Reference Time Offset Node Name Time Offset Status ------------ ------------------------ ------------------------ raclhr-12cr1-n1 0.0 passed
Time offset is within the specified limits on the following set of nodes: "[raclhr-12cr1-n1]" Result: Check of clock time offsets passed
Oracle Cluster Time Synchronization Services check passed
Verification of Clock Synchronization across the cluster nodes was successful. [oracle@raclhr-12cR1-N1 bin]$ ORACLE_SID=lhr12cra1 [oracle@raclhr-12cR1-N1 bin]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Tue Jan 17 13:52:17 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Advanced Analytics and Real Application Testing options
SQL> set line 9999 SQL> show parameter cluster
NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ cluster_database boolean TRUE cluster_database_instances integer 2 cluster_interconnects string SQL> col host_name format a20 SQL> set linesize 200 SQL> select INSTANCE_NAME,HOST_NAME,VERSION,STARTUP_TIME,STATUS,ACTIVE_STATE,INSTANCE_ROLE,DATABASE_STATUS from gv$INSTANCE;
INSTANCE_NAME HOST_NAME VERSION STARTUP_TIME STATUS ACTIVE_STATE INSTANCE_ROLE -------------------------------- -------------------- ---------------------------------- ------------------- ------------------------ ------------------ ------------------------------------ DATABASE_STATUS ---------------------------------- lhr12cra1 raclhr-12cR1-N1 12.1.0.2.0 2017-01-17 13:05:14 OPEN NORMAL PRIMARY_INSTANCE ACTIVE
lhr12cra2 raclhr-12cR1-N2 12.1.0.2.0 2017-01-17 13:05:59 OPEN NORMAL PRIMARY_INSTANCE ACTIVE
SQL>
|
1.2 解除安裝
下面解除安裝掉之前安裝好的叢集,採用靜默安裝的方式來安裝叢集並建立資料庫。
kill -9 `ps -ef|grep d.bin| grep -v grep | awk '{print $2}'` rm -rf /etc/ora* rm -rf /var/tmp/.oracle rm -rf /tmp/* rm -rf /u01/app/ 修改 /etc/inittab 刪除以下三行. h1:2:respawn:/etc/init.evmd run >/dev/null 2>&1 h2:2:respawn:/etc/init.cssd fatal >/dev/null 2>&1 h3:2:respawn:/etc/init.crsd run >/dev/null 2>&1 dd if=/dev/zero of=/dev/asm-diskc bs=104857600 count=1
|
重新建立相關路徑:
mkdir -p /u01/app/oracle mkdir -p /u01/app/grid mkdir -p /u01/app/12.1.0/grid mkdir -p /u01/app/oracle/product/12.1.0/dbhome_1 chown -R grid:oinstall /u01/app/grid chown -R grid:oinstall /u01/app/12.1.0 chown -R oracle:oinstall /u01/app/oracle chmod -R 775 /u01
mkdir -p /u01/app/oraInventory chown -R grid:oinstall /u01/app/oraInventory chmod -R 775 /u01/app/oraInventory
|
然後重啟2臺主機。
About Me
...............................................................................................................................
● 本文作者:小麥苗,只專注於資料庫的技術,更注重技術的運用
● 本文在itpub(http://blog.itpub.net/26736162)、部落格園(http://www.cnblogs.com/lhrbest)和個人微信公眾號(xiaomaimiaolhr)上有同步更新
● 本文itpub地址:http://blog.itpub.net/26736162/viewspace-2132772/
● 本文部落格園地址:http://www.cnblogs.com/lhrbest/p/6337508.html
● 本文pdf版及小麥苗雲盤地址:http://blog.itpub.net/26736162/viewspace-1624453/
● QQ群:230161599 微信群:私聊
● 聯絡我請加QQ好友(642808185),註明新增緣由
● 於 2017-01-12 08:00 ~ 2016-01-21 24:00 在農行完成
● 文章內容來源於小麥苗的學習筆記,部分整理自網路,若有侵權或不當之處還請諒解
● 版權所有,歡迎分享本文,轉載請保留出處
...............................................................................................................................
拿起手機使用微信客戶端掃描下邊的左邊圖片來關注小麥苗的微信公眾號:xiaomaimiaolhr,掃描右邊的二維碼加入小麥苗的QQ群,學習最實用的資料庫技術。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26736162/viewspace-2132772/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 12cR1 RAC 在VMware Workstation上安裝(下)—靜默安裝Oracle
- Oracle 12cR1 RAC 在VMware Workstation上安裝(上)—OS環境配置Oracle
- 在VMware Workstation上安裝Kali LinuxLinux
- oracle安裝:OUI安裝Oracle(圖形介面安裝)OracleUI
- 安裝 VMware workstation
- 安裝Oracle RAC 12cR1Oracle
- 在VMware 上安裝配置Oracle10g RACOracle
- 安裝Vmware Workstation 16
- VMware Workstation解除安裝
- vmware workstation7 + win7 安裝racWin7
- vmware workstation 下安裝ubuntuUbuntu
- VMware Workstation 17安裝教程:安裝系統
- VMware Workstation Pro15.0安裝圖解圖解
- 在 VMware workstation 安裝 CentOS 虛擬機器CentOS虛擬機
- vmware workstation 14 pro安裝方法
- 如何在 Ubuntu 安裝 VMware Workstation ?Ubuntu
- VMware Workstation 的安裝和使用
- VMware Workstation 6.0怎麼安裝
- Linux 安裝 VMware Workstation ProLinux
- CentOS7 在 VirtualBox 上的安裝配置(3) — 圖形介面安裝篇CentOS
- Linux 圖形介面安裝解除安裝Linux
- 在Ubuntu Server 中安裝圖形使用者介面UbuntuServer
- VMware Workstation安裝+徹底解除安裝教程(Windows版)Windows
- oracle linux 7 安裝圖形化介面OracleLinux
- Linux 安裝圖形介面Linux
- 使用 VMware 在 Oracle Enterprise Linux 上安裝 Oracle RAC 10gOracleLinux
- 圖形化安裝OracleOracle
- 使用 VMware 在 Oracle Enterprise Linux 上安裝 Oracle RAC 10g (2)OracleLinux
- WSL安裝及配置圖形介面
- 在 Linux 上安裝 VMware 工具Linux
- 安裝Oracle資料庫軟體./runInstall 圖形安裝介面報錯Oracle資料庫
- 在vmware workstation 6上安裝suse9(enterprise)四屏處理
- 在vmware上基於紅旗linux 5.0安裝oracle 10g racLinuxOracle 10g
- 使用VMware ESXi Server 5.0在OEL6.1上安裝 Oracle RAC 11gR1(3)-安裝OEL6.1ServerOracle
- Archlinux下VMware-workstation的安裝(轉)Linux
- VMware Workstation17虛擬機器安裝虛擬機
- Linux 非圖形介面安裝oracle資料庫LinuxOracle資料庫
- 在AIX上安裝配置Oracle10g RACAIOracle