DBAtlas · 데이터베이스 운영 아틀라스

테이블 / 컬렉션 목록

Oracle

SELECT table_name FROM user_tables ORDER BY table_name;
-- All schemas: SELECT owner, table_name FROM dba_tables ORDER BY owner, table_name;

user_tables는 현재 스키마의 테이블을, all_tables는 접근 가능한 테이블을 반환한다.

PostgreSQL

SELECT table_schema, table_name
FROM information_schema.tables
WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog','information_schema')
ORDER BY 1, 2;
-- psql shortcut: \dt *.*

public 스키마만: WHERE table_schema = 'public'.

MySQL

SHOW TABLES;
-- Another schema: SHOW TABLES FROM mydb;

상세 정보: SELECT table_name, table_rows FROM information_schema.tables WHERE table_schema = DATABASE();

SQL Server

SELECT s.name AS schema_name, t.name AS table_name
FROM sys.tables t
JOIN sys.schemas s ON t.schema_id = s.schema_id
ORDER BY s.name, t.name;

간단한 방법: SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';

MongoDB

show collections
// or: db.getCollectionNames()

시스템 컬렉션도 보려면: db.getCollectionInfos().

Redis

SCAN 0 MATCH * COUNT 100
# Continue with SCAN <cursor> ... using the returned cursor

Redis에는 '테이블'이 없으며 키가 나열된다. 운영 환경에서 KEYS *는 절대 사용하지 않는다(블로킹 발생). SCAN은 커서 기반이다.

DBAtlas에서 열기 →