分类: LINUX
2009-05-15 09:31:53
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检查 Oracle 集群件的状态。
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->
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
|
1.在安装lusterware时如果出现报错现象,需要重新安装时,必须先清除已经安装的cluserware,否则可能会影响到下次安装。一般情况下,只需要在各节点上依次运行目录$ORA_CRS_HOME/install/下的脚本rootdelete.sh和 rootdeinstall.sh即可。
手动卸载:
1、在所有节点停止nodeapps
|
2、删除自动启动程序
|
3、kill css/crs/evm进程,并reboot节点
|
|
|
6、用 universal installer卸载crs
7、删除crs安装目录
|
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
|