本次文档演示在Linux7环境安装Oracle12R2版本的RAC数据库。

 

安装环境:

虚拟机:vbox5.1

操作系统:rhel-server-7.3-x86_64

Grid集群安装包:linuxx64_12201_grid_home

DB数据库安装包:linuxx64_12201_database

 

IP划分如下:

Public-IP

192.168.56.101    ol7-122-rac1

192.168.56.102    ol7-122-rac2

Private-IP

192.168.1.101   ol7-122-rac1-priv

192.168.1.102   ol7-122-rac2-priv

Virtual-IP

192.168.56.103   ol7-122-rac1-vip

192.168.56.104   ol7-122-rac2-vip

Scan-IP    

192.168.56.105

192.168.56.106

192.168.56.107

附:dns为ol7-122-scan.fly.cn

 

ASM磁盘划分如下:

OCR  3块:asm-diskc  2G 、asm-diskd  2G、asm-diske  2G

GIMR 1块:asm-diskf  40G

数据   1块:asm-diskg  10G

 

 

 

一:linux配置

 

Linux安装时选项包如下:

  • Server with GUI
  • Hardware Monitoring Utilities
  • Large Systems Performance
  • Network file system client
  • Performance Tools
  • Compatibility Libraries
  • Development Tools

 

虚拟机配置如下:

 

先配置一台虚拟机(第一个节点 ol7-122-rac1)

 

内存设置6G

 

添加安装ORACLE软件盘 目录为:/u01

添加ASM存储盘(3块OCR,1块GIMR,1块存放数据)

 

 

设置网卡,网卡1位NAT方式

 

 

 

网卡2为主机host-only方式(配置Public-IP)

 

 

 

网卡3为内网方式(配置Private-IP)

 

 

 

二:安装前准备

 

修改 /etc/selinux/config配置

 

 
  1. [root@ol7-122-rac1 ~]# vi /etc/selinux/config

  2.  
  3. SELINUX=disabled

 

关闭防火墙

 

 
  1. [root@ol7-122-rac1 ~]# systemctl stop firewalld

  2. [root@ol7-122-rac1 ~]# systemctl disable firewalld

 

配置内核参数:

 

 
  1. [root@ol7-122-rac1 ~]# vi /etc/sysctl.conf

  2. fs.file-max = 6815744

  3. kernel.sem = 250 32000 100 128

  4. kernel.shmmni = 4096

  5. kernel.shmall = 1073741824

  6. kernel.shmmax = 4398046511104

  7. kernel.panic_on_oops = 1

  8. net.core.rmem_default = 262144

  9. net.core.rmem_max = 4194304

  10. net.core.wmem_default = 262144

  11. net.core.wmem_max = 1048576

  12. net.ipv4.conf.all.rp_filter = 2

  13. net.ipv4.conf.default.rp_filter = 2

  14. fs.aio-max-nr = 1048576

  15. net.ipv4.ip_local_port_range = 9000 65500

  16.  
  17. 修改生效:

  18. [root@ol7-122-rac1 ~]# /sbin/sysctl –p

 

修改系统限制参数

 

 
  1. [root@ol7-122-rac1 ~]# vi /etc/security/limits.conf

  2.  
  3. oracle soft nofile 1024

  4. oracle hard nofile 65536

  5. oracle soft nproc 16384

  6. oracle hard nproc 16384

  7. oracle soft stack 10240

  8. oracle hard stack 32768

  9. oracle hard memlock 134217728

  10. oracle soft memlock 134217728

  11.  
  12. grid soft nofile 1024

  13. grid hard nofile 65536

  14. grid soft nproc 16384

  15. grid hard nproc 16384

  16. grid soft stack 10240

  17. grid hard stack 32768

  18. grid hard memlock 134217728

  19. grid soft memlock 134217728

 

