当前位置: 首页 > news >正文

评估企业网站建设万户网络是干嘛的

评估企业网站建设,万户网络是干嘛的,旅游网站建设首选赢旅动力,对方把我的网站他网站内页友情链接 站长工具检测到是无反链1 前言 在生产环境中,一般设置表空间告警阈值是90%,在接到监控报警后,并不是需要立刻对表空间进行扩容。 决定是否扩容主要看表空间最近的增量是多少,假如剩余10%的空间还能支持1个月的增量,那就不需要急着扩容。如果…

1 前言

在生产环境中,一般设置表空间告警阈值是90%,在接到监控报警后,并不是需要立刻对表空间进行扩容。

决定是否扩容主要看表空间最近的增量是多少,假如剩余10%的空间还能支持1个月的增量,那就不需要急着扩容。如果剩余的空间只能坚持几天,那么最好是立即扩容,以防止数据突增

接到告警后,一般工作过程如下:

  1. 查看表空间利用率和剩余容量;
  2. 查看表空间增量;
  3. 扩容或者释放空间;
  4. 找出数据增量异常的对象。

根据下面的常用sql脚本排查。

2 处理流程

2.1 查看表空间利用率

col tablespace_name for a20
col pct_used for a10
select a.tablespace_name,a.total_mb,a.total_mb - b.free_mb used_mb,b.free_mb,case when a.total_mb <> 0 then round((a.total_mb - b.free_mb) / a.total_mb * 100,2)else null end || '%' pct_usedfrom (select ts.tablespace_name,round(sum(bytes) / 1024 / 1024,2) total_mbfrom dba_tablespaces ts,dba_data_files df  where ts.tablespace_name = df.tablespace_namegroup by ts.tablespace_name) a,(select fs.tablespace_name,round(sum(bytes) / 1024 /1024,2) free_mbfrom dba_free_space fsgroup by fs.tablespace_name) bwhere a.tablespace_name = b.tablespace_nameand a.tablespace_name = '&tsb_name'order by 1;

2.2 查看表空间增量

日增量

set line 200
col ts_name for a30
col pct_used for a10
SELECT a.snap_id,c.tablespace_name ts_name,to_char(to_date(a.rtime, 'mm/dd/yyyy hh24:mi:ss'), 'yyyy-mm-dd hh24:mi') rtime,round(a.tablespace_size * c.block_size / 1024 / 1024, 2) ts_size_mb,round(a.tablespace_usedsize * c.block_size / 1024 / 1024, 2) ts_used_mb,round((a.tablespace_size - a.tablespace_usedsize) * c.block_size / 1024 / 1024,2) ts_free_mb,round(a.tablespace_usedsize * c.block_size / 1024 / 1024, 2) - lag(round(a.tablespace_usedsize * c.block_size / 1024 / 1024, 2),1) over(order by a.tablespace_id,to_date(a.rtime, 'mm/dd/yyyy hh24:mi:ss')) inc_mb,round(a.tablespace_usedsize / a.tablespace_size * 100, 2) || '%' pct_usedFROM dba_hist_tbspc_space_usage a, (SELECT tablespace_id,substr(rtime, 1, 10) rtime,max(snap_id) snap_idFROM dba_hist_tbspc_space_usage nbgroup by tablespace_id, substr(rtime, 1, 10)) b,dba_tablespaces c,v$tablespace dwhere a.snap_id = b.snap_idand a.tablespace_id = b.tablespace_idand a.tablespace_id=d.TS#and d.NAME=c.tablespace_name  and d.NAME = '&tbs_name'and to_date(a.rtime, 'mm/dd/yyyy hh24:mi:ss') >=sysdate-30order by a.tablespace_id,to_date(a.rtime, 'mm/dd/yyyy hh24:mi:ss') desc;

累计增量,根据awr保留时间而定,默认为8天:

