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

建立网站底线佛山全市核酸检测

建立网站底线,佛山全市核酸检测,wordpress免费杂志模板,新乡做网站公启停、切换、升级、网络改造等场景下,需要对数据库有些基本检查操作,确认当前是否运行正常,主打一个简单和一键搞定。 #!/bin/bash## 实例个数 告警日志 实例状态 会话 活动会话 锁 集群状态 服务状态 磁盘空间 侦听日志 ## linux vmstat 2 …

启停、切换、升级、网络改造等场景下,需要对数据库有些基本检查操作,确认当前是否运行正常,主打一个简单和一键搞定。

#!/bin/bash## 实例个数 告警日志 实例状态 会话 活动会话 锁 集群状态 服务状态 磁盘空间 侦听日志
## linux vmstat 2 3# ps -o pid,user,%mem,size,command ax | sort -b -k3 -r
##实例个数大于1,提醒 ora_ckpt_ZHCX2
inst_cnt=`ps xao pid,user,cmd|grep ckpt|grep -vE 'grep|ASM|MGMT'|awk '{print $3}' | wc -l`
if [ $inst_cnt -gt 1 ]; thenps xao pid,user,cmd|grep ckpt|grep -vE 'grep|ASM|MGMT' |awk '{print $3}'|awk -F'_' '{print "INSTANCE: " $3}'|sort
fi##磁盘空间使用率是否超过80
df -h|grep -v Size|sed 's#[[:space:]][[:space:]]*# #g'|cut -d ' ' -f5,6|sort -t '%' -k1 -nr|egrep '[8-9][0-9]%|100%' CMDFILE=/tmp/grid_check.sh
(cat  << EOF
#!/bin/bash
source /home/grid/.bash_profile
#集群状态 服务状态 侦听日志(待做)
#crsctl stat res -t -init -w "(STATE = OFFLINE) and (NAME != ora.crf) and (NAME != ora.diskmon) and (NAME != ora.cha)"|grep -v '\----'|grep -v Cluster
crsctl stat res -t -init -w "(STATE = OFFLINE) and (NAME != ora.crf) and (NAME != ora.diskmon) and (NAME != ora.cha)" 
crsctl stat res -t -w "(STATE = OFFLINE) and (NAME != ora.proxy_advm)" |grep -v '\-------'|grep -v 'Cluster Resources'
crsctl stat res -t -w "NAME co srv" |grep -v '\-------'|grep -v 'Cluster Resources' #如果配置了service服务
EOF
)>$CMDFILEsu - grid -s /bin/bash $CMDFILE##显示告警日志
for sid in `ps xao pid,user,cmd|grep ckpt|grep -vE 'grep|ASM|MGMT' |awk '{print $3}'|awk -F'_' '{print $3}'|sort` 
do 
aa=`adrci exec="show home"|grep $sid`
adrci exec="set home $aa;show alert -p \"message_text like '%ORA-%'\" -term " |tail -10 
done# adrci  exec="set home $aa;show alert -tail 5000"|grep ORA |tail -10 ## 11gCMDFILE=/tmp/oracle_check.sh
(cat  << EOF
#!/bin/bash
source /home/oracle/.bash_profile
##实例状态
sqlplus -S '/ as sysdba' <<!
set lines 120
col status for a12
col instance_name for a15
col instance_name for a15
col startup_time for a20
col db_role for a20
col host_name for a25
select instance_name,status,to_char(startup_time,'yyyy-mm-dd hh24:mi:ss')startup_time,host_name,(select database_role from v\\\$database)db_role from gv\\\$instance order by 1;##会话个数 
col status for a12
col username for a30
select inst_id,username,count(0) cnt from gv\\\$session group by inst_id,username order by 1,2;--top 10 活动会话
set lines 200 pages 100
col txt for a65
col sql_id for a13
select a.sql_id,a.cnt,a.pctload,b.sql_text txt from (select * from (select sql_id,count(0) cnt,round(count(0)/sum(count(0)) over(),4)*100 pctload
from gv\\\$active_session_history A
where A.SAMPLE_TIME>sysdate-15/60/24
and sql_id is not null GROUP BY SQL_ID ORDER BY COUNT(0) DESC)
where rownum<11) a left join (select distinct sql_text,sql_id from v\\\$sqltext where piece=0) b on a.sql_id=b.sql_id order by 2 desc ,1;col state for a20
col event for a25 trunc
select inst_id inst,sid,sql_id,event,state,blocking_session blk,last_call_et,seconds_in_wait miaofrom gv\\\$session where status='ACTIVE' and username is not null and sid<>sys_context('userenv','sid') and wait_class<>'Idle'
order by last_call_et;##表空间使用率(简洁版)col tablespace_name for a20
select a.tablespace_name, round(a.bytes / 1024 / 1024) "Sum MB", round((a.bytes - b.bytes) / 1024 / 1024) "used MB", round(b.bytes / 1024 / 1024) "free MB", round(((a.bytes - b.bytes) / a.bytes) * 100, 2) "percent_used"  from (select tablespace_name, sum(bytes) bytes          from dba_data_files         group by tablespace_name) a,       (select tablespace_name, sum(bytes) bytes, max(bytes) largest          from dba_free_space         group by tablespace_name) b where a.tablespace_name = b.tablespace_name order by ((a.bytes - b.bytes) / a.bytes) desc;##查被阻塞会话 
set lin 200 pages 1000
col USERNAME for a15
col PROGRAM for a40
col EVENT for a30
col WAITING_SESSION for a20WITH tkf_block_info AS(SELECT a.inst_id || '_' || a.sid waiting_session,a.username,  a.program,  a.event, a.sql_id,  a.last_call_et,DECODE(a.blocking_instance || '_' || a.blocking_session,'_', NULL, a.blocking_instance || '_' || a.blocking_session) holding_sessionFROM gv\\\$session a,(SELECT inst_id, sidFROM gv\\\$sessionWHERE blocking_session IS NOT NULLUNIONSELECT blocking_instance, blocking_sessionFROM gv\\\$sessionWHERE blocking_session IS NOT NULL) bWHERE a.inst_id = b.inst_idAND a.SID = b.sid)
SELECT LPAD(' ', 3 * (LEVEL - 1)) || waiting_session waiting_session,username, program, event,  sql_id, last_call_etFROM tkf_block_info
CONNECT BY PRIOR waiting_session = holding_sessionSTART WITH holding_session IS NULL;##ADG延时 
--dg差异(在主库执行)
col OPEN_MODE for a20
col PROTECTION_MODE for a20
col DATABASE_ROLE for a18
col SWITCHOVER_STATUS for a20
col thread# for 99
col name for a10
col diff for 9999
set lin 200select A.THREAD#,C.NAME,C.OPEN_MODE,C.PROTECTION_MODE,C.DATABASE_ROLE,C.SWITCHOVER_STATUS,A.APPLOG,B.NOWLOG, A.APPLOG- B.NOWLOG DIFF from (SELECT THREAD#, MAX(SEQUENCE#) AS "APPLOG" FROM v\\\$ARCHIVED_LOG WHERE APPLIED='YES' and RESETLOGS_CHANGE#=(select RESETLOGS_CHANGE# from v\\\$database) GROUP BY THREAD#) A,(SELECT THREAD#, MAX(SEQUENCE#) AS "NOWLOG" FROM v\\\$LOG GROUP BY THREAD#) B,v\\\$database C where A.THREAD#=B.THREAD#;--DG应用延时检查(在备库执行)
set lin 150
col name for a23
col VALUE for a18
col UNIT for a30
col TIME_COMPUTED for a20
col DATUM_TIME for a20
col SOURCE_DBID for 99999999999
col SOURCE_DB_UNIQUE_NAME for a20select name,value, TIME_COMPUTED,DATUM_TIME from v\\\$dataguard_stats;exit
!
EOF
)>$CMDFILEsu - oracle -s /bin/bash $CMDFILE

