Para listar as maiores tabelas do seu banco de dados, utilize a consulta abaixo:
Fonte: http://swebber.me/blog/2013/01/listando-as-10-maiores-tabelas-no-postgresql/
Conteúdo do cotidiano e gratuito de tecnologia em Banco de dados, Servidores Windows, Linux, BSD e Desenvolvimento em PL/SQL.
|
SELECT esquema, tabela, pg_size_pretty(pg_relation_size(esq_tab)) AS tamanho, pg_size_pretty(pg_total_relation_size(esq_tab)) AS tamanho_total FROM (SELECT tablename AS tabela, schemaname AS esquema, schemaname||'.'||tablename AS esq_tab FROM pg_catalog.pg_tables WHERE schemaname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') ) AS x ORDER BY pg_total_relation_size(esq_tab) DESC;
Name
|
Value
|
Processes
|
3000
|
Sessions
|
3022
|
Transactions
|
Name
|
Value
|
Processes
|
3000
|
Sessions
|
4536
|
Transactions
|
4989
|
-- Selecionamos a MASTER para nao manter a sessao presa em nossa base USE master GO -- Comando de backup comum BACKUP DATABASE [AdventureWorks2008] TO DISK = 'D:\Backups_SQL2008\AdventureWorks2008.bak' WITH NAME = N'Backup Completo da base AdventureWorks2008', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO
|
-- Selecionamos a MASTER para nao manter a sessao presa em nossa base USE master GO -- Comando de backup comum com saida para 4 arquivos BACKUP DATABASE [AdventureWorks2008] TO DISK = 'D:\Backup_SQL2008\AdventureWorks2008_01.bak' , DISK = 'D:\Backup_SQL2008\AdventureWorks2008_02.bak' , DISK = 'D:\Backup_SQL2008\AdventureWorks2008_03.bak' , DISK = 'D:\Backup_SQL2008\AdventureWorks2008_04.bak' WITH NAME = N'Backup Completo da base AdventureWorks2008', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO
|