当前位置: 首页> 汽车> 时评 > oracle RAC安装 保姆级教程

oracle RAC安装 保姆级教程

时间:2025/7/9 21:30:00来源:https://blog.csdn.net/hoffmannlin/article/details/139641195 浏览次数: 0次

使用SSH+Xmanager

我的本地IP是172.17.68.68

服务器配置

[root@rac12-1 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
#Public IP
172.17.212.100 rac12-1
172.17.212.101 rac12-2
#Private IP
1.1.1.1 rac12-1-priv
1.1.1.2 rac12-2-priv
#Vip IP
172.17.212.200 rac12-1-vip
172.17.212.201 rac12-2-vip#Scan IP
172.17.212.10 rac12-scan

安全限制

# cat /etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle soft nproc 2047
oracle hard nproc 16384
oracle hard memlock 134217728
oracle soft memlock 134217728grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
grid soft nproc 2047
grid hard nproc 16384# cat /etc/pam.d/login
session required pam_limits.so 
session required /lib64/security/pam_limits.so

确认基础配置

# cat /home/grid/.bash_profile
################OracleBegin#########################
umask 022
export TMP=/tmp
export TMPDIR=\$TMP
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.3.0/grid
export ORACLE_TERM=xterm
export TNS_ADMIN=\$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib
export ORACLE_SID=+ASM2
export PATH=/usr/sbin:\$PATH
export PATH=\$ORACLE_HOME/bin:\$ORACLE_HOME/OPatch:\$PATH
alias sas='sqlplus / as sysasm'
export PS1="[\`whoami\`@\`hostname\`:"'\$PWD]\$ ' # cat /home/oracle/.bash_profile
################OracleBegin#########################
umask 022
export TMP=/tmp
export TMPDIR=\$TMP
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/19.3.0/db
export ORACLE_HOSTNAME=rac12-2
export ORACLE_TERM=xterm
export TNS_ADMIN=\$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib
export ORACLE_SID=rac12-2
export PATH=/usr/sbin:\$PATH
export PATH=\$ORACLE_HOME/bin:\$ORACLE_HOME/OPatch:\$PATH
alias sas='sqlplus / as sysdba'
export PS1="[\`whoami\`@\`hostname\`:"'\$PWD]\$ '
################OracleEnd#########################

确认ASM

[grid@rac12-1:/home/grid]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnrONLINE  ONLINE       rac12-1                  STABLEONLINE  ONLINE       rac12-2                  STABLE
ora.chadONLINE  ONLINE       rac12-1                  STABLEONLINE  ONLINE       rac12-2                  STABLE
ora.net1.networkONLINE  ONLINE       rac12-1                  STABLEONLINE  ONLINE       rac12-2                  STABLE
ora.onsONLINE  ONLINE       rac12-1                  STABLEONLINE  ONLINE       rac12-2                  STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)1        ONLINE  ONLINE       rac12-1                  STABLE2        ONLINE  ONLINE       rac12-2                  STABLE3        ONLINE  OFFLINE                               STABLE
ora.DATA.dg(ora.asmgroup)1        ONLINE  ONLINE       rac12-1                  STABLE2        ONLINE  ONLINE       rac12-2                  STABLE3        OFFLINE OFFLINE                               STABLE
ora.LISTENER_SCAN1.lsnr1        ONLINE  ONLINE       rac12-1                  STABLE
ora.OCR.dg(ora.asmgroup)1        ONLINE  ONLINE       rac12-1                  STABLE2        ONLINE  ONLINE       rac12-2                  STABLE3        OFFLINE OFFLINE                               STABLE
ora.asm(ora.asmgroup)1        ONLINE  ONLINE       rac12-1                  Started,STABLE2        ONLINE  ONLINE       rac12-2                  Started,STABLE3        OFFLINE OFFLINE                               STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)1        ONLINE  ONLINE       rac12-1                  STABLE2        ONLINE  ONLINE       rac12-2                  STABLE3        OFFLINE OFFLINE                               STABLE
ora.cvu1        ONLINE  ONLINE       rac12-1                  STABLE
ora.qosmserver1        ONLINE  ONLINE       rac12-1                  STABLE
ora.rac12-1.vip1        ONLINE  ONLINE       rac12-1                  STABLE
ora.rac12-2.vip1        ONLINE  ONLINE       rac12-2                  STABLE
ora.scan1.vip1        ONLINE  ONLINE       rac12-1                  STABLE
--------------------------------------------------------------------------------

