Menü +

find ./ -type f -name '*source-string*'

oracle | remote execute sql

#!/bin/bash
# Version: 1.0.1
# Description:
R_USER="username"
SERVER_LIST="
SERVER-01
SERVER-02
SERVER-03
"
cat <<\SQL_CREAT > SQLName.sql
create user US_ISBT_SUPPORT identified by UserPassWord;
GRANT CONNECT TO ADMIN_SUPPORT;
GRANT RESOURCE TO ADMIN_SUPPORT;
GRANT SELECT ANY TABLE TO ADMIN_SUPPORT;
GRANT SELECT ANY DICTIONARY TO ADMIN_SUPPORT;
GRANT SELECT_CATALOG_ROLE TO ADMIN_SUPPORT;
alter user ADMIN_SUPPORT account lock;
SQL_CREAT
for R_SERVER in SERVER_LIST
scp SQLName.sql $R_USER@$R_SERVER:/tmp/
ssh $R_USER@$R_SERVER 'chmod 777 /tmp/SQLName.sql'
ssh -tt $R_USER@$R_SERVER <<EOF
sudo su -
su - oracle
sqlplus / as sysdba
@/tmp/SQLName.sql
exit
exit
exit
EOF

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.