CentOS 6.6 x64 自动化安装Oracle Database 11gR2 RAC脚本
CentOS 6.6 x64 自动化安装Oracle Database 11gR2 RAC脚本
os:CentOS 6.6
hostname:rac11g03,rac11g04
IP: rac11g03 192.108.56.103 192.108.96.103 192.108.26.103
rac11g04 192.108.56.104 192.108.96.104 192.108.26.104
Oracle:11.2.0.4
storage:openfiler 192.108.26.100:3260
说明:
1.centos 6.6已经做了basic安装,ip和主机名已设置.
2.oracle安装文件p13390677_112040_Linux-x86-64_1of7.zip,p13390677_112040_Linux-x86-64_2of7.zip,p13390677_112040_Linux-x86-64_3of7.zip放在rac11g03的/root下,pdksh-5.2.14-30.x86_64.rpm包放在rac11g03的/root下.
3.密码都用的selectshen,可根据自己的需要修改
4.三个网段,192.108.56.0:public,192.108.96.0:private,192.108.26.0:storage
5.以下脚本可以在健壮性和通用性上做一些调整,以用来在开发测试环境中快速部署RAC.
实施:
#################################步骤一#################################
###################rac11g04_init.sh,以下内容放到一个文件中,在rac11g04下sh执行即可:
#!/bin/bash
##此处用于加载光驱为之后安装缺少的包,也可改为网络方式.
mkdir /media/cdrom
mount /dev/cdrom /media/cdrom
mv /etc/yum.repos.d/*.repo /root/
cat > /etc/yum.repos.d/CentOS-Media.repo [c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/cdrom/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
EOF
yum clean all
yum makecache
#调整hosts文件
cat >> /etc/hosts 192.108.56.103 rac11g03
192.108.56.104 rac11g04
192.108.56.203 rac11g03-vip
192.108.56.204 rac11g04-vip
192.108.56.205 rac11g-scan
192.108.96.103 rac11g03-priv
192.108.96.104 rac11g04-priv
EOF
#关闭防火墙,selinux
chkconfig iptables off
service iptables stop
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
#网络参数调整
cat >> /etc/sysctl.conf kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
EOF
sysctl -p
#资源限制参数调整
cat >> /etc/security/limits.conf oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
EOF
#登陆参数调整
cat >> /etc/pam.d/login session required /lib64/security/pam_limits.so
EOF
#安装缺少的包
yum -y install gcc gcc-c++ make binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel unixODBC unixODBC-devel
yum -y install expect
ln -s /lib64/libcap.so.2.16 /lib64/libcap.so.1
#清除NTP服务
service ntpd stop
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.bak
mv /var/run/ntpd.pid /var/run/ntpd.pid.bak
##创建配置grid,oracle用户
groupadd -g 1000 oinstall
groupadd -g 1100 asmadmin
groupadd -g 1200 dba
groupadd -g 1300 asmdba
useradd -u 1100 -d /home/oracle -g oinstall -G dba,asmdba oracle
useradd -u 1101 -d /home/grid -g oinstall -G asmadmin,asmdba grid
echo "selectshen"|passwd --stdin oracle
echo "selectshen"|passwd --stdin grid
cat >> /home/grid/.bash_profile export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export GRID_HOME=/u01/app/11.2.0/grid
export ORACLE_SID=+ASM1
export ORACLE_TERM=xterm
export PATH=/usr/sbin:\$PATH
export PATH=\$ORACLE_HOME/bin:\$PATH
export LD_LIBRARY_PATH=\$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/
export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib
ulimit -u 16384 -n 65536
umask 022
EOF
. /home/grid/.bash_profile
cat >> /home/oracle/.bash_profile export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=rac11g
export ORACLE_TERM=xterm
export PATH=/usr/sbin:\$PATH
export PATH=\$ORACLE_HOME/bin:\$PATH
export LD_LIBRARY_PATH=\$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/
export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib
ulimit -u 16384 -n 65536
umask 022
EOF
. /home/oracle/.bash_profile
#创建安装目录
mkdir -p /u01/app/11.2.0/grid
chown -R grid.oinstall /u01
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle.oinstall /u01/app/oracle
chmod -R 775 /u01
#配置iscsi连接openfiler存储,此处要根据实际情况设置,这里是一个40G的盘,分成两个20G的区
yum -y install iscsi-initiator-utils
iscsiadm -m discovery -t sendtargets -p 192.108.26.100:3260
service iscsi restart
fdisk /dev/sdb n
p
1
+20G
n
p
2
w
EOF

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

MySQL and MariaDB can coexist, but need to be configured with caution. The key is to allocate different port numbers and data directories to each database, and adjust parameters such as memory allocation and cache size. Connection pooling, application configuration, and version differences also need to be considered and need to be carefully tested and planned to avoid pitfalls. Running two databases simultaneously can cause performance problems in situations where resources are limited.

Data Integration Simplification: AmazonRDSMySQL and Redshift's zero ETL integration Efficient data integration is at the heart of a data-driven organization. Traditional ETL (extract, convert, load) processes are complex and time-consuming, especially when integrating databases (such as AmazonRDSMySQL) with data warehouses (such as Redshift). However, AWS provides zero ETL integration solutions that have completely changed this situation, providing a simplified, near-real-time solution for data migration from RDSMySQL to Redshift. This article will dive into RDSMySQL zero ETL integration with Redshift, explaining how it works and the advantages it brings to data engineers and developers.

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.

LaravelEloquent Model Retrieval: Easily obtaining database data EloquentORM provides a concise and easy-to-understand way to operate the database. This article will introduce various Eloquent model search techniques in detail to help you obtain data from the database efficiently. 1. Get all records. Use the all() method to get all records in the database table: useApp\Models\Post;$posts=Post::all(); This will return a collection. You can access data using foreach loop or other collection methods: foreach($postsas$post){echo$post->

MySQL is suitable for beginners because it is simple to install, powerful and easy to manage data. 1. Simple installation and configuration, suitable for a variety of operating systems. 2. Support basic operations such as creating databases and tables, inserting, querying, updating and deleting data. 3. Provide advanced functions such as JOIN operations and subqueries. 4. Performance can be improved through indexing, query optimization and table partitioning. 5. Support backup, recovery and security measures to ensure data security and consistency.
