Tag Archives: database

T-SQL Rename Logical and Physical Database Files

I used to get really nervous about renaming database files, which I think is an appropriate response.  Changing the attributes of the database’s physical objects does sound a bit scary on the surface, but once you’ve done it a few times you’ll realize it’s easy to do, and easy to fix if you make a mistake.  This simple script template shows the basic steps of the process.


Get Database Sizes in PestgreSQL

Returns the database name, owner, and size on a given server.  Tested in PostgrSQL 9.2 and 9.3.

Source: https://wiki.postgresql.org/wiki/Disk_Usage