增加组和用户:

 

 
  1. [root@ol7-122-rac1 ~]# groupadd -g 54321 oinstall

  2. [root@ol7-122-rac1 ~]# groupadd -g 54322 dba

  3. [root@ol7-122-rac1 ~]# groupadd -g 54323 oper

  4. [root@ol7-122-rac1 ~]# groupadd -g 54324 backupdba

  5. [root@ol7-122-rac1 ~]# groupadd -g 54325 dgdba

  6. [root@ol7-122-rac1 ~]# groupadd -g 54326 kmdba

  7. [root@ol7-122-rac1 ~]# groupadd -g 54327 asmdba

  8. [root@ol7-122-rac1 ~]# groupadd -g 54328 asmoper

  9. [root@ol7-122-rac1 ~]# groupadd -g 54329 asmadmin

  10. [root@ol7-122-rac1 ~]# groupadd -g 54330 racdba

  11.  
  12. [root@ol7-122-rac1 ~]# useradd -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper oracle

  13. [root@ol7-122-rac1 ~]# useradd -u 54322 -g oinstall -G asmadmin,asmdba,asmoper,dba grid

  14.  
  15. [root@ol7-122-rac1 ~]# passwd oracle

  16. [root@ol7-122-rac1 ~]# passwd grid

 

增加ip地址:

 

 
  1. [root@ol7-122-rac1 ~]# vi /etc/hosts

  2.  
  3. 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

  4. ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

  5.  
  6. # Public

  7. 192.168.56.101 ol7-122-rac1.localdomain ol7-122-rac1

  8. 192.168.56.102 ol7-122-rac2.localdomain ol7-122-rac2

  9. # Private

  10. 192.168.1.101 ol7-122-rac1-priv.localdomain ol7-122-rac1-priv

  11. 192.168.1.102 ol7-122-rac2-priv.localdomain ol7-122-rac2-priv

  12. # Virtual

  13. 192.168.56.103 ol7-122-rac1-vip.localdomain ol7-122-rac1-vip

  14. 192.168.56.104 ol7-122-rac2-vip.localdomain ol7-122-rac2-vip

 

查看网卡信息:

 

 
  1. [root@ol7-122-rac1 ~]# ifconfig

  2.  
  3. enp0s3:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

  4. ether 08:00:27:05:43:91 txqueuelen 1000 (Ethernet)

  5. RX packets 0 bytes 0 (0.0 B)

  6. RX errors 0 dropped 0 overruns 0 frame 0

  7. TX packets 0 bytes 0 (0.0 B)

  8. TX errors 0 dropped 0 overruns0 carrier 0 collisions 0

  9.  
  10. enp0s8:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

  11. inet 192.168.56.101 netmask255.255.255.0 broadcast 192.168.56.255

  12. inet6 fe80::8194:7929:3e2a:e3fe prefixlen 64 scopeid0x20<link>

  13. inet6 fe80::d240:aa50:b207:6807 prefixlen 64 scopeid0x20<link>

  14. ether 08:00:27:45:6b:00 txqueuelen 1000 (Ethernet)

  15. RX packets 2155 bytes 237797(232.2 KiB)

  16. RX errors 0 dropped 0 overruns 0 frame 0

  17. TX packets 3191 bytes 843960(824.1 KiB)

  18. TX errors 0 dropped 0 overruns0 carrier 0 collisions 0

  19.  
  20. enp0s9:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

  21. inet 192.168.1.101 netmask 255.255.255.0 broadcast 192.168.1.255

  22. inet6 fe80::a00:27ff:feb6:cb02 prefixlen 64 scopeid0x20<link>

  23. ether 08:00:27:b6:cb:02 txqueuelen 1000 (Ethernet)

  24. RX packets 192 bytes 41461 (40.4KiB)

  25. RX errors 0 dropped 0 overruns 0 frame 0

  26. TX packets 1427 bytes 390596(381.4 KiB)

  27. TX errors 0 dropped 0 overruns0 carrier 0 collisions 0

  28.  
  29. lo:flags=73<UP,LOOPBACK,RUNNING> mtu65536

  30. inet 127.0.0.1 netmask 255.0.0.0

  31. inet6 ::1 prefixlen 128 scopeid 0x10<host>

  32. loop txqueuelen 1 (Local Loopback)

  33. RX packets 360 bytes 71850 (70.1KiB)

  34. RX errors 0 dropped 0 overruns 0 frame 0

  35. TX packets 360 bytes 71850 (70.1KiB)

  36. TX errors 0 dropped 0 overruns0 carrier 0 collisions 0

  37.  
  38. virbr0:flags=4099<UP,BROADCAST,MULTICAST> mtu 1500

  39. inet 192.168.122.1 netmask255.255.255.0 broadcast 192.168.122.255

  40. ether 52:54:00:51:3d:85 txqueuelen 1000 (Ethernet)

  41. RX packets 0 bytes 0 (0.0 B)

  42. RX errors 0 dropped 0 overruns 0 frame 0

  43. TX packets 0 bytes 0 (0.0 B)

  44. TX errors 0 dropped 0 overruns0 carrier 0 collisions 0

 

