Hi All,
I have 20 database server (11.2.0.3) hosted on unix and Windows platforms.
Every day I have to kill inactive sessions from all the these 20 database servers. So I have made a below script::
-----------------------------------------------------------------------------------------------------------------------------------
connect sys/&&sys_password@&&tns_database_name as sysdba
SPOOL E:\DELETE_INACTIVE_SESSIONS.SQL
set PAGESIZE 1000
set LIN 5000
SET ECHO OFF;
SET FEEDBACK OFF;
SET HEADING OFF;
select 'alter system kill session '||'`'||SID||','||SERIAL#||'`'||' immediate;' from v$session where status='INACTIVE' and username in ('OSS_DICTIONARY','ADMINISTRATOR');
SPOOL OFF;
@@E:\DELETE_INACTIVE_SESSIONS.SQL
-----------------------------------------------------------------------------------
Is there any way so that this execution of script can be automated in PLSQL code for 20 servers so and that code could be put in batch file for execution(i.e. can be execute through batch file from my windows laptop).
Thanks