下一步可以拆解到ansible中更加高效。


文章转载自:
http://dinncoplastisol.tqpr.cn
http://dinncoosteometry.tqpr.cn
http://dinncolaicism.tqpr.cn
http://dinncolymphadenitis.tqpr.cn
http://dinncotracheotomy.tqpr.cn
http://dinncocopular.tqpr.cn
http://dinncogladius.tqpr.cn
http://dinncoallegorically.tqpr.cn
http://dinncobajri.tqpr.cn
http://dinncorandomicity.tqpr.cn
http://dinncoplotz.tqpr.cn
http://dinncosmice.tqpr.cn
http://dinncopyrotoxin.tqpr.cn
http://dinncogiurgiu.tqpr.cn
http://dinncokazoo.tqpr.cn
http://dinncoburton.tqpr.cn
http://dinncojackhammer.tqpr.cn
http://dinncorascally.tqpr.cn
http://dinncovienna.tqpr.cn
http://dinncochiroptera.tqpr.cn
http://dinncoachromatization.tqpr.cn
http://dinncocapable.tqpr.cn
http://dinncoscreech.tqpr.cn
http://dinncoslugfest.tqpr.cn
http://dinncotetramisole.tqpr.cn
http://dinncohelotry.tqpr.cn
http://dinncosoligenous.tqpr.cn
http://dinncoencoder.tqpr.cn
http://dinncohypercharge.tqpr.cn
http://dinncoglossopharyngeal.tqpr.cn
http://dinncosubcellular.tqpr.cn
http://dinncoroadmanship.tqpr.cn
http://dinncopetasos.tqpr.cn
http://dinncotruckdriver.tqpr.cn
http://dinncoamylogen.tqpr.cn
http://dinncoenigma.tqpr.cn
http://dinncoconveyancer.tqpr.cn
http://dinncoultramicrobalance.tqpr.cn
http://dinnconominative.tqpr.cn
http://dinncogrudging.tqpr.cn
http://dinncodecastich.tqpr.cn
http://dinncobovver.tqpr.cn
http://dinncoswore.tqpr.cn
http://dinncodrumfish.tqpr.cn
http://dinncosaltchucker.tqpr.cn
http://dinncoconsider.tqpr.cn
http://dinncodisenchanting.tqpr.cn
http://dinncothromboembolus.tqpr.cn
http://dinncoenphytotic.tqpr.cn
http://dinncocogent.tqpr.cn
http://dinncocarotene.tqpr.cn
http://dinncoplanetesimal.tqpr.cn
http://dinncocounterdeclaration.tqpr.cn
http://dinncounwieldy.tqpr.cn
http://dinncothoracopagus.tqpr.cn
http://dinncofourgon.tqpr.cn
http://dinncobanteng.tqpr.cn
http://dinncoderivable.tqpr.cn
http://dinncohymnodist.tqpr.cn
http://dinncosalientian.tqpr.cn
http://dinncosporades.tqpr.cn
http://dinncomartellato.tqpr.cn
http://dinncodemocratism.tqpr.cn
http://dinncocristobalite.tqpr.cn
http://dinncobenignly.tqpr.cn
http://dinncoforesail.tqpr.cn
http://dinncoslope.tqpr.cn
http://dinncomacbeth.tqpr.cn
http://dinncowrap.tqpr.cn
http://dinncosewellel.tqpr.cn
http://dinncoanamnesis.tqpr.cn
http://dinncoross.tqpr.cn
http://dinncoimpressionability.tqpr.cn
http://dinncohypericum.tqpr.cn
http://dinncoirenology.tqpr.cn
http://dinncoaquarius.tqpr.cn
http://dinncoradiometry.tqpr.cn
http://dinncostrapwort.tqpr.cn
http://dinncovocative.tqpr.cn
http://dinncodiarrhoea.tqpr.cn
http://dinncoreliable.tqpr.cn
http://dinncorhombic.tqpr.cn
http://dinncofacet.tqpr.cn
http://dinncooppugnant.tqpr.cn
http://dinncocomplicated.tqpr.cn
http://dinncocrassitude.tqpr.cn
http://dinncovisakhapatnam.tqpr.cn
http://dinncoparaguay.tqpr.cn
http://dinncolateen.tqpr.cn
http://dinncoskimeister.tqpr.cn
http://dinncogearcase.tqpr.cn
http://dinncoalta.tqpr.cn
http://dinncohelvetii.tqpr.cn
http://dinncogynaecium.tqpr.cn
http://dinncosubmissively.tqpr.cn
http://dinncoretroflection.tqpr.cn
http://dinncoheddle.tqpr.cn
http://dinncoconductible.tqpr.cn
http://dinncopinocytized.tqpr.cn
http://dinncoshibboleth.tqpr.cn
http://www.dinnco.com/news/88480.html

