1、使用系統性能監視器監視當前SQL的工作性能(控制面板-->管理工具-->性能)可以查看SQL對磁碟、內存的總體佔用
2、使用SQL 性能監視器(SQL Profiler)可以查看SQL 的執行事件,讀寫次數,起始和結束事件等等,可以保存死鎖圖形。
② SQL SERVER裡面如何查看一個表已經占據的容量
用如下方法查看(以sqlserver2008r2為例):
1、登錄SQL Server Managment Studio。
2、在左側的樹中找到要查詢的表名,如dbo.dept表。
③ 如何查看mysql資料庫的數據量
在mysql中,每個資料庫最多可創建20億個表,一個表允許定義1024列,每行的最大長度為8092位元組(不包括文本和圖像類型的長度)。當表中定義有varchar、nvarchar或varbinary類型列時,如果向表中插入的數據行超過8092位元組時將導致transact-sql語句失敗,並產生錯誤信息。sql
server對每個表中行的數量沒有直接限制,但它受資料庫存儲空間的限制。每個資料庫的最大空間1048516tb,所以一個表可用的最大空間為1048516tb減去資料庫類系統表和其它資料庫對象所佔用的空間。
④ 如何查看SQL2000資料庫中所有表的數據量大小
直接在查詢分析器運行即可:
declare @id int
declare @type character(2)
declare @pages
int
declare @dbname sysname
declare @dbsize dec(15,0)
declare @bytesperpage dec(15,0)
declare @pagesperMB dec(15,0)
create table #spt_space
(
objid int null,
rows int null,
reserved dec(15) null,
data dec(15) null,
indexp dec(15) null,
unused dec(15) null
)
set nocount on
-- Create a cursor to loop through the user tables
declare c_tables cursor for
select id
from sysobjects
where xtype = 'U'
open c_tables
fetch next from c_tables
into @id
while @@fetch_status = 0
begin
/* Code from sp_spaceused */
insert into #spt_space (objid, reserved)
select objid = @id, sum(reserved)
from sysindexes
where indid in (0, 1, 255)
and id = @id
select @pages = sum(dpages)
from sysindexes
where indid < 2
and id = @id
select @pages = @pages + isnull(sum(used), 0)
from sysindexes
where indid = 255
and id = @id
update #spt_space
set data = @pages
where objid = @id
/* index: sum(used) where indid in (0, 1, 255) - data */
update #spt_space
set indexp = (select sum(used)
from sysindexes
where indid in (0, 1, 255)
and id = @id)
- data
where objid = @id
/* unused: sum(reserved) - sum(used) where indid in (0, 1, 255) */
update #spt_space
set unused = reserved
- (select sum(used)
from sysindexes
where indid in (0, 1, 255)
and id = @id)
where objid = @id
update #spt_space
set rows = i.rows
from sysindexes i
where i.indid < 2
and i.id = @id
and objid = @id
fetch next from c_tables
into @id
end
select TableName = (select left(name,60) from sysobjects where id = objid),
Rows = convert(char(11), rows),
ReservedKB = ltrim(str(reserved * d.low / 1024.,15,0) + ' ' + 'KB'),
DataKB = ltrim(str(data * d.low / 1024.,15,0) + ' ' + 'KB'),
IndexSizeKB = ltrim(str(indexp * d.low / 1024.,15,0) + ' ' + 'KB'),
UnusedKB = ltrim(str(unused * d.low / 1024.,15,0) + ' ' + 'KB')
from #spt_space, master.dbo.spt_values d
where d.number = 1
and d.type = 'E'
order by reserved desc
drop table #spt_space
close c_tables
deallocate c_tables
⑤ 如何使用SQL語句查詢資料庫及表的空間容量
--1、查看錶空間的名稱及大小
select
t.tablespace_name,
round(sum(bytes/(1024*1024)),0)
ts_size
from
dba_tablespaces
t,
dba_data_files
d
where
t.tablespace_name
=
d.tablespace_name
group
by
t.tablespace_name;
--2、查看錶空間物理文件的名稱及大小
select
tablespace_name,
file_id,
file_name,
round(bytes/(1024*1024),0)
total_space
from
dba_data_files
order
by
tablespace_name;
3.查看所有表空間使用情況
select
b.file_id
文件ID號,
b.tablespace_name
表空間名,
b.bytes/1024/1024||'M'位元組數,
(b.bytes-sum(nvl(a.bytes,0)))/1024/1024||'M'
已使用,
sum(nvl(a.bytes,0))/1024/1024||'M'
剩餘空間,
round(100
-
sum(nvl(a.bytes,0))/(b.bytes)*100,2)||
'%'
佔用百分比
from
dba_free_space
a,dba_data_files
b
where
a.file_id=b.file_id
group
by
b.tablespace_name,b.file_id,b.bytes
order
by
b.file_id;
總有一款適合你!
⑥ 怎麼查看oracle資料庫數據量大小
查看方法:
1、查看所有表空間及表空間大小:
select tablespace_name ,sum(bytes) / 1024 / 1024 as MBfrom dba_data_files group by tablespace_name;
2、查看所有表空間對應的數據文件:
select tablespace_name,file_name from dba_data_files;
3、修改數據文件大小:
alter database datafile 'H:ORACLEPRODUCT10.1.0ORADATAORACLEUSERS01.DBF' RESIZE 10240M;
(6)sql資料庫的存儲量在哪看擴展閱讀
每張表都是作為「段」來存儲的,可以通過user_segments視圖查看其相應信息。
段(segments)的定義:如果創建一個堆組織表,則該表就是一個段。
sql:SELECT segment_name AS TABLENAME,BYTES FROM user_segments WHERE segment_name='表名'。
解釋:
segment_name 就是要查詢的表名(大寫),BYTES 為表存儲所佔用的位元組數。本sql的意思就是查詢出表名和表所佔的存儲空間大小。
⑦ sql資料庫的數據在哪能看到
確定資料庫已在sql伺服器上運行,然後打開企業管理器,打開資料庫,打開Tables,點擊你想查看的那個表,右鍵-打開表-返回所有行;如果是英文版的就:右鍵-open table-return all rows
⑧ 如何查看一條數據所佔據空間的大小
學過電腦都知道,一個字元佔用2個位元組。
1TB=1024GB
1GB=1024MB
1MB=1024KB
1KB=1024B
1位元組=1B
1個漢字=2B
1個大寫字母或小寫字母=1B
標點符號英文狀態下為1B,中文全形為2B。
那你算吧,一條信息有多少字量。
⑨ 如何查看sql server 資料庫大小
在MS Sql Server中可以能過以下的方法查詢出磁碟空間的使用情況及各資料庫數據文件及日誌文件的大小及使用利用率:
1、查詢各個磁碟分區的剩餘空間:
Exec master.dbo.xp_fixeddrives
2、查詢資料庫的數據文件及日誌文件的相關信息(包括文件組、當前文件大小、文件最大值、文件增長設置、文件邏輯名、文件路徑等)
select * from [資料庫名].[dbo].[sysfiles]
轉換文件大小單位為MB:
select name, convert(float,size) * (8192.0/1024.0)/1024. from [資料庫名].dbo.sysfiles
3、查詢當前資料庫的磁碟使用情況:
Exec sp_spaceused
4、查詢資料庫伺服器各資料庫日誌文件的大小及利用率
DBCC SQLPERF(LOGSPACE)