查看scanip的dns配置信息(具体配置可参考 点击打开链接)

 

 
  1. [root@ol7-122-rac1 ~]# nslookup ol7-122-scan.fly.cn

  2.  
  3. Server: 192.168.56.101

  4. Address: 192.168.56.101#53

  5.  
  6. Name: ol7-122-scan.fly.cn

  7. Address: 192.168.56.106

  8. Name: ol7-122-scan.fly.cn

  9. Address: 192.168.56.107

  10. Name: ol7-122-scan.fly.cn

  11. Address: 192.168.56.105

 

建立文件路径

 

 
  1. [root@ol7-122-rac1 ~]# mkdir -p /u01/app/12.2.0.1/grid

  2. [root@ol7-122-rac1 ~]# mkdir -p /u01/app/grid

  3. [root@ol7-122-rac1 ~]# mkdir -p /u01/app/oracle/product/12.2.0.1/db_1

  4. [root@ol7-122-rac1 ~]# chown -R grid:oinstall /u01

  5. [root@ol7-122-rac1 ~]# chmod -R 775 /u01/

  6. [root@ol7-122-rac1 ~]# chown -R oracle:oinstall /u01/app/oracle

 

修改grid用户的环境变量

 

 
  1. [root@ol7-122-rac1 ~]# su - grid

  2. [grid@ol7-122-rac1 ~]$ cd

  3.  
  4. 增加以下内容:

  5. [grid@ol7-122-rac1 ~]$ vi .bash_profile

  6.  
  7. export ORACLE_BASE=/u01/app/grid

  8. export ORACLE_HOME=/u01/app/12.2.0.1/grid

  9. export ORACLE_SID=+ASM1 --注意rac2节点需要修改

  10. export PATH=$ORACLE_HOME/bin:$PATH

  11. export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

  12. export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

  13. umask=022

 

修改oracle用户的环境变量

 

 
  1. [root@ol7-122-rac1 ~]# su - oracle

  2. [oracle@ol7-122-rac1 ~]$ cd

  3.  
  4. 增加以下内容:

  5. [oracle@ol7-122-rac1 ~]$ vi .bash_profile

  6.  
  7. export ORACLE_BASE=/u01/app/oracle

  8. export ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/db_1

  9. export ORACLE_SID=orcl1 --注意rac2节点需要修改

  10. export PATH=$ORACLE_HOME/bin:$PATH

  11. export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

  12. export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

  13. umask=022

 

 

