专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Sybase

请教sysbase中 sp_extendsegment 和 alterbase 有什么不同

发布时间:2010-05-20 14:01:29 文章来源:www.iduyao.cn 采编人员:星星草
请问sysbase中 sp_extendsegment 和 alterbase 有什么不同?
我知道sp_extendsegment 是将某个段扩到设备上,但是alterdabse不也有这个功能吗,而其在sp_extendsegment之前还需要先执行alterdatabase。
两者的用法到底是什么呢,有什么不同呢?请指教,谢谢。

------解决方案--------------------
alter database是将设备上的空间分配给数据库使用。
sp_extendsegement是对分配过来的数据设备空间进行分段规划。

只有先分来空间,才能进行下一步的规划!
------解决方案--------------------
参考标准:


Function
Extends the range of a segment to another database device.
Syntax
sp_extendsegment segname, dbname, devname
Parameters
segname - is the name of the existing segment previously defined with sp_addsegment.
dbname - is the name of the database on which to extend the segment. dbname must be the name of the current database.
devname - is the name of the database device to be added to the current database device range already included in segname.
Examples
1.sp_extendsegment indexes, pubs2, dev2
This command extends the range of the segment indexes for the database pubs2 on the database device dev2.
Comments
·After defining a segment, you can use it in the create table and create index commands to place the table or index on the segment. If you create a table or index on a particular segment, subsequent data for the table or index is located on that segment.
·To associate a segment with a database device, create or alter the database with a reference to that device. A database device can have more than one segment associated with it.
·A segment can be extended over several database devices.
·When you extend the logsegment segment, Adaptive Server recalculates its last-chance threshold.
Messages
·Can't run sp_extendsegment from within a transaction.
sp_extendsegment updates system tables, so it cannot be run from within a transaction.
·Device 'devname' is now exclusively used by 'segname'.
sp_extendsegment succeeded.
·'devname' is reserved exclusively as a log device.
You cannot create a segment on a database device that is dedicated to the database log.
·No such device exists -- run sp_helpdb to list the devices for the current database.
The named device does not exist in master.dbo.sysdevices.
·Segment extended.
sp_extendsegment succeeded. The segment named segname now includes space on the database device devname.
·'segname' is not a valid identifier.
Segment names must conform to the rules for identifiers. They must begin with a letter, an underscore character ( _ ), or a pound sign (#). After the first character, identifiers can include letters, underscores, pound signs, or dollar signs ($).
·The specified device is not used by the database.
Although the device named as the devname parameter exists in master.dbo.sysdevices, it is not used by the specified database. Segments can be extended only on database devices used by the database. Use alter database to extend a database on a device listed in the master.dbo.sysdevices table.
·There is no such segment as 'segname'.
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: