운영 중 이력테이블의 사이즈가 커져서 RDS용량 증가 문제 발생.문제해결방안으로 파티션테이블로 만들고 오래된 하위테이블은 S3로 백업 후 삭제. 1. 파티션 테이블 생성CREATE TABLE IF NOT EXISTS change_history_p( history_sn bigint NOT NULL DEFAULT nextval('change_history_p_history_sn_seq'::regclass), ... change_dt timestamp with time zone NOT NULL) PARTITION BY RANGE (change_dt);2. 하위테이블 생성CREATE TABLE change_history_p_y202305 PARTITION OF change_history_p FO..
select schemaname ,relname as "Table" ,pg_size_pretty(pg_total_relation_size(relid)) as "size" ,pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as "external size" ,now() from pg_catalog.pg_statio_user_tables where 1=1 order by schemaname,pg_total_relation_size(relid) desc;
postgresql에서 대량 이관 작업시 auto vacuum이 켜져 있으면 이관중에 vacuum이 실행되는 문제가 발생하여 이관이 오래 걸림. 대상 테이블 autovacuum 끄기 select 'alter table '||table_schema||'.'||table_name||' set (autovacuum_enabled=false);'from information_schema.tableswhere table_schema = '스키마명' and table_name = '테이블명'; 대상 테이블 autovacuum 다시 켜기select 'alter table '||table_schema||'.'||table_name||' set (autovacuum_enabled=true);' from informati..
- Total
- Today
- Yesterday
- MS-SQL
- Flashback
- query 잘림
- Managing Schema Objects
- 오라클
- 인덱스
- index
- 아이폰
- 한글
- 아이폰4
- postgresql jsonb index
- recovery
- SQLPlus
- parameter
- 독도
- iPhone
- Backup
- 갤럭시S
- 윈도우
- PL/SQL
- tablespace
- 투싼
- linux
- postgresql pg_stat_activity
- iOS5
- PostgreSQL
- oracle
- 리눅스
- 출시일
- postgresql jsonb