克隆rac1节点的虚拟机,为节点2   rac2

 
  1. ip如下:

  2.  
  3. enp0s3:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

  4. ether 08:00:27:da:14:cf txqueuelen 1000 (Ethernet)

  5. RX packets 0 bytes 0 (0.0 B)

  6. RX errors 0 dropped 0 overruns 0 frame 0

  7. TX packets 0 bytes 0 (0.0 B)

  8. TX errors 0 dropped 0 overruns0 carrier 0 collisions 0

  9.  
  10. enp0s8:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

  11. inet 192.168.56.102 netmask255.255.255.0 broadcast 192.168.56.255

  12. inet6 fe80::d240:aa50:b207:6807 prefixlen 64 scopeid0x20<link>

  13. ether 08:00:27:dc:2a:61 txqueuelen 1000 (Ethernet)

  14. RX packets 102 bytes 9763 (9.5KiB)

  15. RX errors 0 dropped 0 overruns 0 frame 0

  16. TX packets 537 bytes 56918 (55.5KiB)

  17. TX errors 0 dropped 0 overruns0 carrier 0 collisions 0

  18.  
  19. enp0s9:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

  20. inet 192.168.1.102 netmask255.255.255.0 broadcast 192.168.1.255

  21. inet6 fe80::a00:27ff:febc:7e8b prefixlen 64 scopeid0x20<link>

  22. ether 08:00:27:bc:7e:8b txqueuelen 1000 (Ethernet)

  23. RX packets 0 bytes 0 (0.0 B)

  24. RX errors 0 dropped 0 overruns 0 frame 0

  25. TX packets 403 bytes 59834 (58.4KiB)

  26. TX errors 0 dropped 0 overruns0 carrier 0 collisions 0

  27.  
  28. lo:flags=73<UP,LOOPBACK,RUNNING> mtu65536

  29. inet 127.0.0.1 netmask 255.0.0.0

  30. inet6 ::1 prefixlen 128 scopeid 0x10<host>

  31. loop txqueuelen 1 (Local Loopback)

  32. RX packets 5654 bytes 14746367(14.0 MiB)

  33. RX errors 0 dropped 0 overruns 0 frame 0

  34. TX packets 5654 bytes 14746367(14.0 MiB)

  35. TX errors 0 dropped 0 overruns0 carrier 0 collisions 0

  36.  
  37. virbr0:flags=4099<UP,BROADCAST,MULTICAST> mtu 1500

  38. inet 192.168.122.1 netmask255.255.255.0 broadcast 192.168.122.255

  39. ether 52:54:00:51:3d:85 txqueuelen 1000 (Ethernet)

  40. RX packets 0 bytes 0 (0.0 B)

  41. RX errors 0 dropped 0 overruns 0 frame 0

  42. TX packets 0 bytes 0 (0.0 B)

  43. TX errors 0 dropped 0 overruns0 carrier 0 collisions 0

  44.  
  45. 修改grid环境变量如下:

  46. export ORACLE_SID=+ASM2

  47.  
  48.  
  49. 修改oracle环境变量如下:

  50. export ORACLE_SID=orcl2

 

修改rac1主机的磁盘介质类型,为共享类型

(以dg_1磁盘为例,OCR和GIMR同理修改)

 

 

 

 

在rac2主机添加rac1的上面修改的共享磁盘(以dg_1磁盘为例,OCR和GIMR同理修改):

 

 

 

 

设置SSH信任关系

基本步骤:

1)设置rac1的rsa和dsa加密,然后都追加到authorized_keys文件中

2)再把rac1的authorized_keys拷贝到rac2中

3)同样rac2的rsa和dsa加密,然后把rac2的rsa和dsa加密追加到authorized_keys文件中

4)再把rac2的authorized_keys文件拷贝到rac1中,覆盖之前的authorized_keys文件

注1:这样的话rac1和rac2的authorized_keys文件中都有了彼此的rsa和dsa加密

注2:需设置grid和oracle两个用户(这里以oracle用户为例)

 

1、Rac1服务器设置:

 

(1)设置rsa和dsa加密:

 
  1. [oracle@ol7-122-rac1 ~]$ ssh-keygen -t rsa

  2. [oracle@ol7-122-rac1 ~]$ ssh-keygen -t dsa

(2)把rsa和dsa加密都放置到authorized_keys文件中:

 
  1. [oracle@ol7-122-rac1 ~]$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys

  2. [oracle@ol7-122-rac1 ~]$ cat .ssh/id_dsa.pub >> .ssh/authorized_keys

(3)把rac1的authorized_keys拷贝到rac2中:

