본문 바로가기

DB/DBA

(19)
Here are some scripts related to Tables/Indexes http://vsbabu.org/oracle/sect16.html Tables/Indexes Here are some scripts related to Tables/Indexes . Tabs w/ Questionable Inds TABLES WITH QUESTIONABLE INDEX(ES) NOTES: Owner - Owner of the table Table Name - Name of the table Column - Name of the column in question The above query shows all tables that have more than one index with the same leading column. These indexes can cause queries to us..
Oracle - tablespace 사용량 SELECT a.tablespace_name , a.total "Total(Mb)" , a.total - b.free "Used(Mb)" , nvl(b.free,0) "Free(Mb)" , round((a.total - nvl(b.free,0))*100/total,0) "Used(%)" from (select tablespace_name, round((sum(bytes)/1024/1024),0) as total from dba_data_files group by tablespace_name) a ,(select tablespace_name, round((sum(bytes)/1024/1024),0) as free from dba_free_space group by tablespace_name) b wher..
오라클의 tablespace 관리하기 오라클의 tablespace 관리하기 먼저, tablespace는 하나 이상의 물리적인 데이터파일들로 구성된 논리적인 데이터 저장 장소이다. 실제로 tablespace를 생성해보도록 한다. SQL> create tablespace test 2 datafile 'c:\oracle\oradata\orcl\test_01.dbf' size 10M; 테이블 영역이 생성되었습니다. SQL> create user test identified by test 2 default tablespace test 3 temporary tablespace temp; 사용자가 생성되었습니다. SQL> grant connect, resource to test; 권한이 부여되었습니다. 일단 tablespace를 만들고나서는 이제 관리의..
Oracle Process Part - User,Server,Background 오라클 프로세스는 서버 자체 즉 인스턴스와 관련된 프로세스로부터 사용자와 관련된 프로세스에 이르기까지 각기 기능을 수행하는 프로세스가 포함되어 있습니다. 오라클의 프로세스는 크게 세가지로 나누어 볼 수 있는데 그 내용은 아래와 같습니다. 1.서버 프로세스 : 클라이언트 요청에 기반을 두고 실행, 전용 및 공유 서버 프로세스가 있습니다. 2.백그라운드 프로세스 : 데이터베이스와 함께 구동하여 블록을 디스크에 기록하고 온라인 재실행 로그를 관리하고 중지된 프로세스들을 정리하는 등과 같은 다양한 유지 관리 작업을 수행 합니다. 3.사용자 프로세스 : User가 실행시킨 SQL문을 서버 프로세스에 전달 합니다. 사용자 프로세스(User Process) 사용자는 애플리케이션 프로그램(Pro*C등)이나 오라클 툴(..
테이블스페이스가 얼마나 사용중인지...알수있는방법 /* tablespace size현황 */ select a.tablespace_name name, sum(b.bytes)/count( distinct a.file_id||'.'||a.block_id ) bytes, sum(b.bytes)/count( distinct a.file_id||'.'||a.block_id ) - sum(a.bytes)/count( distinct b.file_id ) used, sum(a.bytes)/count( distinct b.file_id ) free, 100 * ( (sum(b.bytes)/count( distinct a.file_id||'.'||a.block_id )) - (sum(a.bytes)/count( distinct b.file_id ) )) / (sum(b...
Oracle Database 10g의 응답시간 분석을 위한 새로운 기능 http://www.oracle.com/technology/global/kr/pub/articles/schumacher_analysis.html http://www.oracle.com/technology/global/kr/pub/articles/schumacher_analysis.html 오라클 DBA와 성능 분석 담당자들은 데이타베이스의 성능을 극대화하기 위해, 시스템과 사용자 세션에 관련한 정확한 응답시간 메트릭(metric)을 얻기 위해 고군분투해 왔습니다. DBA는 크게 두 가지 측면에서 어려움을 겪곤 합니다. 먼저, 데이타베이스 또는 사용자 세션이 "어디"에 시간을 사용했는지 확인하는 문제, 두 번째로 사용자의 실제 경험을 객관적으로 평가하는 문제가 그것입니다. 데이타베이스 내부작업 및 상호작용..
DBA 유용한 정보 1. DISK READ가 과도한 SQL문 shared_pool_size가 작거나 sql문장의 튜닝이 안되어 disk가 read가 많은 sql문을 찾는다. select disk_reads, sql_text from v$sqlarea where disk_reads > 10000 order by disk_reads desc 2. 주요 MEMORY 사용 내역 --DB의 주요 메모리 사용을 보여준다. DB가 사용하는 메모리는 v7.3의 경우 OS메모리의 2/5 를, --v8.x 버젼의 경우 1/2 정도를 할당해 주는 것이 좋다. select name, value from v$parameter where name in('db_block_buffers','db_block_size','shared_pool_size',..
TABLESPACE 사용량 CHECK select substr(t_tablespace_name ,1,22) as TABLESPACE_NAME, round(t_total_size/1024/1024) as TOTAL_SIZE, lpad(round((t_total_size-f_free_size)/1024/1024),6,' ')||'('||lpad(round((1-f_free_size/t_total_size)*100,.999),3,' ')||'%)' as USED, lpad(round(f_free_size/1024/1024),6,' ')||'('||lpad(round(f_free_size/t_total_size*100,.999),3,' ')||'%)' as FREE, trunc(f_max_size/1024/1024) as MAX_FREE, trun..