Oracle应急备用语句记录

Oracle 查看版本号

可以通过以下sql查看

select * from v$version;

锁表

操作说明:(1)执行命令
(2)查看进程
(3)复制alter system kill session中的语句kill掉,不用的进程

select object_name, machine,l.os_user_name, t.sid, t.serial#
,'alter system kill session ''' || t.sid ||','|| t.serial# ||''';' 
from v$session t, v$locked_object l, dba_objects d 
where t.sid = l.session_id and d.object_id = l.OBJECT_ID

表备份 

表t_table,备份表t_table_1  

insert into t_table_1  select * from t_table ;
若备份表不存在
create table t_table_1 as select * from t_table ;
posted @ 2020-12-12 17:25  就沈呗  阅读(60)  评论(0编辑  收藏  举报