[oracle@ol7-122-rac1 ~]$ cd/home/oracle/.ssh

[oracle@ol7-122-rac1 .ssh]$ scp authorized_keys 192.168.56.102:/home/oracle/.ssh/ 

 

2、Rac2服务器设置:

(1)设置rsa和dsa加密:

 
  1. [oracle@ol7-122-rac2 ~]$ ssh-keygen -t rsa

  2. [oracle@ol7-122-rac2 ~]$ ssh-keygen -t dsa

(2)把rac2的rsa和dsa加密都放置到从rac1拷贝来的authorized_keys文件中:

 
  1. [oracle@ol7-122-rac2 ~]$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys

  2. [oracle@ol7-122-rac2 ~]$ cat .ssh/id_dsa.pub >> .ssh/authorized_keys

(3)把rac2中的authorized_keys文件拷贝到rac1中,覆盖之前的authorized_keys文件:

 

 
  1. [oracle@ol7-122-rac2 ~]$ cd/home/oracle/.ssh

  2. [oracle@ol7-122-rac2 .ssh]$ scp authorized_keys 192.168.56.101:/home/oracle/.ssh/

 

3、查看一下rac1和rac2相同的authorized_keys文件,如下:

 
  1. [oracle@ol7-122-rac1 .ssh]$ more authorized_keys

  2.  
  3. ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC/NgE63EfDoUOxn9tj9hGdD9h4c8nYWScEKsHDUEbzfqImSxoGd5AOQz4BysMQI2nez0ZxFfFwUsgb/qRsg2JG1VuD+AjNxI+SheXPzRR/yRQcnhlpuYLJx

  4. o+8CzLApcli/u2yXOG9ZAPR65gXBXjUwZfi39ZXT/73zxEYGHvu37fBbglvOtSxTANYXhNgo87Ej8BO5hw/djcjVuw/NAiHpiOM285hh0FtcDqNHaodVsdNMlbZWS6dcqdDiD3gRvgcR4O9bGaa6P9GpIiLaV

  5. F+cp50hcNAdwe9LAGY6Jp8thyXSKhfJsQgdyVUTa1syDUDfeqVVGenZhH+OR9bBerx oracle@ol7-122-rac1.localdomain

  6. ssh-dss AAAAB3NzaC1kc3MAAACBAMdYaS6X2/p+NE3Xc6sGCw/YYU+qkzPuJnV4w5kdPsE2FLFek8hbcMUs4W5J2ye+pg7tvygGNLn6rCyz0Ou13rGA+XnVYkbEL3Xh94QzeLEFxjD9U4pHddiyMyO8fT5VS

  7. D4vWbGhNBKp64qqk+NSTXedSjRg8R0M/VAX+pL2FC0PAAAAFQC+DebpL/hQS3DyKa568YRX+3D3PQAAAIBPW1DC/3g6j0aK4hXglpNBmcr/Jqw7cQIUN/TLmfiMNDRztxdGmiTrkJWtbKPLfw+PKOesZyQlrM

  8. U9aINuQUcOl/7OeJncxAIMlEOO2/R6U/7uOa4oqzMydMKYxmpx5y1ca31BjVSPb8c1jYBYciZ50DEZdqGvt+tfZm4F8aLjzAAAAIEAqHQ9Z3XzpkfT2iBkA8cq048YUMM0k6DEZ4Fgl3B0HmSpwSIARIEAqJe

  9. aplK2ewlMfJiKUdj2GQO6ej8hdOWl0VvdPrhQEl4nUfMJzbACIRISDA1gsBGKRcflrrKYvsEfjWW5AkQnAAFP14Zhac/2MWD3GfUzyJyEGDGIZBjuWWU= oracle@ol7-122-rac1.localdomain

  10. ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC/YA/e1Bkm32Z4VJtg9N+G5DvvLcXfq5+9iRWzUJkEQ/J0/sNoTTzQzUfN8yClm7WTy095gLrqn8X38wb36k9ooNH475gnbHgv584CYOzsxrlzz+RzXBGhb

  11. PtA8MbeYqZnjPvo0ezH3k4/5VmF7zxVnrtm3JEYSXLC6cqVn4tx/4qrILbnPckKRlt0CeWYx07bULN39lni3uQuRJ83LTQ2H0E2WGguHsAQwH+sn9wBvs8swXK0OFOy0AHDHR/gR9gH8Lr1SGgeaqC1VQpCFt

  12. bsRv7W1Ws6kIlF6pMY1n0wXrvCHbh5DJVV6orVZg6GPDRCmgLWcGoEXFmBgknlypYB oracle@ol7-122-rac2.localdomain

  13. ssh-dss AAAAB3NzaC1kc3MAAACBANSC+TmiMYFhb/aXYq2GmP1WfUKUtPaQYHVU+FrDQQfkJVGmnNfp4PXk/LFUppxBNWLhuVeKtrezO978eDCcI5N6ponxaoczJGDWmeFHI1UsKfF9l87m/Jnv2B5jw+YM1

  14. CDjJLfE6HZAZhb6YFFFBVEfbNbEHO/WrkE2tHrOE2EdAAAAFQDzhSTw7Kd6kDz3gceM0yBnJXVqmwAAAIB8Nrr1JX2rTZGX8NELHvvdB9+h076C0n70lkjV8vcwjsY585a2TKbB7rsPGsOK0qYWQTg67hyQ6w

  15. icQYMTnq6U4GIwLrrWAWzqO0c+GykZbLTYtRDAwD9CZEhtnhQNmg/IsBc1Uwl/L1sV8mAz/JErJQNNPuukhu5empSRi1Pw2QAAAIByKzk2HppjeLOetpMHdatpU+LKBZVK4PwFgJORMl4QNYgi1fVsCX/KEZH

  16. Ft6RUcVMozdUuv2/Xwl00jwqTXUw23aStyOWUdR6pgXd3R9g2wdCJxRyLxL4LE9nOBVzSatYvD44w3IDYNXgDQ4hYx8xGOlk/u7MvjFQKZcuk+MtAvg== oracle@ol7-122-rac2.localdomain

 

