행위

Sys login fail

DB CAFE

Dbcafe (토론 | 기여)님의 2024년 7월 12일 (금) 18:23 판 (SYS 로그인 실패)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)
thumb_up 추천메뉴 바로가기


1 쉘 에서 sqlplus 실행하기[편집]

#!/bin/bash
acreds="user_a/supergreatpassword"
bcreds="user_b/anothergreatpassword"
hoststring='fancyoraclehoststring'

runsql () {
  # param 1 is $1
sqlplus -S /nolog << EOF
CONNECT $1@$hoststring;
whenever sqlerror exit sql.sqlcode;
set echo off
set heading off
$2
exit;
EOF
}

echo "TS::$(date): Starting SCHEM_A.PROC_YOU_NEED()..."
runsql "$acreds" "execute SCHEM_A.PROC_YOU_NEED();"

echo "TS::$(date): Starting superusefuljob..."
/var/scripts/superusefuljob.sh

echo "TS::$(date): Starting SCHEM_B.SECRET_B_PROC()..."
runsql "$bcreds" "execute SCHEM_B.SECRET_B_PROC();"

echo "TS::$(date): DONE"


2 SYS 로그인 실패[편집]

2.1 토드/오렌지 툴 접속 이 안될경우 ORA-01017[편집]

$ORACLE_HOME/dbs/orapwSID 파일(sys 암호를 저장하는) 생성 해야함

orapwd file=$ORACLE_HOME/dbs/orapwsid1 password="SYS암호문자" force=y