Oracle中常见的数据库操作

来源:互联网 发布:批处理 base64源码 编辑:程序博客网 时间:2024/06/07 03:10
一、查看修改连接数


select count(*) from v$process ; 当前连接数 


select value from v$parameter where name ='processes';  允许最大连接数


alter system set processes = 300 scope =spfile;  修改连接数




二、空表无法导出处理


commond下执行: show parameter deferred_segment_creation;


如果为true 改为false


alter sysytem set deferred_segment_creation=false;


sql下执行 select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0;


拷出结果执行




三、锁表处理


select b.OWNER, b.OBJECT_NAME, a.SESSION_ID, a.LOCKED_MODE
  from v$locked_object a, dba_objects b
 where a.OBJECT_ID = b.OBJECT_ID  

 

四、删除数据恢复


注意表不要用别名


select * from wf_spyj  as of timestamp(systimestamp - interval '10' minute) where lcslid='xxxxxxxxxx' ;


select *
  from wf_pz as of timestamp(systimestamp - interval '20' minute)
 where sszzjgdm in ('210213580000',
                    '210213590000',
                    '210213970000',
                    '210213600000',
                    '210213610000',
                    '210213980000')

原创粉丝点击