4、测试SSH:

Rac1和 rac2分别测试,可以正常返回日期即可:

 
  1. [oracle@ol7-122-rac1 ~]$ ssh ol7-122-rac1 date

  2. [oracle@ol7-122-rac1 ~]$ ssh ol7-122-rac1-priv date

  3. [oracle@ol7-122-rac1 ~]$ ssh ol7-122-rac2 date

  4. [oracle@ol7-122-rac1 ~]$ ssh ol7-122-rac2-priv date

 

 

绑定UDEV共享磁盘

添加共享磁盘顺序要一致

 

 
  1. for i in c d e f g

  2. do

  3. echo "KERNEL==\"sd?\",SUBSYSTEM==\"block\", PROGRAM==\"/usr/lib/udev/scsi_id--whitelisted --replace-whitespace --device=/dev/\$name\",RESULT==\"`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace--device=/dev/sd$i`\", SYMLINK+=\"asm-disk$i\",OWNER=\"grid\", GROUP=\"asmadmin\",MODE=\"0660\"" >>/etc/udev/rules.d/99-oracle-asmdevices.rules

  4. done

  5.  
  6.  
  7. /sbin/partprobe /dev/sdc

  8. /sbin/partprobe /dev/sdd

  9. /sbin/partprobe /dev/sde

  10. /sbin/partprobe /dev/sdf

  11. /sbin/partprobe /dev/sdg

  12.  
  13.  
  14. /sbin/udevadm test /sys/block/sdc

  15. /sbin/udevadm test /sys/block/sdd

  16. /sbin/udevadm test /sys/block/sde

  17. /sbin/udevadm test /sys/block/sdf

  18. /sbin/udevadm test /sys/block/sdg

  19.  
  20.  
  21. [root@ol7-122-rac1 ~]# /sbin/udevadmcontrol --reload-rules

  22.  
  23.  
  24. [root@ol7-122-rac1 ~]# ll /dev/asm*

  25. lrwxrwxrwx 1 root root 3 Apr 19 17:15/dev/asm-diskc -> sdc

  26. lrwxrwxrwx 1 root root 3 Apr 19 17:16/dev/asm-diskd -> sdd

  27. lrwxrwxrwx 1 root root 3 Apr 19 17:16/dev/asm-diske -> sde

  28. lrwxrwxrwx 1 root root 3 Apr 19 17:16/dev/asm-diskf -> sdf

  29. lrwxrwxrwx 1 root root 3 Apr 19 17:16/dev/asm-diskg -> sdg

  30.  
  31.  
  32. [root@ol7-122-rac1 ~]# ll /dev/sd*

  33. brw-rw---- 1 root disk 8, 0 Apr 19 16:47 /dev/sda

  34. brw-rw---- 1 root disk 8, 1 Apr 19 16:47 /dev/sda1

  35. brw-rw---- 1 root disk 8, 2 Apr 19 16:47 /dev/sda2

  36. brw-rw---- 1 root disk 8, 3 Apr 19 16:47 /dev/sda3

  37. brw-rw---- 1 root disk 8, 16 Apr 19 16:47 /dev/sdb

  38. brw-rw---- 1 root disk 8, 17 Apr 19 16:47 /dev/sdb1

  39. brw-rw---- 1 grid asmadmin 8, 32 Apr 1917:18 /dev/sdc

  40. brw-rw---- 1 grid asmadmin 8, 48 Apr 1917:18 /dev/sdd

  41. brw-rw---- 1 grid asmadmin 8, 64 Apr 1917:18 /dev/sde

  42. brw-rw---- 1 grid asmadmin 8, 80 Apr 1917:18 /dev/sdf

  43. brw-rw---- 1 grid asmadmin 8, 96 Apr 1917:18 /dev/sdg

 

 

 

