ShareChiWai Notes
ShareChiWai Notes
Home
Blog
Menu Venue
Event
Sharing
Contact
Light
Dark
Automatic
Database Maintenance
PostgresSQL database maintenance script
今日想同大家分享一個 PostgresSQL Database maintenance script 用來 reclaim 返 D space 解決方法: VACUUM (FULL, FREEZE, VERBOSE, ANALYZE, SKIP_LOCKED, INDEX_CLEANUP, TRUNCATE); hope you find it useful
Last updated on Feb 17, 2024
1 min read
PostgresSQL database import database backup from command
有時候個SQL script 太大.. 如果用 SQL editor 去 run 個 .sql file 好大機會 會crash 我地可以用 command 來 execute 呢個 .sql 我就用呢個方法去Restore database backup 解決方法: psql -h [`hostname`] -U [`username`] -d [`database_name`] -f [`sql_script.
Last updated on Feb 17, 2024
1 min read
Useful SQL command to reduce the size of the database
今日想和大家分享一個 幾有用的TSQL Command, 去 Release 返一些SQL Server 佔用的空間 Transaction log 和Database file -- select database USE Production; -- Change the recovery mode to SIMPLE, to clear the transaction log ALTER DATABASE Production SET RECOVERY SIMPLE ; -- shrink database to release space DBCC SHRINKDATABASE (Production, 1); Hope you find it useful
Last updated on Feb 17, 2024
1 min read
MSSQL Tips and Tricks
Cite
×