botang 发表于 2020-9-20 16:39:34

SHELL和SQL Script

#!/bin/sh

read -p "PLS INPUT THE ORACLE PASSWORD FOR HR: " PASS
echo $PASS
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
export ORACLE_SID=rcat


/u01/app/oracle/product/12.1.0/dbhome_1/bin/sqlplus hr/$PASS <<EOF
@/home/oracle/1.sql;
EOF


set linesize 1000

select* from employees;

set serveroutput on

begin
dbms_output.put_line('Hello World.');
end;
/



页: [1]
查看完整版本: SHELL和SQL Script