In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Use testdb
Go
If object_id ('tempdb.dbo.#tablespaceinfo','U') is not null
Drop table # tablespaceinfo
Create table # tablespaceinfo (
Nameinfo varchar (555)
Rowsinfo bigint
Reserved varchar (255)
Datainfo varchar (255)
Index_size varchar (255)
Unused varchar (255)
)
DECLARE @ tablename varchar
DECLARE Info_cursor CURSOR FOR
SELECT [name] FROM sys.tables WHERE type='U'
OPEN Info_cursor
FETCH NEXT FROM Info_cursor INTO @ tablename
WHILE @ @ FETCH_STATUS = 0
BEGIN
Insert into # tablespaceinfo exec sp_spaceused @ tablename
FETCH NEXT FROM Info_cursor
INTO @ tablename
END
CLOSE Info_cursor
DEALLOCATE Info_cursor
If object_id ('tempdb.dbo.#tab','U') is not null
Drop table # tab
SELECT
Nameinfo
, rowsinfo
, cast (replace (reserved,' KB','') as bigint) / 1024 "reserved (MB)"
, cast (replace (datainfo,' KB','') as bigint) / 1024 "datainfo (MB)"
, cast (replace (index_size,' KB','') as bigint) / 1024 "index_size (MB)"
, cast (replace (unused,' KB','') as bigint) / 1024 "unused (MB)"
Into # tab
FROM # tablespaceinfo
ORDER BY Cast (Replace (reserved,'KB','') as INT) DESC
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.