2018-5-29 9:10:15 星期二 锁表情况查询: show OPEN TABLES where In_use > ; 慢日志记录: 1. 修改配置文件, 重启服务后永久生效 slow_query_log=on slow_query_log_file=/log/slow.log long_query_time= 2. 动态修改, 重启后失效 set global slow_query_log = ON; set global long_query_time = ; set global…
多条件情况查询 SELECT Title, 'Price Range' = CASE WHEN price IS NULL THEN 'Unpriced' WHEN price < 10 THEN 'Bargain' WHEN price BETWEEN 10 and 20 THEN 'Average' ELSE 'Gift to impress relatives' END FROM titles…
1. 查看所有表空间大小 SQL> select tablespace_name,sum(bytes)/1024/1024 from dba_data_files 2 group by tablespace_name; 2. 已经使用的表空间大小SQL> select tablespace_name,sum(bytes)/1024/1024 from dba_free_space 2 group by tablespace_name; 3. 所以使用空间可以这样计算 select a.tabl…