sp_iqdbspaceinfo 过程
显示在指定表中使用的每个对象和子对象的大小。这不受 RLV dbspace 支持。
语法
sp_iqdbspaceinfo [ ] [, ] [, ] [, ] 参数
所有参数均为可选参数,并且任何参数的提供均不受其它参数值的影响。
- dbspace_name如果指定,则 sp_iqdbspaceinfo 显示在指定的
dbspace中有任何组件的每个表的一行。否则,该过程显示数据库中所有dbspace的信息。
- owner_name对象的所有者。如果指定,sp_iqdbspaceinfo 将仅显示包含指定所有者的那些表的输出。如果未指定,sp_iqdbspaceinfo 显示数据库中所有用户的表的相关信息。
- object_name表名。如果未指定,sp_iqdbspaceinfo 显示数据库中所有表的相关信息。
- object_type有效的
table对象。sp_iqdbspaceinfo 存储过程支持用于解释
、 和 的通配符。它以 LIKE子句匹配查询内部模式的方式显示匹配指定模式的所有dbspace的信息。适用于
SAP IQ 服务器和
Multiplex。特权
您必须具有系统过程的 EXECUTE 特权。 您还必须具有以下其中一种系统特权:
BACKUPDATABASE
- SERVER OPERATOR
- MANAGE ANY
DBSPACE注释
如果指定
RLVdbspace,该过程将不返回任何结果。sp_iqdbspaceinfo 向 DBA 显示各个
dbspace中驻留的对象所占用的空间大小。DBA 可利用这些信息确定必须先重新定位哪些对象,然后才能删除dbspace。子对象列以整数后跟后缀 B、K、M、G、T 或 P(分别表示字节、千字节、兆字节、千兆字节、千吉字节和千万亿字节)的形式显示报告的大小。对于表,sp_iqdbspaceinfo 显示所有子对象的大小信息(以整数加上后缀 B、K、M、G、T 或 P 的形式表示),按
、 和 排序。 sp_iqdbspaceinfo 过程返回:
列名说明dbspace_namedbspace 的名称。object_type对象的类型(仅限于
table或 joinindex)。 owner对象所有者的名称。object_namedbspace 中对象的名称。object_id对象的全局对象 ID。id对象的表 ID。columns给定dbspace上的列存储空间大小。indexes给定dbspace上的索引存储空间大小。不要使用系统生成的索引(例如,唯一约束中的 HG 索引或 FP 索引)。metadata给定dbspace上元数据对象的存储空间大小。primary_key给定dbspace上主键相关对象的存储空间大小。unique_constraint给定dbspace上唯一约束相关对象的存储空间大小。foreign_key给定dbspace上外键相关对象的存储空间大小。dbspace_online表示dbspace是处于联机状态 (Y) 还是脱机状态 (N)。is_dbspace_preallocate“F”表示在成熟(不是原始)的文件系统中创建dbspace时,CREATEDBSPACE语句使用 NOPREALLOCATE 关键字;否则为“T”(缺省)。 如果对使用 -r 开关(只读)启动的服务器运行 sp_iqdbspaceinfo,将显示错误 Msg 13768, Level 14, State 0: SAP SQL Anywhere Error -757: Modifications
notpermittedforread-onlydatabase。此行为是预期行为。其它存储过程(例如 sp_iqdbspace、sp_iqfile、sp_iqdbspaceobjectinfo 或 sp_iqobjectinfo)上不发生此错误。示例
注意以下示例将显示 iqdemo 数据库中的对象,以便更好地阐释输出。iqdemo 包括一个名为 iq_main 的用户
dbspace示例,您自己的数据库中可能不存在该示例。 显示数据库所有dbspace内的所有表中的所有对象和子对象的大小:sp_iqdbspaceinfodbspace_name object_type owner object_name object_id id columnsiq_main table DBA emp1 3689 741 96K
iq_main table DBA iq_dummy 3686 740 24K
iq_main table DBA sale 3698 742 96K
iq_main table GROUPO Contacts 3538 732 288K
iq_main table GROUPO Customers 3515 731 240K
iq_main table GROUPO Departments 3632 738 72K
iq_main table GROUPO Employees 3641 739 408K
iq_main table GROUPO FinancialCodes 3612 736 72K
iq_main table GROUPO FinancialData 3621 737 96K
iq_main table GROUPO Products 3593 735 272K
iq_main table GROUPO SalesOrderItems 3580 734 120K
iq_main table GROUPO SalesOrders 3565 733 144K
indexes metadata primary_key unique_constraint foreign_key dbspace_online is_dbspace_preallocate
0B 1.37M 0B 0B 0B Y T
0B 464K 0B 0B 0B Y T
0B 1.22M 0B 0B 0B Y T
0B 5.45M 24K 0B 48K Y T
48K 4.63M 24K 0B 0B Y T
0B 1.78M 24K 0B 48K Y T
0B 8.03M 24K 0B 48K Y T
0B 1.53M 24K 0B 0B Y T
0B 2.19M 24K 0B 48K Y T
192K 4.67M 24K 0B 0B Y T
0B 2.7M 24K 0B 104K Y T
0B 3.35M 24K 0B 144K Y T
显示数据库指定
dbspace内由指定用户拥有的所有对象和子对象的大小:sp_iqdbspaceinfo iq_main,GROUPOdbspace_name object_type owner object_name object_id id columnsiq_main table GROUPO Contacts 3538 732 288K
iq_main table GROUPO Customers 3515 731 240K
iq_main table GROUPO Departments 3632 738 72K
iq_main table GROUPO Employees 3641 739 408K
iq_main table GROUPO FinancialCodes 3612 736 72K
iq_main table GROUPO FinancialData 3621 737 96K
iq_main table GROUPO Products 3593 735 272K
iq_main table GROUPO SalesOrderItems 3580 734 120K
iq_main table GROUPO SalesOrders 3565 733 144K
indexes metadata primary_key unique_constraint foreign_key dbspace_online is_dbspace_preallocate
0B 5.45M 24K 0B 48K Y T
48K 4.63M 24K 0B 0B Y T
0B 1.78M 24K 0B 48K Y T
0B 8.03M 24K 0B 48K Y T
0B 1.53M 24K 0B 0B Y T
0B 2.19M 24K 0B 48K Y T
192K 4.67M 24K 0B 0B Y T
0B 2.7M 24K 0B 104K Y T
0B 3.35M 24K 0B 144K Y T
显示数据库中指定的
dbspace内由指定用户拥有的指定对象及其子对象的大小:sp_iqdbspaceinfo iq_main,GROUPO,Departmentsdbspace_name object_type owner object_name object_id id columnsiq_main table GROUPO Departments 3632 738 72K
indexes metadata primary_key unique_constraint foreign_key dbspace_online is_dbspace_preallocate
0B 1.78M 24K 0B 48K Y T