본문 바로가기

다른 DBMS99

쿼리를 활용하여 Mysql Uptime 확인하기 쿼리를 활용하여 Update을 확인하는 글입니다. 1.Uptime 확인 show status 쿼리를 활용하여 Uptime을 확인합니다. 초형식으로 되어있으므로 가공이 필요합니다. show status like '%uptime%' Variable_name |Value | -------------------------+------+ Uptime |526090| Uptime_since_flush_status|526090| 2. sec_to_time 쿼리를 활용하여 open 후 현재까지 얼마나 지났는지 확인 select TIME_FORMAT(SEC_TO_TIME(526090 ),'%Hh %im') as Uptime from dual Uptime | --------+ 146h 19m| 끝. 2024. 4. 1.
vacuum 과 vacuum full 차이 보기 (pageinspect extention 사용) 지난시간에 제가 설치하려고 했던 extension입니다. 이걸 사용해서 vacuum과 vacuum full 했을때 어떤 차이가 있는지 확인해보겠습니다. 테스트 테이블 data 컬럼하나만 있는 tbl1을 생성하고 A 하나를 insert합니다. postgres=# create table tbl1 (data text); CREATE TABLE postgres=*# insert into tbl1 values ('A'); INSERT 0 1 확인 postgres=# SELECT lp as tuple, t_xmin, t_xmax, t_field3 as t_cid, t_ctid postgres-# FROM heap_page_items( get_raw_page('tbl1',0)) ; tuple | t_xmin | t_.. 2024. 3. 31.
postgres extention contrib 확장팩 설치 extention을 설치하려고 보니 에러가 발생해서 몇시간의 삽질 끝에... 찾아내서 공유드립니다. 우선 저는 yum으로 pg를 설치하였고, 버전은 15.5 입니다. 최초 에러. postgres=# CREATE EXTENSION pageinspect ; ERROR: extension "pageinspect" is not available DETAIL: Could not open extension control file "/usr/pgsql-15/share/extens/pageinspect.control": No such file or directory. HINT: The extension must first be installed on the system where PostgreSQs running. 해.. 2024. 3. 30.
테이블 관리(file-per-table와 테이블스페이스) 출처 : https://dev.mysql.com/doc/refman/8.0/en/innodb-file-per-table-tablespaces.html https://dev.mysql.com/doc/refman/8.0/en/general-tablespaces.html Mysql은 기본적으로 database라고 불리는 영역이 존재하고 그 내부에 테이블들이 존재합니다.(engine = InnoDB 기준) DB : mysql 5.7.43 mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | | ysbae |.. 2024. 1. 5.