2009년 8월 25일 화요일

mod_deflate, mod_expire



AddOutputFilterByType text/html text/plain text/css text/javascript application/x-javascript application/xml     application/xhtml+xml text/xml




apache1은 mod_gzip apache2는 mod_deflate

mod_expire는
debian 또는 ubuntu를 사용하기에 a2enmod를 이용해서 추가후 설정


ExpiresActive On
ExpiresByType image/jpg "access plus 1 day"
ExpiresByType image/gif "access plus 1 day"
ExpiresByType image/jpeg "access plus 1 day"
ExpiresByType image/png "access plus 1 day"
ExpiresByType text/css "access plus 1 day"

#ExpiresByType text/js "access plus 1 day"
#ExpiresByType text/javascript "access plus 1 day"
#ExpiresByType application/javascript "access plus 1 day"
#ExpiresByType application/x-javascript "access plus 1 day"


뭐 간단히 요런식으로... 심심하시면 header까서 확인까지...

참조 url : http://httpd.apache.org/docs/2.0/ko/mod/mod_deflate.html

2009년 8월 18일 화요일

hint를 이용한 채번

SELECT /*+ INDEX_DESC(TABLENNAME INDEXNAME) */ NVL(MAX(COL), 0) + 1 FROM TABLENAME WHERE ROWNUM = 1;


이때 COL은 NOT NULL.

2009년 8월 13일 목요일

curl

get
curl http://www.ex.com


post
curl -d "a=b&c=d" http://www.ex.com


cookie

cookie.txt로 저장
curl -D cookie.txt http://www.ex.com
cookie.txt에 있는 cookie값 전송
curl -b cookie.txt http://www.ex.com


더 필요한건 사이트에 가서...

참조 url : http://curl.haxx.se/

2009년 7월 6일 월요일

oracle procedure

모든 procedure 확인하기
select text from user_source where name in (select object_name from user_objects where object_type = 'PROCEDURE')

오라클 mysql \G

create or replace PROCEDURE TABLE_PRINT ( p_query in varchar2 )
IS
l_theCursor     integer default dbms_sql.open_cursor;
l_columnValue   varchar2(4000);
l_status        integer;
l_descTbl       dbms_sql.desc_tab;
l_colCnt        number;
BEGIN
execute immediate
'alter session set 
nls_date_format=''yyyy-mon-dd hh24:mi:ss'' ';

dbms_sql.parse(  l_theCursor,  p_query, dbms_sql.native );
dbms_sql.describe_columns
( l_theCursor, l_colCnt, l_descTbl );

for i in 1 .. l_colCnt loop
dbms_sql.define_column
(l_theCursor, i, l_columnValue, 4000);
end loop;

l_status := dbms_sql.execute(l_theCursor);

while ( dbms_sql.fetch_rows(l_theCursor) > 0 ) loop
for i in 1 .. l_colCnt loop
dbms_sql.column_value
( l_theCursor, i, l_columnValue );
dbms_output.put_line
( rpad( l_descTbl(i).col_name, 30 )
|| ': ' || 
l_columnValue );
end loop;
dbms_output.put_line( '-----------------' );
end loop;
execute immediate
'alter session set nls_date_format=''yyyy-mon-dd hh24:mi:ss'' ';
exception
when others then
execute immediate
'alter session set nls_date_format=''yyyy-mon-dd hh24:mi:ss'' ';
raise;
END TABLE_PRINT;

SQL> SET SERVEROUT ON SIZE 1000000

또는

SQL> SET SERVEROUTPUT ON

exec table_print('select * from tab');


procedure 생성시 error가 발생하면
show errors

로 확인할 수 있다.

오라클 mysql의 \G 옵션 따라하기

참조 url : http://asktom.oracle.com/pls/asktom/f?p=100:11:1527471567674194::::P11_QUESTION_ID:1035431863958