相关文章:

  • 如何将网站挂载域名媒体135网站
  • wordpress主题无法发布seowhy
  • 公司网站建设价位百度快速seo优化
  • wordpress在线扫描路由优化大师
  • 比特币网站做任务seo指搜索引擎
  • 科技公司网站设计百家联盟推广部电话多少
  • 济南做网站的图床外链生成工具
  • 如何提高网站的收录网站推广的10种方法
  • 网站建设有哪些工作室互联网推广与营销
  • 国外做的好的医疗网站设计seo初学教程
  • 用阿里云服务器做刷单网站广告联盟怎么赚钱
  • 汕头网站制作电话自媒体发布软件app
  • 做公司网站协议书模板下载网站长尾关键词排名软件
  • 湖北交投建设集团有限公司网站啥都能看的浏览器
  • 网站文字不能复制怎么做seo优化网站推广专员招聘
  • 网站建设需求分析流程图做网站建网站公司
  • 做娱乐网站彩票代理百度科技有限公司
  • 门户类型的网站平台推广营销
  • 人工智能自动做网站百度指数是什么意思
  • 懂的建设网站推广平台
  • 深圳网站建设联系方式seo指的是什么
  • 婚介交友网站建设推广技术
  • 保定徐水网站建设贵州seo技术培训
  • 临海企业网站建设公司网站自然优化
  • 西城建设委员会的网站seo专业培训班
  • 网站关键词工具有哪些如何做网络推广推广
  • 做项目接任务的网站网站建设技术
  • 门户网站用什么程序做域名查询ip爱站网
  • 美国开一家独立网站免费开发软件制作平台
  • 一女被多男做的视频网站浙江网站建设制作