开始安装oracle

[root@rac12-1 ~]# su - oracle
Last login: Wed Jun 12 19:21:03 CST 2024 on pts/0
[oracle@rac12-1:/home/oracle]$ source ~/.bash_profile
[oracle@rac12-1:/home/oracle]$ cd $ORACLE_HOME
[oracle@rac12-1:/u01/app/oracle/product/19.3.0/db]$ ./runInstaller
ERROR: Unable to verify the graphical display setup. This application requires X display. Make sure that xdpyinfo exist under PATH variable.No X11 DISPLAY variable was set, but this program performed an operation which requires it.
[oracle@rac12-1:/u01/app/oracle/product/19.3.0/db]$ export DISPLAY=172.17.68.68:0.0
[oracle@rac12-1:/u01/app/oracle/product/19.3.0/db]$ ./runInstaller
Launching Oracle Database Setup Wizard...

选择仅安装软件
在这里插入图片描述
选择集群模式
在这里插入图片描述
在此配置
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
注意在第二节点上要建立目录

[root@rac12-2 app]# mkdir -p /u01/app/oracle/product/19.3.0/db
[root@rac12-2 app]# chown -R oracle:oinstall /u01/app/oracle

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
由于我这边有其他时间教验方式以及只有两节点, 有关于DNS错误全部可以忽略
在这里插入图片描述
在这里插入图片描述

弹出这框来千万不能点OK!!!
在这里插入图片描述
两个结点依序使用root执行命令
/u01/app/oracle/product/19.3.0/db/root.sh

[root@rac12-1 ~]# /u01/app/oracle/product/19.3.0/db/root.sh
Performing root user operation.The following environment variables are set as:ORACLE_OWNER= oracleORACLE_HOME=  /u01/app/oracle/product/19.3.0/dbEnter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
[root@rac12-1 ~]#

两节点都执行完成后再点OK

在这里插入图片描述
检查

[oracle@rac12-1:/u01/app/oracle/product/19.3.0/db]$ sqlplus -versionSQL*Plus: Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

创建数据库实例

[oracle@rac12-1:/u01/app/oracle/product/19.3.0/db]$ dbca

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
默认会添加1与2
所以只写到sqwh0
这里不启用cdb与pdb模式

在这里插入图片描述

在这里插入图片描述
不开闪回,不开归档,建完实例后再配置
在这里插入图片描述
在这里插入图片描述
调整内存使用到80%左右
在这里插入图片描述
按需调整Processes
在这里插入图片描述
字元集可不动, 默认大字元集满足使用
在这里插入图片描述
取消第二个, 只勾第一个

在这里插入图片描述
填写密码
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
全部忽略, 理由同上

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
登录数据库查看

由于前期规划想让SID叫做rac12-1与rac12-2
但是过程中SID不能包含-
所以我们要修改环境变量
export ORACLE_SID=sqwh01

[oracle@rac12-1:/u01/app/oracle/product/19.3.0/db]$ sqlplus / as sysdbaSQL*Plus: Release 19.0.0.0.0 - Production on Thu Jun 13 09:51:56 2024
Version 19.3.0.0.0Copyright (c) 1982, 2019, Oracle.  All rights reserved.Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0SQL> select instance_number,instance_name,startup_time,status from gv$Instance;INSTANCE_NUMBER INSTANCE_NAME    STARTUP_TIME       STATUS
--------------- ---------------- ------------------ ------------1 sqwh01           13-JUN-24          OPEN2 sqwh02           13-JUN-24          OPENSQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
关键字:oracle RAC安装 保姆级教程

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: