RAC日常检查.docx
《RAC日常检查.docx》由会员分享,可在线阅读,更多相关《RAC日常检查.docx(14页珍藏版)》请在三一办公上搜索。
1、RAC日常检查出入境RAC日常检查 数据库名db_name:orcl Db_unique_name:orcl service_names:orcl 实例名 主机IP:orcl1 实例名 主机IP:orcl2 主机名 主机IP:hporcl1 主机名 主机IP:hporcl2 查看实例数据库状态: $ ./srvctl status database -d orcl Instance orcl1 is running on node hporcl1 Instance orcl2 is running on node hporcl2 查看数据库实例状态: $ ./srvctl status ins
2、tance -d orcl -i orcl1,orcl2 Instance orcl1 is running on node hporcl1 Instance orcl2 is running on node hporcl2 查看hporcl1IP)ASM实例状态 $ ./srvctl status asm -n hporcl1 ASM instance +ASM1 is running on node hporcl1. 查看hporcl2IP)ASM实例状态 $ ./srvctl status asm -n hporcl2 ASM instance +ASM2 is running on n
3、ode hporcl2. 查看节点hporcl1IP)应用程序的状态: $ ./srvctl status nodeapps -n hporcl1 VIP is running on node: hporcl1 GSD is running on node: hporcl1 Listener is running on node: hporcl1 ONS daemon is running on node: hporcl1 查看节点hporcl2IP)应用程序的状态: $ ./srvctl status nodeapps -n hporcl2 VIP is running on node: h
4、porcl2 GSD is running on node: hporcl2 Listener is running on node: hporcl2 ONS daemon is running on node: hporcl2 用crsctl命令,检查crs相关服务的状态: crsctl check crs 查看crs及所有的service的状态: crs_stat t crs_stat -ls 列出配置的所有数据库: srvctl config database 列出RAC数据库的配置: srvctl config database -d orcl 显示节点IP,主机名:hporcl1)应
5、用程序的配置 : srvctl config nodeapps -n hporcl1 -a -g -s l 显示节点IP,主机名:hporcl2)应用程序的配置 : srvctl config nodeapps -n hporcl2 -a -g -s l ORACLE进程检查: ps -ef|grep ora_ CRS进程检查: ps -ef|grep oracm 查看监听程序状态: lsnrctl status listener日志检查IP): /oracle/app/product/10.2/db_1/network/log/ listener.log /oracle/app/produc
6、t/10.2/db_1/network/log/ listener_hporcl1.log listener日志检查IP): /oracle/app/product/10.2/db_1/network/log/ listener.log /oracle/app/product/10.2/db_1/network/log/ listener_hporcl2.log 检查SGA和PGA: show sga select name ,value from gv$sysstat where name like %pga%; select name ,value from v$sysstat where
7、 name like %pga%; 检查参数: show parameter 集群中所有正在运行的实例: SELECT inst_id, instance_number inst_no, instance_name inst_name, parallel, status, database_status db_status, active_state state, host_name host FROM gv$instance ORDER BY inst_id; SELECT inst_id, instance_name, host_name, VERSION, TO_CHAR(startup
8、_time, yyyy-mm-dd hh24:mi:ss) startup_time, status, archiver, database_status FROM gv$instance; 检查查询服务器的运行模式和数据库安装选项: select * from v$option; 检查用户: select username, account_status, default_tablespace, temporary_tablespace, created from dba_users; select a.username, a.temporary_tablespace Temporary T
9、ablespace, b.contents from dba_users a, dba_tablespaces b where a.temporary_tablespace = b.tablespace_name and b.contents TEMPORARY; 控制文件检查: select * from v$controlfile; 无效对象检查: SELECT owner, object_name, object_type, status, LAST_DDL_TIME FROM dba_objects WHERE status like INVALID; 表空间和数据文件检查: sele
10、ct file_id, file_name, tablespace_name, autoextensible from dba_data_files; select count(*) from v$datafile; select name from v$datafile union select member from v$logfile union select name from v$controlfile union select name from v$tempfile; SELECT file#, ts#, NAME, status, BYTES / 1024 / 1024 siz
11、e_mb FROM v$datafile UNION ALL SELECT file#, ts#, NAME, status, BYTES / 1024 / 1024 size_mb FROM v$tempfile; 检查表空间使用情况: SELECT upper(f.tablespace_name) tablespace_name, d.Tot_grootte_Mb tablespace(M), d.Tot_grootte_Mb - f.total_bytes used(M), round(d.Tot_grootte_Mb - f.total_bytes) / d.Tot_grootte_M
12、b * 100, 2) use%, f.total_bytes free_space(M), round(f.total_bytes / d.Tot_grootte_Mb * 100, 2) free%, f.max_bytes max_block(M) FROM (SELECT tablespace_name, round(SUM(bytes) / (1024 * 1024), 2) total_bytes, round(MAX(bytes) / (1024 * 1024), 2) max_bytes FROM sys.dba_free_space GROUP BY tablespace_n
13、ame) f, (SELECT dd.tablespace_name, round(SUM(dd.bytes) / (1024 * 1024), 2) Tot_grootte_Mb FROM sys.dba_data_files dd GROUP BY dd.tablespace_name) d WHERE d.tablespace_name = f.tablespace_name ORDER BY 4 DESC; SELECT df.tablespace_name, COUNT(*) datafile_count, ROUND(SUM(df.BYTES) / 1048576) size_mb
14、, ROUND(SUM(free.BYTES) / 1048576, 2) free_mb, ROUND(SUM(df.BYTES) / 1048576 - SUM(free.BYTES) / 1048576, 2) used_mb, ROUND(MAX(free.maxbytes) / 1048576, 2) maxfree, 100 - ROUND(100.0 * SUM(free.BYTES) / SUM(df.BYTES), 2) pct_used, ROUND(100.0 * SUM(free.BYTES) / SUM(df.BYTES), 2) pct_free FROM dba_
15、data_files df, (SELECT tablespace_name, file_id, SUM(BYTES) BYTES, MAX(BYTES) maxbytes FROM dba_free_space GROUP BY tablespace_name, file_id) free WHERE df.tablespace_name = free.tablespace_name(+) AND df.file_id = free.file_id(+) GROUP BY df.tablespace_name ORDER BY df.tablespace_name; 检查表空间可用性: se
16、lect tablespace_name,status from dba_tablespaces; 临时表空间使用情况和性能检查: SELECT tablespace_name, extent_management, block_size, initial_extent, next_extent, min_extents, max_extents, pct_increase FROM dba_tablespaces WHERE CONTENTS = TEMPORARY; SELECT username, default_tablespace, temporary_tablespace FROM
17、 dba_users; select tablespace_name, initial_extent, next_extent, max_extents, pct_increase, extent_management, status from dba_tablespaces order by extent_management; select tablespace_name, EXTENT_MANAGEMENT, SEGMENT_SPACE_MANAGEMENT from dba_tablespaces; 表和索引分析信息: SELECT table, COUNT(*) FROM dba_t
18、ables WHERE last_analyzed IS NOT NULL GROUP BY table UNION ALL SELECT index, COUNT(*) FROM dba_indexes WHERE last_analyzed IS NOT NULL GROUP BY index; 未建索引的表: SELECT /*+ rule */ owner, segment_name, segment_type, tablespace_name, TRUNC(BYTES / 1024 / 1024, 1) size_mb FROM dba_segments t WHERE NOT EX
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- RAC 日常 检查
链接地址:https://www.31ppt.com/p-3165212.html