10 RAC环境 (1)检查应用程序资源的状态 csr_stat -t命令 $crs_stat –t //显示crs的状态 Name Type Target State Host ———————————————————— ora.gemn……
我们一直都在努力坚持原创.......请不要一声不吭,就悄悄拿走。
我原创,你原创,我们的内容世界才会更加精彩!
【所有原创内容版权均属TechTarget,欢迎大家转发分享。但未经授权,严禁任何媒体(平面媒体、网络媒体、自媒体等)以及微信公众号复制、转载、摘编或以其他方式进行使用。】
微信公众号
TechTarget
官方微博
TechTarget中国
10 RAC环境
(1)检查应用程序资源的状态
csr_stat -t命令
$crs_stat –t //显示crs的状态 Name Type Target State Host ------------------------------------------------------------ ora.gemni.db application ONLINE ONLINE ds1 //数据库,节点1 ora....b1.inst application ONLINE ONLINE ds1 //实例,节点1 ora....b2.inst application ONLINE ONLINE ds2 //实例,节点2 ora....SM1.asm application ONLINE ONLINE ds1 //asm实例,节点1 ora....C1.lsnr application ONLINE ONLINE ds1 //监听,节点1 ora.ds1.gsd application ONLINE ONLINE ds1 //gsd,节点1 ora.ds1.ons application ONLINE ONLINE ds1 //ons,节点1 ora.ds1.vip application ONLINE ONLINE ds1 //vip,节点1 ora....SM2.asm application ONLINE ONLINE ds2 //asm实例,节点2 ora....C2.lsnr application ONLINE ONLINE ds2 //监听,节点2 ora.ds2.gsd application ONLINE ONLINE ds2 //gsd,节点2 ora.ds2.ons application ONLINE ONLINE ds2 //ons,节点2 ora.ds2.vip application ONLINE ONLINE ds2 //vip,节点2 srvctl status nodeapps –n命令 $srvctl status nodeapps -n ds1 //节点的状态 VIP is running on node: ds1 GSD is running on node: ds1 Listener is running on node: ds1 ONS daemon is running on node: ds1 $srvctl status nodeapps -n ds2 VIP is running on node: ds2 GSD is running on node: ds2 Listener is running on node: ds2 ONS daemon is running on node: ds2 srvctl status asm –n命令 $srvctl status asm -n ds1 ASM instance +ASM1 is running on node ds1. $srvctl status asm -n ds2 ASM instance +ASM2 is running on node ds2. srvctl status database –d命令 $srvctl status database -d gemni Instance gemni is running on node ds1 Instance gemni is running on node ds2 |
(2)检查Oracle集群件的状态
$crsctl check crs CSS appears healthy CRS appears healthy EVM appears healthy $crsctl check crs CSS appears healthy CRS appears healthy EVM appears healthy |
(3)列出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 -------------- --------------------- ------- -------- ------ gemni ds1.mycorpdomain.com STARTED 1 OPEN gemni ds2.mycorpdomain.com STARTED 2 OPEN |
(4)检查连接
验证您能够连接到每个节点上的实例和服务。
sqlplus system@gemni |
(5) 检查数据库配置
$export ORACLE_SID=gemni $sqlplus / as sysdba |
//显示sga参数
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/gemni/datafile/users.259.606468449 5 +DG1/gemni/datafile/sysaux.257.606468447 240 +DG1/gemni/datafile/undotbs1.258.606468449 30 +DG1/gemni/datafile/system.256.606468445 480 +DG1/gemni/datafile/undotbs2.264.606468677 25 |
//显示redo文件的组和位置信息
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/gemni/onlinelog/group_1.257.606468581 YES 1 ONLINE +DG1/gemni/onlinelog/group_1.261.606468575 NO 2 ONLINE +RECOVERYDEST/gemni/onlinelog/group_2.258.606468589 YES 2 ONLINE +DG1/gemni/onlinelog/group_2.262.606468583 NO 3 ONLINE +DG1/gemni/onlinelog/group_3.265.606468865 NO 3 ONLINE +RECOVERYDEST/gemni/onlinelog/group_3.259.606468875 YES 4 ONLINE +DG1/gemni/onlinelog/group_4.266.606468879 NO 4 ONLINE +RECOVERYDEST/gemni/onlinelog/group_4.260.606468887 YES |
//显示asm实例的参数
$export ORACLE_SID=+ASM1 $sqlplus / as sysdba SQL> show sga Total System Global Area 92274688 bytes Fixed Size 1217884 bytes Variable Size 65890980 bytes ASM Cache 25165824 bytes $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 |
(6)创建表空间
SQL> connect system/oracle@gemni 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 |
(7)创建在线重做日志文件组
SQL> connect system/oracle@gemni 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 |
(8)检查闪回恢复区空间使用率
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
(9)启动和停止应用程序资源。
遵循以下步骤启动和停止单独的应用程序资源。
启动程序资源
srvctl start nodeapps -n //在节点1启动nodeapps srvctl start nodeapps -n //在节点2启动nodeapps srvctl start asm -n //在节点1启动asm srvctl start asm -n //在节点2启动asm srvctl start database -d //启动database srvctl start service -d -s //启动数据库的服务 crs_stat –t //确认程序资源的状态 srvctl stop service -d -s //停止数据库的服务 srvctl stop database -d //停止数据库 srvctl stop asm -n //停止asm srvctl stop asm -n srvctl stop nodeapps -n //停止nodeapps srvctl stop nodeapps -n crs_stat -t //确认程序资源的状态 |
作者
相关推荐
-
甲骨文自治数据库亮相 带来云计算新希望
早前甲骨文还不在云计算公司之列,而现在该公司正在迅速弥补其失去的时间。甲骨文的云计算核心是甲骨文自治数据库(O […]
-
2017年12月数据库流行度排行榜 定格岁末排名瞬间
数据库知识网站DB-engines最近更新的2017年12月份数据库流行度排名情况是否能提供更多的看点呢?TechTarget数据库网站将与您分享12月份的榜单排名情况,让我们拭目以待。
-
2017年11月数据库流行度排行榜 半数以上数据库积分减少
数据库知识网站DB-engines更新了2016年11月份的数据库流行度排行榜。TechTarget数据库网站将与您一同关注11月份的榜单排名情况。
-
控制合约 不再畏惧Oracle
许多公司都与Oracle有无限制授权协议,他们害怕离开这个协议,所以就证明他们在使用Oracle的软件,即使因为需求单独购买部分授权许可也可能总体是省钱的。