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