use DBD::Oracle connect oracle database
[
2009/09/10 20:40 | by askwan ]
2009/09/10 20:40 | by askwan ]
the first way:
the second way:
----------END-----------
the second way:
----------END-----------
oracle temporary tablespace boom unexpectedly
[
2009/09/07 08:38 | by askwan ]
2009/09/07 08:38 | by askwan ]
临时表空间用途:
INDEX CREATE ,INDEX REBUILD,ORDER BY ,GROUP BY, DISTINCT,Analyze,UNION, Sort-Merge etc..
上面这些操作均会用到临时表空间
临时表空间重建步骤:
比如临时表空间一直增大,导致系统磁盘空间吃紧,考虑重建
1 定位当前临时表空间位置
2 创建临时表空间TEMP02
review:
3 改变缺省临时表空间为TEMP02
4 .删除原缺省表空间temp
5.创建新表空间temp
6. 改变缺省表空间
7.删除中间过程表空间TEMP02
8.重新指定用户临时表空间
涉及临时文件相关操作
eg.
alter database tempfile '/u01/oracle/oradata/askwan/temp.dbf' autoextend off;
alter database tempfile '/u01/oracle/oradata/askwan/temp.dbf' resize 300M;
alter database tempfile ''/u01/oracle/oradata/askwan/temp.dbf' autoextend on;
INDEX CREATE ,INDEX REBUILD,ORDER BY ,GROUP BY, DISTINCT,Analyze,UNION, Sort-Merge etc..
上面这些操作均会用到临时表空间
临时表空间重建步骤:
比如临时表空间一直增大,导致系统磁盘空间吃紧,考虑重建
1 定位当前临时表空间位置
Quotation
SQL> SELECT FILE_NAME,TABLESPACE_NAME FROM DBA_TEMP_FILES;
FILE_NAME TABLESPACE_NAME
-------------------------------------------------------------------------------- ------------------------------
/u01/oracle/oradata/askwan/temp01.dbf TEMP
FILE_NAME TABLESPACE_NAME
-------------------------------------------------------------------------------- ------------------------------
/u01/oracle/oradata/askwan/temp01.dbf TEMP
2 创建临时表空间TEMP02
Quotation
SQL> CREATE TEMPORARY TABLESPACE TEMP02 TEMPFILE '/u01/oracle/oradata/askwan/temp02.dbf'
SIZE 100M REUSE AUTOEXTEND ON NEXT 512K MAXSIZE UNLIMITED;
Tablespace created
SIZE 100M REUSE AUTOEXTEND ON NEXT 512K MAXSIZE UNLIMITED;
Tablespace created
review:
Quotation
SQL> SELECT FILE_NAME,TABLESPACE_NAME FROM DBA_TEMP_FILES;
FILE_NAME TABLESPACE_NAME
-------------------------------------------------------------------------------- ------------------------------
/u01/oracle/oradata/askwan/temp01.dbf TEMP
/u01/oracle/oradata/askwan/temp02.dbf TEMP02
have created successfull.
FILE_NAME TABLESPACE_NAME
-------------------------------------------------------------------------------- ------------------------------
/u01/oracle/oradata/askwan/temp01.dbf TEMP
/u01/oracle/oradata/askwan/temp02.dbf TEMP02
have created successfull.
3 改变缺省临时表空间为TEMP02
Quotation
SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP02;
Database altered
Database altered
4 .删除原缺省表空间temp
Quotation
SQL> drop tablespace temp including contents and datafiles;
Tablespace dropped
Tablespace dropped
5.创建新表空间temp
Quotation
SQL> CREATE TEMPORARY TABLESPACE TEMP TEMPFILE '/u01/oracle/oradata/askwan/temp.dbf'
SIZE 100M REUSE AUTOEXTEND ON NEXT 512K MAXSIZE UNLIMITED;
Tablespace created
SIZE 100M REUSE AUTOEXTEND ON NEXT 512K MAXSIZE UNLIMITED;
Tablespace created
6. 改变缺省表空间
Quotation
SQL> alter database default temporary tablespace temp;
Database altered
Database altered
7.删除中间过程表空间TEMP02
Quotation
SQL> drop tablespace temp02 including contents and datafiles;
Tablespace dropped
Tablespace dropped
8.重新指定用户临时表空间
Quotation
SQL> alter user ASKWAN temporary tablespace temp;
User altered
User altered
涉及临时文件相关操作
eg.
alter database tempfile '/u01/oracle/oradata/askwan/temp.dbf' autoextend off;
alter database tempfile '/u01/oracle/oradata/askwan/temp.dbf' resize 300M;
alter database tempfile ''/u01/oracle/oradata/askwan/temp.dbf' autoextend on;
simple way to parse apache log with perl to find top 10 clients
[
2009/09/04 15:03 | by askwan ]
2009/09/04 15:03 | by askwan ]
usage and output:
./parse_apache.pl [APACHE LOGFILE]
# perl parse_apache.pl access_askwan_com_logClient IPs Num Of Visits
192.168.11.8 1794924
192.168.11.60 80887
192.168.11.9 34403
192.168.11.50 18026
192.168.11.196 8379
192.168.11.201 1353
192.168.11.155 1041
192.168.21.156 449
192.168.21.161 163
192.168.12.2 84
-------------end--------------




