Führen Sie Oracle 11gR2 RAC + DG1 erneut aus
Unter https://www.roamway.com/1273.html,RAC-Datenbank wurde konfiguriert, Diesmal ist der DataGuard-Dienst auf Basis von RAC Dual Machine konfiguriert,
Kann schnelles Umschalten zwischen der Hauptbibliothek und der Standby-Bibliothek realisieren, Bereitstellung von Disaster Recovery- und Backup-Funktionen.
Dieser Teil,Wir müssen die Dataguard-Systemplattform bereitstellen, ASM-Dienst konfigurieren,Installieren Sie dann das Single-Node-Grid, Installieren Sie abschließend die Oracle-Software.
Die Einzelheiten sind wie folgt:
1. Installieren Sie das Betriebssystem, OEL5.5 x64 wird diesmal noch verwendet , Lokale Festplatte 20 GB, Hostname dg.localdomain ,
IP Adresse 192.168.137.159 ,Iptables und Selinux nicht aktivieren.
Wählen Sie beim Anpassen das folgende Installationspaket:
Desktop-Umgebungen:
GNOME Desktop Environment
Applications:
Editors
Development:
Development Libraries
Entwicklungswerkzeuge
GNOME Software Development
Legacy Software Development
X software Development
Base System :
Administration Tools
Base
Legacy Software Support
System Tools
X Window System
dann,执行真正安装,重启数次后安装完成.
下图是配置好的主机名和ip地址.
2. Benutzer erstellen,建目录,赋权限 ,Passwort ändern,改用户配置文件,内核参数, 资源限制等
建立grid用户和oracle用户
groupadd -g 1000 oinstall
groupadd -g 1200 asmadmin
groupadd -g 1201 asmdba
groupadd -g 1202 asmoper
useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash -c ”
grid Infrastructure Owner” Gitter
Echo “Gitter” | passwd –stdin grid
echo ‘export PS1=”`/bin/hostname -s` -> “‘ >> /home/grid/.bash_profile
Echo “export ORACLE_SID=+ASM” >> /home/grid/.bash_profile
Echo “export ORACLE_BASE = / u01 / app / grid” >> /home/grid/.bash_profile
Echo “export ORACLE_HOME=/u01/app/11.2.0/grid” >> /home/grid/.bash_profile
Echo “export ORACLE_TERM = xterm” >> /home/grid/.bash_profile
Echo “export NLS_DATE_FORMAT=’yyyy/mm/dd hh24:mich:ss'” >> /home/grid/.bash_profile
echo ‘export TNS_ADMIN=$ORACLE_HOME/network/admin’ >> /home/grid/.bash_profile
echo ‘export PATH=/usr/sbin:$PFAD’ >> /home/grid/.bash_profile
echo ‘export PATH=$ORACLE_HOME/bin:$PFAD’ >> /home/grid/.bash_profile
echo ‘export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr / lib’ >> /home/grid/.bash_profile
echo ‘export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME / jlib:$ORACLE_HOME / rdbms / jlib’ >>
/home/grid/.bash_profile
Echo “export LANG = en_US” >> /home/grid/.bash_profile
Echo “export NLS_LANG=american_america.AL32UTF8” >> /home/grid/.bash_profile
Echo “umask 022” >> /home/grid/.bash_profile
groupadd -g 1300 dba
groupadd -g 1301 oper
useradd -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle/ -s /bin/bash -c
“Oracle Software Owner” Orakel
Echo “Orakel” | passwd –stdin oracle
echo ‘export PS1=”`/bin/hostname -s` -> “‘ >> /home/oracle/.bash_profile
Echo “exportiere TMP = / tmp” >> /home/oracle/.bash_profile
echo ‘export TMPDIR=$TMP’ >> /home/oracle/.bash_profile
Echo “export ORACLE_HOSTNAME=dg.localdomain” >> /home/oracle/.bash_profile
Echo “export ORACLE_SID=devdb” >> /home/oracle/.bash_profile
Echo “export ORACLE_BASE=/u01/app/oracle” >> /home/oracle/.bash_profile
echo ‘export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1’ >> /home/oracle/.bash_profile
Echo “export ORACLE_UNQNAME=devdb” >> /home/oracle/.bash_profile
echo ‘export TNS_ADMIN=$ORACLE_HOME/network/admin’ >> /home/oracle/.bash_profile
echo ‘export PATH=$ORACLE_HOME/bin:$PFAD’ >> /home/oracle/.bash_profile
echo ‘export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr / lib’ >> /home/oracle/.bash_profile
echo ‘export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME / jlib:$ORACLE_HOME / rdbms / jlib’ >>
/home/oracle/.bash_profile
Echo “export LANG = en_US” >> /home/oracle/.bash_profile
Echo “export NLS_LANG=american_america.AL32UTF8” >> /home/oracle/.bash_profile
Echo “export NLS_DATE_FORMAT=’yyyy/mm/dd hh24:mich:ss'” >> /home/oracle/.bash_profile
建立grid和oracle目录路径,修改权限
mkdir -p / u01 / app / grid
mkdir -p /u01/app/11.2.0/grid
mkdir -p / u01 / app / oracle
chown -R Orakel:oinstall / u01
chown -R Gitter:oinstall /u01/app/grid
chown -R Gitter:oinstall /u01/app/11.2.0
修改/etc/security/limits.conf
Echo “oracle soft nproc 2047” >> /etc/security/limits.conf
Echo “oracle hard nproc 16384” >> /etc/security/limits.conf
Echo “oracle soft nofile 1024” >> /etc/security/limits.conf
Echo “oracle hard nofile 65536” >> /etc/security/limits.conf
Echo “grid hard nproc 16384” >> /etc/security/limits.conf
Echo “grid soft nofile 1024” >> /etc/security/limits.conf
Echo “grid hard nofile 65536” >> /etc/security/limits.conf
修改/etc/profile文件
echo ‘if [ $USER = “Orakel” ] || [ $USER = “Gitter” ] ; dann’ >> /etc/profile
echo ‘if [ $SHELL = “/bin / ksh” ] ; dann’ >> /etc/profile
echo ‘ulimit -p 16384’ >> /etc/profile
echo ‘ulimit -n 65536’ >> /etc/profile
echo ‘else’ >> /etc/profile
echo ‘ulimit -u 16384 -n 65536’ >> /etc/profile
echo ‘fi’ >> /etc/profile
echo ‘fi’ >> /etc/profile
修改内核配置文件
Echo “fs.aio-max-nr = 1048576” >> /etc / sysctl.conf
Echo “fs.file-max = 6815744” >> /etc / sysctl.conf
Echo “kernel.shmall = 2097152” >> /etc / sysctl.conf
Echo “kernel.shmmax = 1054472192” >> /etc / sysctl.conf
Echo “kernel.shmmni = 4096” >> /etc / sysctl.conf
Echo “kernel.sem = 250 32000 100 128” >> /etc / sysctl.conf
Echo “net.ipv4.ip_local_port_range = 9000 65500” >> /etc / sysctl.conf
Echo “net.core.rmem_default = 262144” >> /etc / sysctl.conf
Echo “net.core.rmem_max = 4194304” >> /etc / sysctl.conf
Echo “net.core.wmem_default = 262144” >> /etc / sysctl.conf
Echo “net.core.wmem_max = 1048586” >> /etc / sysctl.conf
Echo “net.ipv4.tcp_wmem = 262144 262144 262144” >> /etc / sysctl.conf
Echo “net.ipv4.tcp_rmem = 4194304 4194304 4194304” >> /etc / sysctl.conf
3. 为ASM创建可用磁盘
关闭dg服务器添加4块磁盘,大小分别是1GB,5GB,5GB,10GB,这4块盘分别作为
GRIDDG,DATEN,FLASH,RMAN备份盘使用。
我们以创建1GB盘为例
这样GRIDDG盘就添加好了,然后用同样的办法添加DATA,FLASH,RMAN备份盘即可。
4.ASM-Dienst konfigurieren
准备好asm安装包
oracleasm-support-2.1.3-1.el5.x86_64.rpm
oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
用rpm -ivh安装这3个asm包即可
配置ASM驱动服务
/usr/sbin/oracleasm configure -i
/usr/sbin/oracleasm init
/usr/sbin/oracleasm configure
/usr/sbin/oracleasm status
这时发现asm服务已经运行
格式化新磁盘,并创建ASM磁盘组
用fdisk命令查看一下刚才创建的磁盘,分别为/dev/sdb/ ,dev/sdc 和/dev/sdd 大小分别是1GB,5GB,5GB
接着使用fdisk 命令格式化这些磁盘,以/dev/sdb为例:
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x33318f33.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won’t be recoverable.
Warnung: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNUNG: DOS-compatible mode is deprecated. It’s strongly recommended to
switch off the mode (command ‘c’) and change display units to
sectors (command ‘u’).
Command (m for help): n
Command action
e extended
p primary partition (1-4)
n
Partition number (1-4):
Value out of range.
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M.,G} (1-130, default 130): 130
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
这样/dev/sdb就格式化好了,wie folgt:
用同样的方法格式化dev/sdc 和/dev/sdd,/dev/sde/,不再一一演示了。
接着配置/dev/sdb , /dev/sdc , /dev/sdd 为ASM盘,方法如下:
/usr/sbin/oracleasm createdisk VOL1 /dev/sdb1
/usr/sbin/oracleasm createdisk VOL2 /dev/sdc1
/usr/sbin/oracleasm createdisk VOL3/dev/sdd1
对于/dev/sde不作为asm盘,而是格式化成ext3分区,然后挂载到/rman_backup目录下即可
Bisher,磁盘方面准备完成。
将grid软件,oracle软件分别上传到/home/grid和/home/oracle下
然后用unzip命令解压,将会得到grid安装目录和database安装目录
5. grid安装
安装前检查,没有报错. 点击Finish开始安装
然后等待安装即可
在最后阶段,执行两个脚本,orainstRoot.sh和root.sh
如果执行没有问题,则grid宣布安装完成。
看一下grid进程
切换到grid用户 , 执行crs_stat -t 发现grid进程出现了。
7. 安装oracle软件
切换到oracle用户,执行runInstaller,安装过程和RAC中大体相同,不同部分如下:
接着安装前检查,正式安装,执行脚本即可完成oracle安装
关于ASM磁盘组配置,RAC主库,DG备库会放到后面演示。