wangyijun 2019-11-15
This project meant to provide useful scripts for DB maintance and management, to make work easier and interesting...
最近在开始把Oracle数据库的脚本转换成shell脚本,所以今天开始分享一下Oracle常用的一些脚本,后面不定期更新。这是第四部分~
use script settdb.sh for DB login details registry
1、showarchrate.sh
#!/bin/bash echo "=================================================查看数据库redo log信息和日志切换次数=====================================================" sqlplus -s $DB_CONN_STR@$SH_DB_SID <sysdate -15 GROUP BY to_char(first_time,'YYYYMMDDHH24') ) GROUP BY substr(year_np,1,8), substr(year_np,5,2), substr(year_np,7,2) ) ORDER BY timestamp_np / EOF exit;
输出:./showarchrate.sh
2、showdblinks.sh
#!/bin/bash echo "=================================================查看数据库dblink信息=====================================================" sqlplus -s $DB_CONN_STR@$SH_DB_SID <
输出: ./showdblinks.sh
觉得有用的朋友多帮忙转发哦!后面会分享更多devops和DBA方面的内容,感兴趣的朋友可以关注下~
ps:最近头条bug真多~