set line 200
col ts_name for a30
col pct_used for a10
with ts as(SELECT a.snap_id,c.tablespace_name ts_name,to_char(to_date(a.rtime, 'mm/dd/yyyy hh24:mi:ss'), 'yyyy-mm-dd hh24:mi') rtime,round(a.tablespace_size * c.block_size / 1024 / 1024, 2) ts_mb,round(a.tablespace_usedsize * c.block_size / 1024 / 1024, 2) ts_used_mb,round((a.tablespace_size - a.tablespace_usedsize) * c.block_size / 1024 / 1024,2) ts_free_mb,round(a.tablespace_usedsize / a.tablespace_size * 100, 2) || '%' pct_usedFROM dba_hist_tbspc_space_usage a, (SELECT tablespace_id,substr(rtime, 1, 10) rtime,max(snap_id) snap_idFROM dba_hist_tbspc_space_usage nbgroup by tablespace_id, substr(rtime, 1, 10)) b,dba_tablespaces c,v$tablespace dwhere a.snap_id = b.snap_idand a.tablespace_id = b.tablespace_idand a.tablespace_id=d.TS#and d.NAME=c.tablespace_nameand to_date(a.rtime, 'mm/dd/yyyy hh24:mi:ss') >=sysdate-30)
select f.ts_name,f.ts_mb,f.ts_used_mb begin_used_mb,f.rtime begin_time,t.ts_used_mb end_used_mb,t.rtime end_time,t.ts_used_mb - f.ts_used_mb inc_mb,round(to_date(t.rtime,'yyyy-mm-dd hh24:mi:ss') - to_date(f.rtime,'yyyy-mm-dd hh24:mi:ss'),2) inc_daysfrom (select a.*,row_number()over(partition by a.ts_name order by a.snap_id desc) rnfrom ts a) t,  (select b.*,row_number()over(partition by b.ts_name order by b.snap_id) rnfrom ts b) fwhere t.rn = 1 and f.rn = 1 and t.ts_name = f.ts_nameand t.ts_name = '&ts_name';

根据上述查出来的表空间日增量和累计增量结果,可以大概估算出剩余的空间可以坚持多久,根据实际情况决定是否扩容。

2.3 查看数据文件路径

此步骤主要是查看表空间数据文件路径,为表空间扩容添加数据文件做好环境调研。

set lines 200
set pagesize 300
col file_name for a60
col size_mb for 999999.99
select * from (select file_name,file_id,tablespace_name,round(bytes / 1024 / 1024,2) size_mb,status,autoextensiblefrom dba_data_fileswhere tablespace_name = '&ts_name'order by 2 desc)where rownum <= 10;

3 表空间扩容

表空间扩容可以选择添加数据文件,或者拓展数据文件。

3.1 添加数据文件

添加数据文件的时候一定要注意:

  • 在RAC集群环境中,切记不要将数据文件创建到本地,这样就会造成集群节点间的不一致,可能会导致其他节点起不来。
  • 也不要将数据文件创建到其他磁盘组中,这样不够规范。

以表空间ts_test为例:

--ASM:
SQL> alter tablespace ts_test add datafile '+DATA' size 100M;--File System:
SQL> alter tablespace ts_test datafile '/u01/app/oracle/oradata/datafile/ts_test02.dbf' size 100M;

3.2 拓展数据文件

假设原来ts_test.274.1171146701大小为100M,我们可以将其拓展到200M以达到扩容的目的:

alter database datafile'+DATA/orcl/datafile/ts_test.274.1171146701' resize 200M;

3.3 扩容后检查

扩容后需要检查表空间使用率是否下降:

col tablespace_name for a20
col pct_used for a10
select a.tablespace_name,a.total_mb,a.total_mb - b.free_mb used_mb,b.free_mb,case when a.total_mb <> 0 then round((a.total_mb - b.free_mb) / a.total_mb * 100,2)else null end || '%' pct_usedfrom (select ts.tablespace_name,round(sum(bytes) / 1024 / 1024,2) total_mbfrom dba_tablespaces ts,dba_data_files df  where ts.tablespace_name = df.tablespace_namegroup by ts.tablespace_name) a,(select fs.tablespace_name,round(sum(bytes) / 1024 /1024,2) free_mbfrom dba_free_space fsgroup by fs.tablespace_name) bwhere a.tablespace_name = b.tablespace_nameand a.tablespace_name = '&tsb_name'order by 1;

4 后续排查

如果表空间时短时间内激增,则在扩容后还需要排查,找出是哪个对象数据突增影响的。

4.1 查看snap_id

set line 200
select distinct snap_id,
to_char(begin_interval_time,‘yyyy-mm-dd hh24:mi:ss’) begin_interval_time,
to_char(end_interval_time,‘yyyy-mm-dd hh24:mi:ss’) end_interval_time
from dba_hist_snapshot
where to_char(begin_interval_time,‘yyyy-mm-dd hh24:mi:ss’) >=
to_char(sysdate - &day_ago,‘yyyy-mm-dd hh24:mi:ss’)
order by snap_id desc;

4.2 查看某个表空间下增量最多的对象

set lines 200
col object_name for a30
select * from
(select obj.owner,obj.object_name,sum(hs.db_block_changes_delta) db_block_changes_delta,
round(sum(hs.space_used_delta) / 1024 / 1024,2) space_delta_mb
from dba_hist_seg_stat hs,
v$tablespace ts,
dba_objects obj,
dba_hist_snapshot sn
where hs.ts# = ts.ts#
and hs.snap_id = sn.snap_id
and hs.obj# = obj.object_id
and ts.name = ‘&tbs_name’
and sn.begin_interval_time >= sysdate - &day_ago
group by obj.owner,obj.object_name
order by space_delta_mb desc)
where rownum <= 10;

http://www.yayakq.cn/news/300647/

相关文章:

  • 门户网站开发源代码电商网站建设需求分析 实例题
  • 海尔商城网站建设维护南宁网站建设设计
  • 网站建设行业咨讯文章网页制作有什么软件
  • 珠海网站开发维护科技公司东莞企慕网站建设
  • 涿鹿做网站wl17581制作网页小程序
  • 给别人做ppt的网站百度推广有效果吗?
  • 网站服务器在哪里买好wordpress 下载插件
  • 企业网站建设的方案书原创文章代写平台
  • 老网站怎么做seo优化华商网
  • 网站被百度惩罚放弃wordpress站点地图样式
  • 做企业网站的轻量级cms网站推广效益怎么分析
  • 电商网站建设方向小蝌蚪福导福航app
  • 阿里云域名服务株洲seo网站推广
  • 免费咨询做网站玉环市建设局网站
  • 金阊seo网站优化软件二级域名建立网站
  • 设计师联盟网站高端网站设计
  • 做网站是通过怎么挣钱如何写软文
  • 上海做网站的公司四川专门做招聘酒的网站
  • 天猫官方网站聚合搜索引擎接口
  • 信用门户网站建设规范四川城乡建设厅建筑特种作业证书
  • 网站建设的培训心得大赛网站开发需求
  • 网站收录更新wordpress 浮动导航插件
  • 常熟市维摩剑门绿茶网站建设目标项目网评ppt
  • 给个网站免费的超炫网站页面
  • 在线h5免费制作网站廊坊网站建站建设
  • 自己做网站能赚钱低价的网站建设
  • 海兴县做网站价格百度推广产品有哪些
  • app设计素材网站做企业网站都有什么平台
  • wordpress国外图片主题深圳seo论坛
  • 国外还有那种做电商的网站兵团公共资源交易中心