shell脚本远程升级数据库
来源:互联网 发布:男士冬季搭配 知乎 编辑:程序博客网 时间:2024/06/05 20:45
#!/bin/shbackupdatedb(){ ssh $remoteIp "mkdir /opt/oracle/exp_dp/;chown oracle:oinstall /opt/oracle/exp_dp -R" 2>/dev/null ssh $remoteIp " su - oracle -c \" sqlplus -s /\"\" as sysdba <<ef create directory exp_dp as '/opt/oracle/exp_dp'; grant read,write on directory exp_dp to user; ef \" " ssh $remoteIp " su - oracle -c \" expdp user/user@user schemas=user directory=exp_dp dumpfile=expdp_cqgdjk.dmp logfile=expdp_cqgda.log \" " return 0}remoteIp=`grep DB file |awk -F ' ' '{print $2}'|tr -d ' '`echo "get remoteId is $remoteIp" > db.logecho "begin to backupdate db" >> db.logbackupdatedbecho "backup db success and bgein to update db" >> db.logscp update.sql $remoteIp:/home/oracle/ssh $remoteIp "chown oracle:oinstall /home/oracle/update.sql"ssh $remoteIp "su - oracle -c \"sqlplus -s user/\"user\" <<ef@update.sqlef\""
0 0
- shell脚本远程升级数据库
- 数据库升级的shell脚本
- Shell脚本远程回滚数据库
- Java执行shell脚本关闭远程数据库
- Mysql 数据库升级shell脚本编写与测试心得
- shell脚本备份mysql里面所有数据库到远程服务器
- 远程运行shell脚本
- Linux下远程升级脚本
- Linux下远程升级脚本
- Linux下远程升级脚本
- 数据库升级脚本
- MySQL数据库升级脚本
- 数据库升级脚本制作
- Java调用远程Shell脚本
- Java调用远程Shell脚本
- shell远程登录执行脚本
- java 远程调用shell脚本
- java远程调用shell脚本
- Fzoj 1692 Problem 1692 Key problem [特殊矩阵的n^2复杂度求矩阵乘法]
- 网络技术知识总结
- 可以放弃选择,但不可以选择放弃
- C++内存管理学习堆和栈
- 使用Genymotion调试出现错误INSTALL_FAILED_CPU_ABI_INCOMPATIBLE解决办法
- shell脚本远程升级数据库
- 设置光标
- MFC中OnDraw与OnPaint的区别
- 递归解决全排列生成算法
- 机房收费系统总结
- [每日练习]面试题--某个短字符串中的字符是否包含在长串中
- Error Domain=AVFoundationErrorDomain Code=-11800 "这项操作无法完成"
- uitableviewcell
- MyEclipse has detected that less than 5% of the 64MB of Perm Gen (Non-heap memor