存档
在Sybase ASE中isql是个小巧而灵活的命令行实用工具。本人非常喜欢用这个工具,无论备份恢复、创建大到数据库小到表索引、配置参数、查看数据库的监控信息、 分析dbcc的命令结果等等我都喜欢用isql来实现。有些用图形界面工具能够实现的功能,我都揣摩如何用命令来实现的,因为在ASE中所有用图形界面能 够实现的功能操作都是可以用命令来完成的(当然图形工具还不能实现的地方太多)。我几乎不用sybase central,感觉这个工具既难用还低级简单。
下面介绍isql工具的使用方法。
呵呵,一些简单的命令参数我就不在这赘述了。我想每个sybase DBA对isql应该再熟悉不过了。今天我仅仅介绍几个本人自认为不太常用但是又比较实用的命令参数。
首先,查看一下isql这个工具都有哪些参数。
可能大家都知道在windows下用程序文件名称后面加空格再加上/? 来查看命令帮助。但是,对isql不能这么用。需要输入isql --help,如下图显示结果(有省略)
C:\Documents and Settings\Administrator>isql --help
usage: isql [option1] [option2] ... where [options] are ...
-b Disables the display of the table headers output.
-e Echoes input.
-F Enables the FIPS flagger.
-p Prints performance statistics.
-n Removes numbering and the prompt symbol when used with -e.
-v Prints the version number and copyright message.
-W Turn off extended password encryption on connection retries.
-X Initiates the login connection to the server with client-side
password encryption.
-Y Tells the Adaptive Server to use chained transactions.
-Q Enables the HAFAILOVER property.
如果输入 isql --h ,则返回简化版的命令参数。
C:\Documents and Settings\Administrator>isql --h
Syntax Error in '--h'.
usage: isql [-b] [-e] [-F] [-p] [-n] [-v] [-W] [-X] [-Y] [-Q]
[-a display_charset] [-A packet_size] [-c cmdend] [-D database]
[-E editor] [-h header] [-H hostname] [-i inputfile]
[-I interfaces_file] [-J client_charset] [-K keytab_file]
[-l login_timeout] [-m errorlevel] [-M labelname labelvalue]
[-o outputfile] [-P password] [-R remote_server_principal]
[-s col_separator] [-S server_name] [-t timeout] [-U username]
[-V [security_options]] [-w column_width] [-y sybase directory]
[-z localename] [-Z security_mechanism] [-x trusted.txt_file]
[--retserverror] [--conceal [wildcard]] [--help]
今天仅介绍 -b, -e, -n,-E,-s,-w这六个参数的使用情况。
(1) 对于-b,命令参数的解释为:Disables the display of the table headers output。也就是不显示表的标题行。
如下面代码所示:
C:\Documents and Settings\Administrator>isql -Usa -Stest -b -Dandkylee
Password:
1> select * from testa
2> go
1 aaaaaa
2 bbbbbb
3 ccccccc
(3 rows affected)
(2) 对于参数-e 和 -n ,-n要依附于-e来使用。
-e 表示Echoes input,也就是回显sql语句。
-n 表示Removes numbering and the prompt symbol when used with -e,也就是不显示sql语句前面的行号。
-e的用法如下:
C:\Documents and Settings\Administrator>isql -Usa -Stest -e -Dandkylee
Password:
1> select db_name()
2> go
1> select db_name()
------------------------------
andkylee
(1 row affected)
1> select * from testa
2> go
1> select * from testa
id name
----------- ------------------------------
1 aaaaaa
2 bbbbbb
3 ccccccc
(3 rows affected)
-e 和 -n 的联合用法如下:
C:\Documents and Settings\Administrator>isql -Usa -Stest -e -n -Dandkylee
Password:
select db_name()
go
select db_name()
------------------------------
andkylee
(1 row affected)
select * from testa
go
select * from testa
id name
----------- ------------------------------
1 aaaaaa
2 bbbbbb
3 ccccccc
(3 rows affected)
这时候你可能在怀疑了,上面我都输入了sql语句,我还要在返回结果中回显刚才输入的sql语句干什么?
的确,这个地方不是-e的应用场景。如果你用isql执行一个sql文件,并想把返回的结果保存到一个文件中,那么这个时候-e就有用处了。isql会在每个sql语句的执行结果前面加上相应的sql语句,这样看起来就很方便了。
简单举个例子:
假设有d:\test_isql.txt,里面的内容为:
select db_name()
go
select * from testa
go
我执行如下的命令参数:isql -Usa -P -Stest -Dandkylee -e -id:\test_isql.txt -od:\test_isql_result.txt
查看d:\test_isql_result.txt的文件内容为:
1> select db_name()
------------------------------
andkylee
(1 row affected)
1> select * from testa
id name
----------- ------------------------------
1 aaaaaa
2 bbbbbb
3 ccccccc
(3 rows affected)
对每个语句的执行结果一目了然,非常直观。
(3) -E 参数的使用
-E editor的意思是:Specifies an editor other than the default editor vi,也就是你可以指定一个文本编辑器用来在isql会话过程中编辑sql语句。这一点和sqlplusw中的ed命令是一模一样的。
多说一点,通过other than the default editor vi字面意思就可以看出,windows下的isql和unix下的isql有点不同。unix的isql下默认就可以使用vi进行编辑sql语句,但是 windows上的isql必须手动指定文本编辑器才能够使用这个功能。
C:\Documents and Settings\Administrator>isql -Usa -Stest -Enotepad -Dandkylee
Password:
1> notepad
[sh:notepad D:\PROGRA~1\ADMINI~1\LOCALS~1\Temp\cti9CE.tmp]
1> select db_name()
2> go
3> reset
1> notepad
[sh:notepad D:\PROGRA~1\ADMINI~1\LOCALS~1\Temp\cti9CE.tmp]
1> select db_name()
2> go
------------------------------
andkylee
(1 row affected)
使用方法是在isql的连接参数中加上-Enotepad(或者其它的文本编辑器,如notepad2,editlus都行,只要在win+R中能够成功执行的都可以!)
然后在提示符下输入notepad加上回车,就会弹出一个记事本让你进行编辑sql语句。这样是不是很方便,尤其在执行很长的sql语句的时候。哪 怕输错一点点都要reset再重新输入一遍。 这样就可以在文本编辑器中编辑好了再去执行了。(呵呵,可能你会说? 不能在记事本中编辑好了直接复制粘贴到isql下执行吗?当然可以! )
另外需着重注意一点,在文本编辑器中编辑的sql语句不能带有go,大家可以在我上面的演示代码中看出这一点。这个苛刻的要求就限制了我们不能在文本编辑器中输入多个sql语句命令。只能一个一个得来。
(4) 再来介绍今天的最后两个参数 -s -w, 我也是最近才开始使用这个参数-s的。感觉挺好。
-s col_separator的意思是:Resets the column separator character, which is blank by default,也就是说,你可以重新指定新的列分割符来替代默认的空格分隔符。
-w column_width 的意思是:Sets the screen width for output,也就是说,你可以指定屏幕的显示宽度(是像素还是字节,我没搞清楚)。
我把这两个参数放在一起使用,感觉效果很不错。请看下面的显示结果:
C:\Documents and Settings\Administrator>isql -Usa -Stest -Enotepad -s"|" -w5000
Password:
1> use andkylee
2> go
1> select * from test
2> go
|id |name |net_type|colc |COLD|COLE|
|-----------|------------------------------|--------|----------|----|----|
| 1|liu |NULL |1 |NULL|NULL|
| 1|liu |NULL |1 |NULL|NULL|
| 2|zhang |NULL |1 |NULL|NULL|
| 3|邓啟中 |1 |1 |NULL|0 |
(4 rows affected)
1>
在这里我把列分割符替换成了|,显示出来的效果如上。 是不是有点类似mysql的显示效果?我把屏幕的宽度设置成了-w5000。同时需要注意的是:你也需要把cmd的屏幕宽度设置大些。在命令提示符cmd 的属性里选择布局,调整屏幕缓冲区里面的宽度。这样就会显示类似上面的效果了。
执行一个字段多点的表,看看效果吧!
1> select * from sysobjects
2> where id< 20
3> go
|name |id |uid |type|userstat|sysstat|indexdel|schemacnt|sysstat2 |crdate |expdate |deltrig |instrig |updtrig |seltrig |ckfirst |cache |audflags |objspare |versionts |loginame |identburnmax |spacestate|erlchgts |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|-----------|----|--------|-------|--------|---------|-----------|--------------------------|--------------------------|-----------|-----------|-----------|-----------|-----------|------|-----------|-----------|--------------------------|------------------------------|-----------------------------------------|----------|------------------|
|sysobjects | 1| 1|S | 0| 97| 1| 0| 229376| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysindexes | 2| 1|S | 0| 97| 0| 0| 229376| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|syscolumns | 3| 1|S | 0| 97| 0| 0| 229376| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|systypes | 4| 1|S | 0| 97| 1| 0| 229376| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysprocedures | 5| 1|S | 0| 97| 1| 0| 229376| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|syscomments | 6| 1|S | 0| 97| 1| 0| 229376| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|syssegments | 7| 1|S | 0| 65| 0| 0| 98304| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|syslogs | 8| 1|S | 0| 1| 0| 0| 73728| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| NULL|NULL |
|sysprotects | 9| 1|S | 0| 97| 1| 0| 229376| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysusers | 10| 1|S | 0| 97| 3| 0| 229376| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysalternates | 11| 1|S | 0| 97| 1| 0| 229888| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysdepends | 12| 1|S | 0| 97| 1| 0| 229376| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|syskeys | 13| 1|S | 0| 97| 1| 0| 229376| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysgams | 14| 1|S | 0| 1| 0| 0| 73728| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| NULL|NULL |
|sysusermessages | 15| 1|S | 0| 113| 2| 0| 73728| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| NULL|NULL |
|sysreferences | 16| 1|S | 0| 97| 3| 0| 229376| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysconstraints | 17| 1|S | 0| 97| 2| 0| 229888| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|systhresholds | 18| 1|S | 0| 65| 0| 0| 98304| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysroles | 19| 1|S | 0| 97| 1| 0| 229888| Dec 2 2009 6:58PM| Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
(19 rows affected)
1>
(你要是发现比|还好的列分割符号,麻烦告诉我一下。谢谢!)
(5) 最后,介绍一个对于显示结果非常实用的存储过程sp_autoformat.
我也是在浏览一些系统存错过程源代码的时候发现的这个过程。这个是sybase 未公开的系统过程,用来格式化输出结果。如果想看这个过程的语法,请到sybsystemprocs里面查找。
看个效果吧!
1> sp_autoformat sysobjects,@whereclause="where id < 20"
2> go
|name |id|uid|type|userstat|sysstat|indexdel|schemacnt|sysstat2|crdate |expdate |deltrig|instrig|updtrig|seltrig|ckfirst|cache|audflags|objspare|versionts |loginame|identburnmax|spacestate|erlchgts |
|---------------|--|---|----|--------|-------|--------|---------|--------|-------------------|-------------------|-------|-------|-------|-------|-------|-----|--------|--------|--------------------------|--------|------------|----------|------------------|
|sysobjects | 1| 1|S | 0| 97| 1| 0| 229376|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysindexes | 2| 1|S | 0| 97| 0| 0| 229376|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|syscolumns | 3| 1|S | 0| 97| 0| 0| 229376|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|systypes | 4| 1|S | 0| 97| 1| 0| 229376|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysprocedures | 5| 1|S | 0| 97| 1| 0| 229376|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|syscomments | 6| 1|S | 0| 97| 1| 0| 229376|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|syssegments | 7| 1|S | 0| 65| 0| 0| 98304|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|syslogs | 8| 1|S | 0| 1| 0| 0| 73728|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| NULL|NULL |
|sysprotects | 9| 1|S | 0| 97| 1| 0| 229376|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysusers |10| 1|S | 0| 97| 3| 0| 229376|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysalternates |11| 1|S | 0| 97| 1| 0| 229888|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysdepends |12| 1|S | 0| 97| 1| 0| 229376|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|syskeys |13| 1|S | 0| 97| 1| 0| 229376|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysgams |14| 1|S | 0| 1| 0| 0| 73728|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| NULL|NULL |
|sysusermessages|15| 1|S | 0| 113| 2| 0| 73728|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| NULL|NULL |
|sysreferences |16| 1|S | 0| 97| 3| 0| 229376|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysconstraints |17| 1|S | 0| 97| 2| 0| 229888|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|systhresholds |18| 1|S | 0| 65| 0| 0| 98304|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
|sysroles |19| 1|S | 0| 97| 1| 0| 229888|Dec 2 2009 6:58PM|Dec 2 2009 6:58PM| 0| 0| 0| 0| 0| 0| 0| 0|NULL |NULL | NULL| 1|0x0000000000000000|
(19 rows affected)
(return status = 0)
(6) 补充,参数-p,显示性能统计信息.
参数-p:Prints performance statistics,与之对应的是会话级别的set statistics time on 。这两个方法都能够显示出 统计信息,但是,会话级别的set statistics time on比参数-p的显示结果更详细些。
示例如下:
利用参数-p来显示简要统计信息:
C:\Documents and Settings\Administrator>isql -Usa -P -p
1> select count(*) from sysobjects
2> go
-----------
160
(1 row affected)
Execution Time (ms.): 0 Clock Time (ms.): 0
在每个SQL语句的最后显示执行时间和耗用时间。
会话级别的选项set statistics time on 显示比较详细的统计时间:
C:\Documents and Settings\Administrator>isql -Usa -P
1>
2> set statistics time on
3> go
Execution Time 0.
Adaptive Server cpu time: 0 ms. Adaptive Server elapsed time: 0 ms.
1> select count(*) from sysobjects
2> go
Parse and Compile Time 0.
Adaptive Server cpu time: 0 ms.
-----------
160
Execution Time 0.
Adaptive Server cpu time: 0 ms. Adaptive Server elapsed time: 0 ms.
(1 row affected)
1>
由上可以看出,会话级别选项set statistics time on会显示解析和编译时间、SQL执行时间、以及总计的执行时间、耗用时间。
啰啰嗦嗦就介绍这么多吧!
————————————————————————————————-
—- 本文为andkylee个人原创,请在尊重作者劳动成果的前提下进行转载;
—- 转载务必注明原始出处 : http://www.dbainfo.net
—- 关键字:isql -b -e -E -n -s -w 命令实用工具 sp_autoformat
————————————————————————————————-
Sybase 在ASE v15.0.2 中新增了“应用程序”跟踪这个特性。
您可以利用“应用程序”跟踪功能收集一个正在运行中的客户会话的有用诊断信息,包括:执行查询、IO 消耗等;并且ASE 会自动把收集到的跟踪信息写到一个文本文件中。可以很方便得用这个特性来诊断一些系统性能瓶颈。
您只需要知道想要跟踪的会话的SPID(Server Process ID) 就可以对那个会话进行跟踪监控。应用系统的用户只需要被授予“set tracing ”权限就可以利用“应用程序”跟踪对自己的会话信息进行跟踪。
执行“应用程序”跟踪需要具有 set tracing 的权限。主要有两类用户:第一:具有sa或者sso角色的用户(默认具有set tracing权限);第二:被赋予了set tracing 执行权限的用户。下面会分别予以介绍。
(1) 具有管理员特权的用户(属于 sa 或者 sso 角色)
对其他用户连接会话启用“应用程序”跟踪,执行:
set tracefile "<file-path>" for <spid>
关闭刚才打开的针对其他用户连接会话的跟踪,需要执行:
set tracefile off for <spid>
备注:
(1) 针对某个用户会话启用跟踪时,需要知道它的SPID 并填写跟踪结果文件保存的路径。如果没有指定跟踪结果文件保存的路径,那么ASE 会自动保存到$SYBASE 目录下。
(2) 在一个会话中,只能有一个set tracefile 为启用状态;并且,某一个SPID 不能被多个会话同时跟踪。
(3) 当被跟踪的会话自己退出,或者跟踪被手动关闭时,ASE 会生成跟踪结果文件。
(4) 在“应用程序”跟踪的过程中,如果跟踪结果文件所在的磁盘空间被耗尽,那么ASE 会自动保存跟踪文件并结束本次“应用程序”跟踪。
(5) 用sp_helpapptrace 存储过程来查看当前正在执行中的所有应用程序跟踪信息。
(2) 被赋予“set tracing” 权限的应用程序用户
对自己的会话启用跟踪,执行:
set tracefile "<file-path>"
结束对自己的会话上的跟踪,使用:
set tracefile off
备注: 不能使用sp_helpapptrace过程来查看正在被跟踪的会话。
(3 ) 哪些信息可被用来跟踪?
在“应用程序”跟踪中可以追踪以下的set option 命令。
set show_sqltext <on/off>
set showplan <on/off>
set statistics io <on/off>
set statistics time <on/off>
set statistics plancost <on/off>
set option 的子命令也可被用来跟踪。
set option show_lop <normal/brief/long/on/off> ---显示使用的逻辑操作数量
set option show_managers <normal/brief/long/on/off> --- 显示使用的数据结构管理器的数量
set option show_log_props <normal/brief/long/on/off> --- 显示所用的逻辑属性
set option show_parallel <normal/brief/long/on/off> --- 显示并行查询优化器信息
set option show_histograms <normal/brief/long/on/off> --- 显示直方图统计信息处理过程
set option show_abstract_plan <normal/brief/long/on/off> --- 显示虚拟查询计划具体信息
set option show_search_engine <normal/brief/long/on/off> --- 显示搜索引擎的详细信息
set option show_counters <normal/brief/long/on/off> --- 显示优化器找到的计划的数量
set option show_best_plan <normal/brief/long/on/off> --- 显示最优计划信息
set option show_code_gen <normal/brief/long/on/off> --- 显示代码产生器的信息
set option show_pio_costing <normal/brief/long/on/off> --- 显示估计的物理IO数
set option show_lio_costing <normal/brief/long/on/off> --- 显示估计的逻辑IO数
set option show_elimination <normal/brief/long/on/off> --- 显示分区消除信息
(4) 例子 (使用具有sa 和sso 角色的用户)
在一个会话中执行如下的命令:
set tracefile "c:/tmp/trace-spid-16.txt" for 16
set show_sqltext on
set showplan on
go
sp_helpapptrace
go
traced_spid tracer_spid trace_file
----------- ----------- ----------------------------
16 19 c:/tmp/ase-trace-spid-16.txt
(1 row affected)
(return status = 0)
上面的输出结果表明该会话的spid为16。
在另外一个会话中,在被监控的用户会话spid=16中执行sp_helpdb过程。
set tracefile off for 16
go
sp_helpapptrace
go
traced_spid tracer_spid trace_file
----------- ----------- ----------
(0 rows affected)
(return status = 0)
跟踪结果信息如下:
================================================================================
Application Tracing report for spid -1 from application "isql"
run by login "sa" on host "TEST"
Tracing started on 2010/04/24 17:08:10.23
================================================================================
No useful sqltext available.
QUERY PLAN FOR STATEMENT 1 (at line 1).
STEP 1
The type of query is EXECUTE.
2010/04/24 17:08:10.23
No useful sqltext available.
Sproc: sp_helpdb, Line: 0
QUERY PLAN FOR STATEMENT 1 (at line 0).
STEP 1
The type of query is DECLARE.
Sproc: sp_helpdb, Line: 38
QUERY PLAN FOR STATEMENT 2 (at line 38).
STEP 1
The type of query is COND.
1 operator(s) under root
|ROOT:EMIT Operator (VA = 1)
|
| |SCALAR Operator (VA = 0)
Sproc: sp_helpdb, Line: 40
QUERY PLAN FOR STATEMENT 3 (at line 40).
STEP 1
The type of query is SET OPTION OFF.
Sproc: sp_helpdb, Line: 43
QUERY PLAN FOR STATEMENT 4 (at line 43).
STEP 1
The type of query is SET OPTION ON.
Sproc: sp_helpdb, Line: 45
QUERY PLAN FOR STATEMENT 5 (at line 45).
STEP 1
The type of query is SELECT.
1 operator(s) under root
|ROOT:EMIT Operator (VA = 1)
|
| |SCALAR Operator (VA = 0)
Sproc: sp_helpdb, Line: 47
QUERY PLAN FOR STATEMENT 6 (at line 47).
STEP 1
The type of query is COND.
1 operator(s) under root
|ROOT:EMIT Operator (VA = 1)
|
| |SCALAR Operator (VA = 0)
Sproc: sp_helpdb, Line: 49
QUERY PLAN FOR STATEMENT 7 (at line 49).
STEP 1
The type of query is COND.
3 operator(s) under root
|ROOT:EMIT Operator (VA = 3)
|
| |RESTRICT Operator (VA = 2)(0)(0)(0)(4)(0)
| |
| | |SCALAR AGGREGATE Operator (VA = 1)
| | | Evaluate Ungrouped ANY AGGREGATE.
| | | Scanning only up to the first qualifying row.
| | |
| | | |SCAN Operator (VA = 0)
| | | | FROM TABLE
| | | | master.dbo.sysmessages
| | | | Index : ncsysmessages
| | | | Forward Scan.
| | | | Positioning by key.
| | | | Index contains all needed columns. Base table will not be read.
| | | | Keys are:
| | | | error ASC
| | | | Using I/O Size 2 Kbytes for index leaf pages.
| | | | With LRU Buffer Replacement Strategy for index leaf pages.
Sproc: sp_helpdb, Line: 53
QUERY PLAN FOR STATEMENT 8 (at line 53).
STEP 1
The type of query is SELECT.
1 operator(s) under root
|ROOT:EMIT Operator (VA = 1)
|
| |SCALAR Operator (VA = 0)
Sproc: sp_helpdb, Line: 55
QUERY PLAN FOR STATEMENT 9 (at line 55).
STEP 1
The type of query is COND.
3 operator(s) under root
|ROOT:EMIT Operator (VA = 3)
|
| |RESTRICT Operator (VA = 2)(0)(0)(0)(4)(0)
| |
| | |SCALAR AGGREGATE Operator (VA = 1)
| | | Evaluate Ungrouped ANY AGGREGATE.
| | | Scanning only up to the first qualifying row.
| | |
| | | |SCAN Operator (VA = 0)
| | | | FROM TABLE
| | | | master.dbo.sysmessages
| | | | Index : ncsysmessages
| | | | Forward Scan.
| | | | Positioning by key.
| | | | Index contains all needed columns. Base table will not be read.
| | | | Keys are:
| | | | error ASC
| | | | Using I/O Size 2 Kbytes for index leaf pages.
| | | | With LRU Buffer Replacement Strategy for index leaf pages.
Sproc: sp_helpdb, Line: 59
QUERY PLAN FOR STATEMENT 10 (at line 59).
STEP 1
The type of query is SELECT.
1 operator(s) under root
|ROOT:EMIT Operator (VA = 1)
|
| |SCALAR Operator (VA = 0)
Sproc: sp_helpdb, Line: 0
QUERY PLAN FOR STATEMENT 11 (at line 0).
STEP 1
The type of query is GOTO.
Sproc: sp_helpdb, Line: 0
QUERY PLAN FOR STATEMENT 12 (at line 0).
STEP 1
The type of query is GOTO.
Sproc: sp_helpdb, Line: 62
QUERY PLAN FOR STATEMENT 13 (at line 62).
STEP 1
The type of query is SET OPTION ON.
Sproc: sp_helpdb, Line: 69
QUERY PLAN FOR STATEMENT 14 (at line 69).
STEP 1
The type of query is COND.
1 operator(s) under root
|ROOT:EMIT Operator (VA = 1)
|
| |SCALAR Operator (VA = 0)
Sproc: sp_helpdb, Line: 70
QUERY PLAN FOR STATEMENT 15 (at line 70).
STEP 1
The type of query is SELECT.
2 operator(s) under root
|ROOT:EMIT Operator (VA = 2)
|
| |SCALAR AGGREGATE Operator (VA = 1)
| | Evaluate Ungrouped COUNT AGGREGATE.
| |
| | |SCAN Operator (VA = 0)
| | | FROM TABLE
| | | master.dbo.sysdatabases
| | | Index : ncsysdatabases
| | | Forward Scan.
| | | Positioning at index start.
| | | Index contains all needed columns. Base table will not be read.
| | | Using I/O Size 2 Kbytes for index leaf pages.
| | | With LRU Buffer Replacement Strategy for index leaf pages.
Sproc: sp_helpdb, Line: 73
QUERY PLAN FOR STATEMENT 16 (at line 73).
STEP 1
The type of query is SELECT.
3 operator(s) under root
|ROOT:EMIT Operator (VA = 3)
|
| |SCALAR AGGREGATE Operator (VA = 2)
| | Evaluate Ungrouped COUNT AGGREGATE.
| |
| | |RESTRICT Operator (VA = 1)(0)(0)(0)(6)(0)
| | |
| | | |SCAN Operator (VA = 0)
| | | | FROM TABLE
| | | | master.dbo.sysdatabases
| | | | Using Clustered Index.
| | | | Index : cdatabases
| | | | Forward Scan.
| | | | Positioning at index start.
| | | | Index contains all needed columns. Base table will not be read.
| | | | Using I/O Size 2 Kbytes for index leaf pages.
| | | | With LRU Buffer Replacement Strategy for index leaf pages.
Sproc: sp_helpdb, Line: 80
————————————————————————————————-
—- 本文为andkylee个人原创,请在尊重作者劳动成果的前提下进行转载;
—- 转载务必注明原始出处 : http://www.dbainfo.net
—- 关键字:tracefile showplan statistics 跟踪 会话
————————————————————————————————-
在ASE中为对象命名的时候,要避免使用系统保留关键字,以防止带来不必要的麻烦。如果是对象名称必须使用系统的自留字,请用 quoted_identifer将该名称引起来。在ASE15.x中可以使用中括号[]来强制使用自留字作为对象名称。(这点功能和sqlserver 相似!)
演示一下在ASE15.x中使用中括号引起来保留字作为列名来创建一张表。
1> select @@version
2> go
------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
Adaptive Server Enterprise/15.0.3/EBF 16738 ESD#2/P/NT (IX86)/Windows 2003/ase1503/2708/32-bit/OPT/Mon Jul 27 20:19:56 2009
(1 row affected)
1> create table testa ([create] int ,[alter] int)
2> go
1> sp_help testa
2> go
Name Owner Object_type Create_date
----- ----- ----------- -------------------
testa dbo user table Apr 24 2010 4:10PM
(1 row affected)
Column_name Type Length Prec Scale Nulls Default_name Rule_name Access_Rule_name Computed_Column_object Identity
----------- ---- ------ ---- ----- ----- ------------ --------- ---------------- ---------------------- ----------
create int 4 NULL NULL 0 NULL NULL NULL NULL 0
alter int 4 NULL NULL 0 NULL NULL NULL NULL 0
Object does not have any indexes.
No defined keys for this object.
name type partition_type partitions partition_keys
----- ---------- -------------- ---------- --------------
testa base table roundrobin 1 NULL
partition_name partition_id pages row_count segment create_date
--------------- ------------ ----- --------- ------- -------------------
testa_672718418 672718418 1 0 default Apr 24 2010 4:10PM
Partition_Conditions
--------------------
NULL
Avg_pages Max_pages Min_pages Ratio(Max/Avg) Ratio(Min/Avg)
----------- ----------- ----------- --------------------------- ---------------------------
1 1 1 1.000000 1.000000
Lock scheme Allpages
The attribute 'exp_row_size' is not applicable to tables with allpages lock scheme.
The attribute 'concurrency_opt_threshold' is not applicable to tables with allpages lock scheme.
exp_row_size reservepagegap fillfactor max_rows_per_page identity_gap ascinserts
------------ -------------- ---------- ----------------- ------------ -----------
1 0 0 0 0 0
(1 row affected)
concurrency_opt_threshold optimistic_index_lock dealloc_first_txtpg
------------------------- --------------------- -------------------
0 0 0
(return status = 0)
1>
在12.x中不支持使用中括号来限定的方法。
回到正题,ASE的所有保留关键字有哪些呢?
可以通过查询系统表来得到结果。 在spt_values表中type为W表示系统保留字。
执行select number,name from spt_values where type='W'这条语句可以得到所有的系统自留关键字。
1> select @@version
2> go-------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
----------------
Adaptive Server Enterprise/12.5/SWR 9616 GA/P/NT (IX86)/OS 4.0/main/1647/32-bit
/
OPT/Fri Jun 01 16:58:25 2001
(1 row affected)
1> select number,name from spt_values where type='W'
2> go
number name
----------- ----------------------------
1 add
2 all
3 alter
4 and
5 any
6 arith_overflow
7 as
8 asc
9 at
10 authorization
11 avg
12 begin
13 between
14 break
15 browse
16 bulk
17 by
18 cascade
19 case
20 char_convert
21 check
22 checkpoint
23 close
24 clustered
25 coalesce
26 commit
27 compute
28 confirm
29 connect
30 constraint
31 continue
32 controlrow
33 convert
34 count
35 create
36 current
37 cursor
38 proxy_table
39 database
40 dbcc
41 deallocate
42 declare
43 default
44 delete
45 desc
46 disk
47 distinct
48 double
49 drop
50 dummy
51 dump
52 else
53 end
54 endtran
55 errlvl
56 errordata
57 errorexit
58 escape
59 except
60 exclusive
61 exec
62 execute
63 exists
64 exit
65 exp_row_size
66 external
67 fetch
68 fillfactor
69 for
70 foreign
71 from
72 goto
73 grant
74 group
75 having
76 holdlock
77 identity
78 identity_insert
79 identity_start
80 if
81 in
82 index
83 insert
84 install
85 intersect
86 into
87 is
88 isolation
89 jar
90 join
91 key
92 kill
93 level
94 like
95 lineno
96 load
97 lock
98 max
99 max_rows_per_page
100 min
101 mirror
102 mirrorexit
103 national
104 identity_gap
105 noholdlock
106 nonclustered
107 not
108 null
109 nullif
110 numeric_truncation
111 of
112 off
113 offsets
114 on
115 once
116 online
117 only
118 open
119 option
120 or
121 order
122 over
123 partition
124 perm
125 permanent
126 plan
127 precision
128 prepare
129 primary
130 print
131 privileges
132 proc
133 procedure
134 processexit
135 public
136 raiserror
137 read
138 readpast
139 readtext
140 reconfigure
141 references
142 remove
143 reorg
144 replace
145 quiesce
146 reservepagegap
147 return
148 revoke
149 role
150 rollback
151 rowcount
152 rows
153 rule
154 save
155 schema
156 select
157 set
158 setuser
159 shared
160 shutdown
161 some
162 statistics
163 stripe
164 sum
165 syb_identity
166 syb_restree
167 syb_terminate
168 table
169 temp
170 temporary
171 textsize
172 to
173 tran
174 transaction
175 trigger
176 truncate
177 tsequal
178 union
179 unique
180 unpartition
181 update
182 use
183 replication
184 user
185 user_option
186 using
187 values
188 varying
189 view
190 waitfor
191 when
192 where
193 while
194 with
195 work
196 writetext
197 modify
198 deterministic
199 func
200 function
201 inout
202 new
203 out
204 output
205 returns
206 stringsize
(206 rows affected)
1>
同样在ASE15.x环境上执行同样的语句,发现ASE15.x比12.x版本多了一些保留字。
name number
---------------------------- -----------
xmltest 207
xmlextract 208
xmlparse 209
encrypt 210
decrypt 211
materialized 212
count_big 213
tracefile 214
scroll 215
decrypt_default 216
insensitive 217
semi_sensitive 218
xmltable 219
关于保留字,对应着有一个系统存储过程sp_checkreswords可以用来查看系统内所有使用保留字作为对象名称的对象。
sp_checkreswords语法为:
sp_checkreswords - Detects and displays identifiers that are Transact-SQL
reserved words. Checks server names, device names, database
names, segment names, user-defined datatypes, object names,
column names, user names, login names, and remote login names.
sp_checkreswords [user_name_param]
之前我用create table testa ([create] int ,[alter] int)创建了一张表。在这张表所在的数据库内部执行sp_checkreswords过程,
系统报告出来了create alter 这两个列名在用关键字。
1> sp_checkreswords
2> go
Reserved Words Used as Database Object Names for Database,testdb.
Upgrade renames sysobjects.schema to sysobjects.schemacnt.
Owner
------------------------------
dbo
Table
Reserved Word Column Names
----------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------
testa
alter
testa
create
-------------------------------------------------------------
-------------------------------------------------------------
Owner
------------------------------
escourt4
Table
Reserved Word Column Names
----------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------
syscolumn
check
syscolumn
default
-------------------------------------------------------------
-------------------------------------------------------------
Database-wide Objects
---------------------
Found no reserved words used as names for database-wide objects.
(return status = 4)
1>
————————————————————————————————-
—- 本文为andkylee个人原创,请在尊重作者劳动成果的前提下进行转载;
—- 转载务必注明原始出处 : http://www.dbainfo.net
—- 关键字:12.0 15.0 spt_values 关键字 reserved words sp_checkreswords
————————————————————————————————-
Sybase ASE自12.5.0.3以来引入了一组监控表,称为:MonTables后者MDA tables。可以利用MDA表实现对sybase ASE的监控和诊断。监控表里面存储着对于ASE状态的统计、汇总信息的快照snapshot。我们可以像查询其他系统表(比如sysobjects、 sysindexes、syscolumns等)一样来查询这些监控表MonTables。
在12.x版本中MDA表默认是没有安装的,需要我们手动进行安装。在ASE15.x中新建数据库服务器的时候就默认装上了。
下面开始详细得介绍安装以及配置MDA的过程。
(1) 检查参数:enable cis是否启用?如果没有启用,打开该参数
sp_configure "enable cis"
go
Parameter Name Default Memory Used Config Value Run Value Unit Type
------------------------------ ----------- ----------- ------------ ------------ -------------------- ----------
enable cis 1 0 1 1 switch static
(1 row affected)
(2) 查看sysservers系统表中是否有loopback这一条记录,如果没有,手动添加一个指向自己的远程服务器
(注:在ASE12.5.4以及之后的版本中在创建数据库服务器的时候默认会添加一个loopback服务器。)
use master
go
sp_helpserver
go
name network_name class status id cost
----------- -------------- ------------ ------------------------------------------------------------------------ -- ----
SYB_BACKUP TEST_BS ASEnterprise timeouts, no net password encryption, writable , rpc security model A 1 NULL
SYB_EJB EJBServer ASEJB external engine auto start 2 NULL
SYB_JSAGENT TEST_JSAGENT ASEnterprise no timeouts, no net password encryption, writable , rpc security model A 4 1000
SYB_JSTASK TEST ASEnterprise timeouts, no net password encryption, writable , rpc security model A 6 1000
TEST TEST local 0 0
TEST_XP TEST_XP RPCServer no timeouts, no net password encryption, writable , rpc security model A 3 1000
(return status = 0)
sp_addserver loopback,null,@@servername
go
-- Test this configuration: -- (NB: this step is no longer required in 15.0 ESD#2 or later) set cis_rpc_handling on go -- -- Alternatively, run: -- sp_configure 'cis rpc handling', 1 -- ...and disconnect/reconnect your session exec loopback...sp_who -- note: 3 dots! go
(3) 安装MDA系统表
在unix的shell下执行:isql -Usa -Pyourpassword -Syourservername -i$SYBASE/$SYBASE_ASE/scripts/installmontables -o$SYBASE/$SYBASE_ASE/scripts/instmontables_log.txt
在windows的命令行下执行:isql -Usa -Pyourpassword -Syourservername -i%SYBASE%\%SYBASE_ASE%\scripts\installmontables -o%SYBASE%\%SYBASE_ASE%\scripts\instmontables_log.txt
(注:ASE15.x中不需要再安装mda表)
(4) 给需要有监控权限的登录赋予mon_role角色
use master
go
grant role mon_role to sa
go
use master go grant role mon_role to sa go
(5) 检查测试基本的MDA配置信息
1> select * from master..monState
2> go
LockWaitThreshold LockWaits DaysRunning CheckPoints NumDeadlocks DiagnosticDumps Connections MaxRecovery StartDate CountersCleared
----------------- ----------- ----------- ----------- ------------ --------------- ----------- ----------- -------------------------- --------------------------
5 0 0 0 0 0 9 5 Apr 24 2010 1:34PM Apr 24 2010 1:34PM
(1 row affected)
1>
(6) 启用所有的监控配置参数
sp_configure "sql text pipe active",1
go
sp_configure "sql text pipe max messages",2000
go
sp_configure "plan text pipe active",1
go
sp_configure "plan text pipe max messages",1000
go
sp_configure "statement pipe active",1
go
sp_configure "statement pipe max messages",5000
go
sp_configure "errorlog pipe active",1
go
sp_configure "errorlog pipe max messages",1000
go
sp_configure "deadlock pipe active",1
go
sp_configure "deadlock pipe max messages",1000
go
sp_configure "wait event timing",1
go
sp_configure "process wait events",1
go
sp_configure "object lockwait timing",1
go
sp_configure "SQL batch capture",1
go
sp_configure "statement statistics active",1
go
sp_configure "per object statistics active",1
go
sp_configure "max SQL text monitored",256
go
其中参数:max SQL text monitored需要重启ASE服务器后才能生效。
(7) 重启ASE后,就可以通过查询monTables来了解ASE的监控信息了。比如:查看当前会话执行的sql语句。
1> sp_autoformat "monProcessSQLText"
2> go
SPID KPID ServerUserID BatchID LineNumber SequenceInLine SQLText
---- ------- ------------ ------- ---------- -------------- ----------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------
31 2228258 1 35 1 1 SELECT SPID=right(space(80)+isnull(convert(varchar(80),SPID),'NULL'),4), KPID=right(space(80)+isnull
(convert(varchar(80),KPID),'NULL'),7), ServerUserID=right(space(80)+isnull(convert(varchar(80),ServerUserID),'NULL'),12), BatchID=right(space(80)+isnull
31 2228258 1 35 1 2 (convert(varchar(80),BatchID),'NULL'),7), LineNumber=right(space(80)+isnull(convert(varchar(80),Line
Number),'NULL'),10), SequenceInLine=right(space(80)+isnull(convert(varchar(80),SequenceInLine),'NULL'),14), SQLText=SUBSTRING(convert(varchar(255),SQLTe
31 2228258 1 35 1 3 xt),1,252) FROM monProcessSQLText
(3 rows affected)
(return status = 0)
备注:在ASE12.5.3及后续的版本中的某些罕见的情况下,配置参数"per object statistics active"会导致时间片的错误。这个bug已在ASE15.x中得到了修正。
另外,ASE的MDA监控功能对系统的整体性能是有不小的影响的,据说要损耗20%多的ASE系能。所以,不建议在生产环境上配置MDA监控表;如果启用了监控表,也一定要在不使用监控功能的时候及时关闭监控参数。执行:
sp_configure "enable monitoring",1
go
关于MDA监控表的使用,后面会有博文继续介绍...
————————————————————————————————-
—- 本文为andkylee个人原创,请在尊重作者劳动成果的前提下进行转载;
—- 转载务必注明原始出处 : http://www.dbainfo.net
—- 关键字:监控表 启用 MDA MonTables
————————————————————————————————-
在Sybase ASE中查看或者修改配置参数有多种方法,比如:利用系统存储过程sp_configure;Sybase Central;Embarcadero DBArtisan等。
我比较喜欢用系统过程sp_configure来修改和查看参数。不管用那种方式,ASE的配置参数信息都是存储在两张系统表:sysconfigures和syscurconfigs上的。其中,表sysconfigures存储所有参数已生效 的详细信息;表syscurconfigs存储所有参数的当前 配置信息。
另外,Sybase ASE各个版本中都会备份曾经修改过的配置参数文件。在$SYBASE目录下servername .cfg是系统的配置参数文件,每次修改系统的参数内容时,ASE都会为servername .cfg做一次备份,备份文件名称用servername 加上依次递增的数字。servername .cfg中每个参数值后面的DEFAULT表示该参数没有被改变,仍然使用默认值。我们可以利用这些配置备份文件servername .001,servername .002 ... servername .040 等,来追踪参数的修改过程。如果某个参数修改后对性能反而没有提升,那么我们就可以利用之前备份的参数文件来恢复到修改之前的参数值。
参数文件比较重要的一点功能是:在master系统库崩溃的时候,可以利用cfg或者顺序参数备份文件来恢复之前的ASE的配置信息。
说了这么多,现在回到标题上的主题。如何知道ASE中哪些参数被修改过了呢?或者说:如何查看哪些参数使用了非缺省呢?
我想起来两种方法:
第一种:查看配置文件servername .cfg的所有参数,并找出取值不等于DEFAULT的所有参数。
第二种:利用sp_configure存储过程。
可能还有别的办法,比如用Sybase Central或者其它的第三方工具。我没有在这些工具上寻找查看的方法,您要是知道也可以共享一下方法。
先来看看系统存储过程sp_configure的参数内容。我利用联机的帮助信息来查看sp_configure的参数,详细的使用方法请查看sybase官方文档中的存储过程这一本。
1> sp_syntax "sp_configure"
2> go
Syntax Help
------------------------------------------------------------------------------
System Procedure
sp_configure - Displays or changes configuration parameters.
sp_configure [configname [, configvalue] | group_name
| non_unique_parameter_fragment]
["p|P|k|K|m|M|g|G"]]
Or,
sp_configure "configuration file", 0, {"write" | "read"
| "verify" | "restore" } "file_name"
(return status = 0)
(sybase ASE为15.0.3)
查看非缺省值参数的方法为:
1> sp_configure "display"
2> go
Parameter Name Default Memory Used Config Value Run Value Unit Type
------------------------------ ------------ ------------- ------------------ ----------- ---------------- -------
SQL batch capture 0 0 1 1 switch dynamic
allow updates to system tables 0 0 1 1 switch dynamic
deadlock pipe active 0 0 1 1 switch dynamic
deadlock pipe max messages 0 915 1024 1024 number dynamic
default character set id 2 0 1 1 id static
default database size 6 0 30 30 megabytes dynamic
enable encrypted columns 0 4138 1 1 switch dynamic
enable file access 0 0 1 1 switch dynamic
enable job scheduler 0 0 1 1 switch dynamic
enable monitoring 0 0 1 1 switch dynamic
enable semantic partitioning 0 0 1 1 switch dynamic
enable stmt cache monitoring 0 0 1 1 switch dynamic
errorlog pipe active 0 0 1 1 switch dynamic
errorlog pipe max messages 0 1087 1024 1024 number dynamic
event buffers per engine 100 #977 5000 5000 number static
max SQL text monitored 0 104 4096 4096 bytes static
max memory 39936 200000 100000 100000 memory pages(2k) dynamic
number of devices 10 #24 20 20 number dynamic
number of engines at startup 1 0 2 2 number static
number of histogram steps 20 0 40 40 number dynamic
object lockwait timing 0 0 1 1 switch dynamic
per object statistics active 0 0 1 1 switch dynamic
plan text pipe active 0 0 1 1 switch dynamic
plan text pipe max messages 0 382 1024 1024 number dynamic
print deadlock information 0 0 1 1 number dynamic
procedure cache size 7000 21170 10000 10000 memory pages(2k) dynamic
process wait events 0 0 1 1 switch dynamic
sql text pipe active 0 0 1 1 switch dynamic
sql text pipe max messages 0 1084 2000 2000 number dynamic
stack size 41984 #2813 43008 43008 bytes static
statement cache size 0 4 2 2 memory pages(2k) dynamic
statement pipe active 0 0 1 1 switch dynamic
statement pipe max messages 0 4182 20000 20000 number dynamic
statement statistics active 0 0 1 1 switch dynamic
wait event timing 0 0 1 1 switch dynamic
xp_cmdshell context 1 0 0 0 switch dynamic
呵呵,这个方法的确很方便啊。
最后补充一点,sp_configure过程的源代码有1400多行,可见这个过程要实现的功能还是挺多的。
通过查看该过程的源代码,找到实现sp_configure "display"这个功能的sql语句为:
select Parameter_Name = convert(char(30), name),
Default_Value = convert(varchar(11), defvalue),
Memory_Used = convert(varchar(11), c.comment),
Config_Value = isnull(b.value2, convert(char(32), b.value)),
Run_Value = isnull(c.value2, convert(char(32), c.value)),
Unit = convert(char(20), c.unit),
Type_ = convert(char(10), c.type)
from master.dbo.sysconfigures b,
master.dbo.syscurconfigs c
where
b.config = c.config
and (c.defvalue != isnull(b.value2, convert(char(32), b.value))
or
c.defvalue != isnull(c.value2, convert(char(32), c.value)))
and c.config != 114 /* Exclude option 'configuration file' */
and c.type != "read-only"
and display_level <= 10 --@user_displaylevel
order by Parameter_Name
go
查询出来的结果是一样的。利用这一堆sql语句查询出来的结果可以用作进一步的分析。
就介绍到这里吧!
————————————————————————————————-
—- 本文为andkylee个人原创,请在尊重作者劳动成果的前提下进行转载;
—- 转载务必注明原始出处 : http://www.dbainfo.net
—- 关键字:参数 非缺省 sp_configure
————————————————————————————————-
在新的电脑上安装完Vmware Server2.0.2后,导入以前的虚拟机文件。在左边的虚拟机列表中选中虚拟机后,右边的窗口空白一片, 无法查看虚拟机的配置信息也无法启动虚拟机。
在系统日志看,看到如下内容:
然后到目录:C:\Documents and Settings\All Users\Application Data\VMware\VMware Server下查看虚拟机的日志信息。依次查看hostd-0.log到hostd-9.log日志文件的内容。
发现如下比较重要的信息:
[2011-04-17 00:46:37.859 'Solo' 1264 info] VM inventory configuration: C:\Documents and Settings\All Users\Application Data\VMware\VMware Server\hostd\vmInventory.xml
[2011-04-17 00:46:37.875 'VmMisc' 1264 info] Max supported virtual machines: 512
[2011-04-17 00:46:37.890 'Vmsvc' 1264 info] Foundry_CreateEx failed: Error: (4000) The virtual machine cannot be found
[2011-04-17 00:46:37.890 'vm:I:\virtual-systems\RedHat5.4\Red Hat Enterprise Linux 5.vmx' 1264 info] Failed to load virtual machine.
[2011-04-17 00:46:37.890 'vm:I:\virtual-systems\RedHat5.4\Red Hat Enterprise Linux 5.vmx' 1264 info] Failed to load virtual machine. Marking as unavailable: vim.fault.NotFound
[2011-04-17 00:46:37.890 'vm:I:\virtual-systems\RedHat5.4\Red Hat Enterprise Linux 5.vmx' 1264 warning] Failed to find activation record, event user unknown.
[2011-04-17 00:46:37.890 'ha-eventmgr' 1264 info] Event 1 : Configuration file for on liuzhenfu in ha-datacenter cannot be found
[2011-04-17 00:46:37.906 'PropertyProvider' 1264 verbose] RecordOp ASSIGN: latestEvent, ha-eventmgr
[2011-04-17 00:46:37.906 'vm:I:\virtual-systems\RedHat5.4\Red Hat Enterprise Linux 5.vmx' 1264 info] State Transition (VM_STATE_INITIALIZING -> VM_STATE_INVALID_LOAD)
[2011-04-17 00:46:37.906 'PropertyProvider' 1264 verbose] RecordOp ASSIGN: disabledMethod, 112
[2011-04-17 00:46:37.906 'vm:I:\virtual-systems\RedHat5.4\Red Hat Enterprise Linux 5.vmx' 1264 info] Marking VirtualMachine invalid
[2011-04-17 00:46:37.906 'PropertyProvider' 1264 verbose] RecordOp ASSIGN: disabledMethod, 112
[2011-04-17 00:46:37.906 'PropertyProvider' 1264 verbose] RecordOp ASSIGN: runtime.connectionState, 112
[2011-04-17 00:46:37.906 'PropertyProvider' 1264 verbose] RecordOp ASSIGN: summary.runtime.connectionState, 112
[2011-04-17 00:46:37.906 'Vmsvc' 1264 info] Loaded virtual machine: I:\virtual-systems\RedHat5.4\Red Hat Enterprise Linux 5.vmx
[2011-04-17 00:46:37.906 'PropertyProvider' 1264 verbose] RecordOp ASSIGN: childConfiguration, ha-root-pool
[2011-04-17 00:46:37.906 'PropertyProvider' 1264 verbose] RecordOp ADD: vm["112"], ha-root-pool
[2011-04-17 00:46:37.906 'PropertyProvider' 2440 verbose] RecordOp ASSIGN: summary.runtime, ha-root-pool
[2011-04-17 00:46:38.203 'Libs' 1848 info] Reloading config state: D:\Virtual Machines\Node1\Windows Server 2003 Enterprise Edition.vmx
[2011-04-17 00:46:38.546 'Libs' 1848 info] VMHS: Transitioned vmx/execState/val to poweredOff
[2011-04-17 00:46:38.687 'Libs' 2128 info] CnxAuthdConnect: Returning false because CnxAuthdConnectPipe failed
[2011-04-17 00:46:38.687 'Libs' 2128 info] CnxConnectAuthd: Returning false because CnxAuthdConnect failed
[2011-04-17 00:46:38.687 'Libs' 2128 info] Cnx_Connect: Returning false because CnxConnectAuthd failed
[2011-04-17 00:46:38.687 'Libs' 2128 info] Cnx_Connect: Error message: Failed to read vmware-authd port number: Cannot connect to VMX: D:\Virtual Machines\Node1\Windows Server 2003 Enterprise Edition.vmx
[2011-04-17 00:46:38.687 'vm:D:\Virtual Machines\Node1\Windows Server 2003 Enterprise Edition.vmx' 1264 info] Upgrade is required for virtual machine, version: 4
[2011-04-17 00:46:38.843 'DiskLib' 1264 info] DISKLIB-SPARSECHK: [D:\Virtual Machines\Node1\Windows Server 2003 Enterprise Edition.vmdk] 16384 excess bytes at end of file
[2011-04-17 00:46:38.875 'DiskLib' 1264 info] DISKLIB-SPARSECHK: [D:\Virtual Machines\Node1\Windows Server 2003 Enterprise Edition.vmdk] GT Error (EE): GT[46][271] = 6814336 / 6814336
[2011-04-17 00:46:38.875 'DiskLib' 1264 info] DISKLIB-SPARSECHK: [D:\Virtual Machines\Node1\Windows Server 2003 Enterprise Edition.vmdk] Resolving GT[46][271] = 0
[2011-04-17 00:46:38.875 'DiskLib' 1264 info] DISKLIB-SPARSECHK: [D:\Virtual Machines\Node1\Windows Server 2003 Enterprise Edition.vmdk] GT Error (EE): GT[46][272] = 6814464 / 6814464
[2011-04-17 00:46:38.875 'DiskLib' 1264 info] DISKLIB-SPARSECHK: [D:\Virtual Machines\Node1\Windows Server 2003 Enterprise Edition.vmdk] Resolving GT[46][272] = 0
[2011-04-17 00:46:38.875 'DiskLib' 1264 info] DISKLIB-SPARSECHK: [D:\Virtual Machines\Node1\Windows Server 2003 Enterprise Edition.vmdk] GT Error (EE): GT[46][273] = 6814592 / 6814592
[2011-04-17 00:46:38.875 'DiskLib' 1264 info] DISKLIB-SPARSECHK: [D:\Virtual Machines\Node1\Windows Server 2003 Enterprise Edition.vmdk] Resolving GT[46][273] = 0
[2011-04-17 00:46:38.875 'DiskLib' 1264 info] DISKLIB-SPARSECHK: [D:\Virtual Machines\Node1\Windows Server 2003 Enterprise Edition.vmdk] GT Error (EE): GT[46][274] = 6814720 / 6814720
[2011-04-17 00:46:38.875 'DiskLib' 1264 info] DISKLIB-SPARSECHK: [D:\Virtual Machines\Node1\Windows Server 2003 Enterprise Edition.vmdk] Resolving GT[46][274] = 0
在另外一个日志文件中发现:
[2011-04-18 13:59:07.281 'Libs' 2204 info] CnxConnectAuthd: Returning false because CnxAuthdConnect failed
[2011-04-18 13:59:07.281 'Libs' 2204 info] Cnx_Connect: Returning false because CnxConnectAuthd failed
[2011-04-18 13:59:07.281 'Libs' 2204 info] Cnx_Connect: Error message: Failed to read vmware-authd port number: Cannot connect to VMX: C:\Virtual Machines\DNServer\Windows Server 2003 Enterprise Edition.vmx
[2011-04-18 13:59:07.281 'vm:C:\Virtual Machines\DNServer\Windows Server 2003 Enterprise Edition.vmx' 2900 info] Upgrade is required for virtual machine, version: 4
[2011-04-18 13:59:07.671 'PropertyProvider' 2900 verbose] RecordOp ASSIGN: summary, 64
[2011-04-18 13:59:07.671 'vm:C:\Virtual Machines\DNServer\Windows Server 2003 Enterprise Edition.vmx' 2900 info] State Transition (VM_STATE_INITIALIZING -> VM_STATE_OFF)
在网上寻找了很久,这篇博文解决VMWare Server 2.0 出现 Cannot Connect to VMX的问题的方法也不奏效。而且,vmware社区http://communities.vmware.com/index.jspa的很多帖子也没有给出有效的方法。这个Cannot connect to VMX问题也是个比较棘手的问题。
解决方法:原来我犯了一个低级的错误。曾经下载了vmware server 1.0.6 和 vmware server 2.0.2这2个版本的安装程序。因为以前的虚拟机环境不存在了,在新的电脑上安装的时候,就选择了vmware server 2.0.2。出现了上面的问题,曾经还重装了两次。 最后看了一篇自己曾经写过的文档《在VMServer1.0.6中配置SQL Server 2005故障转移群集》,才意识到自己选错vmware的版本了。多么低级的一个错误啊,白白折腾了一天多的时间。
曾经还出现过如下的无法登录的问题:The server was unable to process your log in request.Please check with your server administrator.
解决方法:设置使得登录用户对虚拟机文件所在的目录拥有权限。
演示一次sybase ASE15.0.3跨平台备份恢复的过程。
源数据库版本为:
1> select @@version
2> go
-----------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
----------------------------------------------------------------------------
Adaptive Server Enterprise/15.0.3/EBF 16738 ESD#2/P/NT (IX86)/Windows 2003/ase1
503/2708/32-bit/OPT/Mon Jul 27 20:19:56 2009
目的数据库版本为:
1> select @@version
2> go
-----------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
----------------------------------------------------------------------------
Adaptive Server Enterprise/15.0.3/EBF 16548 ESD#1/P/Sun_svr4/OS 5.8/ase1503/268
0/64-bit/FBO/Thu Mar 5 09:39:28 2009
跨平台恢复的详细过程如下:
(1). 检查欲备份的数据库testdb的完整性,利用checkdb和checkalloc
1> dbcc traceon(3604)
2> go
1> dbcc checkdb(testdb)
2> go
1> dbcc checkalloc(testdb)
2> go
(2). 将数据库testdb设置为单用户模式
1> use master
2> go
1> sp_dboption testdb,"single",true
2> go
(3). 清空testdb的日志,并设置检查点
1> dump tran testdb with no_log
2> go
1> checkpoint
2> go
(4). 将属于数据库testdb的脏页写到磁盘上面去,并发出检查点命令。 在发出sp_flushstats系统过程后要等待一段时间,保证数据库有足够的时间把页面信息刷新到磁盘上。
1> sp_flushstats
2> go
1> checkpoint
2> go
(5). 备份数据库testdb
1> dump database testdb to "d:\testdb-20100409.dmp"
2> go
(6). 利用ftp服务器将备份出来的testdb-20100409.dmp文件拷贝到solaris服务器上。
(7).用isql连接到目的数据库服务器上面,执行恢复命令
1> load database testdb from "/app/sybdata/testdb-20100409.dmp"
2> go
(8). 将目的数据库服务器中的testdb调整成在线。
1> online database testdb
2> go
(9). 进入testdb,执行sp_post_xpload系统存储过程来重建用户表的索引。
1> use testdb
2> go
1> sp_post_xpload
2> go
至此,跨平台备份恢复过程完成!
补充:以下为load database过程显示的所有的反馈信息。
1> sp_helpdb testdb
2> go
name db_size owner dbid created status
------ ------------- ----- ---- ------------ -------------
testdb 1300.0 MB sa 4 Apr 09, 2010 don't recover
(1 row affected)
device_fragments size usage
created free kbytes
------------------------------ ------------- --------------------
------------------------- ----------------
testdb_dat 1000.0 MB data only
Apr 9 2010 7:05PM 1016720
testdb_log 300.0 MB log only
Apr 9 2010 7:05PM not applicable
Msg 921, Level 14, State 2:
Server 'SYB_NFJD_TEST', Procedure 'sp_helpdb', Line 588:
Database 'testdb' has not been recovered yet - please wait and try again.
--------------------------------------------------------------
log only free kbytes = 0
(return status = 0)
1> load database testdb from "/app/sybdata/testdb-20100409.dmp"
2> go
Backup Server session id is: 19. Use this value when executing the
'sp_volchanged' system stored procedure after fulfilling any volume change
request from the Backup Server.
Backup Server: 6.28.1.1: Dumpfile name 'scourt5100990F2E6' section number 1
mounted on disk file '/app/sybdata/testdb-20100409.dmp'
Backup Server: 4.188.1.1: Database testdb: 23940 kilobytes (1%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 58630 kilobytes (4%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 93320 kilobytes (7%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 127118 kilobytes (9%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 151180 kilobytes (11%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 172814 kilobytes (12%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 194448 kilobytes (14%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 216082 kilobytes (16%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 237716 kilobytes (17%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 259350 kilobytes (19%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 280984 kilobytes (21%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 302618 kilobytes (22%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 324252 kilobytes (24%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 345886 kilobytes (25%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 367520 kilobytes (27%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 389154 kilobytes (29%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 409636 kilobytes (30%) LOADED.
Backup Server: 4.188.1.1: Database testdb: 409646 kilobytes (100%) LOADED.
Backup Server: 3.42.1.1: LOAD is complete (database testdb).
Started cross-platform conversion for database testdb.
Started cross-platform conversion for system objects.
Cross-platform conversion for database testdb: 672 pages completed.
Completed cross-platform conversion for system objects.
Started cross-platform conversion for user objects.
Cross-platform conversion for database testdb: 10073 pages completed.
Cross-platform conversion for database testdb: 20273 pages completed.
Cross-platform conversion for database testdb: 30458 pages completed.
Cross-platform conversion for database testdb: 40604 pages completed.
Cross-platform conversion for database testdb: 50796 pages completed.
Cross-platform conversion for database testdb: 60924 pages completed.
Cross-platform conversion for database testdb: 71117 pages completed.
Cross-platform conversion for database testdb: 81317 pages completed.
Cross-platform conversion for database testdb: 91517 pages completed.
Cross-platform conversion for database testdb: 101717 pages completed.
Completed cross-platform conversion for user objects.
Started cross-platform conversion for log records.
Cross-platform conversion for database testdb: 11119 pages completed.
Completed cross-platform conversion for log records.
Completed cross-platform conversion for database testdb.
Caution: You have set up this database to include space on disk 5 for both data
and the transaction log. This can make recovery impossible if that disk fails.
All dumped pages have been loaded. ASE is now clearing pages above page 102400,
which were not present in the database just loaded.
ASE has finished clearing database pages.
Started estimating recovery log boundaries for database 'testdb'.
Database 'testdb', checkpoint=(79128, 0), first=(79128, 0), last=(79128, 0).
Completed estimating recovery log boundaries for database 'testdb'.
Started ANALYSIS pass for database 'testdb'.
Completed ANALYSIS pass for database 'testdb'.
Started REDO pass for database 'testdb'. The total number of log records to
process is 1.
Completed REDO pass for database 'testdb'.
Use the ONLINE DATABASE command to bring this database online; ASE will not
bring it online automatically.
1> online database testdb
2> go
Started estimating recovery log boundaries for database 'testdb'.
Database 'testdb', checkpoint=(79128, 0), first=(79128, 0), last=(79128, 0).
Completed estimating recovery log boundaries for database 'testdb'.
Started ANALYSIS pass for database 'testdb'.
Completed ANALYSIS pass for database 'testdb'.
Recovery of database 'testdb' will undo incomplete nested top actions.
Checking table 'sysstatistics' (object ID 24): Logical page size is 4096 bytes.
Checking partition 'sysstatistics_24' (partition ID 24) of table
'sysstatistics'. The logical page size of this table is 4096 bytes.
The indexes for 'sysstatistics' are already correct. They will not be rebuilt.
(1 row affected)
(1 row affected)
(485 rows affected)
(1 row affected)
(57 rows affected)
(1 row affected)
(16 rows affected)
(1 row affected)
(3 rows affected)
(1 row affected)
(0 rows affected)
(915 rows affected)
Checking table 'sysobjects' (object ID 1): Logical page size is 4096 bytes.
Checking partition 'sysobjects_1' (partition ID 1) of table 'sysobjects'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysobjects' are already correct. They will not be rebuilt.
Checking table 'sysindexes' (object ID 2): Logical page size is 4096 bytes.
Checking partition 'sysindexes_2' (partition ID 2) of table 'sysindexes'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysindexes' are already correct. They will not be rebuilt.
Checking table 'syscolumns' (object ID 3): Logical page size is 4096 bytes.
Checking partition 'syscolumns_3' (partition ID 3) of table 'syscolumns'. The
logical page size of this table is 4096 bytes.
The indexes for 'syscolumns' are already correct. They will not be rebuilt.
Checking table 'systypes' (object ID 4): Logical page size is 4096 bytes.
Checking partition 'systypes_4' (partition ID 4) of table 'systypes'. The
logical page size of this table is 4096 bytes.
The indexes for 'systypes' are already correct. They will not be rebuilt.
Checking table 'sysprocedures' (object ID 5): Logical page size is 4096 bytes.
Checking partition 'sysprocedures_5' (partition ID 5) of table 'sysprocedures'.
The logical page size of this table is 4096 bytes.
The indexes for 'sysprocedures' are already correct. They will not be rebuilt.
Checking table 'syscomments' (object ID 6): Logical page size is 4096 bytes.
Checking partition 'syscomments_6' (partition ID 6) of table 'syscomments'. The
logical page size of this table is 4096 bytes.
The indexes for 'syscomments' are already correct. They will not be rebuilt.
Checking table 'syssegments' (object ID 7): Logical page size is 4096 bytes.
Checking partition 'syssegments_7' (partition ID 7) of table 'syssegments'. The
logical page size of this table is 4096 bytes.
The table 'syssegments' has no indexes.
Checking table 'syslogs' (object ID 8): Logical page size is 4096 bytes.
Checking partition 'syslogs_8' (partition ID of table 'syslogs'. The logical
page size of this table is 4096 bytes.
*** NOTICE: Space used on the log segment is 101 pages (0.39 MB), 0.39%.
*** NOTICE: Space reserved on the log segment is 0 pages (0.00 MB), 0.00%.
*** NOTICE: Space free on the log segment is 25499 pages (99.61 MB), 99.61%.
The table 'syslogs' has no indexes.
Checking table 'sysprotects' (object ID 9): Logical page size is 4096 bytes.
Checking partition 'sysprotects_9' (partition ID 9) of table 'sysprotects'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysprotects' are already correct. They will not be rebuilt.
Checking table 'sysusers' (object ID 10): Logical page size is 4096 bytes.
Checking partition 'sysusers_10' (partition ID 10) of table 'sysusers'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysusers' are already correct. They will not be rebuilt.
Checking table 'sysalternates' (object ID 11): Logical page size is 4096 bytes.
Checking partition 'sysalternates_11' (partition ID 11) of table
'sysalternates'. The logical page size of this table is 4096 bytes.
The indexes for 'sysalternates' are already correct. They will not be rebuilt.
Checking table 'sysdepends' (object ID 12): Logical page size is 4096 bytes.
Checking partition 'sysdepends_12' (partition ID 12) of table 'sysdepends'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysdepends' are already correct. They will not be rebuilt.
Checking table 'syskeys' (object ID 13): Logical page size is 4096 bytes.
Checking partition 'syskeys_13' (partition ID 13) of table 'syskeys'. The
logical page size of this table is 4096 bytes.
The indexes for 'syskeys' are already correct. They will not be rebuilt.
Checking table 'sysgams' (object ID 14): Logical page size is 4096 bytes.
The total number of data pages in this table is 8.
The indexes for 'sysgams' are already correct. They will not be rebuilt.
Checking table 'sysusermessages' (object ID 15): Logical page size is 4096
bytes.
Checking partition 'csysusermessages_15' (partition ID 15) of table
'sysusermessages'. The logical page size of this table is 4096 bytes.
The indexes for 'sysusermessages' are already correct. They will not be
rebuilt.
Checking table 'sysreferences' (object ID 16): Logical page size is 4096 bytes.
Checking partition 'sysreferences_16' (partition ID 16) of table
'sysreferences'. The logical page size of this table is 4096 bytes.
The indexes for 'sysreferences' are already correct. They will not be rebuilt.
Checking table 'sysconstraints' (object ID 17): Logical page size is 4096
bytes.
Checking partition 'sysconstraints_17' (partition ID 17) of table
'sysconstraints'. The logical page size of this table is 4096 bytes.
The indexes for 'sysconstraints' are already correct. They will not be
rebuilt.
Checking table 'systhresholds' (object ID 18): Logical page size is 4096 bytes.
Checking partition 'systhresholds_18' (partition ID 18) of table
'systhresholds'. The logical page size of this table is 4096 bytes.
The table 'systhresholds' has no indexes.
Checking table 'sysroles' (object ID 19): Logical page size is 4096 bytes.
Checking partition 'sysroles_19' (partition ID 19) of table 'sysroles'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysroles' are already correct. They will not be rebuilt.
Checking table 'sysattributes' (object ID 21): Logical page size is 4096 bytes.
Checking partition 'sysattributes_21' (partition ID 21) of table
'sysattributes'. The logical page size of this table is 4096 bytes.
The indexes for 'sysattributes' are already correct. They will not be rebuilt.
Checking table 'sysslices' (object ID 22): Logical page size is 4096 bytes.
Checking partition 'csysslices_22' (partition ID 22) of table 'sysslices'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysslices' are already correct. They will not be rebuilt.
Checking table 'systabstats' (object ID 23): Logical page size is 4096 bytes.
Checking partition 'systabstats_23' (partition ID 23) of table 'systabstats'.
The logical page size of this table is 4096 bytes.
The indexes for 'systabstats' are already correct. They will not be rebuilt.
Checking table 'sysstatistics' (object ID 24): Logical page size is 4096 bytes.
Checking partition 'sysstatistics_24' (partition ID 24) of table
'sysstatistics'. The logical page size of this table is 4096 bytes.
The indexes for 'sysstatistics' are already correct. They will not be rebuilt.
Checking table 'sysxtypes' (object ID 25): Logical page size is 4096 bytes.
Checking partition 'sysxtypes_25' (partition ID 25) of table 'sysxtypes'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysxtypes' are already correct. They will not be rebuilt.
Checking table 'sysjars' (object ID 26): Logical page size is 4096 bytes.
Checking partition 'sysjars_26' (partition ID 26) of table 'sysjars'. The
logical page size of this table is 4096 bytes.
The indexes for 'sysjars' are already correct. They will not be rebuilt.
Checking table 'sysqueryplans' (object ID 27): Logical page size is 4096 bytes.
Checking partition 'sysqueryplans_27' (partition ID 27) of table
'sysqueryplans'. The logical page size of this table is 4096 bytes.
The indexes for 'sysqueryplans' are already correct. They will not be rebuilt.
Checking table 'syspartitions' (object ID 28): Logical page size is 4096 bytes.
Checking partition 'syspartitions_28' (partition ID 28) of table
'syspartitions'. The logical page size of this table is 4096 bytes.
The indexes for 'syspartitions' are already correct. They will not be rebuilt.
Checking table 'syspartitionkeys' (object ID 29): Logical page size is 4096
bytes.
Checking partition 'syspartitionkeys_29' (partition ID 29) of table
'syspartitionkeys'. The logical page size of this table is 4096 bytes.
The indexes for 'syspartitionkeys' are already correct. They will not be
rebuilt.
Checking table 'sysencryptkeys' (object ID 98): Logical page size is 4096
bytes.
Checking partition 'sysencryptkeys_98' (partition ID 98) of table
'sysencryptkeys'. The logical page size of this table is 4096 bytes.
Msg 9989, Level 16, State 1:
Server 'SYB_NFJD_TEST', Line 1:
The number of deleted rows (65535) in the page header of DOL datapage 633,
partition ID 98 is incorrect. This value cannot be negative.
One or more indexes are corrupt. They will be rebuilt.
There are 0.000000 rows in 1 pages for object 'sysencryptkeys'.
Clustered index 'csysencryptkeys' (ID = 2) successfully restored for object
'sysencryptkeys' in 'testdb' database.
(50 rows affected)
(0 rows affected)
(0 rows affected)
WARNING: One or more indexes on user tables may have been marked as 'suspect'
making these indexes unusable. Use the sp_post_xpload stored procedure to check
and rebuild these indexes.
Database 'testdb' is now online.
1> use testdb
2> go
1> sp_indsuspect
2> go
Suspect indexes in database testdb:
Own.Tab.Ind (Obj_ID, Ind_ID)
-----------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------
---------------------------------------------------------------
testuser.S_OFFICE.S_OFFICE_IND1_x (395145422, 2)
dbo.office.unique_indx_officeid (439669583, 2)
testuser.S_USER.S_USER_IND1_x (699146505, 2)
testuser.S_USER.S_USER_IND2_x (699146505, 3)
dbo.devices.abc (704002508, 2)
dbo.databases.abc (736002622, 2)
dbo.usages.abcd (768002736, 2)
testuser.LAN_PAGENO_RANGE.aaaaa (788194827, 2)
dbo.pbcattbl.pbcattbl_idx (800002850, 2)
dbo.pbcatcol.pbcatcol_idx (848003021, 2)
dbo.pbcatfmt.pbcatfmt_idx (896003192, 2)
testuser.LAN_SYS_syscolumns.LAN_SYS_syscolumns (1012195625, 2)
testuser.WF_EFORM.PK_WF_EFORM_x (1019147645, 2)
testuser.LAN_SYS_sysobjects.LAN_SYS_sysobjects (1060195796, 2)
testuser.ARCHIVES.PK_ARCHIVES_x (1084527866, 2)
/**************************************************
省略一部分表的索引............
**************************************************/
testuser.LAN_SYS_sysindexes.LAN_SYS_sysindexes (1108195967, 2)
dbo.PartitionTestTable.idx_PartitionTestTable_id (1223672376, 2)
dbo.PartitionTestTable.idx_PartitionTestTable_name (1223672376, 3)
dbo.test3.idx_test3_id (1351672832, 2)
dbo.test4.idx_test4_id (1399673003, 2)
testuser.LAN_sysdevices.namesss (1828198532, 2)
testuser.LAN_sysusages.pk_lan_sysusages (1892198760, 2)
testuser.LAN_sysdatabases.pk_lan_sysdatabases (1940198931, 2)
dbo.lzftest.idx_lzftest_id (1975675055, 2)
testuser.Usertype_relation.Idx_Usertype_relation (2020199216, 2)
Msg 17870, Level 16, State 1:
Server 'SYB_NFJD_TEST', Procedure 'sp_autoformat', Line 267:
Table '#temp1' does not exist in database 'tempdb'.
(return status = 0)
1>
2> sp_post_xpload
3> go
sp_post_xpload: Processing table AIX_PAGENOS (1/419)
sp_post_xpload: Processing table AIX_PAGENO_RANGE (2/419)
sp_post_xpload: Processing table AIX_SYS_syscolumns (3/419)
sp_post_xpload: Processing table AIX_SYS_sysindexes (4/419)
sp_post_xpload: Processing table AIX_SYS_sysobjects (5/419)
sp_post_xpload: Processing table AJDACG (6/419)
sp_post_xpload: Processing table AJDAJY (7/419)
sp_post_xpload: Processing table AJGDB (8/419)
Checking table 'AJGDB' (object ID 796526840): Logical page size is 4096 bytes.
Checking partition 'AJGDB_796526840' (partition ID 796526840) of table 'AJGDB'.
The logical page size of this table is 4096 bytes.
One or more indexes are corrupt. They will be rebuilt.
There are 127204.000000 rows in 10481 pages for object 'AJGDB'.
Non-clustered index 'PK_AJGDB_x' (ID = 2) successfully restored for object
'AJGDB' in 'testdb' database.
There are 127204.000000 rows in 10481 pages for object 'AJGDB'.
Non-clustered index 'INDX_AJGDB_SN_x' (ID = 3) successfully restored for object
'AJGDB' in 'testdb' database.
There are 127204.000000 rows in 10481 pages for object 'AJGDB'.
Non-clustered index 'PK_AJGDB_SN_x' (ID = 4) successfully restored for object
'AJGDB' in 'testdb' database.
sp_post_xpload: Processing table ARCHIVES (15/419)
Checking table 'ARCHIVES' (object ID 1084527866): Logical page size is 4096
bytes.
Checking partition 'ARCHIVES_1084527866' (partition ID 1084527866) of table
'ARCHIVES'. The logical page size of this table is 4096 bytes.
The indexes for 'ARCHIVES' are already correct. They will not be rebuilt.
sp_post_xpload: Processing table CASES_SXGG (118/419)
sp_post_xpload: Processing table CASES_TB (119/419)
sp_post_xpload: Processing table CASES_TJGL (120/419)
sp_post_xpload: Processing table CASES_WS (121/419)
sp_post_xpload: Processing table CASES_XS1 (122/419)
sp_post_xpload: Processing table CASES_XS2 (123/419)
sp_post_xpload: Processing table CASES_XSBHR (124/419)
sp_post_xpload: Processing table CASES_XSFDMSSSZX (125/419)
sp_post_xpload: Processing table CASES_XZ1 (126/419)
sp_post_xpload: Processing table CASES_XZBG (127/419)
sp_post_xpload: Processing table CASES_YS (128/419)
sp_post_xpload: Processing table CASES_ZBGZB (129/419)
sp_post_xpload: Processing table CASES_ZHENGR (130/419)
sp_post_xpload: Processing table CASES_ZHESJG (131/419)
sp_post_xpload: Processing table CASES_ZHESJGYJ (132/419)
sp_post_xpload: Processing table CASES_ZJ (133/419)
sp_post_xpload: Processing table CASES_ZJLT (134/419)
sp_post_xpload: Processing table CASES_ZX1 (135/419)
Checking table 'DATACODE' (object ID 1189576245): Logical page size is 4096
bytes.
Checking partition 'DATACODE_1189576245' (partition ID 1189576245) of table
'DATACODE'. The logical page size of this table is 4096 bytes.
The indexes for 'DATACODE' are already correct. They will not be rebuilt.
sp_post_xpload: Processing table DB_10 (146/419)
sp_post_xpload: Processing table DB_11 (147/419)
sp_post_xpload: Processing table DB_5 (148/419)
sp_post_xpload: Processing table DB_6 (149/419)
sp_post_xpload: Processing table DB_7 (150/419)
sp_post_xpload: Processing table DB_8 (151/419)
sp_post_xpload: Processing table DB_9 (152/419)
sp_post_xpload: Processing table DGKJZMX (153/419)
sp_post_xpload: Processing table DSR (154/419)
.........................
sp_post_xpload: Processing table LAN_PAGENOS (243/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB10 (244/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB11 (245/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB5 (246/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB6 (247/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB7 (248/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB8 (249/419)
sp_post_xpload: Processing table LAN_PAGENOS_DB9 (250/419)
sp_post_xpload: Processing table LAN_PAGENO_RANGE (251/419)
Checking table 'LAN_PAGENO_RANGE' (object ID 788194827): Logical page size is
4096 bytes.
Checking partition 'LAN_PAGENO_RANGE_788194827' (partition ID 788194827) of
table 'LAN_PAGENO_RANGE'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_PAGENO_RANGE' are already correct. They will not be
rebuilt.
sp_post_xpload: Processing table LAN_PAGENO_RANGE2 (252/419)
sp_post_xpload: Processing table LAN_PAGENO_RANGE3 (253/419)
sp_post_xpload: Processing table LAN_SYS_syscolumns (254/419)
Checking table 'LAN_SYS_syscolumns' (object ID 1012195625): Logical page size is
4096 bytes.
Checking partition 'LAN_SYS_syscolumns_1012195625' (partition ID 1012195625) of
table 'LAN_SYS_syscolumns'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_SYS_syscolumns' are already correct. They will not be
rebuilt.
sp_post_xpload: Processing table LAN_SYS_sysindexes (255/419)
Checking table 'LAN_SYS_sysindexes' (object ID 1108195967): Logical page size is
4096 bytes.
Checking partition 'LAN_SYS_sysindexes_1108195967' (partition ID 1108195967) of
table 'LAN_SYS_sysindexes'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_SYS_sysindexes' are already correct. They will not be
rebuilt.
sp_post_xpload: Processing table LAN_SYS_sysobjects (256/419)
Checking table 'LAN_SYS_sysobjects' (object ID 1060195796): Logical page size is
4096 bytes.
Checking partition 'LAN_SYS_sysobjects_1060195796' (partition ID 1060195796) of
table 'LAN_SYS_sysobjects'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_SYS_sysobjects' are already correct. They will not be
rebuilt.
sp_post_xpload: Processing table LAN_sysdatabases (257/419)
Checking table 'LAN_sysdatabases' (object ID 1940198931): Logical page size is
4096 bytes.
Checking partition 'LAN_sysdatabases_1940198931' (partition ID 1940198931) of
table 'LAN_sysdatabases'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_sysdatabases' are already correct. They will not be
rebuilt.
sp_post_xpload: Processing table LAN_sysdevices (258/419)
Checking table 'LAN_sysdevices' (object ID 1828198532): Logical page size is
4096 bytes.
Checking partition 'LAN_sysdevices_1828198532' (partition ID 1828198532) of
table 'LAN_sysdevices'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_sysdevices' are already correct. They will not be
rebuilt.
sp_post_xpload: Processing table LAN_sysusages (259/419)
Checking table 'LAN_sysusages' (object ID 1892198760): Logical page size is 4096
bytes.
Checking partition 'LAN_sysusages_1892198760' (partition ID 1892198760) of table
'LAN_sysusages'. The logical page size of this table is 4096 bytes.
The indexes for 'LAN_sysusages' are already correct. They will not be rebuilt.
sp_post_xpload: Processing table PartitionTestTable (271/419)
Checking table 'PartitionTestTable' (object ID 1223672376): Logical page size is
4096 bytes.
Checking partition 'zhang' (partition ID 1239672433) of table
'PartitionTestTable'. The logical page size of this table is 4096 bytes.
Checking partition 'liu' (partition ID 1255672490) of table
'PartitionTestTable'. The logical page size of this table is 4096 bytes.
Checking partition 'wang' (partition ID 1271672547) of table
'PartitionTestTable'. The logical page size of this table is 4096 bytes.
Checking partition 'li' (partition ID 1287672604) of table 'PartitionTestTable'.
The logical page size of this table is 4096 bytes.
One or more indexes are corrupt. They will be rebuilt.
There are 262144.000000 rows in 1082 pages for object 'PartitionTestTable'.
Non-clustered index 'idx_PartitionTestTable_id' (ID = 2) successfully restored
for object 'PartitionTestTable' in 'testdb' database.
There are 262144.000000 rows in 1082 pages for object 'PartitionTestTable'.
Non-clustered index 'idx_PartitionTestTable_name' (ID = 3) successfully restored
for object 'PartitionTestTable' in 'testdb' database.
sp_post_xpload: Processing table S_OFFICE (346/419)
Checking table 'S_OFFICE' (object ID 395145422): Logical page size is 4096
bytes.
Checking partition 'PK_S_OFFICE_x_395145422' (partition ID 395145422) of table
'S_OFFICE'. The logical page size of this table is 4096 bytes.
The indexes for 'S_OFFICE' are already correct. They will not be rebuilt.
sp_post_xpload: Processing table Usertype_relation (364/419)
Checking table 'Usertype_relation' (object ID 2020199216): Logical page size is
4096 bytes.
Checking partition 'Usertype_relation_2020199216' (partition ID 2020199216) of
table 'Usertype_relation'. The logical page size of this table is 4096 bytes.
The indexes for 'Usertype_relation' are already correct. They will not be
rebuilt.
sp_post_xpload: Processing table databases (395/419)
Checking table 'databases' (object ID 736002622): Logical page size is 4096
bytes.
Checking partition 'databases_736002622' (partition ID 736002622) of table
'databases'. The logical page size of this table is 4096 bytes.
The indexes for 'databases' are already correct. They will not be rebuilt.
sp_post_xpload: Processing table devices (396/419)
Checking table 'devices' (object ID 704002508): Logical page size is 4096
bytes.
Checking partition 'devices_704002508' (partition ID 704002508) of table
'devices'. The logical page size of this table is 4096 bytes.
The indexes for 'devices' are already correct. They will not be rebuilt.
sp_post_xpload: Processing table employee (397/419)
sp_post_xpload: Processing table employee_bak (398/419)
sp_post_xpload: Processing table kqjcb (399/419)
sp_post_xpload: Processing table lzftest (400/419)
Checking table 'lzftest' (object ID 1975675055): Logical page size is 4096
bytes.
/**************************************************
省略一部分表的索引重建过程............
**************************************************/
Checking partition 'li' (partition ID 1991675112) of table 'lzftest'. The
logical page size of this table is 4096 bytes.
Checking partition 'liu' (partition ID 2007675169) of table 'lzftest'. The
logical page size of this table is 4096 bytes.
Checking partition 'wang' (partition ID 2023675226) of table 'lzftest'. The
logical page size of this table is 4096 bytes.
Checking partition 'zhang' (partition ID 2039675283) of table 'lzftest'. The
logical page size of this table is 4096 bytes.
Checking partition 'zhu' (partition ID 2071675397) of table 'lzftest'. The
logical page size of this table is 4096 bytes.
The indexes for 'lzftest' are already correct. They will not be rebuilt.
sp_post_xpload: Processing table office (401/419)
Checking table 'office' (object ID 439669583): Logical page size is 4096 bytes.
Checking partition 'office_439669583' (partition ID 439669583) of table
'office'. The logical page size of this table is 4096 bytes.
The indexes for 'office' are already correct. They will not be rebuilt.
sp_post_xpload: Processing table office_bak (402/419)
sp_post_xpload: Processing table pbcatcol (403/419)
Checking table 'pbcatcol' (object ID 848003021): Logical page size is 4096
bytes.
Checking partition 'pbcatcol_848003021' (partition ID 848003021) of table
'pbcatcol'. The logical page size of this table is 4096 bytes.
The indexes for 'pbcatcol' are already correct. They will not be rebuilt.
sp_post_xpload: Processing table pbcatedt (404/419)
sp_post_xpload: Processing table pbcatfmt (405/419)
Checking table 'pbcatfmt' (object ID 896003192): Logical page size is 4096
bytes.
Checking partition 'pbcatfmt_896003192' (partition ID 896003192) of table
'pbcatfmt'. The logical page size of this table is 4096 bytes.
The indexes for 'pbcatfmt' are already correct. They will not be rebuilt.
sp_post_xpload: Processing table pbcattbl (406/419)
Checking table 'pbcattbl' (object ID 800002850): Logical page size is 4096
bytes.
Checking partition 'pbcattbl_800002850' (partition ID 800002850) of table
'pbcattbl'. The logical page size of this table is 4096 bytes.
The indexes for 'pbcattbl' are already correct. They will not be rebuilt.
sp_post_xpload: Processing table pbcatvld (407/419)
sp_post_xpload: Processing table syscolumn (408/419)
sp_post_xpload: Processing table sysobjects1 (409/419)
sp_post_xpload: Processing table temp2 (410/419)
sp_post_xpload: Processing table temptbl (411/419)
sp_post_xpload: Processing table test (412/419)
sp_post_xpload: Processing table test (413/419)
sp_post_xpload: Processing table test2 (414/419)
sp_post_xpload: Processing table test3 (415/419)
Checking table 'test3' (object ID 1351672832): Logical page size is 4096 bytes.
Checking partition 'pk_test3_id_1351672832' (partition ID 1351672832) of table
'test3'. The logical page size of this table is 4096 bytes.
The indexes for 'test3' are already correct. They will not be rebuilt.
sp_post_xpload: Processing table test4 (416/419)
Checking table 'test4' (object ID 1399673003): Logical page size is 4096 bytes.
Checking partition 'pk_test4_id_1399673003' (partition ID 1399673003) of table
'test4'. The logical page size of this table is 4096 bytes.
The indexes for 'test4' are already correct. They will not be rebuilt.
sp_post_xpload: Processing table testtimestamp (417/419)
sp_post_xpload: Processing table testvarchar (418/419)
sp_post_xpload: Processing table usages (419/419)
Checking table 'usages' (object ID 768002736): Logical page size is 4096 bytes.
Checking partition 'usages_768002736' (partition ID 768002736) of table
'usages'. The logical page size of this table is 4096 bytes.
The indexes for 'usages' are already correct. They will not be rebuilt.
(return status = 0)
1> sp_indsuspect
2> go
There are no suspect indexes in database testdb.
(return status = 0)
1>
————————————————————————————————-
—- 本文为andkylee个人原创,请在尊重作者劳动成果的前提下进行转载;
—- 转载务必注明原始出处 : http://www.dbainfo.net
—- 关键字: ASE 15.0.3 跨平台 备份 恢复 Solaris windows
————————————————————————————————-
分析一下给表增加字段时sybase数据库的内部处理过程。
表原来的结构:
create table t(id int, col1 varchar(30))
向表中插入数据:
insert into t
select 1,'a'
go
insert into t
select 1,'a'
go
insert into t
select 2,'b'
go
insert into t
select 3,'c'
go
测试表t的object_id是:
1> select object_id('t')
2> go
-----------
608002166
利用dbcc log分析数据库的日志,可以看出上面的四条insert语句对应了四个单独的事务。因为sybase中默认是隐式提交的。
四条记录的页号和偏移分别是:
row1. pageno=801 offset=32
row2. pageno=801 offset=44
row3. pageno=801 offset=56
row4. pageno=801 offset=68
BEGINXACT (256007,32) sessionid=256007,32
attcnt=1 rno=32 op=0 padlen=2 sessionid=256007,32 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
masterxsid=(invalid sessionid)
xstat=XBEG_ENDXACT,
spid=1 suid=1 uid=1 masterdbid=0 dtmcord=0
name=$ins time=Apr 7 2010 10:21:49:756AM
INSERT (256007,33) sessionid=256007,32
attcnt=1 rno=33 op=4 padlen=0 sessionid=256007,32 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=608002166 ptnid=608002166 pageno=801 offset=32 status=0x800 (0x08
00
(XSTAT_EXPAGE))
cid=0 indid=0
old ts=0x0000 0x000017d3 new ts=0x0000 0x000017e1
xrow:
10003620d3c ( 0): 01000000 0001000c 61020908 ........a...
ENDXACT (256007,34) sessionid=256007,32
attcnt=1 rno=34 op=30 padlen=4 sessionid=256007,32 len=32
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
endstat=COMMIT time=Apr 7 2010 10:21:49:756AM
xstat=0x0 []
BEGINXACT (256007,35) sessionid=256007,35
attcnt=1 rno=35 op=0 padlen=2 sessionid=256007,35 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
masterxsid=(invalid sessionid)
xstat=XBEG_ENDXACT,
spid=1 suid=1 uid=1 masterdbid=0 dtmcord=0
name=$ins time=Apr 7 2010 10:21:55:756AM
INSERT (256007,36) sessionid=256007,35
attcnt=1 rno=36 op=4 padlen=0 sessionid=256007,35 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=608002166 ptnid=608002166 pageno=801 offset=44 status=0x800 (0x08
00
(XSTAT_EXPAGE))
cid=0 indid=0
old ts=0x0000 0x000017e1 new ts=0x0000 0x000017e3
xrow:
10003620ddc ( 0): 01010000 0001000c 61020908 ........a...
ENDXACT (256007,37) sessionid=256007,35
attcnt=1 rno=37 op=30 padlen=4 sessionid=256007,35 len=32
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
endstat=COMMIT time=Apr 7 2010 10:21:55:756AM
xstat=0x0 []
BEGINXACT (256007,38) sessionid=256007,38
attcnt=1 rno=38 op=0 padlen=2 sessionid=256007,38 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
masterxsid=(invalid sessionid)
xstat=XBEG_ENDXACT,
spid=1 suid=1 uid=1 masterdbid=0 dtmcord=0
name=$ins time=Apr 7 2010 10:22:03:756AM
INSERT (256007,39) sessionid=256007,38
attcnt=1 rno=39 op=4 padlen=0 sessionid=256007,38 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=608002166 ptnid=608002166 pageno=801 offset=56 status=0x800 (0x08
00
(XSTAT_EXPAGE))
cid=0 indid=0
old ts=0x0000 0x000017e3 new ts=0x0000 0x000017e5
xrow:
10003620e7c ( 0): 01020000 0002000c 62020908 ........b...
ENDXACT (256007,40) sessionid=256007,38
attcnt=1 rno=40 op=30 padlen=4 sessionid=256007,38 len=32
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
endstat=COMMIT time=Apr 7 2010 10:22:03:756AM
xstat=0x0 []
BEGINXACT (256007,41) sessionid=256007,41
attcnt=1 rno=41 op=0 padlen=2 sessionid=256007,41 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
masterxsid=(invalid sessionid)
xstat=XBEG_ENDXACT,
spid=1 suid=1 uid=1 masterdbid=0 dtmcord=0
name=$ins time=Apr 7 2010 10:22:07:756AM
INSERT (256007,42) sessionid=256007,41
attcnt=1 rno=42 op=4 padlen=0 sessionid=256007,41 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=608002166 ptnid=608002166 pageno=801 offset=68 status=0x800 (0x08
00
(XSTAT_EXPAGE))
cid=0 indid=0
old ts=0x0000 0x000017e5 new ts=0x0000 0x000017e7
xrow:
10003620f1c ( 0): 01030000 0003000c 63020908 ........c...
ENDXACT (256007,43) sessionid=256007,41
attcnt=1 rno=43 op=30 padlen=4 sessionid=256007,41 len=32
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
endstat=COMMIT time=Apr 7 2010 10:22:07:756AM
xstat=0x0 []
接着,向表中添加一个identity字段。
alter table t add col2 int identity not null
go
再利用dbcc log分析日志,我们可以看出在这四行数据上面发生了延迟更新(op=6,INSID在日志类型中是延迟更新的意思!)。
每行数据的页号和偏移变成了:
row1. pageno=801 offset=32
row2. pageno=801 offset=49
row3. pageno=801 offset=66
row4. pageno=801 offset=83
INSIND (256008,24) sessionid=256008,2
attcnt=1 rno=24 op=6 padlen=2 sessionid=256008,2 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=608002166 ptnid=608002166 pageno=801 offset=32 status=0x2000 (0x2
000
(XSTAT_EXTABLE))
cid=0 indid=0
old ts=0x0000 0x000017f8 new ts=0x0000 0x000017f9
data rnum 0 ptr=(256008,13)
INSIND (256008,25) sessionid=256008,2
attcnt=1 rno=25 op=6 padlen=2 sessionid=256008,2 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=608002166 ptnid=608002166 pageno=801 offset=49 status=0x2000 (0x2
000
(XSTAT_EXTABLE))
cid=0 indid=0
old ts=0x0000 0x000017f9 new ts=0x0000 0x000017fa
data rnum 1 ptr=(256008,15)
INSIND (256008,26) sessionid=256008,2
attcnt=1 rno=26 op=6 padlen=2 sessionid=256008,2 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=608002166 ptnid=608002166 pageno=801 offset=66 status=0x2000 (0x2
000
(XSTAT_EXTABLE))
cid=0 indid=0
old ts=0x0000 0x000017fa new ts=0x0000 0x000017fb
data rnum 2 ptr=(256008,17)
INSIND (256008,27) sessionid=256008,2
attcnt=1 rno=27 op=6 padlen=2 sessionid=256008,2 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=608002166 ptnid=608002166 pageno=801 offset=83 status=0x2000 (0x2
000
(XSTAT_EXTABLE))
cid=0 indid=0
old ts=0x0000 0x000017fb new ts=0x0000 0x000017fc
data rnum 3 ptr=(256008,19)
比较一下前后的各行的偏移量。我们发现:第一行没有移动,第二行向下移动了5(49-44)字节,第三行向下移动了10字节,第四行向下移动了15字节(83-68)。也就是说,每行增加了5个字节的数据。5个字节是因为:int类型占用4个字节再加一个字节的长度。
关于alter table add语法方面的
在向表添加列时是不能够添加not null 列的。错误如下所示:
1> alter table t add col4 char(30) not null
2> go
Msg 4997, Level 16, State 1:
Server 'SYB_NFJD_TEST', Line 1:
ALTER TABLE 't' failed. Default clause is required in order to add non-NULL
column 'col4'.
1> alter table t add col4 int not null
2> go
Msg 4997, Level 16, State 1:
Server 'SYB_NFJD_TEST', Line 1:
ALTER TABLE 't' failed. Default clause is required in order to add non-NULL
column 'col4'.
1>
1. 只能添加为空的字段。
2. 但是,本文前面的向表添加identity类型的int 非空字段却可以。alter table t add col2 int identity not null却可以。
3. 这似乎和SQL标准中的不太一致。
4. 分析page:801页面上的数据。发现最后添加的identity列居然是作为可变长字段进行存储的。字段col即使被定义为非空,但是物理存储上却是作为可变长存储的。因为是varchar类型。
注意: 后来我通过试验发现有一种例外情况。就是新增一个非空列的时候对这列指定默认值,就可以成功增加这列。
比如:alter table test add COLC char(1) default "0" not null
这条语句就能够成功执行!
删除表上的字段的时候报错:
1> alter table t drop col2
2> go
Msg 11052, Level 16, State 1:
Server 'SYB_NFJD_TEST', Line 1:
The 'select into' database option is not enabled for database 'testdb'. ALTER
TABLE with data copy cannot be done. Set the 'select into' database option and
re-run.
1>
报错的原因是表t所在的数据库testdb没有打开select into buklcopy选项。
打开testdb的select into/bulkcopy/pllsort 选项
1> use master
2> go
1> sp_dboption testdb,'select into',true
2> go
Database option 'select into/bulkcopy/pllsort' turned ON for database 'testdb'.
Running CHECKPOINT on database 'testdb' for option 'select
into/bulkcopy/pllsort' to take effect.
(return status = 0)
再次执行删除列的操作,可以执行成功!
1> use testdb
2> go
1> alter table t drop col2
2> go
(4 rows affected)
删除完col2之后,再次分析一下dbcc log的结果。
发现背后进行的操作有三步:
第一:删除表t在systabstats上的统计信息并重建;
第二:删除在系统表sysstatistics,sysobjects,syscolumns,sysindexes,syspartitions上对应记录的索引然后重建;
第三:更新在系统表sysstatistics,sysobjects,syscolumns,sysindexes,syspartitions上对应记录的信息。
删除表上的列的过程的日志信息,如下:
BEGINXACT (256038,36) sessionid=256038,36
attcnt=1 rno=36 op=0 padlen=2 sessionid=256038,36 len=104
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
masterxsid=(invalid sessionid)
xstat=XBEG_ENDXACT,
spid=1 suid=1 uid=1 masterdbid=0 dtmcord=0
name=$ALTER TABLE ADM t ID=880003135 dbid=4 fid=1 time=Apr 7 2010
12:43:21:076PM
BT_DELETE (256038,37) sessionid=256038,36
attcnt=1 rno=37 op=72 padlen=7 sessionid=256038,36 len=88
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=23 systabstats indid=2 ptnid=23 pageno=209 level=0 root=208 cid=0
status=0x00 (0x0000)
slot=90 ridposn=0 oldposn=0
old ts=0x0000 0x00001c54 new ts=0x0000 0x00001c86
B-tree key:
10003624c20 ( 0): 003473c8 3f000034 73c83f00 0000c400 .4s.?..4s.?.....
10003624c30 ( 16): 00 .
DOL_DELETE (256038,38) sessionid=256038,36
attcnt=1 rno=38 op=66 padlen=6 sessionid=256038,36 len=224
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=23 systabstats ptnid=23 pageno=196 rowno=0 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
old ts=0x0000 0x00001c7d new ts=0x0000 0x00001c87
xdol_row:
10003624c6a ( 0): 00000000 00000000 3473c83f 00000000 ........4s.?....
10003624c7a ( 16): 00000000 00000001 00000006 00000001 ................
10003624c8a ( 32): 40100000 00000000 00000000 00000000 @...............
10003624c9a ( 48): 00000000 00000000 00000000 00000000 ................
10003624caa ( 64): 00000000 00000000 00000000 00000000 ................
10003624cba ( 80): 00000000 00000000 40378000 00000000 ........@7......
10003624cca ( 96): 00000000 00000000 00000000 00000000 ................
10003624cda ( 112): 3f800000 3f800000 00000000 00000000 ?...?...........
10003624cea ( 128): 00000000 00000000 00000000 00000000 ................
10003624cfa ( 144): 3f800000 3f800000 3473c83f 00000000 ?...?...4s.?....
10003624d0a ( 160): 00009d51 00bf1c77 ...Q...w
DOL_INSERT (256038,39) sessionid=256038,36
attcnt=1 rno=39 op=63 padlen=6 sessionid=256038,36 len=224
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=23 systabstats ptnid=23 pageno=196 rowno=7 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
old ts=0x0000 0x00001c87 new ts=0x0000 0x00001c88
xdol_row:
10003624d4a ( 0): 00070004 00000000 3473c83f 00000000 ........4s.?....
10003624d5a ( 16): 00000000 00000001 00000006 00000001 ................
10003624d6a ( 32): 40100000 00000000 00000000 00000000 @...............
10003624d7a ( 48): 00000000 00000000 00000000 00000000 ................
10003624d8a ( 64): 00000000 00000000 00000000 00000000 ................
10003624d9a ( 80): 00000000 00000000 40378000 00000000 ........@7......
10003624daa ( 96): 00000000 00000000 00000000 00000000 ................
10003624dba ( 112): 3f800000 3f800000 00000000 00000000 ?...?...........
10003624dca ( 128): 00000000 00000000 00000000 00000000 ................
10003624dda ( 144): 3f800000 3f800000 3473c83f 00000000 ?...?...4s.?....
10003624dea ( 160): 00009d51 00d1a923 ...Q...#
BT_INSERT (256038,40) sessionid=256038,36
attcnt=1 rno=40 op=71 padlen=7 sessionid=256038,36 len=88
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=23 systabstats indid=2 ptnid=23 pageno=209 level=0 root=208 cid=0
status=0x220 (0x0200 (XSTAT_BT_CHANGE_LCTXREPLACEDEL), 0x0020
(XSTAT_BT_CHANGE_REPLACERID))
slot=90 ridposn=0 oldposn=0
old ts=0x0000 0x00001c86 new ts=0x0000 0x00001c89
B-tree key:
10003624e38 ( 0): 003473c8 3f000034 73c83f00 0000c420 .4s.?..4s.?....
10003624e48 ( 16): 07 .
OAMCREATE (256038,41) sessionid=256038,36
attcnt=1 rno=41 op=41 padlen=4 sessionid=256038,36 len=128
odc_stat=0x0040 (0x0040 (LHSX_SLRXACT))
loh_status: 0x40 (0x00000040 (LHSX_SLRXACT))
xpostcommit_scan_nextpg=3
Page header for page 0x10003624e64
pageno=888 nextpg=888 prevpg=888 ptnid=880003135 timestamp=0000 00001c8a
oampgcount=0 attrcount=0 indid=0 totalentries_lo=0 entrycount=0
page status bits: 0x8004 (0x8000 (PG_OAMPG), 0x0004 (PG_OAMSORT))
old next ts=0x0000 0x00000000 new next ts=0x0000 0x00000000
old prev ts=0x0000 0x00000000 new prev ts=0x0000 0x00000000
oampg=0 cid=0 objid=880003135
extent oampage=0 extptnid=880003135 pgl_status=0x808 (XPG_SET_SORT)
OAMINSERT (256038,42) sessionid=256038,36
attcnt=1 rno=42 op=39 padlen=0 sessionid=256038,36 len=72
odc_stat=0x0140 (0x0100 (LHSR_DO_NOT_UNDO), 0x0040 (LHSX_SLRXACT))
loh_status: 0x140 (0x00000100 (LHSR_DO_NOT_UNDO), 0x00000040 (LHSX_SLRXA
CT))
oampg=888, allocpg=768, xinspg=888
xobjid=880003135 , xindid=0, xptnid=880003135
prev ts=0x0000 0x00001c8a new ts=0x0000 0x00001c8b
hdr prev ts=0x0000 0x00001c8a hdr new ts=0x0000 0x00001c8b
ALLOC (256038,43) sessionid=256038,36
attcnt=1 rno=43 op=13 padlen=4 sessionid=256038,36 len=128
odc_stat=0x0200 (0x0200 (LHSX_POSTCOMMIT_SCAN))
loh_status: 0x200 (0x00000200 (LHSX_POSTCOMMIT_SCAN))
xpostcommit_scan_nextpg=0
Page header for page 0x10003624f2c
pageno=889 nextpg=0 prevpg=0 ptnid=880003135 timestamp=0000 00001c8c
nextrno=0 level=0 indid=0 freeoff=32 minlen=6
page status bits: 0x1 (0x0001 (PG_DATA))
old next ts=0x0000 0x00000000 new next ts=0x0000 0x00000000
old prev ts=0x0000 0x00000000 new prev ts=0x0000 0x00000000
oampg=888 cid=0 objid=880003135
extent oampage=888 extptnid=880003135 pgl_status=0x808 (XPG_SET_SORT)
OAMENTRYMOVE (256039,0) sessionid=256038,36
attcnt=1 rno=0 op=51 padlen=0 sessionid=256038,36 len=144
odc_stat=0x0040 (0x0040 (LHSX_SLRXACT))
loh_status: 0x40 (0x00000040 (LHSX_SLRXACT))
xobjid=880003135 xindid=0 xsrc_ptnid=880003135 xdst_ptnid=0
entries_moved=0, xsrc_cacheid=0 xdst_cacheid=0
xsrc_1st_oampgno=0 xsrc_oampgno=888
xdst_1st_oampgno=0 xdst_oampgno=0
xsrc_1st_oam_oldts=0x0000 0x00000000 xsrc_oam_oldts=0x0000 0x00001c8b
xsrc_1st_oam_newts=0x0000 0x00000000 xsrc_oam_newts=0x0000 0x00001c8d
xdst_1st_oam_oldts=0x0000 0x00000000 xdst_oam_oldts=0x0000 0x00000000
xdst_1st_oam_newts=0x0000 0x00000000 xdst_oam_newts=0x0000 0x00000000
oamentry: allocpg=0 used=0 unused=0
deleted_index=0 reserved=10 xoamvstat=0x0 (0x00)
OAMATPUT (256039,1) sessionid=256038,36
attcnt=1 rno=1 op=52 padlen=0 sessionid=256038,36 len=120
odc_stat=0x0040 (0x0040 (LHSX_SLRXACT))
loh_status: 0x40 (0x00000040 (LHSX_SLRXACT))
objid=880003135 ptnid=880003135 pageno=888 offset=10 status=0x00 (0x000
0)
cid=0 indid=0
old ts=0x0000 0x00001c8d new ts=0x0000 0x00001c8f
xvallen=64
newval:
100032660e8 ( 0): 00000000 00000000 00000000 00000000 ................
100032660f8 ( 16): 00000000 00000000 00000000 00000000 ................
10003266108 ( 32): 00000000 00000000 00000000 00000000 ................
10003266118 ( 48): 00000000 00000000 00000000 00000000 ................
10003266128 ( 64):
DROPEXTSMAP (256039,2) sessionid=256038,36
attcnt=1 rno=2 op=77 padlen=4 sessionid=256038,36 len=152
odc_stat=0x0200 (0x0200 (LHSX_POSTCOMMIT_SCAN))
loh_status: 0x200 (0x00000200 (LHSX_POSTCOMMIT_SCAN))
xpostcommit_scan_nextpg=256039
objid=880003135 , indid=0 ptnid=880003135 de_status=0x00 (0x0000)
de_allocpg=768, de_oamretainpg (saved oam pg)=0, de_retainpg (saved pg)=
0,
de_cid (cache ID)=0
Extent map: 0x08000000
Extents in use:
Extid: 800
Alloc : 0x03 ( 800 801 )
Dealloc : 0x00 ( )
DOL_UPDATE (256039,3) sessionid=256038,36
attcnt=1 rno=3 op=65 padlen=0 sessionid=256038,36 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=2 sysindexes ptnid=2 pageno=19 rowno=18 cid=0 erl=0
status (xstat)=0x00 (0x0000)
status2 (xstat2)=0x04 (0x0004 (XSTAT2_DOL_SHROW))
old ts=0x0000 0x00001c6c new ts=0x0000 0x00001c90
xfirstoff=0, xoldvlen=0, xnewvlen=0
xoldstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image:
10003266200 ( 0):
new image:
10003266200 ( 0):
DOL_UPDATE (256039,4) sessionid=256038,36
attcnt=1 rno=4 op=65 padlen=6 sessionid=256038,36 len=72
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=2 sysindexes ptnid=2 pageno=19 rowno=18 cid=0 erl=0
status (xstat)=0x00 (0x0000)
status2 (xstat2)=0x04 (0x0004 (XSTAT2_DOL_SHROW))
old ts=0x0000 0x00001c90 new ts=0x0000 0x00001c91
xfirstoff=57, xoldvlen=1, xnewvlen=1
xoldstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image: 46
10003266240 ( 0): 2e .
new image: 41
10003266241 ( 0): 29 )
DOL_UPDATE (256039,5) sessionid=256038,36
attcnt=1 rno=5 op=65 padlen=6 sessionid=256038,36 len=72
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=28 syspartitions ptnid=28 pageno=82 rowno=16 cid=0 erl=0
status (xstat)=0x00 (0x0000)
status2 (xstat2)=0x04 (0x0004 (XSTAT2_DOL_SHROW))
old ts=0x0000 0x00001c50 new ts=0x0000 0x00001c92
xfirstoff=35, xoldvlen=1, xnewvlen=1
xoldstatus=0x08: (0x0008 (DOL_ROW_UPDATED))
xnewstatus=0x08: (0x0008 (DOL_ROW_UPDATED))
old image: 33
10003266288 ( 0): 21 !
new image: 121
10003266289 ( 0): 79 y
DOL_UPDATE (256039,6) sessionid=256038,36
attcnt=1 rno=6 op=65 padlen=6 sessionid=256038,36 len=72
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=28 syspartitions ptnid=28 pageno=82 rowno=16 cid=0 erl=0
status (xstat)=0x00 (0x0000)
status2 (xstat2)=0x04 (0x0004 (XSTAT2_DOL_SHROW))
old ts=0x0000 0x00001c92 new ts=0x0000 0x00001c93
xfirstoff=39, xoldvlen=1, xnewvlen=1
xoldstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image: 33
100032662d0 ( 0): 21 !
new image: 121
100032662d1 ( 0): 79 y
DOL_UPDATE (256039,7) sessionid=256038,36
attcnt=1 rno=7 op=65 padlen=6 sessionid=256038,36 len=72
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=28 syspartitions ptnid=28 pageno=82 rowno=16 cid=0 erl=0
status (xstat)=0x00 (0x0000)
status2 (xstat2)=0x04 (0x0004 (XSTAT2_DOL_SHROW))
old ts=0x0000 0x00001c93 new ts=0x0000 0x00001c94
xfirstoff=27, xoldvlen=1, xnewvlen=1
xoldstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image: 32
10003266318 ( 0): 20
new image: 120
10003266319 ( 0): 78 x
DOL_UPDATE (256039,8) sessionid=256038,36
attcnt=1 rno=8 op=65 padlen=6 sessionid=256038,36 len=72
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=28 syspartitions ptnid=28 pageno=82 rowno=16 cid=0 erl=0
status (xstat)=0x00 (0x0000)
status2 (xstat2)=0x04 (0x0004 (XSTAT2_DOL_SHROW))
old ts=0x0000 0x00001c94 new ts=0x0000 0x00001c95
xfirstoff=23, xoldvlen=1, xnewvlen=1
xoldstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image: 0
10003266360 ( 0): 00 .
new image: 2
10003266361 ( 0): 02 .
DOL_UPDATE (256039,9) sessionid=256038,36
attcnt=1 rno=9 op=65 padlen=2 sessionid=256038,36 len=72
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=2 sysindexes ptnid=2 pageno=19 rowno=18 cid=0 erl=0
status (xstat)=0x00 (0x0000)
status2 (xstat2)=0x04 (0x0004 (XSTAT2_DOL_SHROW))
old ts=0x0000 0x00001c91 new ts=0x0000 0x00001c96
xfirstoff=80, xoldvlen=3, xnewvlen=3
xoldstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image:
100032663a8 ( 0): beb176 ..v
new image:
100032663ab ( 0): d1a923 ..#
BT_DELETE (256039,10) sessionid=256038,36
attcnt=1 rno=10 op=72 padlen=1 sessionid=256038,36 len=80
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=3 syscolumns indid=2 ptnid=3 pageno=53 level=0 root=49 cid=0 statu
s=0x00
(0x0000)
slot=14 ridposn=0 oldposn=0
old ts=0x0000 0x00001c6b new ts=0x0000 0x00001c97
B-tree key:
100032663f0 ( 0): 003473c8 3f000000 01000000 2e0035 .4s.?.........5
DOL_DELETE (256039,11) sessionid=256038,36
attcnt=1 rno=11 op=66 padlen=4 sessionid=256038,36 len=96
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=3 syscolumns ptnid=3 pageno=46 rowno=53 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
old ts=0x0000 0x00001c6a new ts=0x0000 0x00001c98
xdol_row:
10003266432 ( 0): 00350000 00010000 3473c83f 00010038 .5......4s.?...8
10003266442 ( 16): 00000004 00020000 00000007 00000000 ................
10003266452 ( 32): 00000000 002a6964 0026 .....*id.&
BT_DELETE (256039,12) sessionid=256038,36
attcnt=1 rno=12 op=72 padlen=1 sessionid=256038,36 len=80
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=3 syscolumns indid=2 ptnid=3 pageno=53 level=0 root=49 cid=0 statu
s=0x00
(0x0000)
slot=15 ridposn=0 oldposn=0
old ts=0x0000 0x00001c97 new ts=0x0000 0x00001c99
B-tree key:
100032664a0 ( 0): 003473c8 3f000000 02000000 2e0036 .4s.?.........6
DOL_DELETE (256039,13) sessionid=256038,36
attcnt=1 rno=13 op=66 padlen=2 sessionid=256038,36 len=96
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=3 syscolumns ptnid=3 pageno=46 rowno=54 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
old ts=0x0000 0x00001c98 new ts=0x0000 0x00001c9a
xdol_row:
100032664e2 ( 0): 00360000 00010000 3473c83f 00020027 .6......4s.?...'
100032664f2 ( 16): 0000001e ffff0000 00000002 00000000 ................
10003266502 ( 32): 00000000 002c6e61 6d650026 .....,name.&
BT_DELETE (256039,14) sessionid=256038,36
attcnt=1 rno=14 op=72 padlen=1 sessionid=256038,36 len=80
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=3 syscolumns indid=2 ptnid=3 pageno=53 level=0 root=49 cid=0 statu
s=0x00
(0x0000)
slot=16 ridposn=0 oldposn=0
old ts=0x0000 0x00001c99 new ts=0x0000 0x00001c9b
B-tree key:
10003266550 ( 0): 003473c8 3f000000 03000000 2e0037 .4s.?.........7
DOL_DELETE (256039,15) sessionid=256038,36
attcnt=1 rno=15 op=66 padlen=2 sessionid=256038,36 len=96
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=3 syscolumns ptnid=3 pageno=46 rowno=55 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
old ts=0x0000 0x00001c9a new ts=0x0000 0x00001c9c
xdol_row:
10003266592 ( 0): 00370000 00010000 3473c83f 00038026 .7......4s.?...&
100032665a2 ( 16): 00000004 fffe0000 00000007 00000000 ................
100032665b2 ( 32): 00000000 002c636f 6c320026 .....,col2.&
DOL_INSERT (256039,16) sessionid=256038,36
attcnt=1 rno=16 op=63 padlen=4 sessionid=256038,36 len=96
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=3 syscolumns ptnid=3 pageno=46 rowno=78 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
old ts=0x0000 0x00001c9c new ts=0x0000 0x00001c9d
xdol_row:
100032665f2 ( 0): 004e0004 00010000 3473c83f 00010038 .N......4s.?...8
10003266602 ( 16): 00000004 00020000 00000007 00000000 ................
10003266612 ( 32): 00000000 002a6964 0026 .....*id.&
BT_INSERT (256039,17) sessionid=256038,36
attcnt=1 rno=17 op=71 padlen=1 sessionid=256038,36 len=80
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=3 syscolumns indid=2 ptnid=3 pageno=53 level=0 root=49 cid=0 statu
s=0x220
(0x0200 (XSTAT_BT_CHANGE_LCTXREPLACEDEL), 0x0020 (XSTAT_BT_CHANGE_REPLACERID))
slot=14 ridposn=0 oldposn=0
old ts=0x0000 0x00001c9b new ts=0x0000 0x00001c9e
B-tree key:
10003266660 ( 0): 003473c8 3f000000 01000000 2e204e .4s.?........ N
DOL_INSERT (256039,18) sessionid=256038,36
attcnt=1 rno=18 op=63 padlen=2 sessionid=256038,36 len=96
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=3 syscolumns ptnid=3 pageno=46 rowno=79 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
old ts=0x0000 0x00001c9d new ts=0x0000 0x00001c9f
xdol_row:
100032666a2 ( 0): 004f0004 00010000 3473c83f 00020027 .O......4s.?...'
100032666b2 ( 16): 0000001e ffff0000 00000002 00000000 ................
100032666c2 ( 32): 00000000 002c6e61 6d650026 .....,name.&
BT_INSERT (256039,19) sessionid=256038,36
attcnt=1 rno=19 op=71 padlen=1 sessionid=256038,36 len=80
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=3 syscolumns indid=2 ptnid=3 pageno=53 level=0 root=49 cid=0 statu
s=0x220
(0x0200 (XSTAT_BT_CHANGE_LCTXREPLACEDEL), 0x0020 (XSTAT_BT_CHANGE_REPLACERID))
slot=15 ridposn=0 oldposn=0
old ts=0x0000 0x00001c9e new ts=0x0000 0x00001ca0
B-tree key:
10003266710 ( 0): 003473c8 3f000000 02000000 2e204f .4s.?........ O
DOL_UPDATE (256039,20) sessionid=256038,36
attcnt=1 rno=20 op=65 padlen=0 sessionid=256038,36 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=28 syspartitions ptnid=28 pageno=82 rowno=16 cid=0 erl=0
status (xstat)=0x00 (0x0000)
status2 (xstat2)=0x04 (0x0004 (XSTAT2_DOL_SHROW))
old ts=0x0000 0x00001c95 new ts=0x0000 0x00001ca1
xfirstoff=0, xoldvlen=0, xnewvlen=0
xoldstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image:
10003266760 ( 0):
new image:
10003266760 ( 0):
DOL_UPDATE (256039,21) sessionid=256038,36
attcnt=1 rno=21 op=65 padlen=0 sessionid=256038,36 len=64
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=1 sysobjects ptnid=1 pageno=1 rowno=30 cid=0 erl=0
status (xstat)=0x00 (0x0000)
status2 (xstat2)=0x04 (0x0004 (XSTAT2_DOL_SHROW))
old ts=0x0000 0x00001c77 new ts=0x0000 0x00001ca2
xfirstoff=0, xoldvlen=0, xnewvlen=0
xoldstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image:
100032667a0 ( 0):
new image:
100032667a0 ( 0):
DOL_UPDATE (256039,22) sessionid=256038,36
attcnt=1 rno=22 op=65 padlen=6 sessionid=256038,36 len=72
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=1 sysobjects ptnid=1 pageno=1 rowno=30 cid=0 erl=0
status (xstat)=0x00 (0x0000)
status2 (xstat2)=0x04 (0x0004 (XSTAT2_DOL_SHROW))
old ts=0x0000 0x00001ca2 new ts=0x0000 0x00001ca3
xfirstoff=23, xoldvlen=1, xnewvlen=1
xoldstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image: 64
100032667e0 ( 0): 40 @
new image: 0
100032667e1 ( 0): 00 .
DOL_UPDATE (256039,23) sessionid=256038,36
attcnt=1 rno=23 op=65 padlen=6 sessionid=256038,36 len=72
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=1 sysobjects ptnid=1 pageno=1 rowno=30 cid=0 erl=0
status (xstat)=0x00 (0x0000)
status2 (xstat2)=0x04 (0x0004 (XSTAT2_DOL_SHROW))
old ts=0x0000 0x00001ca3 new ts=0x0000 0x00001ca4
xfirstoff=25, xoldvlen=1, xnewvlen=1
xoldstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image: 0
10003266828 ( 0): 00 .
new image: 1
10003266829 ( 0): 01 .
DOL_UPDATE (256039,24) sessionid=256038,36
attcnt=1 rno=24 op=65 padlen=6 sessionid=256038,36 len=72
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=1 sysobjects ptnid=1 pageno=1 rowno=30 cid=0 erl=0
status (xstat)=0x00 (0x0000)
status2 (xstat2)=0x04 (0x0004 (XSTAT2_DOL_SHROW))
old ts=0x0000 0x00001ca4 new ts=0x0000 0x00001ca5
xfirstoff=17, xoldvlen=1, xnewvlen=1
xoldstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image: 0
10003266870 ( 0): 00 .
new image: 1
10003266871 ( 0): 01 .
DOL_UPDATE (256039,25) sessionid=256038,36
attcnt=1 rno=25 op=65 padlen=6 sessionid=256038,36 len=72
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=1 sysobjects ptnid=1 pageno=1 rowno=30 cid=0 erl=0
status (xstat)=0x00 (0x0000)
status2 (xstat2)=0x04 (0x0004 (XSTAT2_DOL_SHROW))
old ts=0x0000 0x00001ca5 new ts=0x0000 0x00001ca6
xfirstoff=19, xoldvlen=1, xnewvlen=1
xoldstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image: 1
100032668b8 ( 0): 01 .
new image: 2
100032668b9 ( 0): 02 .
DOL_UPDATE (256039,26) sessionid=256038,36
attcnt=1 rno=26 op=65 padlen=6 sessionid=256038,36 len=224
odc_stat=0x0100 (0x0100 (LHSR_DO_NOT_UNDO))
loh_status: 0x100 (0x00000100 (LHSR_DO_NOT_UNDO))
objectid=23 systabstats ptnid=23 pageno=196 rowno=7 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
status2 (xstat2)=0x10 (0x0010 (XSTAT2_DOLUPD_ROW_IMAGE))
old ts=0x0000 0x00001c88 new ts=0x0000 0x00001ca7
Redo-only log record
100032668f4 ( 0): 00040000 00003473 c83f0000 00000000 ......4s.?......
10003266904 ( 16): 00000000 00010000 00060000 00014010 ..............@.
10003266914 ( 32): 00000000 00000000 00000000 00000000 ................
10003266924 ( 48): 00000000 00000000 00000000 00000000 ................
10003266934 ( 64): 00000000 00000000 00000000 00000000 ................
10003266944 ( 80): 00020000 00004037 80000000 00000000 ......@7........
10003266954 ( 96): 00000000 00000000 00000000 00003f80 ..............?.
10003266964 ( 112): 00003f80 00000000 00000000 00000000 ..?.............
10003266974 ( 128): 00000000 00000000 00000000 00003f80 ..............?.
10003266984 ( 144): 00003f80 00003473 c83f0000 00000000 ..?...4s.?......
10003266994 ( 160): 9d5100d1 a923 .Q...#
BT_DELETE (256039,27) sessionid=256038,36
attcnt=1 rno=27 op=72 padlen=7 sessionid=256038,36 len=88
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=23 systabstats indid=2 ptnid=23 pageno=209 level=0 root=208 cid=0
status=0x00 (0x0000)
slot=90 ridposn=0 oldposn=0
old ts=0x0000 0x00001c89 new ts=0x0000 0x00001ca8
B-tree key:
100032669e0 ( 0): 003473c8 3f000034 73c83f00 0000c420 .4s.?..4s.?....
100032669f0 ( 16): 07 .
DOL_UPDATE (256039,28) sessionid=256038,36
attcnt=1 rno=28 op=65 padlen=4 sessionid=256038,36 len=256
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=23 systabstats ptnid=23 pageno=196 rowno=7 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
status2 (xstat2)=0x00 (0x0000)
old ts=0x0000 0x00001ca7 new ts=0x0000 0x00001ca9
xfirstoff=56, xoldvlen=94, xnewvlen=94
xoldstatus=0x04: (0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image:
10003266a38 ( 0): 00000000 00000000 00000000 00000000 ................
10003266a48 ( 16): 00000000 00000000 00000002 00000000 ................
10003266a58 ( 32): 40378000 00000000 00000000 00000000 @7..............
10003266a68 ( 48): 00000000 00000000 3f800000 3f800000 ........?...?...
10003266a78 ( 64): 00000000 00000000 00000000 00000000 ................
10003266a88 ( 80): 00000000 00000000 3f800000 3f80 ........?...?.
new image:
10003266a96 ( 0): 3ff00000 00000000 00000000 00000000 ?...............
10003266aa6 ( 16): 00000000 00000000 00000002 00000000 ................
10003266ab6 ( 32): 40378000 00000000 00000000 00000000 @7..............
10003266ac6 ( 48): 00000000 00000000 00000000 00000000 ................
10003266ad6 ( 64): 00000000 00000000 00000000 00000000 ................
10003266ae6 ( 80): 00000000 00000000 00000000 0000 ..............
BT_INSERT (256039,29) sessionid=256038,36
attcnt=1 rno=29 op=71 padlen=7 sessionid=256038,36 len=88
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=23 systabstats indid=2 ptnid=23 pageno=209 level=0 root=208 cid=0
status=0x20 (0x0020 (XSTAT_BT_CHANGE_REPLACERID))
slot=90 ridposn=0 oldposn=0
old ts=0x0000 0x00001ca8 new ts=0x0000 0x00001caa
B-tree key:
10003266b38 ( 0): 003473c8 3f000034 73c83f00 0000c420 .4s.?..4s.?....
10003266b48 ( 16): 07 .
BT_DELETE (256039,30) sessionid=256038,36
attcnt=1 rno=30 op=72 padlen=3 sessionid=256038,36 len=80
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=2 sysindexes indid=2 ptnid=2 pageno=34 level=0 root=33 cid=0 statu
s=0x00
(0x0000)
slot=93 ridposn=0 oldposn=0
old ts=0x0000 0x00001c49 new ts=0x0000 0x00001cab
B-tree key:
10003266b90 ( 0): 003473c8 3f000000 00001300 12 .4s.?........
DOL_DELETE (256039,31) sessionid=256038,36
attcnt=1 rno=31 op=66 padlen=5 sessionid=256038,36 len=168
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=2 sysindexes ptnid=2 pageno=19 rowno=18 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
old ts=0x0000 0x00001c96 new ts=0x0000 0x00001cac
xdol_row:
10003266bd2 ( 0): 0012000c 000c0000 3473c83f 00000000 ........4s.?....
10003266be2 ( 16): 00000000 00000000 00000000 00000000 ................
10003266bf2 ( 32): 00000000 00000000 00000000 32010000 ............2...
10003266c02 ( 48): 00010000 00000006 00290000 00000071 .........).....q
10003266c12 ( 64): 74000000 00000000 00000000 009d5100 t.............Q.
10003266c22 ( 80): d1a92300 03000000 00005500 53004b00 ..#.......U.S.K.
10003266c32 ( 96): 47204700 45004300 41204100 40204020 G G.E.C.A A.@ @
10003266c42 ( 112): 40 @
DOL_INSERT (256039,32) sessionid=256038,36
attcnt=1 rno=32 op=63 padlen=1 sessionid=256038,36 len=160
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=2 sysindexes ptnid=2 pageno=19 rowno=25 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
old ts=0x0000 0x00001cac new ts=0x0000 0x00001cad
xdol_row:
10003266c7a ( 0): 00190004 000c0000 3473c83f 00000000 ........4s.?....
10003266c8a ( 16): 00000000 00000000 00000000 00000000 ................
10003266c9a ( 32): 00000000 00000000 00000000 32010000 ............2...
10003266caa ( 48): 00010000 00000006 00290000 0000006d .........).....m
10003266cba ( 64): 74000000 00000000 009d5100 d1a92300 t.........Q...#.
10003266cca ( 80): 03000000 00005100 4f004720 47204700 ......Q.O.G G G.
10003266cda ( 96): 45004300 41204100 40204020 40 E.C.A A.@ @ @
BT_INSERT (256039,33) sessionid=256038,36
attcnt=1 rno=33 op=71 padlen=3 sessionid=256038,36 len=80
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=2 sysindexes indid=2 ptnid=2 pageno=34 level=0 root=33 cid=0 statu
s=0x220
(0x0200 (XSTAT_BT_CHANGE_LCTXREPLACEDEL), 0x0020 (XSTAT_BT_CHANGE_REPLACERID))
slot=93 ridposn=0 oldposn=0
old ts=0x0000 0x00001cab new ts=0x0000 0x00001cae
B-tree key:
10003266d28 ( 0): 003473c8 3f000000 00001320 19 .4s.?...... .
BT_DELETE (256039,34) sessionid=256038,36
attcnt=1 rno=34 op=72 padlen=7 sessionid=256038,36 len=88
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=28 syspartitions indid=2 ptnid=28 pageno=90 level=0 root=89 cid=0
status=0x00 (0x0000)
slot=93 ridposn=0 oldposn=0
old ts=0x0000 0x00001c45 new ts=0x0000 0x00001caf
B-tree key:
10003266d78 ( 0): 003473c8 3f000034 73c83f00 00005200 .4s.?..4s.?...R.
10003266d88 ( 16): 10 .
BT_DELETE (256039,35) sessionid=256038,36
attcnt=1 rno=35 op=72 padlen=3 sessionid=256038,36 len=80
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=28 syspartitions indid=3 ptnid=28 pageno=113 level=0 root=112 cid=
0
status=0x00 (0x0000)
slot=93 ridposn=0 oldposn=0
old ts=0x0000 0x00001c46 new ts=0x0000 0x00001cb0
B-tree key:
10003266dd0 ( 0): 003473c8 3f000000 00005220 10 .4s.?.....R .
BT_DELETE (256039,36) sessionid=256038,36
attcnt=1 rno=36 op=72 padlen=7 sessionid=256038,36 len=96
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=28 syspartitions indid=4 ptnid=28 pageno=129 level=0 root=128 cid=
0
status=0x00 (0x0000)
slot=93 ridposn=0 oldposn=0
old ts=0x0000 0x00001c47 new ts=0x0000 0x00001cb1
B-tree key:
10003266e20 ( 0): 013473c8 3f000000 00005220 100b745f .4s.?.....R ..t_
10003266e30 ( 16): 38383030 30333133 35 880003135
DOL_DELETE (256039,37) sessionid=256038,36
attcnt=1 rno=37 op=66 padlen=1 sessionid=256038,36 len=120
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=28 syspartitions ptnid=28 pageno=82 rowno=16 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
old ts=0x0000 0x00001ca1 new ts=0x0000 0x00001cb2
xdol_row:
10003266e72 ( 0): 0010000c 00010000 3473c83f 3473c83f ........4s.?4s.?
10003266e82 ( 16): 00010000 00000002 00000378 00000000 ...........x....
10003266e92 ( 32): 00000379 00000379 00000000 00009d51 ...y...y.......Q
10003266ea2 ( 48): 00beb176 00000045 745f3838 30303033 ...v...Et_880003
10003266eb2 ( 64): 31333500 38 135.8
DOL_INSERT (256039,38) sessionid=256038,36
attcnt=1 rno=38 op=63 padlen=1 sessionid=256038,36 len=120
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=28 syspartitions ptnid=28 pageno=82 rowno=23 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
old ts=0x0000 0x00001cb2 new ts=0x0000 0x00001cb3
xdol_row:
10003266eea ( 0): 00170004 00010000 3473c83f 3473c83f ........4s.?4s.?
10003266efa ( 16): 00010000 00000002 00000378 00000000 ...........x....
10003266f0a ( 32): 00000379 00000379 00000000 00009d51 ...y...y.......Q
10003266f1a ( 48): 00d1a923 00000045 745f3838 30303033 ...#...Et_880003
10003266f2a ( 64): 31333500 38 135.8
BT_INSERT (256039,39) sessionid=256038,36
attcnt=1 rno=39 op=71 padlen=7 sessionid=256038,36 len=88
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=28 syspartitions indid=2 ptnid=28 pageno=90 level=0 root=89 cid=0
status=0x220 (0x0200 (XSTAT_BT_CHANGE_LCTXREPLACEDEL), 0x0020
(XSTAT_BT_CHANGE_REPLACERID))
slot=93 ridposn=0 oldposn=0
old ts=0x0000 0x00001caf new ts=0x0000 0x00001cb4
B-tree key:
10003266f70 ( 0): 003473c8 3f000034 73c83f00 00005220 .4s.?..4s.?...R
10003266f80 ( 16): 17 .
BT_INSERT (256040,0) sessionid=256038,36
attcnt=1 rno=0 op=71 padlen=3 sessionid=256038,36 len=80
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=28 syspartitions indid=3 ptnid=28 pageno=113 level=0 root=112 cid=
0
status=0x220 (0x0200 (XSTAT_BT_CHANGE_LCTXREPLACEDEL), 0x0020
(XSTAT_BT_CHANGE_REPLACERID))
slot=93 ridposn=0 oldposn=0
old ts=0x0000 0x00001cb0 new ts=0x0000 0x00001cb5
B-tree key:
1000325c060 ( 0): 003473c8 3f000000 00005220 17 .4s.?.....R .
BT_INSERT (256040,1) sessionid=256038,36
attcnt=1 rno=1 op=71 padlen=7 sessionid=256038,36 len=96
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=28 syspartitions indid=4 ptnid=28 pageno=129 level=0 root=128 cid=
0
status=0x220 (0x0200 (XSTAT_BT_CHANGE_LCTXREPLACEDEL), 0x0020
(XSTAT_BT_CHANGE_REPLACERID))
slot=93 ridposn=0 oldposn=0
old ts=0x0000 0x00001cb1 new ts=0x0000 0x00001cb6
B-tree key:
1000325c0b0 ( 0): 013473c8 3f000000 00005220 170b745f .4s.?.....R ..t_
1000325c0c0 ( 16): 38383030 30333133 35 880003135
BT_DELETE (256040,2) sessionid=256038,36
attcnt=1 rno=2 op=72 padlen=7 sessionid=256038,36 len=96
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=24 sysstatistics indid=2 ptnid=24 pageno=625 level=0 root=624 cid=
0
status=0x00 (0x0000)
slot=8 ridposn=0 oldposn=0
old ts=0x0000 0x00001c84 new ts=0x0000 0x00001cb7
B-tree key:
1000325c110 ( 0): 013473c8 3f000034 73c83f00 006c0000 .4s.?..4s.?..l..
1000325c120 ( 16): 00010000 01f10001 ff .........
DOL_DELETE (256040,3) sessionid=256038,36
attcnt=1 rno=3 op=66 padlen=4 sessionid=256038,36 len=160
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=24 sysstatistics ptnid=24 pageno=497 rowno=1 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
old ts=0x0000 0x00001c83 new ts=0x0000 0x00001cb8
xdol_row:
1000325c162 ( 0): 00010000 00070000 00000000 3473c83f ............4s.?
1000325c172 ( 16): 3473c83f 00000000 00000000 00000001 4s.?............
1000325c182 ( 32): 00009d51 00d1a923 6c06006a 00000000 ...Q...#l..j....
1000325c192 ( 48): 00000000 00000000 00000000 40080000 ............@...
1000325c1a2 ( 64): 00000000 40000000 00000000 40000000 ....@.......@...
1000325c1b2 ( 80): 00000000 00000000 00000000 0054004c .............T.L
1000325c1c2 ( 96): 0044003c 0034002c 202c .D.<.4., ,
DOL_INSERT (256040,4) sessionid=256038,36
attcnt=1 rno=4 op=63 padlen=6 sessionid=256038,36 len=152
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=24 sysstatistics ptnid=24 pageno=497 rowno=6 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
old ts=0x0000 0x00001cb8 new ts=0x0000 0x00001cb9
xdol_row:
1000325c202 ( 0): 00060004 00060000 00000000 3473c83f ............4s.?
1000325c212 ( 16): 3473c83f 00000000 00000000 00000001 4s.?............
1000325c222 ( 32): 00009d51 00d1a923 6c050060 00000000 ...Q...#l..`....
1000325c232 ( 48): 00000000 00000000 00000000 40000000 ............@...
1000325c242 ( 64): 00000000 40000000 00000000 40000000 ....@.......@...
1000325c252 ( 80): 00000000 004c0044 003c0034 002c202c .....L.D.<.4., ,
1000325c262 ( 96):
BT_INSERT (256040,5) sessionid=256038,36
attcnt=1 rno=5 op=71 padlen=7 sessionid=256038,36 len=96
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=24 sysstatistics indid=2 ptnid=24 pageno=625 level=0 root=624 cid=
0
status=0x220 (0x0200 (XSTAT_BT_CHANGE_LCTXREPLACEDEL), 0x0020
(XSTAT_BT_CHANGE_REPLACERID))
slot=8 ridposn=0 oldposn=0
old ts=0x0000 0x00001cb7 new ts=0x0000 0x00001cba
B-tree key:
1000325c2a8 ( 0): 013473c8 3f000034 73c83f00 006c0000 .4s.?..4s.?..l..
1000325c2b8 ( 16): 00010000 01f12006 ff ...... ..
BT_DELETE (256040,6) sessionid=256038,36
attcnt=1 rno=6 op=72 padlen=3 sessionid=256038,36 len=80
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=1 sysobjects indid=2 ptnid=1 pageno=161 level=0 root=160 cid=0
status=0x00 (0x0000)
slot=35 ridposn=0 oldposn=0
old ts=0x0000 0x00001c68 new ts=0x0000 0x00001cbb
B-tree key:
1000325c308 ( 0): 01000000 01000000 01201e01 74 ......... ..t
BT_DELETE (256040,7) sessionid=256038,36
attcnt=1 rno=7 op=72 padlen=5 sessionid=256038,36 len=80
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=1 sysobjects indid=3 ptnid=1 pageno=10 level=0 root=9 cid=0 status
=0x00
(0x0000)
slot=48 ridposn=0 oldposn=0
old ts=0x0000 0x00001c69 new ts=0x0000 0x00001cbd
B-tree key:
1000325c358 ( 0): 003473c8 3f000000 01001e .4s.?......
DOL_UPDATE (256040,8) sessionid=256038,36
attcnt=1 rno=8 op=65 padlen=6 sessionid=256038,36 len=72
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objectid=1 sysobjects ptnid=1 pageno=1 rowno=30 cid=0 erl=0
status (xstat)=0x1000 (0x1000 (XSTAT_DOL_EXROW))
status2 (xstat2)=0x00 (0x0000)
old ts=0x0000 0x00001ca6 new ts=0x0000 0x00001cbe
xfirstoff=82, xoldvlen=1, xnewvlen=1
xoldstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
xnewstatus=0x0c: (0x0008 (DOL_ROW_UPDATED), 0x0004 (DOL_ROW_POSSUNCMT))
old image: 4
1000325c3a8 ( 0): 04 .
new image: 0
1000325c3a9 ( 0): 00 .
BT_INSERT (256040,9) sessionid=256038,36
attcnt=1 rno=9 op=71 padlen=3 sessionid=256038,36 len=80
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=1 sysobjects indid=2 ptnid=1 pageno=161 level=0 root=160 cid=0
status=0x20 (0x0020 (XSTAT_BT_CHANGE_REPLACERID))
slot=35 ridposn=0 oldposn=0
old ts=0x0000 0x00001cbb new ts=0x0000 0x00001cbf
B-tree key:
1000325c3f0 ( 0): 01000000 01000000 01201e01 74 ......... ..t
BT_INSERT (256040,10) sessionid=256038,36
attcnt=1 rno=10 op=71 padlen=5 sessionid=256038,36 len=80
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
objid=1 sysobjects indid=3 ptnid=1 pageno=10 level=0 root=9 cid=0 status
=0x20
(0x0020 (XSTAT_BT_CHANGE_REPLACERID))
slot=48 ridposn=0 oldposn=0
old ts=0x0000 0x00001cbd new ts=0x0000 0x00001cc0
B-tree key:
1000325c440 ( 0): 003473c8 3f000000 01201e .4s.?.... .
ENDXACT (256040,11) sessionid=256038,36
attcnt=1 rno=11 op=30 padlen=4 sessionid=256038,36 len=32
odc_stat=0x0000 (0x0000)
loh_status: 0x0 (0x00000000)
endstat=COMMIT time=Apr 7 2010 12:43:21:076PM
xstat=0x0 []
Total number of log records 301
DBCC execution completed. If DBCC printed error messages, contact a user with
System Administrator (SA) role.
有兴趣的可以自己分析一下。
自己先补充一下。
如果数据库没有打开select into选项的时候,drop column都会报错误:
Msg 11052, Level 16, State 1: Server 'TEST', Line 1: The 'select into' database option is not enabled for database 'escourt5'. ALTER TABLE with data copy cannot be done. Set the 'select into' database option and re-run 。
注意:不能添加非空列(除了第一个identity列)。 添加一列的时候,指定为非空并且有默认值的话,也报错:
1> alter table test add COLE char(1) default "0"
2> go
Msg 11052, Level 16, State 1: Server 'TEST', Line 1: The 'select into' database option is not enabled for database 'escourt5'. ALTER TABLE with data copy cannot be done. Set the 'select into' database option and re-run.
有空总结一下。 为什么会进行data copy。
————————————————————————————————-
—- 本文为andkylee个人原创,请在尊重作者劳动成果的前提下进行转载;
—- 转载务必注明原始出处 : http://www.dbainfo.net
—- 关键字: 字段 增加 删除 日志 内部 internals
————————————————————————————————-