Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1373471
  • 博文数量: 112
  • 博客积分: 7112
  • 博客等级: 少将
  • 技术积分: 1299
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-31 16:27
文章分类

全部博文(112)

文章存档

2011年(19)

2010年(20)

2009年(16)

2008年(20)

2007年(37)

分类: LINUX

2009-05-15 09:31:53

VMware Server 在 Oracle Enterprise Linux 上安装 Oracle RAC 10g


安装方法请见附件。


1.从RAC架构来讲,应用软件分为5层:

CRS:整个RAC环境,包括VIP,监听,ASM,DB等等。

RAC:的CLUSTER支持组件。

LINSTENER:监听整个ORACLE网络。

ASM  INSTANCE:ASM实例,提供存储管理,存储空间给整个CLUSTER集群使用。

DB INSTANCE:实例层。

2.对于UNKNOWN状态的应用,只能是手工先stop再start

分析:VIP已经启动,因此直接考虑启动ASM层。

如果ASM不启动,RAC2的实例始终为OFFLINE的状态:



下面我们来探究一下您刚刚配置的环境。

检查应用程序资源的状态。
rac1-> crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.devdb.db application ONLINE ONLINE rac1
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2

rac1-> srvctl status nodeapps -n rac1
VIP is running on node: rac1
GSD is running on node: rac1
Listener is running on node: rac1
ONS daemon is running on node: rac1

rac1-> srvctl status nodeapps -n rac2
VIP is running on node: rac2
GSD is running on node: rac2
Listener is running on node: rac2
ONS daemon is running on node: rac2

rac1-> srvctl status asm -n rac1
ASM instance +ASM1 is running on node rac1.

rac1-> srvctl status asm -n rac2
ASM instance +ASM2 is running on node rac2.

rac1-> srvctl status database -d devdb
Instance devdb1 is running on node rac1
Instance devdb2 is running on node rac2

rac1-> srvctl status service -d devdb
rac1->
检查 Oracle 集群件的状态。
rac1-> crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy

rac2-> crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy

在命令行执行 crsctl 以查看所有可用选项。

列出 RAC 实例。
SQL> select
2 instance_name,
3 host_name,
4 archiver,
5 thread#,
6 status
7 from gv$instance;

INSTANCE_NAME HOST_NAME ARCHIVE THREAD# STATUS
-------------- --------------------- ------- -------- ------
devdb1 rac1.mycorpdomain.com STARTED 1 OPEN
devdb2 rac2.mycorpdomain.com STARTED 2 OPEN
检查连接。

验证您能够连接到每个节点上的实例和服务。

sqlplus system@devdb1
sqlplus system@devdb2
sqlplus system@devdb
检查数据库配置。
rac1-> export ORACLE_SID=devdb1
rac1-> sqlplus / as sysdba

SQL> show sga

Total System Global Area 209715200 bytes
Fixed Size 1218556 bytes
Variable Size 104859652 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes


SQL> select file_name,bytes/1024/1024 from dba_data_files;

FILE_NAME BYTES/1024/1024
------------------------------------------- ---------------
+DG1/devdb/datafile/users.259.606468449 5
+DG1/devdb/datafile/sysaux.257.606468447 240
+DG1/devdb/datafile/undotbs1.258.606468449 30
+DG1/devdb/datafile/system.256.606468445 480
+DG1/devdb/datafile/undotbs2.264.606468677 25


SQL> select
2 group#,
3 type,
4 member,
5 is_recovery_dest_file
6 from v$logfile
7 order by group#;

GROUP# TYPE MEMBER IS_
------ ------- --------------------------------------------------- ---
1 ONLINE +RECOVERYDEST/devdb/onlinelog/group_1.257.606468581 YES
1 ONLINE +DG1/devdb/onlinelog/group_1.261.606468575 NO
2 ONLINE +RECOVERYDEST/devdb/onlinelog/group_2.258.606468589 YES
2 ONLINE +DG1/devdb/onlinelog/group_2.262.606468583 NO
3 ONLINE +DG1/devdb/onlinelog/group_3.265.606468865 NO
3 ONLINE +RECOVERYDEST/devdb/onlinelog/group_3.259.606468875 YES
4 ONLINE +DG1/devdb/onlinelog/group_4.266.606468879 NO
4 ONLINE +RECOVERYDEST/devdb/onlinelog/group_4.260.606468887 YES


