Showing posts with label kill. Show all posts
Showing posts with label kill. Show all posts

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

Monday, January 20, 2014

killing expdp/impdp job.

some time it is really necessary  to terminate  a expdb/impdp jobs because of any valid reason which impact database.
here are the steps for quick references, how can we terminate the expdp/impdp job,
step 1:  take the job_name from below views
select * from USER_DATAPUMP_JOBS;
select * from DBA_DATAPUMP_SESSIONS;
step 2: Attach to that job_name which you find out in step1.
oracle@aa: /u02/backups # impdp system/***** attach=test_DUMP11(job_name)
step 3:  stop job immediate
impdp> STOP_JOB=IMMEDIATE
impdp>kill_job
- Manish Nashikkar