Oracle 判断CLOB字段
是否为null,则为:SELECT *FROM TABLE_NAME S WHERE S.CLOB_FIELD IS NULL ORDBMS_LOB.GETLENGTH(S.CLOB_FIELD) = 0;
判断不能为空,则修改为:IS NOT NULL OR DBMS_LOB.GETLENGTH(S.CLOB_FIELD)<> 0;
DBMS_LOB为专门处理大对象的一个包
DBMS_LOB.GETLENGTH是查大对象数据类型的大小
oracle链接数查看
*数据库允许的最大连接数
select value from v$parameter where name = 'processes'
*当前的连接数
select count(*) from v$process
*查看当前用户所有表
select * from user_tables
*修改最大连接数:
alter system set processes = 300 scope = spfile
*重启数据库:
shutdown immediate startup
*查看oracle服务进程的信息
select * from v$process
*查看client端的信息
select * from v$session
*查看会话设置数
select value from v$parameter where name = 'sessions'
*设置会话数
--连接数(sessions)与其参数文件中的进程数(process)有关系,sessions=(1.1*process+5) alter system set sessions=335 scope=spfile;
*查看会话数
--查看当前链接数 select count(*) from v$session; --按用户分组统计查看链接数 select username,count(username) from v$session where username is not null group by username ; --查看客户端信息 select sid,serial#,username,program,machine,status from v$session; 分组查看信息 select b.MACHINE, b.PROGRAM , count(*) from v$process a, v$session b where a.ADDR = b.PADDR and b.USERNAME is not null group by b.MACHINE , b.PROGRAM order by count(*) desc;
*查看并发量
select count(*) from v$session where status='ACTIVE';
server端的信息:
paddr 即v$process中的server进程的addr
server 服务器是dedicate/shared
*系统参数配置
查看当前系统SGA的信息
select name,bytes/1024/1024 as "Size(M)" from v$sgainfo;