DB Size 구하기 (일별 체크)
1. PM.sql (DB Size 구하는 sqlplus 명령어)
[SUTMS1:/oracle/tmp/db_size]$ cat dbsize.sql
select sum(bytes)/1024/1024 MB from dba_segments; 실제사용량
select sum(bytes)/1024/1024 MB from dba_data_files; 오라클에 잡혀있는용량
quit
* 결과물
[SUTMS1] /oracle/tmp/db_size]$ sqlplus '/as sysdba' @/oracle/tmp/db_size/dbsize.sql

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Aug 10 14:59:47 2009

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options


        MB
----------
203063.188

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
[SUTMS1] /oracle/tmp/db_size
]$
2. crontab 에서 돌아갈 스크립트
[SUTMS1:/oracle/tmp/db_size]$ cat run.sh
date >> /oracle/tmp/db_size/dbsize.txt
sqlplus '/as sysdba' @/oracle/tmp/db_size/dbsize.sql | head -n 15 | tail -1 >> /oracle/tmp/db_size/dbsize.txt
3. cron job
[dbtms1:/]# crontab -l (ROOT USER)
00 6 * 8 * su - oracle -c "/oracle/tmp/db_size/run.sh"

하루에 한번 06시에 DB size 구해서 dbsize.txt 에 추가(add)하는 스크립트 && cron job
by 까나리 | 2009/08/10 14:58 | 시스템 | 트랙백 | 덧글(0)
트랙백 주소 : http://kkanari.egloos.com/tb/4208052
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]

:         :

:

비공개 덧글

◀ 이전 페이지 다음 페이지 ▶