Non standard block size 를 사용하는 tablespace 생성과 삭제
>명령어
>select name, bytes
from v$sgastat
where name like '%buffer%'
and pool is null;
-Database buffer cache나 redo log buffer 의 크기를 확인.
>select pool, sum(bytes)
from v$sgastat
where pool is not null
group by pool;
-Shared pool, Large pool, java poll의 크기를 확인.
>select name, block_size, buffers, buffers*block_size as "SIZE"
from v$buffer_pool;
-다양한 Database buffer cache의 상태를 확인.
>CREATE TABLESPACE <tablespace명>
DATAFILE '<data file>' SIZE <크기>
BLOCKSIZE <크기>;
-BlockSize에 지정된 크기의 block size를 갖는 tablespace를 생성.
------------------------------------------------------------
>show parameter db_block_size;
-Standard block size
>select tablespace_name, block_size
from dba_tablespaces;
-각 tablespace 별 block 크기를 확인
>show sga;
-sga영역 조회
>show parameter sga_
>show parameter cache_size
-사용하지 않는 캐쉬 사이즈는 자동으로 관리 되지 않음
>select pool, sum(bytes)
from v$sgastat
where pool is not null
group by pool;
-SGA 내에 여러 pool size 크기 확인
>select name, bytes
from v$sgastat
where name like '%buffer%'
and pool is null;
-Database Buffer Cache , Redo Log Buffer 크기 조회
>select name, block_size, buffers, buffers*block_size as "SIZE"
from v$buffer_pool;
-현재 buffer cache에는 8k block size인 buffer cache만 존재.
---16k block size를 가진 테이블 스페이스 create 명령했지만 오류가 난다.
왜냐면 16k buffer cache가 존재하지 않기 때문이다.
>alter system set db_16k_cache_size =16M;
-16k block 크기의 buffer cache를 설정.
>show parameter cache_size;
-db_16k_cache_size가 16M로 할당 되었음을 확인
>select name, block_size, buffers, buffers*block_size as "SIZE"
from v$buffer_pool;
-Buffer cache 조회
>create tablespace imsy
datafile '/app/ora11g/oradata/DISK1/imsy01.dbf' size 5M
blocksize 16k;
-16k block size tablespace를 생성.
>select tablespace_name, block_size
from dba_tablespaces
order by 1;
-table space 조회 _ 16k block 사이즈를 가진 tablespace 확인
>select tablespace_name, bytes, file_name
from dba_data_files;
-테이블 스페이스, 크기, datafile 경로 조회
>alter system set db_16k_cache_size=0M;
>select tablespace_name, bytes, file_name
from dba_data_files;
-9i에서는 발생한다. 11g에서는 16k block 크기를 사용하는 tablespace가 사용할 수 없게 됨.
-Open 상태이기는 하지만 dba_data_file 조회 할 수 없음.
>select t.name talbespace_name, d.bytes, d.name file_name
from v$tablespace t, v$datafile d
where t.ts#=d.ts#
order by 1;
-dynamic performance view 조회
>create table imsy(no number) tablespace imsy;
-imsy tablespace를 사용 할 수 없다.
>drop table space imsy
-imsy tablespace 삭제 /
* 바람직한 케이스 tablespace 삭제 -> buffer cache 삭제 :
>imsy01.dbf 파일 삭제
-삭제 후 조회