oracle 数据库几个技巧

来源:互联网 发布:淘宝网排名查询 编辑:程序博客网 时间:2024/05/16 06:35
--从回收站内恢复表
flashback table 表名 to before drop  ;
 
--查看表空间中各对像占用空间情况
select tablespace_name 表空间,segment_name 表名称,bytes / 1024 / 1024 || 'MB' 表大小
from user_segments a 
where segment_type = 'TABLE'
and tablespace_name = 'BOSSDATA_SPACE'
order by bytes / 1024 / 1024 desc ;
 
--查看回收站内表数据 
select * from recyclebin a where a.original_name='表名' ;
select * from "BIN$vC0T1FTZb9DgQAB/AQBb/A==$0" ;
 
--清空回收站
purge recyclebin ;
  
 
--查看进程对应编号
select a.SPID,a.PID,b.SID,b.PADDR,a.ADDR 
 from v$process a ,v$session  b where a.ADDR=b.PADDR and a.SPID =30746 ;
 
--查看1天前表里的数据       
select * from 表名  as of timestamp sysdate-1 ;
 
--删除表后表不在回收站内
drop table 表名 purge ;
0 0
原创粉丝点击