Parthiban Kanavu Part 1 & 2
Parthiban Kanavu Part 3
Monday, April 13, 2009
Friday, April 3, 2009
Thursday, March 12, 2009
Oracle: RecycleBin
From 10g, When you drop a table, Oracle renames the table and stores it in logical recycle bin. The table structure is preserved, meaning all the triggers and indexes on the table are preserved. Even though the table is logically dropped, it still exists in bin, there by occupying space in the tablespace
To view the contents of the recyclebin, go to sqlplusw, and type
sql> show recyclebin
If you dropped the table by mistake and want to revert it back, then issue the command
sql> Flashback table table_name to before drop;
If you want to permanently drop a table,bypassing recyclebin then
sql> drop table table_name purge;
To clear Recylcebin
sql> purge recyclebin
Scripts to manage recyclebin
To drop a table from recycle bin
purge table table_name
You can also purge tables at tablespace level
Purge tablespace tablespace_name
Purge for specific users in tablespace
Purge tablespace tablespace_name USER user_name
To drop all objects in recyclein
purge dba_recylebin
To view the contents of the recyclebin, go to sqlplusw, and type
sql> show recyclebin
If you dropped the table by mistake and want to revert it back, then issue the command
sql> Flashback table table_name to before drop;
If you want to permanently drop a table,bypassing recyclebin then
sql> drop table table_name purge;
To clear Recylcebin
sql> purge recyclebin
Scripts to manage recyclebin
To drop a table from recycle bin
purge table table_name
You can also purge tables at tablespace level
Purge tablespace tablespace_name
Purge for specific users in tablespace
Purge tablespace tablespace_name USER user_name
To drop all objects in recyclein
purge dba_recylebin
Oracle: How to kill Jobs
Sometimes Jobs run in background and they may not be visible in session viewer
Use below SQL to kill jobs
To get list of jobs running
Select sid,d.*
from dba_jobs_running r,dba_jobs d
where r.job = d.job
For SID from above query, Get Serial# from v$ v$session
select * from v$session
where sid in 138
ALTER SYSTEM KILL SESSION '138,19296';
Alter session kill session 'SID,SERIAL#'
Use below SQL to kill jobs
To get list of jobs running
Select sid,d.*
from dba_jobs_running r,dba_jobs d
where r.job = d.job
For SID from above query, Get Serial# from v$ v$session
select * from v$session
where sid in 138
ALTER SYSTEM KILL SESSION '138,19296';
Alter session kill session 'SID,SERIAL#'
Subscribe to:
Posts (Atom)


