Re: best practises for avoiding to write passwords in shell scripts (example sqlplus from Oracle)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Sven Aluoor wrote:
> Hi folks
>
> I have here a CentOS box where i need to setup cronjob (with session
> to remote Oracle instance). On the remote DB i have no access, expect
> limited user.

With sqlplus and oracle I pretty much always ran scripts
as sysdba

from one of my scripts that fires up Oracle ASM:
# Set variables for ASM sid (first)
su $ORACLE_USERNAME -c "echo "startup" | sqlplus / as sysdba" | tee
$ASM_STARTUP_LOG

another example -
        su $ORACLE_USERNAME -c "sqlplus / as sysdba 
@/home/oracle/sql/snapshot-restore/restore-from-prod-oracle-change-passwords.sql"
| tee -a $FINAL_SQL_LOG

If I needed to login as a specific user to oracle I would login
as sysdba and run

alter session set current_schema=OTHER_USER_NAME;

to change the user name after login.

So no passwords needed.

For servers, everything automated relies on ssh key based auth.

I'm no Oracle expert by any means!

nate


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux