`
无心徘徊
  • 浏览: 160936 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

表空间相关操作

 
阅读更多
select b.file_id  文件ID,
  b.tablespace_name  表空间,
  b.file_name     物理文件名,
  b.bytes       总字节数,
  (b.bytes-sum(nvl(a.bytes,0)))   已使用,
  sum(nvl(a.bytes,0))        剩余,
  sum(nvl(a.bytes,0))/(b.bytes)*100 剩余百分比
  from dba_free_space a,dba_data_files b
  where a.file_id=b.file_id
  group by b.tablespace_name,b.file_name,b.file_id,b.bytes
  order by b.tablespace_name


针对表空间进行增加物理文件
alter tablespace 表空间名 add datafile '路径' size 2048M;
扩大表空间文件
alter tablespace datafile '路径' resize 2048M;


select t2.username,    
       t2.sid,    
       t2.serial#,    
       t3.object_name,    
       t2.OSUSER,    
       t2.MACHINE,    
       t2.PROGRAM,    
       t2.LOGON_TIME,    
       t2.COMMAND,    
       t2.LOCKWAIT,    
       t2.SADDR,    
       t2.PADDR,    
       t2.TADDR,    
       t2.SQL_ADDRESS,    
       t1.LOCKED_MODE    
  from v$locked_object t1, v$session t2, dba_objects t3    
where t1.session_id = t2.sid    
   and t1.object_id = t3.object_id    
order by t2.logon_time; 

alter system kill session'50,492';
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics