1. What is the database size?
Exec sp_helpdb
Select * From sysfiles
2. query a database space
Use dbname
Sp_spaceused
3. query a tablespace
Sp_spaceused tablename
4. view the log file content
DBCC log (dbname, type = 4)
Syntax:
DBCC log ({dbid | dbname}, [, type = {-1 | 0 | 1 | 2 | 3 | 4}])
Parameters:
Dbid or dbname-enter either the dbid or the name of the database
In question.
Type-is the type of output:
0-minimum information (operation, context, transaction ID)
1-more information (plus flags, tags, row length, description)
2-very detailed information (plus Object Name, index name,
Page ID, slot ID)
3-full information about each operation
4-full information about each operation plus hexadecimal dump
Of the current transaction log's row.
-1-full information about each operation plus hexadecimal dump
Of the current transaction log's row, plus checkpoint begin,
DB version, Max xdesid
By default type = 0
To view the transaction log for the master database, you can run
Following command:
DBCC log (master)