--查询锁表
select s.sid, s.machine, l.oracle_username, l.locked_mode, S.osuser, 'ALTER SYSTEM KILL SESSION ''' || s.sid || ', ' || s.serial# || ''';' Command, s.LOGON_TIME from v$locked_object l, v$session s, all_objects o where l.session_id = s.sid and l.object_id = o.object_id order by s.LOGON_TIME;
--数据库空间使用
SELECT a.tablespace_name 表空间名, total 表空间大小, free 表空间剩余大小, (total - free) 表空间使用大小, ROUND((total - free) / total, 4) * 100 使用率 FROM (SELECT tablespace_name, ROUND(SUM(bytes) / (1024 * 1024), 4) free FROM DBA_FREE_SPACE GROUP BY tablespace_name) a, (SELECT tablespace_name, ROUND(SUM(bytes) / (1024 * 1024), 4) total FROM DBA_DATA_FILES GROUP BY tablespace_name) b WHERE a.tablespace_name = b.tablespace_name;
删除物化视图 drop materialized view view_disease 刷新物化视图 命令窗口: exec dbms_mview.refresh('view_disease','C'); create user hpas_js identified by 123456; grant connect , resource,dba to hpas_js; imp username/password@localhost/orcl file='E:\*.dmp' full=y; exp: C:\Users\Administrator>imp gl_platform/123pt456@172.29.81.211/orcl file='E:\why1020\apache-tomcat-8.5.31-ynjx\hpas_cs.dmp' full=y; 导出例子: exp hpas_gl/123456@127.0.0.1:1522/orcl tables=(BCB_FOLLOWUP,BCB_MEDICATION,BCB_PATIENTS,BCB_SCREEREPORT,BCB_TEMP,BCB_TREATMENT) file=E:\why1020\bcb_tables.dmp 导入例子: imp hpas_gl/123456@172.29.81.211/orcl file=E:\why1020\bcb_tables.dmp full=y 远程连接plsql; > sqlplus /nolog; SQL> conn username/password@ip:port/orcl;