节点信息:IP PRIVIP VIP HOSTNAME
123.125.17.2 192.168.100.2 123.125.17.6 RAC-01
123.125.17.4 192.168.100.3 123.125.17.8 RAC-02
|
/usr/sbin/groupadd oinstall /usr/sbin/groupadd dba /usr/sbin/useradd -m -g oinstall -G dba oracle id oracle |
# passwd oracle Changing password for user oracle. New password: Retype new password: passwd:all authentication tokens updated successfully. |
mkdir -p /u01/app/oracle chown -R oracle:oinstall /u01/app/oracle chmod -R 775 /u01/app/oracle |
cat >> /etc/sysctl.conf >>EOF kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default=262144 net.core.wmem_default=262144 net.core.rmem_max=262144 net.core.wmem_max=262144 EOF /sbin/sysctl -p |
cat >> /etc/security/limits.conf >>EOF oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 EOF |
modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180 cat >> /etc/rc.d/rc.local >>EOF modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180 EOF |
127.0.0.1 localhost.localdomain localhost 192.168.100.2 rac-priv01 192.168.100.3 rac-priv02 123.125.17.2 rac-01 123.125.17.4 rac-02 123.125.17.6 rac-vip01 123.125.17.8 rac-vip02 |
$ mkdir ~/.ssh $ chmod 755 ~/.ssh $ /usr/bin/ssh-keygen -t rsa |
ssh rac-02 date
ssh rac-01 date
ssh rac-priv01 date
ssh rac-priv02 date
|
分区 类型 大小
SDB的分区的规划
1 主分区 50
2 主分区 50 3 主分区 200 4 扩展分区 - 5 逻辑型 200 6 逻辑型 200 7 逻辑型 200 8 逻辑型 200 9 逻辑型 200 10 逻辑型 600 11 逻辑型 600 12 逻辑型 600 13 逻辑型 1200 14 逻辑型 1200 15 逻辑型 任意 16 逻辑型 任意
SDC分区的划分
1 主分区 600
2 主分区 600
3 主分区 600
Syncing disks.
|
目的 最小大小 (MB) 标准化大小 (MB) 磁盘设备 原始设备 Oracle CRS Voting 20 50 /dev/sdb1 /dev/raw/raw1 SPFILE 50 /dev/sdb2 /dev/raw/raw2 Oracle Cluster Registry 100 200 /dev/sdb3 /dev/raw/raw3 EXAMPLE 表空间 160 200 /dev/sdb5 /dev/raw/raw5 USERS 表空间 120 200 /dev/sdb6 /dev/raw/raw6 控制文件 1 110 200 /dev/sdb7 /dev/raw/raw7 重做日志 1_1 120 200 /dev/sdb8 /dev/raw/raw8 重做日志 1_2 120 200 /dev/sdb9 /dev/raw/raw9 UNDOTBS1 表空间 500 600 /dev/sdb10 /dev/raw/raw10 SYSTEM 表空间 500 600 /dev/sdb11 /dev/raw/raw11 TEMP 表空间 250 600 /dev/sdb12 /dev/raw/raw12 SYSAUX 表空间 800 1200 /dev/sdb13 /dev/raw/raw13 UNDOTBS2 表空间 500 600 /dev/sdb14 /dev/raw/raw14 重做日志 2_1 120 200 /dev/sdb15 /dev/raw/raw15 口令文件 5 50 /dev/sdc1 /dev/raw/raw16 控制文件 2 110 200 /dev/sdc2 /dev/raw/raw17 重做日志 2_2 120 200 /dev/sdc3 /dev/raw/raw1 |
/dev/raw/raw1 /dev/sdb1 /dev/raw/raw2 /dev/sdb2 /dev/raw/raw3 /dev/sdb3 /dev/raw/raw5 /dev/sdb5 /dev/raw/raw6 /dev/sdb6 /dev/raw/raw7 /dev/sdb7 /dev/raw/raw8 /dev/sdb8 /dev/raw/raw9 /dev/sdb9 /dev/raw/raw10 /dev/sdb10 /dev/raw/raw11 /dev/sdb11 /dev/raw/raw12 /dev/sdb12 /dev/raw/raw13 /dev/sdb13 /dev/raw/raw14 /dev/sdb14 /dev/raw/raw15 /dev/sdb15 /dev/raw/raw16 /dev/sdc1 /dev/raw/raw17 /dev/sdc2 /dev/raw/raw18 /dev/sdc3 |
chown root:oinstall /dev/raw/raw[12] chmod 660 /dev/raw/raw[12] |
chown oracle:oinstall /dev/raw/raw[3-9] chown oracle:oinstall /dev/raw/raw1[0-7] chmod 660 /dev/raw/raw[3-9] chmod 660 /dev/raw/raw1[0-7] |
RHEL2/3 /sbin/service rawdevices restart |
目的 原始设备 文件名 oracle CRS voting /dev/raw/raw1 /u02/oracrs/vote.crs SPFILE /dev/raw/raw2 u01/oradata/gemni/spfilegemni.ora Oracle Cluster Registry /dev/raw/raw3 /u02/oracrs/ocr.crs EXAMPLE 表空间 /dev/raw/raw5 /u02/oradata/gemni/example_01.dbf USERS 表空间 /dev/raw/raw6 /u02/oradata/gemni/users_01.dbf 控制文件 1 /dev/raw/raw7 /u01/oradata/gemni/control.ctl 重做日志 1_1 /dev/raw/raw8 /u01/oradata/gemni/redo1_1.log 重做日志 1_2 /dev/raw/raw9 /u01/oradata/gemni/redo1_2.log UNDOTBS1 表空间 /dev/raw/raw10 /u02/oradata/gemni/undo1_01.dbf SYSTEM 表空间 /dev/raw/raw11 /u02/oradata/gemni/system_01.dbf TEMP 表空间 /dev/raw/raw12 /u02/oradata/gemni/temp_01.dbf SYSAUX 表空间 /dev/raw/raw13 /u02/oradata/gemni/sysaux_01.dbf UNDOTBS2 表空间 /dev/raw/raw14 /u02/oradata/gemni/undo2_01.dbf 重做日志 2_1 /dev/raw/raw15 /u01/oradata/gemni/redo2_1.log 口令文件 /dev/raw/raw16 /u01/oradata/gemni/orapwgemni 控制文件 2 /dev/raw/raw17 /u02/oradata/gemni/control02.ctl 重做日志 2_2 /dev/raw/raw18 /u01/oradata/gemni/redo2_2.log |
mkdir -p /u02/oracrs chown -R oracle:oinstall /u02/oracrs chmod -R 775 /u02/oracrs |
mkdir -p /u01/oradata/gemni /u02/oradata/gemni chown -R oracle:oinstall /u0[12]/oradata chmod -R 775 /u0[12]/oradata |
ln -s /dev/raw/raw1 /u02/oracrs/vote.crs ln -s /dev/raw/raw2 /u01/oradata/gemni/spfilegemni.ora ln -s /dev/raw/raw3 /u02/oracrs/ocr.crs ln -s /dev/raw/raw5 /u02/oradata/gemni/example_01.dbf ln -s /dev/raw/raw6 /u02/oradata/gemni/users_01.dbf ln -s /dev/raw/raw7 /u01/oradata/gemni/control.ctl ln -s /dev/raw/raw8 /u01/oradata/gemni/redo1_1.log ln -s /dev/raw/raw9 /u01/oradata/gemni/redo1_2.log ln -s /dev/raw/raw10 /u02/oradata/gemni/undo1_01.dbf ln -s /dev/raw/raw11 /u02/oradata/gemni/system_01.dbf ln -s /dev/raw/raw12 /u02/oradata/gemni/temp_01.dbf ln -s /dev/raw/raw13 /u02/oradata/gemni/sysaux_01.dbf ln -s /dev/raw/raw14 /u02/oradata/gemni/undo2_01.dbf ln -s /dev/raw/raw15 /u01/oradata/gemni/redo2_1.log ln -s /dev/raw/raw16 /u01/oradata/gemni/orapwgemni ln -s /dev/raw/raw17 /u02/oradata/gemni/control02.ctl ln -s /dev/raw/raw18 /u01/oradata/gemni/redo2_2.log |
cat > $HOME/gemni_raw.conf << EOF system=/u02/oradata/gemni/system_01.dbf sysaux=/u02/oradata/gemni/sysaux_01.dbf example=/u02/oradata/gemni/example_01.dbf users=/u02/oradata/gemni/users_01.dbf temp=/u02/oradata/gemni/temp_01.dbf undotbs1=/u02/oradata/gemni/undo1_01.dbf undotbs2=/u02/oradata/gemni/undo2_01.dbf redo1_1=/u01/oradata/gemni/redo1_1.log redo1_2=/u01/oradata/gemni/redo1_2.log redo2_1=/u01/oradata/gemni/redo2_1.log redo2_2=/u01/oradata/gemni/redo2_2.log control1=/u01/oradata/gemni/control.ctl control2=/u02/oradata/gemni/control02.ctl spfile=/u01/oradata/gemni/spfilegemni.ora pwdfile=/u01/oradata/gemni/orapwgemni EOF |
exec /usr/bin/ssh-agent $SHELL /usr/bin/ssh-add Enter passphrase for /home/oracle/.ssh/id_rsa: Identity added: /home/oracle/.ssh/id_rsa (/home/oracle/.ssh/id_rsa) Identity added: /home/oracle/.ssh/id_dsa (/home/oracle/.ssh/id_dsa) |
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.1.0/crs_1
RHEL4 and SLES9 Only
export LD_ASSUME_KERNEL=2.4.21 |
$ cd $ORACLE_BASE/product/10.1.0/crs_1/bin $ olsnodes ds1 ds2 |
export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.1.0/db_1 仅针对 RHES4 和 SLES9 export LD_ASSUME_KERNEL=2.4.21 |
cp /etc/redhat-release /etc/redhat-release.orig cat > /etc/redhat-release << EOF Red Hat Enterprise Linux AS release 3 (Taroon) EOF |
$ dbca 1. Welcome ― 选择“Oracle Real Application Clusters database” 2. Operations ― 创建数据库 3. Node Selection ― 单击 Select All(ds1 和 ds2) 4. Database Templates ― 通用 5. Database Identification ― 全局数据库名: gemni.orademo.org 6. Management Options ― 利用 Enterprise Manager 配置数据库;使用数据库控制进行数据库管理 7. Database Credentials ― 为所有帐户使用相同的口令;输入口令并再次确认 8. Storage Options ― 原始设备;指定原始设备映射文件 (/home/oracle/gemni_raw.conf) 9. Recovery Configuration ― 单击 Next 10. Database Content ― 示例模式 11. 初始化参数 ― 内存、典型 12. Database Storage ― 单击 Next 13. Create Options ― 选择“Create Database” 14. Summary ― 检查总结信息并单击 OK |
GEMNI = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 123.125.17.6)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 123.125.17.8)(PORT = 1521)) (LOAD_BALANCE = yes) (FAILOVER = ON) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = gemni.ora.org) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) ) ) ) |