概述
This project meant to provide useful scripts for DB maintance and management, to make work easier and interesting...
最近在開始把Oracle資料庫的腳本轉換成shell腳本,所以今天開始分享一下Oracle常用的一些腳本,後面不定期更新。這是第四部分~
一、初始化腳本settdb.sh
use script settdb.sh for DB login details registry
二、實用腳本
1、showarchrate.sh
#!/bin/bash
echo "=================================================查看資料庫redo log信息和日誌切換次數====================================================="
sqlplus -s $DB_CONN_STR@$SH_DB_SIDGROUP 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真多~