数据库日常巡检1

此检查项适用于Oracle 11g,由于不明白csdn表格编辑方法,检查结果就不展示了哈。

NO 检查项 步骤 cmd 结果
1 标准组件 检查组件 select comp_id,comp_name,status from dba_registry
2 基本项检查 检查数据库的名称 select name from v$database SID
3 检查数据库的版本 select * from v$version
4 检查字符集 select parameter,value from v$nls_parameters where parameter in (‘NLS_CHARACTERSET’)
5 检查数据库flashback是否关闭 select flashback_on from v$database
6 检查AWR报告保留的时间和采样频率 select snap_interval, retention from dba_hist_wr_control
7 检查SMB保留的空间占比 select parameter_name,parameter_value from dba_sql_management_config
8 检查archive mode select parameter_name,parameter_value from dba_sql_management_config
9 检查数据库的force logging已经打开 select force_logging from v$database
10 检查数据库redo log大小设置 select max(bytes/1024/1024),min(bytes/1024/1024),avg(bytes/1024/1024),count(*),thread# from v$log group by thread#
11 检查归档参数 select name, display_value, isdefault from v$parameter where name in (‘archive_lag_target’, ‘log_archive_max_processes’, ‘log_archive_local_first’, ‘log_archive_format’, ‘log_checkpoints_to_alert’)
12 fra大小检查 select name, display_value, isdefault from v$parameter where name in (‘db_recovery_file_dest_size’)
13 检查内存参数 select name, display_value, isdefault from v$parameter where name in (‘shared_pool_size’, ‘shared_pool_reserved_size’, ‘large_pool_size’, ‘java_pool_size’, ‘db_cache_size’,’pga_aggregate_target’, ‘sga_max_size’, ‘streams_pool_size’, ‘memory_target’, ‘memory_max_target’, ‘sga_target’,’log_buffer’)
14 检查undo参数 select name, display_value, isdefault from v$parameter where name in (‘undo_retention’, ‘undo_management’, ‘undo_tablespace’)
15 检查optimize参数 select name, display_value, isdefault from v$parameter where name in (‘optimizer_secure_view_merging’, ‘parallel_automatic_tuning’, ‘optimizer_capture_sql_plan_baselines’,’parallel_execution_message_size’, ‘parallel_min_servers’,’parallel_max_servers’, ‘parallel_degree_policy’,’optimizer_adaptive_features’,’optimizer_adaptive_reporting_only’)
16 检查资源参数 select name, display_value, isdefault from v$parameter where name in (‘aq_tm_processes’, ‘db_block_size’,’db_files’,’fast_start_mttr_target’,’job_queue_processes’, ‘open_cursors’, ‘processes’, ‘session_cached_cursors’, ‘resource_limit’,’db_writer_processes’)
17 检查安全参数 select name, display_value, isdefault from v$parameter where name in (‘sec_case_sensitive_logon’, ‘remote_login_passwordfile’)
18 检查其他参数 select name, display_value, isdefault from v$parameter where name in (‘audit_trail’, ‘filesystemio_options’, ‘recyclebin’, ‘local_listener’, ‘cell_offload_processing’,’deferred_segment_creation’,’audit_sys_operations’)
19 检查db_securefile参数设置 select display_value from v$parameter where name = ‘db_securefile’
20 检查隐含参数设置 select name, display_value, isdefault from v$parameter where name in (‘_use_adaptive_log_file_sync’)
21 检查初始化用户审计设置 select user_name,count(*) from dba_stmt_audit_opts where user_name in (‘DBMGR’,’OVSEE’,’DBMONOPR’) group by user_name order by user_name;
22 检查锁定数据库sys、system用户和expire不用的用户 select username,account_status from dba_users where username in (‘ORACLE_OCM’,’DIP’,’WMSYS’,’DBSNMP’,’EXFSYS’,’APPQOSSYS’,’SYSTEM’,’SYS’,’OUTLN’)
23 检查密码函数 select owner,object_name,object_type,status from dba_objects where object_name=’CRBANK_PW_VERIFY_FUNCTION’
24 检查default profile的密码过期策略 select * from dba_profiles where profile=’DEFAULT’
25 检查CRBANK_PW_PROFILE select * from dba_profiles where profile=’CRBANK_PW_PROFILE’
26 检查所有表空间 select tablespace_name, bigfile from dba_tablespaces
27 检查表空间是否为自动扩展 select tablespace_name, autoextensible from dba_data_files where tablespace_name <> ‘UNDOTBS1’
28 检查数据库的default空间 select property_name,property_value from database_properties where property_name = ‘DEFAULT_PERMANENT_TABLESPACE’
29 检查Audit及FGA_LOG$表空间是否迁移 select owner,segment_name,segment_type,tablespace_name from dba_segments where segment_name in (‘AUD$,’I_AUD1’, ‘FGA_LOG$’)
30 检查auto optimizer stats collection select client_name,status from dba_autotask_client where client_name = ‘auto optimizer stats collection’
31 检查AUTOSTATS_TARGET select dbms_stats.get_prefs(‘AUTOSTATS_TARGET’) FROM DUAL
32 检查默认的CBO直方图策略 select dbms_stats.get_prefs(‘METHOD_OPT’) from dual
33 检查默认的CBO分区收集策略 select dbms_stats.get_prefs(‘GRANULARITY’) from dual
34 检查数据库PUBLISH CBO策略 select dbms_stats.get_prefs(‘PUBLISH’) from dual
35 检查STATS_HISTORY_RETENTION select DBMS_STATS.GET_STATS_HISTORY_RETENTION from dual
36 检查统计信息自动收集job select job_name, enabled from dba_scheduler_jobs where job_name=’BSLN_MAINTAIN_STATS_JOB’
37 检查dictionary的统计信息收集 select operation,start_time,end_time from dba_optstat_operations where operation in (‘gather_dictionary_stats’) and target is null
38 auto space advisor和sql tuning advisor这两个自动任务是否被取消 select client_name,status from dba_autotask_client

你可能感兴趣的:(oracle)