检查警告文件,跟踪文件,备分情况
1.表空间的使用情况:
select a.tablespace_name as table_space, a.total_size as total_size,round(b.total_free_size,1) as total_free_size,round((a.total_size - b.total_free_size),2) as userd_size, to_char(100*b.total_free_size/a.total_size,'99.99')||'%' as percent_free from (select tablespace_name,sum(bytes)/1024/1024 as total_size from dba_data_files group by tablespace_name) a, (select tablespace_name, sum(bytes/1024/1024) as total_free_size from dba_free_space group by tablespace_name) b where a.tablespace_name= b.tablespace_name;
2.检查有无失效对象:
select owner object_owner,object_name,object_type,status from dba_objects where owner not in('sys','system') and status='INVALID' order by owner,object_type,object_name;
3.检查有无失效索引:
select index_name,index_type,table_name,status from dba_indexes where status='UNSABLE';
4. 检查是否有表空间碎片:FSFI(free space fragmentation index) 100表示没有碎片,低于30%要处理
select tablespace_name, sqrt(max(blocks)/sum(blocks))*(100/sqrt(sqrt(count(blocks)))) as FSFI from dba_free_space group by tablespace_name order by 1;
5.每月数据增长情况:
select to_char(creation_time,'RRRR Month') as month, sum(bytes)/1024/1024/1024 growth_in_gb from sys.v_$datafile where creation_time>sysdate -365 group by to_char(creation_time,'RRRR Month');
6.每月表空间增长情况:
select a.ts# as tablespace_no, b.name as tablespace_name, to_char(creation_time,'RRRR Month') month,sum(a.bytes)/1024/1024/1024 growht_in_gb from sys.v_$datafile a, sys.v_$tablespace b where a.creation_time>sysdate-365 and a.ts#=b.ts# group by a.ts#,b.name,to_char(a.creation_time,'RRRR Month');
7.在线重做日志文件的创建:
添加一个组
alter database add logfile group 4('/u01/oracle/data/redo_4a.log','/u02/oracle/data/redo_4b.log') size 5M;
添加到某个组:
alter database add logfile member '/u03/oracle/data/redo_4c.log' to group 3;
系统提供: v$log v$logfile
确认数据文件的使用量:
select d.tablespace_name tablespace,d.file_name filename,d.bytes total_file_size,nvl((d.bytes-s.bytes),d.bytes) userd_size,trunc(((nvl((d.bytes-s.bytes),d.bytes))/d.bytes)*100) pct_used from sys.dba_data_files d,v$datafile v,(select file_id,sum(bytes) bytes from sys.dba_free_space group by file_id) s where (s.file_id(+)=d.file_id) and (d.file_name=v.name) union select d.tablespace_name tablespace,d.file_name filename,d.bytes total_file_size,nvl(t.bytes_cached,0) used_size ,trunc((t.bytes_cached/d.bytes)*100) pct_used from sys.dba_temp_files d,v$temp_extent_pool t,v$tempfile v where (t.file_id(+)=d.file_id) and (d.file_id=v.file#);
确认数据库缓冲快取区的hit ratio:
select 1-(phy.value/(cur.value+con.value)) cache_hit_ratio, round((1-(phy.value/(cur.value+con.value)))*100,2) ratio from v$sysstat cur,v$sysstat con,v$sysstat phy where cur.name='DB BLOCK GETS' and con.name='CONSISTENT GETS' and phy.name='PHYSICAL READS';
确认使用者联机使用PGA的大小:
select username, name, value from v$statname n,v$session s,v$sesstat t where s.sid=t.sid and n.statistic#=t.statistic# and s.type='USER' and s.username is not null and n.name ='SESSION PGA MEMORY' and username not like 'SYSTEM' and t.value >30000;
分享到:
相关推荐
一些日常使用的脚本,帮助管理数据库 一、oracle用户权限检查 二、锁的检查 三、查看一个长查询的进度 四、查看ACTIVE SESSION的等待事件 . . . .
这篇文章介绍了DBA每天在监控Oracle数据库方面的职责,讲述了如何通过shell...本文首先回顾了一些DBA常用的Unix命令,以及解释了如何通过Unix Cron来定时执行DBA脚本。同时文章还介绍了8个重要的脚本来监控Oracle数据库
一些自己写得或者搜集来的常用的sql服务器检查/管理脚本。供大家参考。 GRANT VIEW SERVER STATE TO ['+ltrim(rtrim(@loginname))+'] GRANT VIEW ANY DEFINITION TO ['+ltrim(rtrim(@loginname))+'] GRANT VIEW ANY ...
从一个“普通”的Oracle DBA(Oracle数据库管理员)转变为Oracle Applications DBA(Oracle应用程序数据库管理员),有两个内容你必须去弄清楚。第一个内容是如何成为一个Oracle Applications DBA(Oracle应用程序...
1.1.5 常用非关系型数据库产品介绍.............................................................................8 1.2 mysql 多实例安装实战....................................................................
SQL Server急救包 导航常用脚本:性能调优:备份和还原:您是管理Microsoft SQL Server的DBA,系统管理员或开发人员。 如果它们出现故障或速度缓慢,这是您的错。 这些工具可帮助您了解服务器中正在发生的事情。 ...
但此时不对数据文件和日志文件进行校验检查。 3、startup open dbname 先执行“nomount”,然后执行“mount”,再打开包括Redo log文件在内的所有数据库文件, 这种方式下可访问数据库中的数据。 4、startup,...
DBA Shell 函数和脚本使常见的数据库命令行杂务变得容易,例如分配环境变量、将脚本运行到日志中、提供存储的密码、错误检查、检查数据库状态、数据库重新启动、编译等。
2021 云和恩墨大讲堂PPT汇总,共50份。 2021 云和恩墨大讲堂内容涵盖Oracle、MySQL、PG等多种数据库...Oracle诊断性能问题时常用脚本工具 PostgreSQL日常工作分享 PostgreSQL实践分享 wls、was中间件故障基本分析介绍
§3.4 DBA常用参数说明 71 §3.4.1 跟踪文件路径(BACKGROUND_DUMP_DEST) 71 §3.4.2 在缓冲区驻留对象(BUFFER_POOL_KEEP) 71 §3.4.3 版本兼容(COMPATIBLE) 72 §3.4.4 控制文件路径(CONTROL_FILES) 72 §...
学习oracle,首先我们必须要掌握常用的基本命令,oracle中的命令比较多,常用的命令如下: 1. 登录命令(sqlplus) 说明:用于登录到oracle数据库 用法:sqlplus 用户名/密码 [as sysdba/sysoper] 注意:当用特权用户...
解答DBA日常工作中80%的常见问题,覆盖2400多个主题 从网络到性能优化,从备份恢复到Error message,一应俱全 例子:遇到失效的存储过程怎么办? 4. 如何对存储过程进行Debug? 需要Toad单独的Debug Option...
1.2.3 开启innodb严格检查模式 39 1.3 动态更改系统配置参数 39 1.3.1 支持动态更改独立表空间 39 1.3.2 支持动态更改innodb锁超时时间 40 1.4 innodb新参数汇总 40 1.5 同步复制新参数汇总 48 1.6 sql语句...
4.3.6 where子句中的常用操作符 4.4 基本的update和delete语句 4.4.1 update语句 4.4.2 delete语句 4.5 数据排序 4.6 函数:字符串函数、数字函数和聚集函数(不是分组) 4.6.1 字符串函数 4.6.2 数字函数 4.6.3 ...
4 尝试使用SQL脚本将完好的数据复制到一个新表中,或者用EXP配合QUERY参数导出完好的数据。 5 手工修改坏块。 有两种情况是不能使用事件10231和DBMS_REPAIR.SKIP_CORRUPT_BLOCKS来跳过坏块的: 1 硬件问题...
4.3.6 where子句中的常用操作符 86 4.4 基本的update和delete语句 87 4.4.1 update语句 87 4.4.2 delete语句 88 4.5 数据排序 90 4.6 函数:字符串函数、数字函数和聚集函数(不是分组) 91 4.6.1 字符串函数 ...
LE, *QLEADER(快速引出标注) DBA, *DIMBASELINE(基线标注) DCO, *DIMCONTINUE(连续标注) D, *DIMSTYLE(标注样式) DED, *DIMEDIT(编辑标注) DOV, *DIMOVERRIDE(替换标注系统变量) DIMASO标注关联(on开...
他当过开发人员,也做过DBA,目前是 Oracle ACE总监和OakTable成员。最近几年,他专注于研究Oracle内部原理以及解决性能问题。他的博客主页是 kerryosborne.oracle-guy.com。 ROBYN SANDS 思科公司的软件...