on 2014 Jan 23 12:02 PM
Hi folks,
I would like to know which command I use to know database physical size. In SQL Server I can use sp_helpdb ou sp_spaceused. Is there any command like these?
Also, any command to know the dbpsace allocated size and the file size.
Thanks! Roger
Request clarification before answering.
I don't know whether this is the easiest way for a running database, but you can calculate that with the database properties FileSize (number of database pages) and PageSize (size of a database page), say in MB - for the system dbspace (i.e. the database .db file):
select db_property('FileSize') * db_property('PageSize') / 1024 / 1024;
and accordingly for other dbspaces like the transaction log (.log):
select db_extended_property('FileSize', 'TransLog') * db_property('PageSize') / 1024 / 1024;
Note: This tells the whole size of these files, not the "used space" vs. free space. There are other properties for that, or the DBINFO utility.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
52 | |
10 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.