Oracle11gRAC巡检手册
Oracle11gRAC巡检手册
什么是"轨表”(tracked tables): 是指启用了flashback archive特性的表。
RMSn
说明: The Oracle RAC management processes,负责执行Oracle RAC的管理任务,比如RAC相关资源的创建和集群中新实例的
使用情况
# su — grid
$ asmcmd
ASMCMD> ls
DATA/
ORA_DATA/
ASMCMD> lsdgora_data
数据库
su–oracle
sqlplus“/as sysdba”
诊断结果及建议
DBstatus
数据库状态
select status from v$instance;
配置情况
Tnsping tnsname(数据库实例名)
Alert
配置情况
标准配置
/u01/app/oracle/diag/rdbms/〈SID〉/<INSTANCE〉/trace/alert_sid.log
运行情况
正常
More alert_sid.log
CRS
服务运行情况
crsctl check crs
检查crs的健康情况
数据库巡检
张浩
数据库检测
硬件机型
HP DL580 G7
是否集群
是
系统实际用户数
10
数据库进程
进入操作系统,登陆Oracle用户,命令:su — oracle
Process
进程情况
进入操作系统,登陆Oracle用户
Oracle11gRAC数据库巡检手册
张浩
数据库检测
硬件机型
HP DL580 G7
是否集群
是
系统实际用户数
10
数据库进程
进入操作系统,登陆Oracle用户,命令:su - oracle
Process
进程情况
进入操作系统,登陆Oracle用户
命令:ps -ef|grep ora_
说明
Oracle 10g 后台进程
SMON(System Monitor)用于执行历程恢复、合并空间碎片并释放临时段。
查看日志
命令:
More/u01/app/oracle/product/11.2.0/db_1/network/log/sqlnet.log
有错误才有日志
Tnsname
配置情况
标准配置
位置:/u01/app/oracle/product/11.2.0/db_1/network/admin
运行情况
正常
查看状态
from
dba_free_space
group by
tablespace_name
) fs
where df.tablespace_name=fs.tablespace_name
order by "Pct Free"
/
运行情况
正常
Sessions
并发数
select count(*) from v$session where status='ACTIVE';
锁表有时候是瞬间的,长时间锁定的表才可能是死锁。
select l.*, s.OSUSER, s.ACTION, o.OBJECT_NAME
from gv$locked_object l, gv_$session s, all_objects o
Oracle巡检手册
如果有记录返回,则说明存在无效对象。若这些对象与应用相关,那么需要重新编译生成这个对象。
3.6检查回滚段情况
3.6.1检查回滚段状态
输出结果中所有回滚段的“STATUS”该为“ONLINE”。
3.6.2检查是否有回滚段争用
发生回滚段争用时,需要审视争用情况,即哪些用户正在使用回滚段资源
检查监听进程是否存在:
二、检查系统和Oracle日志文件
检查相关的日志文件,包含:检查操作系统的日志文件,检查Oracle日志文件,检查Oracle核心转储目录,检查root用户和oracle用户的email,检查数据库的字符集,总共五个部分。
2.1检查操作系统日志文件
查看是否有与Oracle用户相关的出错信息。
3.3检查Oracle表空间情况
输出结果中STATUS应该都为ONLINE。
3.4检查Oracle所有数据文件情况
输出结果中“STATUS”应该都为“ONLINE”。
或者:
输出结果中“STATUS”应该都为“AVAILABLE”。
3.5检查对象情况
3.5.1检查对象类别和大小
合理分配资源,将冗余以及临时表定期进行清理,释放资源空间。
表空间不够
增加数据文件到相应的表空间
出现ORA-600
根据日志文件的内容查看相应的TRC文件,如果是Oracle的bug,要及时打上相应的补丁
Listener日志:$ORACLE_HOME/network/log/sqlnet.log
2.3检查Oracle核心转储目录
如果上面命令的结果每天都在增长,则说明Oracle进程经常发生核心转储。这说明某些用户进程或者数据库后台进程由于无法处理的原因而异常退出。频繁的核心转储特别是数据库后台进程的核心转储会导致数据库异常终止。
oracle 11g RAC巡检过程说明
oracle rac巡检过程一 RAC环境RAC架构,2节点信息节点1SQL> show parameter instanceNAME TYPE VALUE------------------------------------ ----------- -----------------------------------------------active_instance_count integercluster_database_instances integer 2 instance_groups stringinstance_name string RACDB1 instance_number Integer 1 instance_type string RDBMS open_links_per_instance integer 4 parallel_instance_group stringparallel_server_instances integer 2节点2SQL> show parameter instanceNAME TYPE VALUE------------------------------------ ----------- ------------------------------------------active_instance_count integercluster_database_instances integer 2 instance_groups stringinstance_name string RACDB2instance_number integer 2instance_type string RDBMSopen_links_per_instance integer 4parallel_instance_group stringparallel_server_instances integer 2数据库版本SQL> select * from v$version;BANNER----------------------------------------------------------------Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProdPL/SQL Release 10.2.0.1.0 - ProductionCORE 10.2.0.1.0 ProductionTNS for Linux: Version 10.2.0.1.0 - ProductionNLSRTL Version 10.2.0.1.0 - Production操作系统信息节点1[oracle@rac1 ~]$ uname -aLinux rac1 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:02 EDT 2007 i686 i686 i386 GNU/Linux 节点2[oracle@rac2 ~]$ uname -aLinux rac2 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:02 EDT 2007 i686 i686 i386 GNU/LinuxRAC所有资源信息[oracle@rac2 ~]$ crs_stat -tName Type Target State Host----------------------------------------------------------------------------------------------ora....B1.inst application ONLINE ONLINE rac1ora....B2.inst application ONLINE ONLINE rac2ora....DB1.srv application ONLINE ONLINE rac2ora.....TAF.cs application ONLINE ONLINE rac2ora.RACDB.db application ONLINE ONLINE rac2ora....SM1.asm application ONLINE ONLINE rac1ora....C1.lsnr application ONLINE ONLINE rac1ora.rac1.gsd application ONLINE ONLINE rac1ora.rac1.ons application ONLINE ONLINE rac1ora.rac1.vip application ONLINE ONLINE rac1ora....SM2.asm application ONLINE ONLINE rac2ora....C2.lsnr application ONLINE ONLINE rac2ora.rac2.gsd application ONLINE ONLINE rac2ora.rac2.ons application ONLINE ONLINE rac2ora.rac2.vip application ONLINE ONLINE rac2二模拟两个节点内联网不通,观察RAC会出现什么现象?给出故障定位的整个过程本小题会模拟RAC的私有网络不通现象,然后定位故障原因,最后排除故障。
oracle健康检查(巡检)手册
性能检查
数据库性能
检查数据库的整体性能,包括响应时间、吞吐量 和资源利用率等。
查询性能
检查特定查询的性能,包括执行计划、索引和查 询优化等方面。
锁和争用
检查数据库中的锁和争用情况,以发现潜在的性 能瓶颈和问题。
03 Oracle数据库巡检方法
手动巡检方法
数据库日志检查
检查Oracle数据库的日志文件,包括警告日志、跟踪文件等,以发现 潜在的问题和错误。
远程巡检方法
远程监控
01
通过远程监控工具,实时监控Oracle数据库的运行状态和性能
指标。
远程诊断
02
通过远程诊断工具,远程连接到数据库服务器,对数据库进行
故障排除和诊断。
远程备份与恢复
03
通过远程备份与恢复工具,远程备份和恢复Oracle数据库的数
据和日志文件。
04 Oracle数据库巡检结果分 析
Oracle Enterprise Manager (OEM): OEM是一个集成的平台,用于自动监控、 诊断和优化Oracle数据库的性能。
Automatic Database Diagnostic Monitor (ADDM):ADDM是一个 自动化的性能诊断工具,可以自动 发现和解决性能问题。
在此添加您的文本16字
内存优化
在此添加您的文本16字
调整内存参数:根据数据库的实际需求,合理配置内存参 数,如SGA和PGA的大小。
在此添加您的文本16字
内存泄漏检测:定期检查内存使用情况,发现内存泄漏并 及时处理。
软件优化建议
调整初始化参数
根据数据库的性能需求,调整初始化参数,如打开表的数量、共 享池的大小等。
巡检结果数据收集
oracle巡检 手册
Oracle巡检手册第一部分数据库状态监控首先检查oracle的log,在sqlplus中:show parameter background_dump_dest;select * from v$diag_info;可以得到日志路径1:检查oracle 监听lsnrtcl statusPs –ef|grep ora2:检查oracle初始化参数Select * from v$parameter;3:检查oracle实例状态Select instance_name,version,status,database_status from v$instance;select inst_id,instance_name,host_name,VERSION,TO_CHAR(startup_time,'yyyy-mm-dd hh24:mi:ss')startup_time,status,archiver,database_status FROM gv$instance;4:检查后台进程状态:select name,Description From v$BGPROCESS Where Paddr<>'00'5:查看系统全局区SGA信息select * from v$sga;6: 查看SGA各部分占用内存情况:select * from v$sgastat;select request_misses,request_failures from v$shared_pool_reserved;比较好的状态:REQUEST_MISSES REQUEST_FAILURES为0或者接近0REQUEST_MISSES REQUEST_FAILURES-------------- ----------------007:查看系统SCN号select (select dbms_flashback.get_system_change_number from dual)scn,current_scn,scn_to_timestamp(current_scn)from v$database;8:检查数据库状态:select name,log_mode,open_mode,platform_name from v$database;select inst_id,dbid,name,to_char(created,'yyyy-mm-dd hh24:mi:ss')created,log_mode,to_char(version_time,'yyyy-mm-ddhh24:mi:ss')version_time,open_mode from gv$database;第二部分:数据库空间监控检查表空间使用率select A.tablespace_name, (1 - (A.total) / B.total) * 100 used_percentfrom (select tablespace_name, sum(bytes) totalfrom dba_free_spacegroup by tablespace_name) A,(select tablespace_name, sum(bytes) totalfrom dba_data_filesgroup by tablespace_name) Bwhere A.tablespace_name = B.tablespace_name;检查system表空间内的内容select distinct (owner)from dba_tableswhere tablespace_name = 'SYSTEM'and owner != 'SYS'and owner != 'SYSTEM'unionselect distinct (owner)from dba_indexeswhere tablespace_name = 'SYSTEM'and owner != 'SYS'and owner != 'SYSTEM';输出:no rows selected分析:如果有记录返回,则表明system表空间内存在一些非system和sys用户的对象。
Oracle-11g日常维护手册
Oracle 11g 日常维护手册目录第1章文档说明 (4)第2章CRS的管理 (4)2.1 RAC状态检查 (4)2.1.1检查守护进程状态 (4)2.1.2检查资源状态 (4)2.2 手工启动与关闭RAC (5)2.3 OCR的管理 (5)2.4 VOTING DISK的管理 (7)2.5 CSS管理 (8)2.6 管理工具SRVCTL (8)2.6.1管理实例 (8)2.6.2管理监听程序 (9)2.6.3管理ASM (9)2.6.4管理service (9)2.7 修改RAC的IP及VIP (10)2.7.1修改外网IP及心跳IP (10)2.7.2修改VIP (11)2.7.3查看与删除IP (11)第3章ASM的管理 (12)3.1 管理DG (12)3.1.1建立与扩充disk group (12)3.1.2 mount与unmount的命令 (13)3.1.3删除disk group (13)3.1.4增加DISK的total_mb (13)3.1.5 DG的属性-AU大小 (13)3.1.6 DG的属性-离线删除时间 (14)3.1.7 DG的属性-兼容版本 (14)3.1.8向ASM中添加disk的完整步骤 (15)3.2 ASMCMD (16)3.2.1 ASMCMD常用命令 (16)3.2.2复制ASM文件 (17)3.2.3命令lsdg (17)3.2.4元数据备份与恢复 (18)3.3 ASM磁盘头信息备份与恢复 (18)3.4 ASM常用视图 (19)3.4.1视图V$ASM_DISKGROUP (19)3.4.2视图V$ASM_DISK (20)3.5 常用方法 (21)3.5.1如何确定ASM实例的编号 (21)3.5.2查询DG-RAW-磁盘的对应关系 (21)第4章数据库管理 (23)4.1 参数文件管理 (23)4.2 表空间管理 (24)4.2.1表空间自动扩张 (24)4.2.2表空间更名 (25)4.2.3表空间的数据文件更名 (25)4.2.4缺省表空间 (25)4.2.5表空间删除 (26)4.2.6 UNDO表空间 (26)4.2.7 TEMP表空间 (26)4.3 重做日志文件管理 (26)4.3.1增加REDO日志组 (26)4.3.2删除日志组 (27)4.3.3日志切换 (27)4.3.4日志清理 (27)4.3.5重做日志切换次数查询 (27)4.4 归档模式 (28)4.4.1单实例数据库修改为归档模式的方法 (28)4.4.2 RAC数据库修改为归档模式的方法 (28)4.4.3归档路径 (29)4.5 重建控制文件 (30)4.6 内存参数管理 (31)4.6.1 Oracle内存管理发展阶段 (31)4.6.2自动内存管理AMM (31)4.6.3自动共享内存管理ASMM (32)4.6.4自动PGA管理 (32)4.7 其他管理内容 (32)4.7.1数据库版本查看 (32)4.7.2字符集 (33)4.7.3创建密码文件 (33)4.7.4关闭审计功能 (33)4.7.5帐号管理 (33)4.7.6 profile管理 (34)第1章文档说明本文档描述了Oracle11g中常见的维护和管理方法,包括CRS、ASM、数据库等。
oracle 11g R2 RAC健康检查报告
oracle 11g R2 RAC健康检查1.检查集群状态[grid@rac1 ~]$ iduid=501(grid) gid=501(oinstall) groups=501(oinstall),504(asmadmin),506(asmdba),507(asmoper) [grid@rac1 ~]$ crsctl check clusterCRS-4537: Cluster Ready Services is onlineCRS-4529: Cluster Synchronization Services is onlineCRS-4533: Event Manager is online[grid@rac1 ~]$2.检查rac下实例的状态[grid@rac1 ~]$ srvctl config database1.检查集群状态[grid@rac1 ~]$ iduid=501(grid) gid=501(oinstall) groups=501(oinstall),504(asmadmin),506(asmdba),507(asmoper) [grid@rac1 ~]$ crsctl check clusterCRS-4537: Cluster Ready Services is onlineCRS-4529: Cluster Synchronization Services is onlineCRS-4533: Event Manager is online[grid@rac1 ~]$2.检查rac下实例的状态[grid@rac1 ~]$ srvctl config databaseorcl[grid@rac1 ~]$ srvctl status database -d orclInstance orcl1 is running on node rac1Instance orcl2 is running on node rac2[grid@rac1 ~]$3.检查rac下某个实例状态[grid@rac1 ~]$ srvctl status instance -d orcl -i orcl1Instance orcl1 is running on node rac1[grid@rac1 ~]$ srvctl status instance -d orcl -i orcl2Instance orcl2 is running on node rac2[grid@rac1 ~]$4.检查rac各个节点应用程序状态(vip,network,gsd,ons,eons)[grid@rac1 ~]$ srvctl status nodeappsVIP rac1-vip is enabledVIP rac1-vip is running on node: rac1VIP rac2-vip is enabledVIP rac2-vip is running on node: rac2Network is enabledNetwork is running on node: rac1Network is running on node: rac2GSD is enabledGSD is running on node: rac1GSD is running on node: rac2ONS is enabledONS daemon is running on node: rac1ONS daemon is running on node: rac2eONS is enabledeONS daemon is running on node: rac1eONS daemon is running on node: rac2[grid@rac1 ~]$5.检查rac下的数据库配置[grid@rac1 ~]$ srvctl config database -d orcl -a Database unique name: orclDatabase name: orclOracle home: /u01/app/oracle/product/11.2.0/db_1 Oracle user: oracleSpfile: +DATA/orcl/spfileorcl.oraDomain:Start options: openStop options: immediateDatabase role: PRIMARYManagement policy: AUTOMATICServer pools: orclDatabase instances: orcl1,orcl2Disk Groups: DATA,BACKServices:Database is enabledDatabase is administrator managed[grid@rac1 ~]$6.检查rac下的ASM状态以及ASM配置[grid@rac1 ~]$ srvctl status asmASM is running on rac1,rac2[grid@rac1 ~]$ srvctl status asm -aASM is running on rac1,rac2ASM is enabled.[grid@rac1 ~]$ srvctl config asm -aASM home: /u01/app/grid/11.2.0/gridASM listener: LISTENERASM is enabled.[grid@rac1 ~]$7.检查rac下的TNS监听器状态以及配置[grid@rac1 ~]$ srvctl status listenerListener LISTENER is enabledListener LISTENER is running on node(s): rac1,rac2 [grid@rac1 ~]$ srvctl config listener -aName: LISTENERNetwork: 1, Owner: gridHome: <CRS home>/u01/app/grid/11.2.0/grid on node(s) rac2,rac1End points: TCP:1521[grid@rac1 ~]$8.检查rac下的SCAN状态以及配置[grid@rac1 ~]$ srvctl status scanSCAN VIP scan1 is enabledSCAN VIP scan1 is running on node rac1[grid@rac1 ~]$ srvctl config scanSCAN name: rac-cluster-scan, Network: 1/192.9.100.0/255.255.255.0/eth0 SCAN VIP name: scan1, IP: /rac-cluster-scan/192.9.100.36[grid@rac1 ~]$#SCAN192.9.100.36 rac-cluster-scan9.检查rac下的VIP各个节点的状态以及配置[grid@rac1 ~]$ srvctl status vip -n rac1VIP rac1-vip is enabledVIP rac1-vip is running on node: rac1[grid@rac1 ~]$ srvctl status vip -n rac2VIP rac2-vip is enabledVIP rac2-vip is running on node: rac2[grid@rac1 ~]$ srvctl config vip -n rac1VIP exists.:rac1VIP exists.: /rac1-vip/192.9.100.33/255.255.255.0/eth0[grid@rac1 ~]$ srvctl config vip -n rac2VIP exists.:rac2VIP exists.: /rac2-vip/192.9.100.35/255.255.255.0/eth0[grid@rac1 ~]$#VIP192.9.100.33 rac1-vip192.9.100.35 rac2-vip10.检查rac下各个节点应用程序配置情况 (VIP、GSD、ONS、监听器)[grid@rac1 ~]$ srvctl config nodeapps -a -g -s -l-l option has been deprecated and will be ignored.VIP exists.:rac1VIP exists.: /rac1-vip/192.9.100.33/255.255.255.0/eth0VIP exists.:rac2VIP exists.: /rac2-vip/192.9.100.35/255.255.255.0/eth0GSD exists.ONS daemon exists. Local port 6100, remote port 6200Name: LISTENERNetwork: 1, Owner: gridHome: <CRS home>/u01/app/grid/11.2.0/grid on node(s) rac2,rac1End points: TCP:152111.检查rac下的各个节点间的时钟同步情况[grid@rac1 ~]$ cluvfy comp clocksync -verboseVerifying Clock Synchronization across the cluster nodesChecking if Clusterware is installed on all nodes...Check of Clusterware install passedChecking if CTSS Resource is running on all nodes...Check: CTSS Resource running on all nodesNode N ame Status------------------------------------ ------------------------rac1 passedResult: CTSS resource check passedQuerying CTSS for time offset on all nodes...Result: Query of CTSS for time offset passedCheck CTSS state started...Check: CTSS stateNode N ame State------------------------------------ ------------------------rac1 ObserverCTSS is in Observer state. Switching over to clock synchronization checks using NTP Starting Clock synchronization checks using Network Time Protocol(NTP)...NTP Configuration file check started...The NTP configuration file "/etc/ntp.conf" is available on all nodesNTP Configuration file check passedChecking daemon liveness...Check: Liveness for "ntpd"Node N ame Running?------------------------------------ ------------------------rac1 yesResult: Liveness check passed for "ntpd"Checking NTP daemon command line for slewing option "-x"Check: NTP daemon command lineNode N ame Slewing O ption S et?------------------------------------ ------------------------rac1 yesResult:NTP daemon slewing option check passedChecking NTP daemon's boot time configuration, in file "/etc/sysconfig/ntpd", for slewing option "-x"Check: NTP daemon's boot time configurationNode N ame Slewing O ption S et?------------------------------------ ------------------------rac1 yesResult:NTP daemon's boot time configuration check for slewing option passedNTP common Time Server Check started...PRVF-5410 : Check of common NTP Time Server failedPRVF-5416 : Query of NTP daemon failed on all nodesResult: Clock synchronization check using Network Time Protocol(NTP) passedOracle Cluster Time Synchronization Services check passedVerification of Clock Synchronization across the cluster nodes was successful.[grid@rac1 ~]$12.检查rac下的所有正在运行的实例情况col status for a15;col database_status for a15;col instance_name for a15;col host_name for a15;col active_state for a15;SQL> set linesize 200;SQL> select instance_number, instance_name, parallel , status , database_status, active_state, host_name from gv$instance order by instance_number;INSTANCE_NUMBER INSTANCE_NAME PARALLEL STATUS DATABASE_STATUS ACTIVE_STATE HOST_NAME--------------- --------------- --------- --------------- --------------- --------------- ---------------1o rcl1YES OPEN ACTIVE NORMAL rac12o rcl2YES OPEN ACTIVE NORMAL rac2SQL> select * from v$active_instances;INST_NUMBER INST_NAME----------- --------------------------------------------------------------------1r ac1:orcl12r ac2:orcl213.检查数据文件及它们所在的 ASM磁盘组select name from v$datafileunionselect member from v$logfileunionselect name from v$controlfileunionselect name from v$tempfile;SQL> select name from v$datafile2 union3 select member from v$logfile4 union5 select name from v$controlfile6 union7 select name from v$tempfile;NAME--------------------------------------------------------------------------------+BACK/orcl/controlfile/current.299.768402009+BACK/orcl/onlinelog/group_1.298.768402013+BACK/orcl/onlinelog/group_2.297.768402015+BACK/orcl/onlinelog/group_3.296.768402261+BACK/orcl/onlinelog/group_4.295.768402263+DATA/orcl/controlfile/current.280.768402009+DATA/orcl/datafile/example.385.768402021........+DATA/orcl/tempfile/sms_db_temp.400.768403227+DATA/orcl/tempfile/temp.386.76840201914.检查ASM磁盘情况QL> select path from v$asm_disk;PATH--------------------------------------------------------------------------------/dev/oracleasm/disks/BACK_VOL1/dev/oracleasm/disks/DATA_VOL1/dev/oracleasm/disks/OCR_VOL3/dev/oracleasm/disks/OCR_VOL2/dev/oracleasm/disks/OCR_VOL1SQL> col path for a50;SQL> select path,disk_number,name from v$asm_disk;PATH DISK_NUMBER N AME-------------------------------------------------- ----------- -----------------/dev/oracleasm/disks/BACK_VOL10B ACK_0000/dev/oracleasm/disks/DATA_VOL10D ATA_0000/dev/oracleasm/disks/OCR_VOL32O CR_0002/dev/oracleasm/disks/OCR_VOL21O CR_0001/dev/oracleasm/disks/OCR_VOL10O CR_0000SQL> select group_number,name,offline_disks from v$asm_diskgroup;GROUP_NUMBER N AME OFFLINE_DISKS------------ ------------------------------ -------------1O CR02D ATA03B ACK0SQL> select group_number,name,total_mb,free_mb from v$asm_diskgroup;GROUP_NUMBER N AME TOTAL_MB FREE_MB------------ ------------------------------ ---------- ----------1O CR2859 19332D ATA568739 5568103B ACK571600 508953SQL>SQL> SELECT AS diskgroup, , t.stripe, t.redundancy, t.primary_region, t.mirror_region2 FROM V$ASM_DISKGROUP dg, V$ASM_TEMPLATE t3 WHERE dg.group_number = t.group_number ORDER BY ;rows will be truncatedDISKGROUP NAME STRIPE R EDUND PRIM------------------------------ ------------------------------ ------ ------ ----OCR ARCHIVELOG COARSE M IRROR COLDBACK ARCHIVELOG COARSE U NPROT COLDDATA ARCHIVELOG COARSE U NPROT COLDBACK ASMPARAMETERBAKFILE COARSE U NPROT COLDOCR ASMPARAMETERBAKFILE COARSE M IRROR COLDDATA ASMPARAMETERBAKFILE COARSE U NPROT COLDOCR ASMPARAMETERFILE COARSE M IRROR COLDBACK ASMPARAMETERFILE COARSE U NPROT COLDDATA ASMPARAMETERFILE COARSE U NPROT COLDOCR ASM_STALE COARSE H IGH COLDBACK ASM_STALE COARSE U NPROT COLDDISKGROUP NAME STRIPE R EDUND PRIM------------------------------ ------------------------------ ------ ------ ----DATA ASM_STALE COARSE U NPROT COLDOCR AUTOBACKUP COARSE M IRROR COLDDATA AUTOBACKUP COARSE U NPROT COLDBACK AUTOBACKUP COARSE U NPROT COLDBACK BACKUPSET COARSE U NPROT COLDOCR BACKUPSET COARSE M IRROR COLDDATA BACKUPSET COARSE U NPROT COLDOCR CHANGETRACKING COARSE M IRROR COLDBACK CHANGETRACKING COARSE U NPROT COLDDATA CHANGETRACKING COARSE U NPROT COLDBACK CONTROLFILE FINE UNPROT COLDDISKGROUP NAME STRIPE R EDUND PRIM------------------------------ ------------------------------ ------ ------ ----OCR CONTROLFILE FINE HIGH COLDDATA CONTROLFILE FINE UNPROT COLDBACK DATAFILE COARSE U NPROT COLDDATA DATAFILE COARSE U NPROT COLDOCR DATAFILE COARSE M IRROR COLDBACK DATAGUARDCONFIG COARSE U NPROT COLDOCR DATAGUARDCONFIG COARSE M IRROR COLDDATA DATAGUARDCONFIG COARSE U NPROT COLDOCR DUMPSET COARSE M IRROR COLDBACK DUMPSET COARSE U NPROT COLDDATA DUMPSET COARSE U NPROT COLDDISKGROUP NAME STRIPE R EDUND PRIM------------------------------ ------------------------------ ------ ------ ----OCR FLASHBACK COARSE M IRROR COLDDATA FLASHBACK COARSE U NPROT COLDBACK FLASHBACK COARSE U NPROT COLDOCR FLASHFILE COARSE M IRROR COLDDATA FLASHFILE COARSE U NPROT COLDBACK FLASHFILE COARSE U NPROT COLDOCR OCRBACKUP COARSE M IRROR COLDBACK OCRBACKUP COARSE U NPROT COLDDATA OCRBACKUP COARSE U NPROT COLDBACK OCRFILE COARSE U NPROT COLDOCR OCRFILE COARSE M IRROR COLDDISKGROUP NAME STRIPE R EDUND PRIM------------------------------ ------------------------------ ------ ------ ----DATA OCRFILE COARSE U NPROT COLDOCR ONLINELOG COARSE M IRROR COLDBACK ONLINELOG COARSE U NPROT COLDDATA ONLINELOG COARSE U NPROT COLDBACK PARAMETERFILE COARSE U NPROT COLDOCR PARAMETERFILE COARSE M IRROR COLDDATA PARAMETERFILE COARSE U NPROT COLDOCR TEMPFILE COARSE M IRROR COLDDATA TEMPFILE COARSE U NPROT COLDBACK TEMPFILE COARSE U NPROT COLDOCR XTRANSPORT COARSE M IRROR COLDDISKGROUP NAME STRIPE R EDUND PRIM------------------------------ ------------------------------ ------ ------ ----DATA XTRANSPORT COARSE U NPROT COLDBACK XTRANSPORT COARSE U NPROT COLD57 rows selected.SQL> set linesize 300;SQL> select name, path, mode_status, state, disk_number from v$asm_disk;NAME PATH MODE_ST S TATE DISK_NUMBER------------------------------ -------------------------------------------------- ------- -------- -----------BACK_0000 /dev/oracleasm/disks/BACK_VOL1 ONLINE NORMAL 0DATA_0000 /dev/oracleasm/disks/DATA_VOL1 ONLINE NORMAL 0OCR_0002 /dev/oracleasm/disks/OCR_VOL3 ONLINE NORMAL 2OCR_0001 /dev/oracleasm/disks/OCR_VOL2 ONLINE NORMAL 1OCR_0000 /dev/oracleasm/disks/OCR_VOL1 ONLINE NORMAL 0SQL> select name, state from v$asm_diskgroup;NAME STATE------------------------------ -----------OCR MOUNTEDDATA MOUNTEDBACK MOUNTED15.检查rac状态[grid@rac1 ~]$ crs_stat -t -vName Type R/RA F/FT Target State Host----------------------------------------------------------------------ora.BACK.dg ora....up.type0/5 0/ ONLINE ONLINE rac1ora.DATA.dg ora....up.type0/5 0/ ONLINE ONLINE rac1ora....ER.lsnr o ra....er.type0/5 0/ONLINE ONLINE rac1ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac1ora.OCR.dg ora....up.type0/5 0/ ONLINE ONLINE rac1ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac1ora.eons ora.eons.type 0/3 0/ ONLINE ONLINE rac1ora.gsd ora.gsd.type 0/5 0/ ONLINE ONLINE rac1work o ra....rk.type0/5 0/ONLINE ONLINE rac1ora.oc4j ora.oc4j.type 0/5 0/0 ONLINE ONLINE rac2ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac1 ora.orcl.db ora....se.type0/2 0/1 ONLINE ONLINE rac1 ora....SM1.asm a pplication 0/5 0/0 ONLINE ONLINE rac1 ora....C1.lsnr a pplication 0/5 0/0 ONLINE ONLINE rac1 ora.rac1.gsd application 0/5 0/0 ONLINE ONLINE rac1 ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1 ora.rac1.vip ora....t1.type0/0 0/0 ONLINE ONLINE rac1 ora....SM2.asm a pplication 0/5 0/0 ONLINE ONLINE rac2 ora....C2.lsnr a pplication 0/5 0/0 ONLINE ONLINE rac2 ora.rac2.gsd application 0/5 0/0 ONLINE ONLINE rac2 ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2 ora.rac2.vip ora....t1.type0/0 1/0 ONLINE ONLINE rac2 ora....ry.acfs o ra....fs.type0/5 0/ONLINE ONLINE rac1 ora.scan1.vip ora....ip.type0/0 0/0 ONLINE ONLINE rac1展开全文。
Oracle 11g完全手册
一.Window下关闭Oracle 11g正常在Windows下安全关闭Oracle数据库系统的步骤如下:1.从命令行下找到oracle的BIN目录,然后输入isqlplusctl stop命令停止isqlplus进程。
2.同样在BIN目录下,emctl stop dbconsole停止企业管理器的控制台进程。
3.同样在BIN目录下,lsnrctl stop停止监听进程。
4.在命令行下输入sqlplus /nolog , 然后conn / as sysdba连接到数据库shutdown immediate;====================================================================== select username,password from dba_users; --查看用户信息select username,account_status from dba_users; --查看用户是否解锁alter user scott account unlock; --解锁scott用户alter user scott account lock;--锁scott用户alter user scott identified by tiger; --为scott用户修改密码为tiger创建用户以及给表赋予权限:创建用户create user user_name identified by password;grant dba to user_name;查询表的权限grant select on gecs_law to user_name;select file_name from dba_data_files; --查看数据文件路径select name from v$controlfile; --查看控制文件路径select member from v$logfile; --查看日志文件路径====================================================================== Oracle关于shutdown、startup几个参数:shutdown有四个参数:normal、transactional、immediate、abort。
Oracle数据库日常巡检指令
Oracle 数据库日常巡检指令Oracle数据库的日常巡检内容包括:Oracle数据库基本状况检查;Oracle相关资源的使用情况检查;Oracle数据库性能检查;数据库服务器cpu、mem和I/O 性能检查;数据库服务器安全性及其他事项检查等五大检查项目。
1、数据库基本状况检查(1)、数据库实例状况检查说明:其中“STATUS”表示Oracle当前的实例状态,必须为“OPEN”;“DATABASE_STATUS”表示Oracle当前数据库的状态,必须为“ACTIVE”。
(2)、数据库表空间状态检查说明:输出结果中STATUS应该都为“ONLINE”。
(3)、数据库数据文件检查1 select tablespace_name,status from dba_tablespaces;说明:输出结果中“STATUS”应该都为“AVAILABLE”。
(4)、数据库在线日志检查1 select group#,status,type,member from v$logfile;说明:输出结果应该有3条或3条以上记录,“STATUS”应该为非“INVALID”,非“DELETED”。
“STATUS”的值为空表示正常。
(5)、数据库回滚段检查1 select segment_name,status from dba_rollback_segs;说明:输出结果中所有回滚段的“STATUS”应该为“ONLINE”。
2、数据库相关资源使用情况检查(1)、检查Oracle初始化文件中相关参数值1 select resource_name,max_utilization,initial_allocation, limit_value from v$resource_limit;说明:若字段值【LIMIT_VALU】-【MAX_UTILIZATION】<=5,则表明与RESOURCE_NAME相关的Oracle初始化参数需要调整。
Oracle Database 11g Oracle Tuning Pack数据手册说明书
ORACLE TUNING PACKFEATURES• SQL Tuning Advisor• Automatic SQL TuningAdvisor• Real-Time SQL Monitoring• SQL Profiles• SQL Access Advisor• SQL Tuning Sets• Object Reorganization WizardBENEFITS• Comprehensive solution forapplication and SQL tuningthat eliminates need formanual tuning.• Provides automatic tuning ofSQL statements.• Enhances systemperformance and reliabilityand significantly lowersmanagement costs.Oracle Tuning Pack, an add-on pack for management of OracleDatabase 11g, offers an extremely cost effective and easy-to-use solution that automates the entire application tuning process. Enhancement of SQL performance is achieved through real-time monitoring and SQL Advisors that are seamlessly integrated with the Enterprise Manager, and together provide a comprehensive solution for automating the complex and time-consuming task of application tuning. For database administrators and application developers, application tuning is a critically important area and a considerable amount of their time is spent performing this very important function. A poorly tuned business application can potentially affect not just a few users but an entire business operation and for this reason companies invest significant resources to ensure smooth running of applications vital for their businesses. SQL Access Advisor The design of the database schema can have a big impact on the overall application performance. SQL Access Advisor, provides comprehensive advice on how to optimize schema design in order to maximize application performance. SQL Access and SQL Tuning Advisors, together, provide a complete solution for tuning database applications. The SQL Access Advisor accepts input from all possible sources of interest, such as the cursor cache, the Automatic Workload Repository (AWR), any user-defined workload, and will even generate a hypothetical workload if a schema contains dimensions or primary/foreign key relationships. It comprehensively analyzes the entire workload and provides recommendations to create new partitions or indexes if required, drop any unused indexes, create new materialized views and materialized view logs. Determining the optimal partitioning or indexing strategy for a particular workload is a complicated process that requires expertise and time. SQL Access Advisor considers the cost of insert/update/delete operations in addition to the queries on the workload and makes appropriate recommendations, accompanied by a quantifiable measure of expected performance gain as well as scripts needed to implement the recommendations. The SQL Access Advisor takes the mystery out of access structure design process. By automating this very critical function, SQL Access Advisor obviates the need for the error-prone, lengthy, and expensive manual tuning process. SQL Tuning Advisor Manual SQL tuning is a complex process that presents many challenges. It requires expertise in several areas, is very time consuming, and requires an intimateknowledge of the schema structures and the data usage model of the application. All these factors make manual SQL tuning a challenging and resource intensive task that is ultimately very expensive for businesses.SQL Tuning Advisor is Oracle’s answer to all the pitfalls and challenges of manual SQL tuning. It automates the SQL tuning process by comprehensively exploring all the possible ways of tuning a SQL statement. The analysis and tuning is performed by the database engine’s significantly enhanced query optimizer. Four types of analysis are performed by the SQL Tuning Advisor:• Statistics Analysis: In this analysis objects with stale or missing statistics are identified and appropriate recommendations are made to remedy the problem.• SQL Profiling: This feature, introduced in Oracle Database 10g, revolutionizes the approach to SQL tuning. SQL Profiling tunes SQL statements withoutrequiring any change to the application code.• Access Path Analysis: In this analysis new indexes that can significantlyenhance query performance are identified and recommended.The output of this analysis is in the form of recommendations, along with a rationale for each recommendation and its expected performance benefit.The SQL Tuning Advisor offers a powerful, intuitive, and user-friendly way for performing SQL tuning. Tuning of SQL statements no longer has to be the domain of experts. Oracle has built a tuning expert inside the database engine to perform this very important function for the database administrators in a fraction of the time and cost needed to carry out the same task manually.Automatic SQL Tuning AdvisorThe SQL Tuning Advisor also runs in automatic mode. In this mode, the advisor runs automatically during system maintenance windows as a maintenance task. During each run, the advisor selects high-load SQL queries in the system, and generates recommendations on how to tune them.Figure 1: Automatic SQL Tuning Results SummaryThe Automatic SQL Tuning Advisor can be configured to auto-implement SQL Profile recommendations. If you enable automatic implementation, the advisor will create SQL Profiles for only those SQL statements where performance improvement would be at least threefold. Other types of recommendations such as to create newindexes, refresh optimizer statistics or restructure SQL can only be implemented manually. DML statements are not considered for tuning by the Automatic SQL Tuning Advisor.You can view a summary of the automatic SQL tuning results over a specified period, and can view a detailed report on recommendations made for all SQL statements processed. The recommendations can then be implemented selectively by a manual process. You can also view the recommendations that were automatically implemented.Real-time SQL MonitoringThe first step in SQL tuning is identifying poor SQL that is consuming excessive system resources. Traditionally, DBAs have always struggled with long-running SQL in live production environments because they never had the tools to figure out if the long-running query was moments away from completion or a run-away query that could take an inordinate amount of time to complete. Real-Time SQL Monitoring introduced in Oracle Database 11g provides the fastest and easiest way to identify and fix performance problems with long running SQL statements. Live visual displays track the details of SQL execution using new, fine-grained SQL statistics that are updated automatically at no cost to the performance of production systems.By default, SQL monitoring is automatically started when a SQL statement runs parallel, or when it has consumed at least 5 seconds of CPU or IO time in a single execution. Once monitoring is initiated, an entry is added to performance views. This entry tracks row source information at each step of the execution collecting key performance metrics, including the elapsed time, CPU time, number of reads and writes, I/O wait time and various other wait times. This allows the DBAs to decide whether to let the query complete or terminate the query.Figure 1: Real Time SQL MonitoringReal Time SQL Monitoring has been enhanced in Oracle Database 11g Release 2 to support execution plans that are being executed in part by the Oracle Databasemachine, Exadata. DBAs now have a powerful tool to track complex execution plans, identify poor indexing mechanisms and identify skew in parallel queries– all in real time. Object Reorganization Wizard Oracle Tuning Pack also provides the ability to reorganize objects. Managing the space usage of your tablespaces efficiently by removing wasted space is not only a good space management practice but it also enhances performance by reducing unnecessary disk I/Os. Reorganization is used for: 1) rebuilding indexes and tables that are fragmented, 2) relocating objects to another tablespace, and 3) recreating objects with optimal storage attributes. Contact Us For more information about [insert product name], please visit or call +1.800.ORACLE1 to speak to an Oracle representative. Copyright © 2010, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. UNIX is a registered trademark licensed through X/Open Company, Ltd. 0110Oracle Tuning Pack 11g delivers maximum benefits when used with the following Oracle products:RELATED PRODUCTS • Oracle Diagnostics Pack • Oracle Configuration Management Pack • Oracle Provisioning Pack • Oracle Database Change Management Pack • Oracle Real Application Testing Option。
★Oracle数据库巡检操作内涵
★Oracle数据库巡检操作内涵Oracle数据库巡检操作内涵吴汉耿资历荣誉履历曾任医保办公室主任、副主任、信息科科长、副科长、后勤科副科长等。
现为医保办公室副主任,具备高级岗位胜任力,取得中国医院协会医院医疗保险管理专业委员会合中国国家人事人才培训网联合签发的《从业人员培训合格证书》。
荣誉汕头市无偿献血先进个人,广东省无偿献血奉献奖铜奖获得者,国家无偿献血奉献奖铜奖获得者;广东省卫生信息化卓越青年工程师;广东省医学信息优秀管理者。
学术情况论文发表论文16篇,其中获得二等奖3篇,三等奖2篇,成果奖1篇,汕头科协三等奖1篇学者库编号PCNI:0000001 00834855X著作《思考的魅力》、《儒衢缵绪》、《中西结合·方剂条例》和《刺腧条辨》著作权《中西结合·方剂条例》登记号:国作登字-2020-A-00009537,《刺腧条辨》登记号:国作登字-2022-A-10116949,获中国版权保护中心认证,受《中华人民共和国著作权法》保护。
学术兼职汕头市汕头市计算机学会理事广东省医院协会信息专委会委员并潮汕分委会常务委员广东省广东省医院协会医院品管圈管理专业委员会委员广东省医院协会医院医疗保险管理专业委员会委员广东省卫生经济学会信息专委会常务委员广东省中医药学会会员、广东省中西医结合学会会员国家级中国中西医结合学会会员中国医药新闻信息协会智慧医院与后勤安全信息分会理事《中华现代医院管理杂志》常务编委一、Oracle数据库巡检概述目录二、Oracle数据库体系架构介绍三、数据库性能优化概述四、案例经验分享数据库系统的重要性数据是血液,数据库系统是心脏应用程序是大脑网络是血管、神经硬件是肌肉和骨骼数据库巡检概述启动、关闭数据库查看告警日志文件查看OS日志OS文件系统表空间管理检查备份与容灾性能监控启动数据库Linux/AIX: #su–oracle$exportORACLE_SID=ora11g$lsnrctlstart$sqlplus‘/assysdba’SQL>star tupWindows:-控制面板\系统和安全\管理工具?服务?OracleOraDb11g_home1TNSListener?启动OracleServiceORA11G?启动启动数据库(续)Windows 注册表:HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\KEY_OraDb11g_home1注意各个参数以及数值的名称格式之间的关系启动数据库(续)如果ORA_ORA11G_AUTOSTART=falsecmd.exe:sqlplus/assysdbaSQL> startup关闭数据库Linux/AIX: #su–oracle$exportORACLE_SID=ora11g$lsnrctlstop$sqlplus‘/assysdba’SQL>shutdownimmediate Windows:-控制面板\系统和安全\管理工具?服务?OracleOraDb11g_home1TNSListener?停止OracleServiceORA11G?停止关闭数据库(续)cmd.exe:sqlplus/assysdbaSQL>shutdownimmediate如果不停止后台服务,内存是不会释放的。
Oracle数据库巡检命令手册
Oracle数据库巡检命令手册点击上方卡片关注前言如果给你一个全新的O ra c le单机数据库环境,作为D B A,您需要关注哪些点?本文仅讨论L inux主机~注意:首先申明本文所述并非标准答案,只是个人的一些见解,欢迎 大家补充完善~一、⭐ 主机层面⭐1、 主机版本和O racle版本「主机版本:」c a t /e tc/s y s te m-re le a s e c a t /e tc/red ha t-re le a s e「O ra c le版本和补丁版本:」s q lp lus-v e rs io no p a tc h ls p a tc he s2、 主机硬件资源包括C P U负载,物理内存和磁盘使用。
「C P U负载和内存:」to p f re e-m⚠ 需要注意主机的C P U负载和物理内存使用是否异常,S w a p是否被过多使用。
「磁盘使用情况:」ls b lkf d is k -ld f-T h⚠ 显而易见,需要关注磁盘使用情况,是否存在使用率过高。
3、 计划任务 cron t ab一般计划任务会布置一些备份策略或者归档删除的策略,我们可以通过c ro nta b来查看:c ro nta b-l4、 检查H ost s 文件和网络配置c a t /e tc/ho s ts ip ad d rnmc li c o nne c tio n s ho w5、 检查系统参数文件c a t /e tc/s y s c tl.c o nf⚠ 需注意是否有设置非常规参数。
6、 检查 rc.local 文件rc.lo c a l文件用于配置开机自启动脚本,一般会设置关闭透明大页或者O ra c le数据库开机自启。
c a t /e tc/rc.lo c a l7、 环境变量配置查看环境变量配置,进一步熟悉环境。
c a t ~/.b a s h_p ro f ile c a t /ho me/o ra c le/.b a s h_p ro f ile8、 检查系统服务s y s te mc tl s ta tus f ire w a lld.s e rv ic e g e te nf o rc e c a t /p ro c/c md line c a t /e tc/s y s c o nfig/ne tw o rk二、 数据库层面1、 查看数据库实例和监听p s-e f|g re p s mo ns u -o ra c le ls nrc tl s ta tus2、 数据库表空间使用s q lp lus/ a s s y s d b a c o l TA B L E S P A C E_N A M E f o r a20s e le c t tb s_us e d_inf o.ta ble s p a c e_na me,tb s_us e d_inf o.a llo c_mb,tb s_us e d_inf e d_mb,tb s_us e d_inf o.ma x_mb,tb s_us e d_inf o.f re e_o f_ma x_mb,tb s_us e d_inf e d_o f_ma x|| '%'us e d_o f_ma x_p c t f ro m (s e le c t a.ta b le s p a c e_na me,ro und(a.b y te s_a llo c/ 1024/ 1024) a llo c_mb,ro und((a.b y te s_a llo c-nv l(b.b y te s_f re e,0)) / 1024/ 1024) us e d_mb,ro und((a.b y te s_a llo c-nv l(b.b y te s_f re e,0)) *100/ a.ma x b y te s) us e d_o f_ma x,ro und((a.ma x b y te s-a.b y te s_a llo c+nv l(b.b y te s_f re e,0)) / 1048576) f re e_o f_ma x_mb,ro und(a.ma x b y te s/ 1048576) ma x_mb f ro m (s e le c t f.ta b le s p a c e_na me,s um(f.b y te s) b y te s_a llo c,s um(d e c o d e(f.a uto e x te ns ib le,'Y E S',f.ma x b y te s,'N O', f.b y te s)) ma x b y te sf ro m d b a_d a ta_f ile s fg ro up b y ta b le s p a c e_na me) a,(s e le c t f.ta b le s p a c e_na me,s um(f.b y te s) b y te s_f re e f ro m d b a_f re e_s p a c efg ro up b y ta b le s p a c e_na me) b w he re a.ta b le s p a c e_na me=b.ta b le s p a c e_na me(+)) tb s_us e d_inf o o rd e r b y tb s_us e d_inf e d_o f_ma x de s c;3、 检查RMA N备份情况rma n ta rg e t /lis t b a c kup;s q lp lus/ a s s y s d b a c o l s ta tus f o r a10c o l inp ut_ty p e f o r a20c o l I N P U T_B Y T E S_D I S P L AY f o r a10c o l O U T P U T_B Y T E S_D I S P L AYf o r a10c o l T I M E_TA K E N_D I S P L AY f o r a10s e le c t inp ut_ty p e,s ta tus,to_c ha r(s ta rt_time,'y y y y-mm-d d hh24:mi:s s'),to_c ha r(e nd_time,'y y y y-mm-d d hh24:mi:s s'),inp ut_b y te s_d is p la y,o utp ut_b y te s_d is p la y,time_ta ke n_d is p la y,C O M P R E S S I O N_R AT I Of ro m v$rma n_b a c kup_jo b_d e ta ils w he re s ta rt_time>d a te'2021-07-01'o rd e r b y3d e s c;4、 检查控制文件冗余查看控制文件数量和位置,是否处于多份冗余状态。
Oracle 11G RAC巡检脚本说明
Oracle 10G RAC巡检脚本===========================SRVCTL============================1.列出配置的所有数据库srvctl config database2.显示指定集群数据库的所有服务srvctl config service -d GDTV3.查看所有实例和服务的状态srvctl status database -d GDTV4.查看单个实例的状态srvctl status service -d GDTV -s <service_name>5.特定节点上节点应用程序的状态srvctl status nodeapps -n DBSERVER1srvctl status nodeapps -n DBSERVER26.列出RAC数据库的配置srvctl config database -d GDTV7.显示节点应用程序的配置—(VIP、GSD、ONS、监听器)srvctl config nodeapps -n DBSERVER1 -a -g -s -lsrvctl config nodeapps -n DBSERVER2 -a -g -s -l=========================================进程检查================== 8. Oracle进程检查Ps –ef |grep ora_9. CRS进程检查ps -ef | grep oracm$ps –df |grep d.bin应有:crsd.bin ocssd.bin evmd.bincrsctl check crscrs_stat –tcrs_stat –ls=================alert.log====================================8.查看各个instance的alert.log=====================instance配置参数======================== 9.查看spfile.ora查看profile====================参看监听状态============================== 10.$hostname$export ORACLE_SID=GDTV1$lsnrctl status$hostname$export ORACLE_SID=GDTV2$lsnrctl statuslistener日志检查/u01/app/oracle/product/9.2.0/network/log/listener.log/u01/app/oracle/product/9.2.0/network/log/listener.log================oracm状态检查===================================11.1c rs日志检查ocssd.log</u01/product/Oracle/oracm/log>$tail -20 cm.log======================SQL下检查============================== $hostname$export ORACLE_SID=GDTV1sqlplus "/as sysdba"or sqlplus "/as sysdba"@GDTV1--run on db server as sysdba!!!--collect by lyf 200609set pagesize 1000set linesize 120set echo onCOLUMN name_col_plus_show_param FORMAT a36 HEADING NAMECOLUMN value_col_plus_show_param FORMAT a30 HEADING VALUEcol tablespace_name format a15host hostname1.集群中所有正在运行的实例SELECTinst_id, instance_number inst_no, instance_name inst_name, parallel, status, database_status db_status, active_state state, host_name hostFROM gv$instanceORDER BY inst_id;INST_ID INST_NO INST_NAME PAR STATUS DB_STATUS STATE HOST-------- -------- ---------- --- ------- ------------ --------- -------1 1 orcl1 YES OPEN ACTIVE NORMAL rac12 2 orcl2 YES OPEN ACTIVE NORMAL rac2SELECT inst_id, instance_name, host_name, VERSION, TO_CHAR (startup_time, 'yyyy-mm-dd hh24:mi:ss') startup_time, status, archiver, database_status FROM gv$instance;2.检查参数show paramter3.检查SGA和PGAshow sgaselect name ,value/1024/1024/1024 from gv$sysstat where name like '%pga%';select name ,value/1024/1024/1024 from v$sysstat where name like '%pga%';4.检查查询服务器的运行模式和数据库安装选项set linesize 200select * from v$option;5.用户检查col temporary_tablespace for a21select username,account_status,default_tablespace,temporary_tablespace,created from dba_users;select ername , a.temporary_tablespace "Temporary Tablespace" , b.contentsfrom dba_users a , dba_tablespaces bwhere a.temporary_tablespace=b.tablespace_nameand b.contents <> 'TEMPORARY';6、控制文件检查col name for a60select * from v$controlfile;7、无效对象检查col OBJECT_NAME for a24SELECT owner , object_name, object_type,status ,LAST_DDL_TIME FROM dba_objects WHERE status like 'INVALID';8、表空间和数据文件检查1)数据文件col file_name for a56set linesize 300select file_id,file_name,tablespace_name,autoextensible from dba_data_files;select count(*) from v$datafile;show parameter db_filesselect name from v$datafileunionselect member from v$logfileunionselect name from v$controlfileunionselect name from v$tempfile;SELECT file#, ts#, NAME, status, BYTES / 1024 / 1024 size_mb FROM v$datafile UNION ALL SELECT file#, ts#, NAME, status, BYTES / 1024 / 1024 size_mb FROM v$tempfile;2)表空间set linesize 300col tablespace_name for a16SELECT 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_Mb * 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)t otal_bytes,round(MAX(bytes)/(1024*1024),2)m ax_bytesFROM s ys.dba_free_spaceGROUP B Y t ablespace_name)f,(SELECT dd.tablespace_name, round(SUM(dd.bytes)/(1024*1024),2) Tot_grootte_MbFROM sys.dba_data_files d dGROUP BY dd.tablespace_name) dWHERE d.tablespace_name = f.tablespace_nameORDER BY 4 DESC;表空间的空间使用情况SELECT df.tablespace_name, COUNT (*) datafile_count,ROUND (SUM (df.BYTES) / 1048576) size_mb,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_freeFROM dba_data_files df,(SELECT tablespace_name, file_id, SUM (BYTES) BYTES, MAX (BYTES) maxbytes FROM dba_free_space GROUP BY tablespace_name, file_id) freeWHERE df.tablespace_name = free.tablespace_name(+) AND df.file_id = free.file_id(+) GROUP BY df.tablespace_name ORDER BY;表空间可用性检查select 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 dba_users;selecttablespace_name,initial_extent,next_extent,max_extents,pct_increase,extent_management,stat us from dba_tablespaces order by extent_management;select tablespace_name,EXTENT_MANAGEMENT,SEGMENT_SPACE_MANAGEMENT from dba_tablespaces;表:1、监控表的增长select segment_name,segment_type,bytes/1024/1024 from dba_segments where owner='FOUNDER' ORDER BY bytes/1024/1024 desc;2、表和索引分析信息SELECT'table', COUNT (*) FROM dba_tables WHERE last_analyzed IS NOT NULL GROUP BY 'table'UNION ALLSELECT 'index', COUNT (*) FROM dba_indexes WHERE last_analyzed IS NOT NULL GROUP BY 'index';3.未建索引的表SELECT/*+r ule*/owner,s egment_name,s egment_type,t ablespace_name,TRUNC(BYTES/1024/1024,1)s ize_mbFROM d ba_segments tWHERE N OT E XISTS(SELECT'x'FROM d ba_indexes iWHERE t.owner=i.table_ownerAND t.segment_name=i.table_name)AND t.segment_type I N('TABLE','TABLE P ARTITION')AND t.owner N OT I N('SYS','SYSTEM')ORDER B Y5D ESC;升序用ASC9.sort_segment检查select tablespace_name,extent_size db_blocks_per_extent,total_extents,used_extents,free_extents from v$sort_segment;10.数据库总大小select round(sum(space)) all_space_M from(select sum(bytes)/1024/1024 space from dba_data_filesunion allselect nvl(sum(bytes)/1024/1024,0) space from dba_temp_filesunion allselect sum(bytes)/1024/1024 space from v$log);11.检测连接数情况(1)select SW.Sid,ername,SW.Event,SW.Wait_Time,SW.State,SW.Seconds_In_Wait SEC_IN_WAIT from v$session S,v$session_wait SW where ername is not null and SW.Sid=S.Sidand SW.event not like '%SQL*Net%' order by SW.Wait_Time Desc;(2)select count(*) from v$session;(3)select sid,serial#,username,program,machine,status from v$session;11.回滚段信息1)信息1col segment_name format a20col tablespace_name format a20select segment_name,owner,tablespace_name,dba_rollback_segs.statusfrom dba_rollback_segs,v$Datafile where file_id=file#;2)信息2select segment_name,initial_extent,next_extent,min_extents, owner,dba_rollback_segs.status status,optsizefrom dba_rollback_segs,v$rollstatwhere dba_rollback_segs.segment_id=v$n;3)信息3col Rollback_Name for a16select substr(V$,1,20) "Rollback_Name",substr(V$rollstat.EXTENTS,1,6)"EXTENT",v$rollstat.RSSIZE, v$rollstat.WRITES,substr(v$rollstat.XACTS,1,6)"XACTS",v$rollstat.GETS,substr(v$rollstat.WAITS,1,6)"WAITS",v$rollstat.HWMSIZE, v$rollstat.SHRINKS,substr(v$rollstat.WRAPS,1,6)"WRAPS",substr(v$rollstat.EXTENDS,1,6)"EXTEND",v$rollstat.AVESHRINK,v$rollstat.AVEACTIVEfrom v$rollname, v$rollstatwhere v$N = v$Norder by v$N;4)信息4select Rollback_Name,p.pid O racle_PID,p.spid O S_PID,nvl(ername,'NO T RANSACTION')T ransaction,p.terminal T erminalfrom v$lock l, v$process p, v$rollname rwhere l.addr = p.addr(+)and t runc(l.id1(+)/65536)=nand l.type(+)='TX'and l.lmode(+)=6order by ;5)回滚段的争用情况select name ,waits ,gets ,waits/gets "Ratio" from v$rollstat a ,v$rollname b where n=n; 6)rollback信息select substr(sys.dba_rollback_segs.SEGMENT_ID,1,5) "ID#",substr(sys.dba_segments.OWNER,1,8)"Owner",substr(sys.dba_segments.TABLESPACE_NAME,1,17)"Tablespace N ame",substr(sys.dba_segments.SEGMENT_NAME,1,12)"Rollback N ame",substr(sys.dba_rollback_segs.INITIAL_EXTENT,1,10) "INI_Extent",substr(sys.dba_rollback_segs.NEXT_EXTENT,1,10) "Next Exts",substr(sys.dba_segments.MIN_EXTENTS,1,5)"MinEx",substr(sys.dba_segments.MAX_EXTENTS,1,5)"MaxEx",substr(sys.dba_segments.PCT_INCREASE,1,5)"%Incr",substr(sys.dba_segments.BYTES,1,15) "Size (Bytes)",substr(sys.dba_segments.EXTENTS,1,6)"Extent#",substr(sys.dba_rollback_segs.STATUS,1,10) "Status"from sys.dba_segments, sys.dba_rollback_segswhere sys.dba_segments.segment_name = sys.dba_rollback_segs.segment_name and sys.dba_segments.segment_type = 'ROLLBACK'order by sys.dba_rollback_segs.segment_id;12.Redo log信息检查1)Redo Log文件状态col member for a56select f.member "member",f.group#"group",l.bytes/1024/1024 "size",l.statusfrom v$logfile f, v$log lwhere f.group#=l.group#order by f.group#,f.member;2)LogGroup信息SELECT group#, sequence#, bytes, members, status from v$log;3)关于log_bufferselect name,value from v$sysstat where name in('redo entries','redo buffer allocation retries');4)查询LOG大小及频率set linesize 300set pages 100column d1 form a20 heading "Date"column sw_cnt form 99999 heading 'Number|of|Switches'column Mb form 999,999 heading "Redo Size"column redoMbytes form 999,999,9999 heading "Redo Log File Size (Mb)" break on reportcompute sum of sw_cnt on reportcompute sum of Mb on reportvar redoMbytes number;beginselect max(bytes)/1024/1024 into :redoMbytes from v$log;end;/print redoMbytesselect trunc(first_time) d1,c ount(*)s w_cnt,c ount(*)*:redoMbytes M bfrom v$log_historygroup by trunc(first_time)/13.IO情况检查col file_name for a46select file_name,fs.phyrds reads,fs.phywrts writes,(fs.readtim/decode(fs.phyrds,0,-1,fs.phyrds)) readtime,(fs.writetim/decode(fs.phywrts,0,-1,fs.phywrts)) writetimefromv$datafile df,v$filestat fswhere df.file#=fs.file#order by ;select count(*) from v$session;14.命中率相关检查1)Shared Pool Size命中率select round((sum(gets)-sum(reloads))/sum(gets)*100,1) "libiary cache hit ratio %"from v$librarycache where namespacein ('SQL AREA','TABLE/PROCEDURE','BODY','TRIGGER');2)数据字典命中率select round((1-sum(getmisses)/sum(gets))*100,1) "data dictionary hit ratio %"from v$rowcache;3)锁竞争select substr(,1,25) Name,l.gets,l.misses,100*(l.misses/l.gets)"%R atio(STAY U NDER1%)"from v$latch l, v$latchname lnwhere in ('cache buffers lru chain')and tch# = tch#;4)排序命中率select a.value "Sort(Disk)", b.value "Sort(Memory)",round(100*(a.value/decode((a.value+b.value), 0,1,(a.value+b.value))),2) "% Ratio (STAY UNDER 5%)"from v$sysstat a, v$sysstat bwhere = 'sorts (disk)'and = 'sorts (memory)';5)数据缓冲区命中率select round((1-(phy.value/(cur.value+con.value)))*100,1)||'%' ratiofrom v$sysstat phy,v$sysstat cur,v$sysstat conwhere ='physical reads' and ='db block gets' and ='consistent gets'; 6)Miss LRU Hit命中率column "Miss LRU Hit%" format 99.9999999;col name format a40select name, (sleeps/gets) "Miss LRU Hit%"from v$latch where name ='cache buffers lru chain';7)检查内存排序性能select , to_char(value)from v$statname a, v$sysstatwhere a.statistic# = v$sysstat.statistic#and in ('sorts (disk)', 'sorts (memory)', 'sorts (rows)');8)redo log buffer retry ratioselect to_char(r.value/e.value) "redo log buffer retry ratio"from v$sysstat r,v$sysstat ewhere ='redo buffer allocation retries'and ='redo entries';9)wait等待检查select count(*) total_in_wait from v$session_waitwhere event='log buffer space';select event,total_waits,time_waited,average_waitfrom v$system_eventwhere event like '%undo%';select sid,seq#,event,WAIT_TIME,SECONDS_IN_WAIT from v$session_wait where event not like 'SQL%'and event not like 'rdbms%';15、查询lock锁SELECT lpad(' ',DECODE(request,0,0,1))||sid sess, id1, id2, lmode, request, typeFROM V$LOCKWHERE id1 IN (SELECT id1 FROM V$LOCK WHERE lmode = 0)ORDER BY id1, request;linux。
运维手册_数据库_Oracle11gRAC日常运维手册(352)
Oracle运维手册恒生电子客服总部系统服务部本文所述内容(包括文字和图片),恒生电子股份有限公司(以下简称“恒生”或“恒生公司”)拥有完全独立的唯一版权。
未经恒生公司书面同意或授权,任何单位和个人都不得将其复制、影印或引用。
目录第一章通过SQL*Plus管理Oracle系统 (3)**. 登录oracle系统 (3)**. 退出SQL*Plus (3)**. 在sqlplus下得到帮助信息 (3)第二章Oracle11gR2 RAC日常管理 4**. 监控oracle (4)**. 监控Oracle日志 (4)**. 监控oracle状态 (5)**. 监控表空间使用情况 (6)**. 监控主机 (8)**. 监控CPU (8)**. 使用vmstat 命令监控cpu使用情况 (8)**. 监控主机日志 (9)**. 监控OS文件系统使用情况 (9)**. 启动、关闭数据库 (9)**. 启动数据库 (9)**. 关闭数据库 (11)**. 监听器启动、关闭 (13)**. 表统计信息维护 (14)**. 修改主机系统时间 (15)**. 时间管理原则 (15)**. 时间修改方法 (15)**. 数据库日志收集 (15)**. OS日志 (16)**. DB日志 (16)**. grid日志 (16)**. AWR和ASH报告生成 (16)**. AWR报告生成(同10g) (16)**. ASH报告生成(同10g) (19)**. Recyclebin管理 (23)**. 归档日志的清理 (23)**. 查看回收站中的对象 (23)**. 指定删除某些特定对象 (23)**. 指定删除某表空间的所有回收站对象 (23)**. 清除某用户下的回收站对象 (23)**. 清除所有回收站对象 (23)**. 数据库性能监控 (24)**. 查看系统当前等待事件 (24)**. 通过sid查看sql语句24第一章通过SQL*Plus管理Oracle 系统登录oracle系统以oracle用户登录主机1)以sys用户登录oracle系统[oracle@rac1 ~]$ sqlplus / as sysdba2)其他用户登录oracle系统[oracle@rac1 ~]$ sqlplus hs_user/handsome@jsswdb1退出SQL*PlusSQL>exit在sqlplus下得到帮助信息列出全部SQL命令和SQL*Plus命令SQL> help index列出某个特定的命令的信息SQL>help 命令名或者SQL>? 命令名第二章Oracle11gR2 RAC日常管理监控oracle2.1.1.监控Oracle日志2.1.1.1. DB日志以oracle用户登录该日志文件在每个节点主机的$ORACLE_BASE/diag/rdbms/<dbname>/<sid>/trace目录下,文件名为:alert_XXXX.log (节点1)例如:/u01/app/oracle/diag/rdbms/hsdb/hsdb1/trace/alert_hsdb1.log在出现oracle故障前或故障时,数据库会将一些警告、错误信息写入该文件,交易时应随时监控该文件,及时发现警告、错误信息。
oracle 11g rac 巡检注意crfclust.bdb文件巨大问题(121)
问题简介11g rac 巡检注意crfclust.bdb文件巨大问题环境介绍硬件平台:两台HP580 ,11g rac 数据库,具体版本:11.2.0.4.5问题描述东航期货刘工说他们发现一个奇怪的问题:11g rac 操作系统/u01 目录挂载点,里面除了安装oracle相关软件外,没有放或者安装其它东西,过一段时间莫名其妙的满了/u01 40g 的空间都用完了事件分析我进入/u01 目录发现:/u01/app/11.2.0/grid/crf/db/rac1/crfclust.bdb单个文件大小19G,然后让用户观察一天,用户发现此文件一直在增长,后来我在metalink 上查了一下发现原来是一个bug:下面当时参考文档:Oracle Cluster Health Monitor (CHM) using large amount of space (more than default) (Doc ID 1343105.1)To BottomIn this DocumentSymptomsCauseSolutionReferencesAPPLIES TO:Oracle Server - Enterprise Edition - Version 11.2.0.2 and laterInformation in this document applies to any platform. SYMPTOMSCluster Health Monitor (CHM) files in$GI_HOME/crf/db/<node name? directory are filling up disk space in GI_HOME.The bdb files in $GRID_HOME/crf/db/<node name> are larger than 1GB (default size) and filling up the GI_HOME file system.CAUSEOracle Cluster Health Monitor (CHM) using large amount of space when it is collecting the OS statistics.Check Cluster Health Monitor berkerleydatabase files in $GI_HOME/crf/db/<node name> directorySOLUTIONRemove those large Berkeley database files to free up space by doing the following as root:$GI_HOME/bin/crsctl stop res ora.crf -initcd $GI_HOME/crf/db/<nodename>rm *.bdb$GI_HOME/bin/crsctl start res ora.crf -initPlease note that bdb files get regenerated when CHM (ora.crf) resource is restarted. The files are owned by root, so only root can delete the bdb files. Other than losing the OS statistics that CHM has gathered, deleting bdb files does not have other impact. CHM will start collecting the OS statistics again.Having very large bdb files (greater than 2GB) is likely due to a bug since the default size limits the bdb to 1GB unless the CHM data retention time is increased. One such bug is 10165314.Also, please note that the local bdb file (<hostname>.ldb) may need to be deleted as well. REFERENCES@ BUG:10165314 - CHM/CRF/IPDOS REPOSITORY EXCEEDS 1GB AFTER ADD/REMOVE NODE OR FRESH INSTALLNOTE:1328466.1 - Cluster Health Monitor (CHM) FA小飞 2015/4/15 20:10:39APPLIES TO:Oracle Database - Enterprise Edition - Version11.2.0.1 to 11.2.0.4 [Release 11.2]Information in this document applies to any platform. SYMPTOMS11gR2 GI **mand fails:$ oclumon manage -get reppathCRS-9011-Error manage: Failed to initialize connection to the Cluster Logger ServiceBut "status & target" of resource ora.crf is online on all the node :crsctl stat res ora.crf -initNAME=ora.crfTYPE=ora.crf.typeTARGET=ONLINESTATE=ONLINE on dibarac01The following error is reported in the<GI_HOME>/log/<node>/crflogd/crflogd.log file[ clsdmc][1818209888]Fail to connect(ADDRESS=(PROTOCOL=ipc)(KEY=dibarac01DBG_LOGD)) with status 9[ clsdmt][1826756928]Listening to(ADDRESS=(PROTOCOL=ipc)(KEY=dibarac01DBG_LOGD)) 2013-07-09 16:14:14.404: [ clsdmt][1826756928]PID for the Process [19534], connkey 62013-07-09 16:14:14.404:[ clsdmt][1826756928]Creating PID [19534] file for home /oracle/grid-11.2.0.3 host dibarac01 bin ologgerd to /oracle/grid-11.2.0.3/ologgerd/init/ 2013-07-09 16:14:14.404:[ clsdmt][1826756928]Writing PID [19534] to the file [/oracle/grid-11.2.0.3/ologgerd/init/dibarac01.pid] 2013-07-09 16:14:14.478: [CRFLDREP][1818209888]BDB space utilization will be 2199257282013-07-09 16:14:14.522:[CRFLDREP][1835854144]db_delete: BDB grown beyond user desired limits disabling loggerd2013-07-09 16:14:14.522:[ CRFM][1818209888]crfm_listeninit: couldn't create endp(ret:20), conaddrtcp://192.168.139.1:61021.2013-07-09 16:14:14.522:[ CRFLOGD][1843370304]Thread ldbwrite running[ CLWAL][1818209888]clsw_Initialize: OLR initlevel [70000]2013-07-09 16:14:29.177: [ CRFLOGD][2482564704]**ing up...2013-07-09 16:14:29.381: [ COMMCRS][2491111744]clsc_connect: (0x6f2bca0) no listener at (ADDRESS=(PROTOCOL=ipc)(KEY=dibarac01DBG_LOGD))CAUSEThe issue was investigated in multiple bugs:BUG 17238613 - LNX64-11204-CHM:OLOGGERD WAS DISABLED BECAUSE BDB GROWN BEYOND DESIRED LIMITSBUG 20439706 - DB_KEYEXIST: KEY/DATA PAIR ALREADY EXISTS ERROR IN CRFLOGD.LOGBUG 18447164 - CRFCLUST.BDB GROW HUGE SIZEBUG 19692024 - EXADATA: CRFCLUST.BDB IS GROWING TO 40 GBBUG 20127477 - CRFCLUST.BDB HAS GROWN UNEXPECTEDLY BUG 20127477 - CRFCLUST.BDB HAS GROWN UNEXPECTEDLY BUG 20316849 - HUGE REPSIZE RESULTING IN GI HOME DIRECTORY FILLING UPBUG 20351845 - RETENTION FOR CHM DATA IS SET TO 34YRS.All of those are closed as duplicate of the following:BUG 20186278 - TAG OCR: GET ID FAILED AND CHM DB SIZE 24 GBSOLUTIONRequest/apply the patch or use the following workaround:1. On all nodes, issue "crsctl stop res ora.crf -init" as root user2. On all nodes, remove the value of BDBSIZE tag entry (set it to blank) in<GI_HOME>/crf/admin/crf<node>.ora, do not delete the BDBSIZE tag3. On all nodes, issue "crsctl start res ora.crf -init" as root userREFERENCESNOTE:1328466.1 - Cluster Health Monitor (CHM) FAQ处理建议QQ给用户发了上面文章后,给出解决方案:1. On all nodes, issue "crsctl stop res ora.crf -init" as root user2. On all nodes, remove the value of BDBSIZE tag entry (set it to blank) in <GI_HOME>/crf/admin/crf<node>.ora, do not delete the BDBSIZE tag3. On all nodes, issue "crsctl start res ora.crf -init" as root user第二天老大也发出相关类似邮件,证明问题的确是由于此引起的问题心得这个问题本身并不复杂,metalink上一搜一就找到答案了,但是同时两个体会:1.出现问题需要网络搜索时尽量到oracle官网上去找相关内容2.前天晚上已经把方案给客户了,但是貌似客户没有自己处理好,结果升级到老大那里处理了,以后可以后续跟踪下,找用户确认一下问题是否解决。
Oracle11g检查RAC运行状况手册
检查RAC运行状况[grid@rac1 ~]$ crsctl check clusterCRS-4537: Cluster Ready Services is onlineCRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online检查Database实例例状态[oracle@rac1 ~]$ srvctl status database -d prod Instance rac1 is running on node rac1Instance rac2 is running on node rac2检查节点应用状态及配置[oracle@rac1 ~]$ srvctl status nodeappsVIP rac1-vip is enabledVIP rac1-vip is running on node: rac1VIP rac2-vip is enabledVIP rac2-vip is running on node: rac2Network is enabledNetwork is running on node: rac1Network is running on node: rac2GSD is disabledGSD is not running on node: rac1GSD is not running on node: rac2ONS is enabledONS daemon is running on node: rac1ONS daemon is running on node: rac2eONS is enabledeONS daemon is running on node: rac1eONS daemon is running on node: rac2[oracle@rac1 ~]$ srvctl config nodeapps -a -g -s -l-l option has been deprecated and will be ignored. VIP exists.:rac1VIP exists.: /rac1-vip/182.168.8.53/255.255.255.0/eth0 VIP exists.:rac2VIP exists.: /rac2-vip/182.168.8.54/255.255.255.0/eth0 GSD exists.ONS daemon exists. Local port 6100, remote port 6200 Name: LISTENER Network: 1, Owner: gridHome: <CRS home>/u01/app/11.2.0/grid on node(s) rac2,rac1End points: TCP:1521查看数据库配置[oracle@rac1 ~]$ srvctl config database -d prod -aDatabase unique name: prodDatabase name: prodOracle home: /u01/app/oracle/product/11.2.0/db_1 Oracle user: oracleSpfile: +DATA/prod/spfileprod.oraDomain:Start options: openStop options: immediateDatabase role: PRIMARYManagement policy: AUTOMATICServer pools: prodDatabase instances: prod1,prod2Disk Groups: DATA,FRAServices:Database is enabledDatabase is administrator managed检查 ASM状态及配置[oracle@rac1 ~]$ srvctl status asmASM is running on rac1,rac2[oracle@rac1 ~]$ srvctl status asmASM is running on rac1,rac2[oracle@rac1 ~]$ srvctl config asm -aASM home: /u01/app/11.2.0/gridASM listener: LISTENERASM is enabled.检查 TNS的状态及配置[oracle@rac1 ~]$ srvctl status listenerListener LISTENER is enabledListener LISTENER is running on node(s): rac1,rac2 [oracle@rac1 ~]$ srvctl status listenerListener LISTENER is enabledListener LISTENER is running on node(s): rac1,rac2 [oracle@rac1 ~]$ srvctl config listener -a Name: LISTENERNetwork: 1, Owner: gridHome: <CRS home>/u01/app/11.2.0/grid on node(s) rac2,rac1End points: TCP:1521检查 SCAN的状态及配置[oracle@rac1 ~]$ srvctl status scanSCAN VIP scan1 is enabledSCAN VIP scan1 is running on node rac1[oracle@rac1 ~]$ srvctl config scanSCAN name: rac-scan, Network: 1/182.168.8.0/255.255.255.0/eth0 SCAN VIP name: scan1, IP: //182.168.8.55检查 VIP的状态及配置[oracle@rac1 ~]$ srvctl status vip -n rac1VIP rac1-vip is enabledVIP rac1-vip is running on node: rac1[oracle@rac1 ~]$ srvctl status vip -n rac2VIP rac2-vip is enabledVIP rac2-vip is running on node: rac2[oracle@rac1 ~]$ srvctl config vip -n rac1VIP exists.:rac1VIP exists.: /rac1-vip/182.168.8.53/255.255.255.0/eth0 [oracle@rac1 ~]$ srvctl config vip -n rac2VIP exists.:rac2VIP exists.: /rac2-vip/182.168.8.54/255.255.255.0/eth0。
ORACLE11g质量检查标准
Oracle11g 通用巡检项SSIA27A 检查数据库版本以oracle用户分别登录主备节点。
执行如下命令:sqlplus / as sysdbaSQL> select * from v$version;Oracle11G的版本为及以上。
显示类似如下信息:BANNER--------------------------------------------------------------------------------Oracle Database 11g EnterpriseEdition Release .1.0 - 64bitProductionPL/SQL Release .1.0 -ProductionCORE .1.0 ProductionTNS for HPUX: Version .1.0 -ProductionNLSRTL Version .1.0 -Production如果与指定规划版本不符合则联系外购商升级到指定规划版本。
SSIA28A 检查安装路径以oracle用户分别登录到两个节点上。
执行如下命令:% echo $ORACLE_BASE% echo $ORACLE_HOME 对于ATAE路径为:ORACLE_BASE为/opt/app/oracleORACLE_HOME为/opt/app/oracle/product/如果安装路径与不一致,则向安装人员确认。
SSIA32A 检查l(非RAC)以oracle用户分别登录到两个节点上。
执行如下命令:显示类似如下信息:如果不一致,请根据实际情况修改。
SSIA34A (非RAC)以oracle用户分别登录到两个节点上。
执行如下命令:% cat $ORACLE_HOME HOST的取值为浮动IP地址或浮动IP地址对应的逻辑主机名;显示类似如下信息:如果不一致,请根据实际情况修改SSIA35A 检查数据库监以oracle用户分别登录到两个节显示的信息如果包含:The。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
使用情况
select b.THREAD#,a.GROUP#,a.STATUS,a.MEMBER,b.BYTES,b.ARCHIVED,b.STATUS
from v$logfile a,v$log b where a.GROUP#=b.GROUP#;
Performance
配置情况
察看数据库锁表
tablespace_name,
round(sum(bytes)/1048576) TotalSpacefrBiblioteka mdba_data_files
group by
tablespace_name
) df,
(select
tablespace_name,
round(sum(bytes)/1048576) FreeSpace
Select * from v$parameter;
运行情况
正常
使用资源情况
select * from v$resource_limit;
ASM
使用情况
select group_number,name,total_mb,free_mb from v$asm_diskgroup;
DBfile
数据文件状态
select owner,segment_name,segment_type,file_id,block_id from dba_extents
where file_id = &P1 and &P2 between block_id and block_id + blocks -1;
column event for a35;
from
dba_free_space
group by
tablespace_name
) fs
where df.tablespace_name=fs.tablespace_name
order by "Pct Free"
/
运行情况
正常
Sessions
并发数
select count(*) from v$session where status='ACTIVE';
查看日志
命令:
More/u01/app/oracle/product/11.2.0/db_1/network/log/sqlnet.log
有错误才有日志
Tnsname
配置情况
标准配置
位置:/u01/app/oracle/product/11.2.0/db_1/network/admin
运行情况
正常
查看状态
where s.sid=sw.sid and s.status='ACTIVE'
order by sw.p1;
select event,p1 "File #",p2 "Block #",p3 "Reason Code" from v$session_wait
order by event;
where event = 'buffer busy waits';
column "Tablespace" format a13
column "UsedMB" format 99,999,999
column "FreeMB" format 99,999,999
column "Total MB" format 99,999,999
select
fs.tablespace_name "Tablespace",
资源运行情况
crs_stat–t
用来查看RAC中各节点上resources的运行状况,Resources的属性等
OCR
运行情况
ocrcheck
验证OCR的状态以及空间使用情况
Voting
Disk
运行情况
crsctl query css votedisk
Votingdisk状态查询
ASM
运行情况
crs_stat -t | grep asm
LMON-Global Enqueue Service Monitor全局查询服务监视进程
LCK0 - Instance Enqueue Process 实例查询进程
进程状态
Space
使用情况
df -h
Listener
监听状态
命令:lsnrctl status
配置正常
运行情况
命令:sqlplus“/as sysdba”
锁表有时候是瞬间的,长时间锁定的表才可能是死锁。
select l.*, s.OSUSER, s.ACTION, o.OBJECT_NAME
from gv$locked_object l, gv_$session s, all_objects o
where l.SESSION_ID=s.SID
and o.OBJECT_ID=l.OBJECT_ID
and t2.sql_address=t3.address
order by t2.logon_time;
enqueue等待
Selecteq_type"lock",total_req# "gets",total_wait# "waits",cum_wait_time from v$enqueue_stat where total_wait#>0;
(df.totalspace - fs.freespace) "Used MB",
fs.freespace "FreeMB",
df.totalspace "Total MB",
round(100 * (fs.freespace / df.totalspace)) "Pct Free"
from
(select
死锁
set linesize 200
column oracle_username for a16
column os_user_name for a12
column object_name for a30
SELECT l.xidusn, l.object_id,l.oracle_username,l.os_user_name,l.process,
DIAG
说明: 数据库诊断进程(The diagnosibility process),负责维护管理各种用于诊断的转储文件,并执行oradebug命令。
DIA0
说明: 另一个数据库诊断进程,负责检测Oracle数据库中的挂起(hang)和死锁的处理。
PSP0
说明: process spawner,用于产生oracle进程
等待事件
set linesize 200
column username for a12
column program for a30
column event for a28
column p1text for a15
column p1 for 999,999,999,999,999
select ername,s.program,sw.event,sw.p1text,sw.p1 from v$session s,v$session_wait sw
select name,status from v$datafile;
控制文件状态
select status,name from v$controlfile;
日志文件状态
select group#,members,archived,status from v$log;
表空间使用率
set pagesize 50
该进程还负责flashback的数据归档的空间管理、分配、保留,跟踪tracked transactions。
什么是"轨表"(tracked tables): 是指启用了flashback archive特性的表。
RMSn
说明: The Oracle RAC management processes,负责执行Oracle RAC的管理任务,比如RAC相关资源的创建和集群中新实例的
Tnsping tnsname(数据库实例名)
Alert
配置情况
标准配置
/u01/app/oracle/diag/rdbms/<SID>/<INSTANCE>/trace/alert_sid.log
运行情况
正常
More alert_sid.log
CRS
服务运行情况
crsctl check crs
检查crs的健康情况
SMCO
说明: space management coordinator,该进程负责空间管理协调管理工作,负责执行空间的分配和回收。
Wnnn
说明: 命名为W000,W001,W002.....,由smcO动态产生执行上述相关任务。
VKTM
说明: virtual keeper of time,用于提供wall-clock time,(每秒钟更新一次)。提供每二十毫秒更新一次的
FBDA
说明: 涉及到flashback-data-archive新特性的一个进程,The flashback data archiver proces。用于将"轨表"(tracked
tables)的历史数据进行归档。当"轨表"上的事务提交以后,fbda进程负责将数据的前镜像保存到flashback archive区域。