三:安装GRID软件

 

 
  1. 解压grid安装包

  2. [grid@ol7-122-rac1 ~]$ cd /u01/app/12.2.0.1/grid/

  3. [grid@ol7-122-rac1 grid]$ unzip linuxx64_12201_grid_home.zip

  4.  
  5. 安装grid前检查

  6. [grid@ol7-122-rac1 grid]$ ./runcluvfy.sh stage -pre crsinst -n ol7-122-rac1,ol7-122-rac2 -verbose

  7.  
  8. 安装grid

  9. [grid@ol7-122-rac1 grid]$ ./gridSetup.sh


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 查看集群状态

 

 
  1. [grid@ol7-122-rac1 ~]$ crsctl stat res -t

  2.  
  3. --------------------------------------------------------------------------------

  4. Name Target State Server Statedetails

  5. --------------------------------------------------------------------------------

  6. Local Resources

  7. --------------------------------------------------------------------------------

  8. ora.ASMNET1LSNR_ASM.lsnr

  9. ONLINE ONLINE ol7-122-rac1 STABLE

  10. ONLINE ONLINE ol7-122-rac2 STABLE

  11. ora.DG_MGMT.dg

  12. ONLINE ONLINE ol7-122-rac1 STABLE

  13. ONLINE ONLINE ol7-122-rac2 STABLE

  14. ora.DG_OCR.dg

  15. ONLINE ONLINE ol7-122-rac1 STABLE

  16. ONLINE ONLINE ol7-122-rac2 STABLE

  17. ora.LISTENER.lsnr

  18. ONLINE ONLINE ol7-122-rac1 STABLE

  19. ONLINE ONLINE ol7-122-rac2 STABLE

  20. ora.chad

  21. ONLINE ONLINE ol7-122-rac1 STABLE

  22. ONLINE ONLINE ol7-122-rac2 STABLE

  23. ora.net1.network

  24. ONLINE ONLINE ol7-122-rac1 STABLE

  25. ONLINE ONLINE ol7-122-rac2 STABLE

  26. ora.ons

  27. ONLINE ONLINE ol7-122-rac1 STABLE

  28. ONLINE ONLINE ol7-122-rac2 STABLE

  29. --------------------------------------------------------------------------------

  30. Cluster Resources

  31. --------------------------------------------------------------------------------

  32. ora.LISTENER_SCAN1.lsnr

  33. 1 ONLINE ONLINE ol7-122-rac2 STABLE

  34. ora.LISTENER_SCAN2.lsnr

  35. 1 ONLINE ONLINE ol7-122-rac1 STABLE

  36. ora.LISTENER_SCAN3.lsnr

  37. 1 ONLINE ONLINE ol7-122-rac1 STABLE

  38. ora.MGMTLSNR

  39. 1 ONLINE ONLINE ol7-122-rac1 169.254.84.228192.1

  40. 68.1.101,STABLE

  41. ora.asm

  42. 1 ONLINE ONLINE ol7-122-rac1 Started,STABLE

  43. 2 ONLINE ONLINE ol7-122-rac2 Started,STABLE

  44. 3 OFFLINE OFFLINE STABLE

  45. ora.cvu

  46. 1 ONLINE ONLINE ol7-122-rac1 STABLE

  47. ora.mgmtdb

  48. 1 ONLINE ONLINE ol7-122-rac1 Open,STABLE

  49. ora.ol7-122-rac1.vip

  50. 1 ONLINE ONLINE ol7-122-rac1 STABLE

  51. ora.ol7-122-rac2.vip

  52. 1 ONLINE ONLINE ol7-122-rac2 STABLE

  53. ora.qosmserver

  54. 1 ONLINE ONLINE ol7-122-rac1 STABLE

  55. ora.scan1.vip

  56. 1 ONLINE ONLINE ol7-122-rac2 STABLE

  57. ora.scan2.vip

  58. 1 ONLINE ONLINE ol7-122-rac1 STABLE

  59. ora.scan3.vip

  60. 1 ONLINE ONLINE ol7-122-rac1 STABLE

 

 

