Thursday, November 1, 2012

Oracle / Linux [ BASH Notify DB ]

[root@localhost notify]# cat notify.sh
sqlplus /nolog << EOF
connect system/12345
@names_sid.sql
quit
EOF

[root@localhost notify]# cat names_sid.sql
spool /home/siltech/name.log
select name from v$database
/
spool off

[root@localhost notify]# cat /home/siltech/name.log

NAME                                                                           
---------                                                                      
XE

0 comentários:

Post a Comment