关于Oracle DBA常用脚本总结--shell脚本转换执行
概述
This project meant to provide useful scripts for DB maintance and management, to make work easier and interesting...
最近在开始把Oracle数据库的脚本转换成shell脚本,所以今天开始分享一下Oracle常用的一些脚本,后面不定期更新。
一、环境准备
1、配置tnsnames.ora
保证别名和ORACLE_SID一致,后面脚本需要
# vim /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora =================================================================== MDMDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =xx.xx.65)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = MDMDB) ) ) ===================================================================
2、测试连接
二、初始化脚本settdb.sh
use script settdb.sh for DB login details registry
输出:
三、第一个脚本--findfunc.sh
#!/bin/bash echo "===========================查看用户$1函数对象========================" FUNC_OWNER=`sqlplus -silent $DB_CONN_STR@$SH_DB_SID <
输出:
觉得有用的朋友多帮忙转发哦!后面会分享更多devops和DBA方面的内容,感兴趣的朋友可以关注下~
相关推荐
firefaith 2020-10-30
以梦为马不负韶华 2020-10-20
wangzhaotongalex 2020-09-22
jarrygao 2020-11-02
woaimeinuo 2020-10-21
laisean 2020-09-01
libao 2020-09-16
卖口粥湛蓝的天空 2020-09-15
huha 2020-10-16
laisean 2020-11-11
大牛牛 2020-10-30
liguojia 2020-10-20
wangzhaotongalex 2020-10-20
JohnYork 2020-10-16
Julyth 2020-10-16
applecarelte 2020-10-16
laisean 2020-09-27
flycappuccino 2020-09-27
liguojia 2020-09-27
流年浅滩 2020-10-23
liujianhua 2020-10-22
tufeiax 2020-09-03
vvu 2020-09-16
Yyqingmofeige 2020-08-18
zhushixia 2020-08-17