配置asm

 

[grid@ol7-122-rac1 grid]$ asmca

 

 

 

 

 

四:安装ORACLE软件

 

 
  1. 解压oracle安装包

  2. [oracle@ol7-122-rac1 oracle]$ unzip linuxx64_12201_database.zip

  3.  
  4. 安装

  5. [oracle@ol7-122-rac1 oracle]$ ./runInstaller

 

 

 

 

 

五:安装数据库

 

[oracle@ol7-122-rac1 ~]$ dbca

 

 

 

 

 

查看集群状态

 

 
  1. [grid@ol7-122-rac1 ~]$ srvctl config database -d orcl

  2.  
  3. Database unique name: orcl

  4. Database name: orcl

  5. Oracle home: /u01/app/oracle/product/12.2.0.1/db_1

  6. Oracle user: oracle

  7. Spfile: +DG_DATA/ORCL/PARAMETERFILE/spfile.272.942322245

  8. Password file: +DG_DATA/ORCL/PASSWORD/pwdorcl.256.942319377

  9. Domain:

  10. Start options: open

  11. Stop options: immediate

  12. Database role: PRIMARY

  13. Management policy: AUTOMATIC

  14. Server pools:

  15. Disk Groups: DG_DATA

  16. Mount point paths:

  17. Services:

  18. Type: RAC

  19. Start concurrency:

  20. Stop concurrency:

  21. OSDBA group: dba

  22. OSOPER group: oper

  23. Database instances: orcl1,orcl2

  24. Configured nodes: ol7-122-rac1,ol7-122-rac2

  25. CSS critical: no

  26. CPU count: 0

  27. Memory target: 0

  28. Maximum memory: 0

  29. Default network number for database services:

  30. Database is administrator managed

  31.  
  32.  
  33. [grid@ol7-122-rac1 ~]$ srvctl status database -d orcl

  34.  
  35. Instance orcl1 is running on node ol7-122-rac1

  36. Instance orcl2 is running on node ol7-122-rac2

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