Hide Password in scrypt withouth using "/ as sysdba"
Hide Password in scrypt withouth using "/ as sysdba"
(OP)
Hello All,
How can I hide the password on line 9 in the script below with using login as sysdba?
#!/bin/ksh
dbname=mydbname
export ORACLE_SID=$dbname
export ORACLE_HOME=/orahome/app/oracle/product/10.2.05/
. /usr/sislocal/$dbname/to$dbname
#log into database
sqlplus -s splex/password << EOF #want to hide password here, without using sqlplus -s "/ as sysdba"
set pagesize 0
set linesize 4000
set feedback off
set trimspool on
spool rowcount.txt;
select source_name from splex.count_match_vw;
spool off;
EOF
How can I hide the password on line 9 in the script below with using login as sysdba?
#!/bin/ksh
dbname=mydbname
export ORACLE_SID=$dbname
export ORACLE_HOME=/orahome/app/oracle/product/10.2.05/
. /usr/sislocal/$dbname/to$dbname
#log into database
sqlplus -s splex/password << EOF #want to hide password here, without using sqlplus -s "/ as sysdba"
set pagesize 0
set linesize 4000
set feedback off
set trimspool on
spool rowcount.txt;
select source_name from splex.count_match_vw;
spool off;
EOF
RE: Hide Password in scrypt withouth using "/ as sysdba"
CODE
#!/bin/ksh USER=splex PASS=splexpassword DATABASE=mydbname sqlplus -s /nolog << EOF conn ${USER}/${PASS}@${DATABASE} set pagesize 0 linesize 4000 feedback off trimspool on spool rowcount.txt; select source_name from splex.count_match_vw; spool off; EOF
The username and password will still be visible in the script, but it won't be in the command line where anyone can see.
To further hide those you could put their definitions into a protected or encrypted file that the script can pull them from.
RE: Hide Password in scrypt withouth using "/ as sysdba"
Much appreciated.