1、查看所有实例和服务的状态$srvctlstatusdatabase-dorclInstanceorcl1isrunningonnodelinux1Instanceorcl2isrunningonnodelinux22、查看单个实例的状态$srvctlstatusinstance-dorcl-iorcl2Instanceorcl2isrunningonnodelinux23、查看数据库全局命名服务的状态$srvctlstatusservice-dorcl-sorcltestServiceorcltestisrunningoninstance(s)orcl2,orcl14、查看特定节点上节点应用程序的状态$srvctlstatusnodeapps-nlinux1VIPisrunningonnode:linux1GSDisrunningonnode:linux1Listenerisrunningonnode:linux1ONSdaemonisrunningonnode:linux15、查看ASM实例的状态$srvctlstatusasm-nlinux1ASMinstance+ASM1isrunningonnodelinux1.6、列出配置的所有数据库$srvctlconfigdatabaseorcl7、显示RAC数据库的配置$srvctlconfigdatabase-dorcllinux1orcl1/u01/app/oracle/product/10.2.0/db_1linux2orcl2/u01/app/oracle/product/10.2.0/db_18、显示指定集群数据库的所有服务$srvctlconfigservice-dorclorcltestPREF:orcl2orcl1AVAIL:9、显示节点应用程序的配置—(VIP、GSD、ONS、监听器)$srvctlconfignodeapps-nlinux1-a-g-s-lVIPexists.:/linux1-vip/192.168.1.200/255.255.255.0/eth0:eth1GSDexists.ONSdaemonexists.Listenerexists.10、显示ASM实例的配置$srvctlconfigasm-nlinux1+ASM1/u01/app/oracle/product/10.2.0/db_111、查看集群中所有正在运行的实例SELECTinst_id,instance_numberinst_no,instance_nameinst_name,parallel,status,database_statusdb_status,active_statestate,host_namehostFROMgv$instanceORDERBYinst_id;INST_IDINST_NOINST_NAMEPARSTATUSDB_STATUSSTATEHOST----------------------------------------------------------------11orcl1YESOPENACTIVENORMALrac122orcl2YESOPENACTIVENORMALrac212、查看位于磁盘组中的所有数据文件selectnamefromv$datafileunionselectmemberfromv$logfileunionselectnamefromv$controlfileunionselectnamefromv$tempfile;NAME-------------------------------------------+FLASH_RECOVERY_AREA/orcl/controlfile/current.258.570913191+FLASH_RECOVERY_AREA/orcl/onlinelog/group_1.257.570913201+FLASH_RECOVERY_AREA/orcl/onlinelog/group_2.256.570913211+FLASH_RECOVERY_AREA/orcl/onlinelog/group_3.259.570918285+FLASH_RECOVERY_AREA/orcl/onlinelog/group_4.260.570918295+ORCL_DATA1/orcl/controlfile/current.259.570913189+ORCL_DATA1/orcl/datafile/example.257.570913311+ORCL_DATA1/orcl/datafile/indx.270.570920045+ORCL_DATA1/orcl/datafile/sysaux.260.570913287+ORCL_DATA1/orcl/datafile/system.262.570913215+ORCL_DATA1/orcl/datafile/undotbs1.261.570913263+ORCL_DATA1/orcl/datafile/undotbs1.271.570920865+ORCL_DATA1/orcl/datafile/undotbs2.265.570913331+ORCL_DATA1/orcl/datafile/undotbs2.272.570921065+ORCL_DATA1/orcl/datafile/users.264.570913355+ORCL_DATA1/orcl/datafile/users.269.570919829+ORCL_DATA1/orcl/onlinelog/group_1.256.570913195+ORCL_DATA1/orcl/onlinelog/group_2.263.570913205+ORCL_DATA1/orcl/onlinelog/group_3.266.570918279+ORCL_DATA1/orcl/onlinelog/group_4.267.570918289+ORCL_DATA1/orcl/tempfile/temp.258.57091330321rowsselected.13、查看属于“ORCL_DATA1”磁盘组的所有ASM磁盘SELECTpathFROMv$asm_diskWHEREgroup_numberIN(selectgroup_numberfromv$asm_diskgroupwherename='ORCL_DATA1');PATH----------------------------------ORCL:VOL1ORCL:VOL214、启动/停止RAC集群确保是以oracleUNIX用户登录的。我们将从rac1节点运行所有命令:#su–oracle$hostnameRac115、停止OracleRAC10g环境第一步是停止Oracle实例。当此实例(和相关服务)关闭后,关闭ASM实例。最后,关闭节点应用程序(虚拟IP、GSD、TNS监听器和ONS)。$exportORACLE_SID=orcl1$emctlstopdbconsole$srvctlstopinstance-dorcl-iorcl1$srvctlstopasm-nrac1$srvctlstopnodeapps–nrac116、启动OracleRAC10g环境第一步是启动节点应用程序(虚拟IP、GSD、TNS监听器和ONS)。当成功启动节点应用程序后,启动ASM实例。最后,启动Oracle实例(和相关服务)以及企业管理器数据库控制台。$exportORACLE_SID=orcl1$srvctlstartnodeapps-nrac1$srvctlstartasm-nrac1$srvctlstartinstance-dorcl-iorcl1$emctlstartdbconsole17、使用SRVCTL启动/停止所有实例启动/停止所有实例及其启用的服务。我只是觉得有意思就把此步骤作为关闭所有实例的一种方法加进来了!$srvctlstartdatabase-dorcl$srvctlstopdatabase-dorcl18、RAC中crs自动启动脚本with/etc/init.d/init.crsdisable/enabletodisableorenableitnexttimereboot/etc/init.d/init.crsd/etc/init.d/init.evmd/etc/init.d/init.cssd19、RAC中数据库启动/关闭/查看脚本启动数据库:srvctlstartdatabase-dRACDB;关闭数据库:srvctlstopdatabase-dRACDB;检查数据启动状态:srvctlstatusdatabase-dRACDB;查看数据库实例状态:srvctlstatusinstance-dRACDB-iRACDB1,RACDB220、单独启动节点的资源srvctlstartnodeapps-ngnd-rac01srvctlstartnodeapps-nons-rac0121、RAC中客户端TNSNAME.ORA配置#TNSNAMES.ORANetworkConfigurationFile:D:\oracle\ora92\NETWORK\ADMIN\tnsnames.ora#GeneratedbyOracleconfigurationtools.HIS=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.5)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.7)(PORT=1521))(LOAD_BALANCE=yes)(FAILOVER=on))(CONNECT_DATA=(SERVICE_NAME=orcl)(FAILOVER_MODE=(TYPE=select)(METHOD=basic))))HIS2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.7)(PORT=1521)))(CONNECT_DATA=(SID=ORCL2)))HIS1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.5)(PORT=1521)))(CONNECT_DATA=(SID=ORCL1)))