11. java.lang.IllegalStateException
最近在使用response.sendRedirect()时出现如下错误: java.lang.IllegalStateException org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:423) 经过分析、查看jdk文档终于找到解决的办法,在response.sendRedirect()方法后加return语句即可,如下: response.sendRedirect(login.jsp); return null; 原因是:在程序中两次调用了response.sendRedirect()方法。 jdk5.0文档中很清楚地介绍了出现IllegalStateException异常的可能情况: 1)同一个页面中再次调用response.sendRedirect()方法。 2)提交的URL错误,即不是个有效的URL。
12.查看表空间并设置成自动增长:
5.1查看表空间是否自动增长
SELECT FILE_NAME,TABLESPACE_NAME,AUTOEXTENSIBLE FROM dba_data_files;
5.2 设置表空间自动增长
ALTER DATABASE DATAFILE 'c:\SmartDB01.ora' AUTOEXTEND ON;//打开自动增长
ALTER DATABASE DATAFILE 'c:\SmartDB01.ora' AUTOEXTEND ON NEXT 200M ;//每次自动增长200m
ALTER DATABASE DATAFILE 'c:\SmartDB01.ora' AUTOEXTEND ON NEXT 200M MAXSIZE 1024M;//每次自动增长200m,数据表最大不超过1G
13.(1).增加表空间:
alter tablespace 表空间名 add datefile ‘路径名(可以随便定义,但不要重复)’ size 大小;
例:alter tablespace promotion add datafile '/opt/oracle/oradata/promotion4.dbf' size 30G;
(2)增加索引表空间:
alter tablespace promotion_index add datafile '/opt/oracle/oradata/promotion6.dbf' size 30G;
14.查看表空间:
1.(查看表空间并统计所有)
select a.tablespace_name,a.bytes/1024/1024 "Sum MB",(a.bytes-b.bytes)/1024/1024 "used MB",b.bytes/1024/1024 "free MB",round(((a.bytes-b.bytes)/a.bytes)*100,2) "percent_used" from (select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a, (select tablespace_name,sum(bytes) bytes,max(bytes) largest from dba_free_space group by tablespace_name) b where a.tablespace_name=b.tablespace_name order by ((a.bytes-b.bytes)/a.bytes) desc
(2)(查看表空间)
select b.file_name FileName,
b.tablespace_name "Tablespace",
round(b.bytes / 1024 / 1024 / 1024, 2) "SpaceSize(G)",
round((b.bytes - sum(nvl(a.bytes, 0))) / 1024 / 1024 / 1024, 2) "Used(G)",
round(substr((b.bytes - sum(nvl(a.bytes, 0))) / (b.bytes) * 100,
1,
5),
2) "Used(%)"
from dba_free_space a, dba_data_files b
where a.file_id = b.file_id
group by b.tablespace_name, b.file_name, b.bytes
order by b.tablespace_name;
15.重新刷索引:
declare
v_str_indexvarchar2(50);
cursortype_cursoris
selectindex_namefromuser_indexeswheretable_owner = 'SG_FJ';
begin
opentype_cursor;
loop
fetchtype_cursorintov_str_index;
exitwhentype_cursor%notfound;
executeimmediate'alter index ' || v_str_index || ' rebuild tablespace promotion_index';
endloop;
closetype_cursor;
exception
whenothersthen
null;
end;
/
搜寻下一个序列:selectsq_contenttemplate_templateid.nextvalfromdual
搜寻当前序列:selectsq_contenttemplate_templateid.currvalfromdual
使用索引查询数据:select count(索引字段) from table
分区介绍:
1.查看分区表数据:
Select * from 表名 partition(表分区名);
例:select * from dm partition (P_LIST00);
查询单个分区表所有的数据: select count(*) from dm partition(P_LIST00);
2. 创建分区索引:
CREATE INDEX <index_name> ON <partition_table_name>(<column_name>);
3.查询当前用户下所有的分区表:
Select * from user_part_tables;
4.查询当前用户下所有的分区索引:
Select * from user_part_indexes;
5.删除分区表:
alter table 表名 drop partition 分区表名;
15.ORA-27486: insufficient privileges
解决方法:grant create job to 用户;
查询job是否已经建成:
SELECT JOB_NAME,JOB_TYPE,JOB_ACTION,REPEAT_INTERVAL,STATE FROM user_scheduler_jobs;
16.启动ftp: service vsftpd start
查看ftp: service vsftpd status
停止FTP: service vsftpd stop
17.查看索引:
select * from user_indexes where table_owner = 'FJZ';(大写用户名)
18.清缓存:echo 3 > /proc/sys/vm/drop_caches
19.归档时打包生成md5文件命令:
md5sum -b Promotion_UpgradingPackage_C00_from_C15.zip > Promotion_UpgradingPackage_C00_from_C15.zip.md5
或
md5sum -b Promotion_V100R002C00_install.tar.gz > Promotion_V100R002C00_install.tar.gz.md5
md5sum -b Promotion_V100R002C00_import.zip > Promotion_V100R002C00_import.zip.md5
20. (1).NVL( string1, replace_with)
功能:如果string1为NULL,则NVL函数返回replace_with的值,否则返回string1的值,如果两个参数都为NULL ,则返回NULL。
(2).NVL2(E1, E2, E3)的功能为:如果E1为NULL,则函数返回E3,否则返回E2