Oracle RAC 19C 搭建脚本
时间: 2024-01-01 16:03:20 浏览: 155
以下是Oracle RAC 19c搭建脚本,仅供参考:
1. 安装基础软件包
```bash
yum install -y binutils.x86_64 compat-libcap1.x86_64 gcc.x86_64 gcc-c++.x86_64 glibc.i686 glibc.x86_64 glibc-devel.i686 glibc-devel.x86_64 ksh compat-libstdc++-33 libaio.i686 libaio.x86_64 libaio-devel.i686 libaio-devel.x86_64 libgcc.i686 libgcc.x86_64 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 libXi.i686 libXi.x86_64 libXtst.i686 libXtst.x86_64 make.x86_64 sysstat.x86_64
```
2. 创建用户和组
```bash
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
```
3. 修改内核参数
```bash
cat >> /etc/sysctl.conf <<EOF
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
EOF
sysctl -p
```
4. 修改用户限制
```bash
cat >> /etc/security/limits.conf <<EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
```
5. 创建目录并授权
```bash
mkdir -p /u01/app/oracle/product/19.0.0/grid
mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
```
6. 设置环境变量
```bash
cat >> /home/oracle/.bash_profile <<EOF
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/19.0.0/grid
export ORACLE_SID=+ASM1
export PATH=\$PATH:\$ORACLE_HOME/bin
EOF
```
7. 安装Oracle Grid Infrastructure
```bash
su - oracle
cd /tmp/grid
./gridSetup.sh -silent -responseFile /tmp/grid/response/grid_install.rsp
```
8. 安装Oracle Database
```bash
cd /tmp/db
./runInstaller -silent -responseFile /tmp/db/response/db_install.rsp
```
以上是Oracle RAC 19c搭建脚本的大致流程,具体的安装步骤和配置参数需要根据实际情况进行调整。另外,安装Oracle RAC还需要进行一系列的配置和管理操作,包括创建ASM磁盘组、配置监听器、创建数据库实例等,需要仔细阅读官方文档并按照要求进行操作。
阅读全文