Tuesday, July 15, 2014

Global Checkpoint, Log Switches & Kill Sessions in RAC


Below are 3 commands are useful in RAC Environment,

Make switching the logfile for all instances in a RAC environment with Single command,

SQL> ALTER SYSTEM SWITCH ALL LOGFILE; (Make sure that your RAC Database is in Archivelog Mode)

Make Checkpoint for all Instances in a RAC environment with single command,

SQL> ALTER SYSTEM CHECKPOINT GLOBAL; (LOCAL is default)

Suppose you want to kill inactive/particular multiple sessions from RAC Database, then below query might be useful,

SQL> set  pages 0
SQL> spool kill.sql
SQL> select 'alter system kill session ' ||''''||SID ||','||SERIAL#||''||',@'||INST_ID||''''||';' from gv$session where status='INACTIVE'; 
SQL>spool off
SQL> @kill.sql

## change in where clause, if you need to kill some different sessions

Cheers,
Manish

No comments:

Post a Comment