当前位置:Gxlcms > 数据库问题 > DBA 职责及日常工作职责

DBA 职责及日常工作职责

时间:2021-07-01 10:21:17 帮助过:2人阅读

  1. select file_name from dba_data_files where status="OFFLINE"   


 

6、检查表空间的使用情况

 

[sql] view plain copy
  1. select a.tablespace_name,round((total-free)/total,3)*100 pecentfrom FROM (select tablespace_name,sum(bytes) free from dba_free_space group by tablespace_name) a,(select tablespace_name,sum(bytes) total from dba_data_files group by tablespace_name) b where a.tablespace_name=b.tablespace_name   

 

 

7、检查剩余表空间

 

[sql] view plain copy
  1. select tablespace_name,sum(blocks) as free_blk,trunc(sum(bytes)/(1024*1024)) as free_m,max(bytes)/(1024) as big_chunk_k,count(*) as num_chunksfrom FROM dba_free_space group by tablespace_name;   


 

8、监控数据库性能

 

运行utlbstat.sql/utlestat.sql生成系统报告,或者使用statspace收集统计数据

 

9、检查数据库性能,记录数据库的CPU使用、IO、Buffer命中率等等,使用vmstat,iostat,glance,top

 

10、日常出现问题的处理

 

每周的工作——SQL

 

1、控制数据库对象的空间扩展情况,根据本周每天的检查情况找到空间扩展很快的数据库对象,并采取相应的措施。

 

删除历史数据、扩展表空间

 

[sql] view plain copy
  1. alter tablespace <name> add datafile ‘<file>‘ size <size>   


 

调整数据对象的存储参数 next extent pct_increase

 

2、监控数据量的增长情况

 

根据本周每天的检查情况找到记录数据数量增长很快的数据库对象,并采取相应的措施

 

删除历史数据、扩表空间

 

[sql] view plain copy
  1. alter tablespace <name> add datafile ‘<file>‘ size <size>   


 

3、系统健康检查

 

检查以下内容:

 

[sql] view plain copy
  1. init<sid>.oracontrolfileredo log filearchiveingsort area sizetablespace(system,temporary,tablespace fragment)datafiles(autoextend,location)object(number of extent,next extent,index)rollback segmentlogging & tracing(alert.log,max_dump_file_size,sqlnet)   


 

4、检查无效的数据库对象

 

[sql] view plain copy
  1. select owner,object_name,object_type from dba_objects where status=‘INVALID‘   

 

5、检查不起作用的约束

 

[sql] view plain copy
  1. select owner,constraint_name,table_name,constraint_type,status from dba_constraints where status=‘DISABLED‘ and constraint_type=‘p‘   

 

6、检查无效的trigger

 

[sql] view plain copy
  1. select owner,trigger_name,table_name,status from dba_triggers where status=‘DISABLED‘   

 

每月的工作——SQL

 

1、Analyze tables/indexes/cluster

 

[sql] view plain copy
  1. analyze table <name> estimate statistics sample 50 percent;  

 

2、检查表空间碎片

 

根据本月每周的检查分析数据库碎片,找到相应的解决方法

 

3、寻找数据库性能调整机会

 

比较每天对数据库性能的监控报告,确定是否有必要对数据库性能进行调整

 

4、数据库性能调整,如有必要进行性能调整

 

5、提出下一步空间管理计划,根据每周的监控,提出空间管理的改进方法

DBA 职责及日常工作职责

标签:

人气教程排行