Tuesday, October 9, 2007

Send a Message to all logged in Users

REM
REM Script: send.sql
REM
Rem
Rem Name: Send.Sql
Rem Function: Send a message to all connect users on NT.
Rem Usage: Execute the file connected as SYS from SQL*Plus
Rem

Set Pages 0 Feed Off Term Off Echo Off
Spool Temp.Bat
Select Distinct 'Net Send ' Terminal ' Please log off now.'
From V$Session Where UserName Is Not Null and termnial is not null;
Spool Off
Host Temp
exit

2 comments:

lateshgc said...

Nice Blog!

M'ohit Gupta said...

your syntax is wrong. it will be :

Select Distinct 'Net Send '|| Terminal ||' Please log off now.'
From V$Session Where UserName Is Not Null and terminal is not null;