rac1-> export ORACLE_SID=+ASM1
rac1-> sqlplus / as sysdba

SQL> show sga

Total System Global Area 92274688 bytes
Fixed Size 1217884 bytes
Variable Size 65890980 bytes
ASM Cache 25165824 bytes


SQL> show parameter asm_disk

NAME TYPE VALUE
------------------------------ ----------- ------------------------
asm_diskgroups string DG1, RECOVERYDEST
asm_diskstring string


SQL> select
2 group_number,
3 name,
4 allocation_unit_size alloc_unit_size,
5 state,
6 type,
7 total_mb,
8 usable_file_mb
9 from v$asm_diskgroup;

ALLOC USABLE
GROUP UNIT TOTAL FILE
NUMBER NAME SIZE STATE TYPE MB MB
------ ------------ -------- ------- ------ ------ -------
1 DG1 1048576 MOUNTED NORMAL 6134 1868
2 RECOVERYDEST 1048576 MOUNTED EXTERN 2047 1713


SQL> select
2 name,
3 path,
4 header_status,
5 total_mb free_mb,
6 trunc(bytes_read/1024/1024) read_mb,
7 trunc(bytes_written/1024/1024) write_mb
8 from v$asm_disk;

NAME PATH HEADER_STATU FREE_MB READ_MB WRITE_MB
----- ---------- ------------ ---------- ---------- ----------
VOL1 ORCL:VOL1 MEMBER 3067 229 1242
VOL2 ORCL:VOL2 MEMBER 3067 164 1242
VOL3 ORCL:VOL3 MEMBER 2047 11 354
创建表空间。
SQL> connect system/oracle@devdb
Connected.
SQL> create tablespace test_d datafile '+DG1' size 10M;

Tablespace created.

SQL> select
2 file_name,
3 tablespace_name,
4 bytes
5 from dba_data_files
6 where tablespace_name='TEST_D';

FILE_NAME TABLESPACE_NAME BYTES
---------------------------------------- --------------- ----------
+DG1/devdb/datafile/test_d.269.606473423 TEST_D 10485760
创建在线重做日志文件组。
SQL> connect system/oracle@devdb
Connected.
SQL> alter database add logfile thread 1 group 5 size 50M;

Database altered.

SQL> alter database add logfile thread 2 group 6 size 50M;

Database altered.

SQL> select
2 group#,
3 thread#,
4 bytes,
5 members,
6 status
7 from v$log;

GROUP# THREAD# BYTES MEMBERS STATUS
---------- ---------- ---------- ---------- ----------------
1 1 52428800 2 CURRENT
2 1 52428800 2 INACTIVE
3 2 52428800 2 ACTIVE
4 2 52428800 2 CURRENT
5 1 52428800 2 UNUSED
6 2 52428800 2 UNUSED

SQL> select
2 group#,
3 type,
4 member,
5 is_recovery_dest_file
6 from v$logfile
7 where group# in (5,6)
8 order by group#;

GROUP# TYPE MEMBER IS_
------ ------- ---------------------------------------------------- ---
5 ONLINE +DG1/devdb/onlinelog/group_5.271.606473683 NO
5 ONLINE +RECOVERYDEST/devdb/onlinelog/group_5.261.606473691 YES
6 ONLINE +DG1/devdb/onlinelog/group_6.272.606473697 NO
6 ONLINE +RECOVERYDEST/devdb/onlinelog/group_6.262.606473703 YES
检查闪回恢复区空间使用率。
SQL> select * from v$recovery_file_dest;

NAME SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES
------------- ----------- ---------- ----------------- ---------------
+RECOVERYDEST 1572864000 331366400 0 7


SQL> select * from v$flash_recovery_area_usage;

FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
------------ ------------------ ------------------------- ---------------
CONTROLFILE .97 0 1
ONLINELOG 20 0 6
ARCHIVELOG 0 0 0
BACKUPPIECE 0 0 0
IMAGECOPY 0 0 0
FLASHBACKLOG 0 0 0
启动和停止应用程序资源。

