6th June 2009

One-liner database script

posted in One-liners, Systems Administration |

To run a script on all database instances currently running on an Oracle RAC cluster node I have used the following:

for sid in `ps -ef |grep pmon|grep -v grep|grep -v ASM|cut -d_ -f3-|sort -u|grep ^dw`; do export ORACLE_SID=$sid; sqlplus “/ as sysdba”  @security_audit.sql; done

Leave a Reply

You must be logged in to post a comment.