Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Shell script: database business monitoring

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

#! / bin/bash

# write a simple script first, and then use the script to call the stored procedure

# by: AsiaInfo-Zhang Yan

Export ORACLE_HOME=/opt/oracle/app/oracle_base/product/11.2.0/db_1

Export PATH=$ORACLE_HOME/bin:$PATH

# DATE_STR saves three values returned from the database: the year and month before 1 hour, the time string from 12 hours ago, and the current time string

DATE_STR= (`sqlplus-s username / password sysdate

And c.expire_date > sysdate

And c.effective_date < a.create_date

And c.create_dateTO_DATE ('${DATE_STR [2]}', 'YYYYMMDDHH24MISS')

Commit

Exit

Eof

Done

Echo "`date` this check is complete!"

Echo ""

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report