遵循以下步骤启动和停止单独的应用程序资源。

srvctl start nodeapps -n  
srvctl start nodeapps -n
srvctl start asm -n
srvctl start asm -n
srvctl start database -d
srvctl start service -d -s
crs_stat -t

srvctl stop service -d -s
srvctl stop database -d
srvctl stop asm -n
srvctl stop asm -n
srvctl stop nodeapps -n
srvctl stop nodeapps -n
crs_stat -t


-------------------------------------------------------------------------------------
文件:Oracle10g集群安装.rar
大小:607KB
下载:下载
-------------------------------------------------------------------------------------
注意事项:

1.在安装lusterware时如果出现报错现象,需要重新安装时,必须先清除已经安装的cluserware,否则可能会影响到下次安装。一般情况下,只需要在各节点上依次运行目录$ORA_CRS_HOME/install/下的脚本rootdelete.sh和 rootdeinstall.sh即可。

  手动卸载:

 

1、在所有节点停止nodeapps

srvctl stop nodeapps -n nodename

2、删除自动启动程序

Sun:

rm /etc/init.d/init.cssd
rm /etc/init.d/init.crs
rm /etc/init.d/init.crsd
rm /etc/init.d/init.evmd
rm /etc/rc3.d/K96init.crs
rm /etc/rc3.d/S96init.crs
rm -Rf /var/opt/oracle/scls_scr
rm -Rf /var/opt/oracle/oprocd
rm /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab

Linux:

rm /etc/oracle/*
rm -f /etc/init.d/init.cssd
rm -f /etc/init.d/init.crs
rm -f /etc/init.d/init.crsd
rm -f /etc/init.d/init.evmd
rm -f /etc/rc2.d/K96init.crs
rm -f /etc/rc2.d/S96init.crs
rm -f /etc/rc3.d/K96init.crs
rm -f /etc/rc3.d/S96init.crs
rm -f /etc/rc5.d/K96init.crs
rm -f /etc/rc5.d/S96init.crs
rm -Rf /etc/oracle/scls_scr
rm -f /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab

HP-UX:

rm /sbin/init.d/init.cssd
rm /sbin/init.d/init.crs
rm /sbin/init.d/init.crsd
rm /sbin/init.d/init.evmd
rm /sbin/rc2.d/K960init.crs
rm /sbin/rc2.d/K001init.crs
rm /sbin/rc3.d/K960init.crs
rm /sbin/rc3.d/S960init.crs
rm -Rf /var/opt/oracle/scls_scr
rm -Rf /var/opt/oracle/oprocd
rm /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab

HP Tru64:

rm /sbin/init.d/init.cssd
rm /sbin/init.d/init.crs
rm /sbin/init.d/init.crsd
rm /sbin/init.d/init.evmd
rm /sbin/rc3.d/K96init.crs
rm /sbin/rc3.d/S96init.crs
rm -Rf /var/opt/oracle/scls_scr
rm -Rf /var/opt/oracle/oprocd
rm /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab

IBM AIX:

rm /etc/init.cssd
rm /etc/init.crs
rm /etc/init.crsd
rm /etc/init.evmd
rm /etc/rc.d/rc2.d/K96init.crs
rm /etc/rc.d/rc2.d/S96init.crs
rm -Rf /etc/oracle/scls_scr
rm -Rf /etc/oracle/oprocd
rm /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab

3、kill css/crs/evm进程,并reboot节点

ps -ef | grep css/crs/evm

kill -9 processid


4、删除/tmp/.oracle或/var/tmp/.oracle

rm -f /tmp/.oracle 或rm -f /var/tmp/.oracle

5、删除ocr.loc

rm -f /etc/oracle/orc.loc

6、用 universal installer卸载crs

7、删除crs安装目录

rm -Rf crs_install_dir

8、使用dd清除vote disk和ocr(裸设备)

dd if=/dev/zero f=/dev/votedisk_device bs=8192 count=2560

dd if=/dev/zero f=/dev/ocr_device bs=8192 count=12800


文件:Oracle10g集群安装.rar
大小:607KB
下载:下载





阅读(1711) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-06-23 10:48:19

非常好,谢谢