1、生成每5分钟采样时间
select to_date('2018-08-01 00:00:00','YYYY-MM-DD HH24:MI:SS') + generate_series(0,287) * interval '5' minute from dual;
generate_series(start, stop, step_interval) 生成一个数值序列,从start 到 stop,步进为step(其实就是个间隔,如1,3,3结果会生成1,4,7)
interval '5' minute 是新版本支持的语法
2、text类型服务器存储没有长度限制,name相当于varchar 63(V6和V7都是)。
3、批量启用、禁用外键或触发器SQL
1)外键:select 'alter table '|| a.relname || ' MODIFY CONSTRAINT ' ||b.CONNAME||' enable'||';' from SYS_CLASS a,SYS_CONSTRAINT b where a.oid=b.CONRELID and a.RELKIND='r' and b.CONTYPE='f';
select CONNAME from SYS_CONSTRAINT where CONTYPE ='f' and CONSTATUS='t';
2)触发器:select 'alter trigger '|| SCHEMANAME||'.'||TGNAME || ' enable' ||';' from sys_triggers where SCHEMANAME='D5000' and TGKIND='n';
select TGNAME from sys_triggers where TGENABLED='t' and TGKIND='n' and SCHEMANAME='D5000';
4、清理操作系统缓存
echo 3> /proc/sys/vm/drop/caches
5、银河麒麟(湖南麒麟)普通用户无法使用crontab
ssh secadm@localhost(密码与root一致)
rbapol -s "cap/all=eip" -f /usr/bin/crontab
执行完退出即可
6、建立用户时指定归属的默认表空间
create user zxf with superuser password 'zxf' default tablespace SYSTEM;