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”按钮。
[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
和节点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 仅安装软件
章。
依照上图设置好,单击“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
和节点2的运行,运行完后再到节点2运行:
/u01/app/oracle/product/12.1.0/dbhome_1/root.sh
等到运行完root.sh,切换回Execute Configuration scripts窗口单击“OK”按钮。
单击Close按钮。
1.1.5 使用DBCA创建数据库
在Oracle 用户下在节点一操作:
运行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名字一致。
位,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”按钮。
000。依照上图设置好,单击“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 |
台主机。
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好友(642808185),注明添加缘由
● 于 2017-01-12 08:00 ~ 2016-01-21 24:00 在农行完成
● 文章内容来源于小麦苗的学习笔记,部分整理自网络,若有侵权或不当之处还请谅解
● 版权所有,欢迎分享本文,转载请保留出处
...............................................................................................................................
拿起手机使用微信客户端扫描下边的左边图片来关注小麦苗的微信公众号:xiaomaimiaolhr,扫描右边的二维码加入小麦苗的QQ群,学习最实用的数据库技术。