SQL Server的datetime存储格式
Dateime 使用8个字节存储: 前4个直接用于表示日期, 表示的方式是相对 Jan 1, 1900的天数差 后4个字节表示时间, 从半夜开始的时间,单位是 1/300 秒 [@more@]
由allocation_unit_id查询其所属对象名称
需要sys.partitions与sys.allocation_units做连接,如查询allocation_unit_id=281474980249600所属对象名称:1> SELECT object_name(object_id) AS object_name2> FROM sys.partitions p JOIN sys.allocation_units a3> ON p.partition_id = a.container_id4> WHERE a.allocation_unit_id=281474980249600;5> goobject_name------------------------------------------------------sysidxstats[@more@]
sys.allocation_units与sys.system_internals_allocation_units的差别
后者多出三个列:first_page,root_page,first_iam_page其他都是相同的。[@more@]
把自编存储过程设置为系统存储过程
sp_ms_marksystemobject 'sp_desc'[@more@]
SQL Server中的未文档化的dbcc命令(适用于SQL Server 2000)
DBCC is an abbreviation for Database Console Command. DBCC commands are generally used to check the physical and logical consistency of a database, although they are also used for a variety of miscellaneous tasks, as you will see here.Note, the command:DBCC TRACEON (3604)is issued before each of the following DBCC examples in order to better demonstrate the effects of the command by displaying a trace of the output of the DBCC command. It is not actually required to run the DBCC commands examine
SQL Server中的dbcc ind命令用法
DBCC IND has three parameters. The first parameter is the database name or the database ID. The second parameter is the object name or object ID within the database. The third parameter is a specific index ID or one of the values 0, -1, or −2. Here's the syntax:DBCC IND ({'dbname' | dbid }, { 'objname' | objid }, { indid | 0 | -1 | -2 }) 0Displays the page numbers for all IAMs and data pages.-1Displays the page numbers for all IAMs, data pages, and index pages.-2Displays the page number
SQL Server 2005+ 中的数据块种类
page 0:file headerpage 1:1st PFS(page free space)page 2:1st GAMpage 3:1st SGAMpage 4及page 5:unusedpage 6:1st DCM(differential changed map)page 7:1st BCM(bulk changed map),也称为ML mapping page上述内容恰好占掉数据文件的第一个extent。[@more@]
SQL Server中的dbcc page命令用法
dbcc page ( {'dbname' | dbid}, filenum, pagenum [, printopt={0|1|2|3} ])The filenum and pagenum parameters are taken from the page IDs that come from various system tables and appear in DBCC or other system error messages. A page ID of, say, (1:354) has filenum = 1 and pagenum = 354.The printopt parameter has the following meanings:0 - print just the page header 1 - page header plus per-row hex dumps and a dump of the page slot array (unless its a page that doesn't have one, like allocation bitm
Never do today what you can do tomorrow
In fact, Oracle never writes a data or rollback block to disk unless it really has to.Its philosophy seems to be: Never do today what you can do tomorrow, because with a little luck you won't have to do it tomorrow either.==Practical Oracle 8i,P12[@more@]
Inside SQL Server系列新版,SQL Server 2008 Internals目录
2009年3月11日,MS Press出版了Kalen Delaney的Inside SQL Server系列的2008版本,改名为SQL Server 2008 Internals(这是学习Inside Windows的做法,Inside Windows第4版改称Windows Internals)。与其2005版本(Inside SQL Server 2005 Storage Engine,Inside SQL Server 2005 Query Tuning and Optimization)相比,更新并不多,去掉了Storage Engine第一章的安装,毕竟一本讲internal的书讲安装有点说不过去。以下是其目录:第1章:SQL Server 2008 architecture and configuration,Storage Engine的第2、3章。第2章:Change tracking,
查看OEM端口设置
查看文件:ORACLE_HOME/install/portlist.ini 其中的“Enterprise Manager Console HTTP 端口”一行用于标识OEM端口。[@more@]
dos版电影
开始-->运行,输入:telnet towel.blinkenlights.nl [@more@]
T-SQL什么时候该使用分号
There are two situations in which you must use the semicolon. The first situation is where you use a Common Table Expression (CTE), and the CTE is not the first statement in the batch. The second is where you issue a Service Broker statement and the Service Broker statement is not the first statement in the batch.[@more@]
迷信的Sybase
Sybase从版本12一下跳到了15,什么原因?13在西方不吉利,14在中国不吉利。[@more@]
不同DBMS的SQL比较
http://troels.arvin.dk/db/rdbms/[@more@]
SQL Server 2008的几个参考网址
SQL Server 2008白皮书:http://msdn.microsoft.com/en-us/library/bb418497.aspx SQL Server 2008 Books online:http://msdn.microsoft.com/en-us/library/ms130214.aspx关于SQL Server内存管理:http://blogs.msdn.com/slavao/archive/tags/SQL+Server+Memory+Management/default.aspx[@more@]
Oracle 11g的SQL Developer连接SQL Server 2008
1. 启动SQL Developer时,要求指定java.exe所在的路径,如:E:/oracle/product/11.1.0/db_2/jdk/bin2. 然后要添加SQL Server JDBC驱动,到http://sourceforge.net/project/showfiles.php?group_id=33291&package_id=25350&release_id=534076点击jtds-1.2.2-dist.zip 下载SQL Server JDBC驱动,拷贝到任意一个目录,解压。3 点击SQL Developer的“Tools ”-->“Preference”-->“Database”-->“Third party JDBC drivers”-->“Add entries...”,选择刚才的解压目录下的jtds-1.2.2.jar文件,如:E:/oracle/product/1
DOS命令的换行
DOS使用^,linux使用反斜杠。[@more@]
温家宝:教育事业还是应该由懂教育的人来办
今天sohu上的一个新闻题目,农村老太太都懂得道理,要从一国总理口中说出来,不得不说这条新闻真幽默。[@more@]
MacBook上的Windows键盘
Del:Fn+delete Win:commandpagedown:Fn+Downpageup:Fn+UpHOME:Fn+LeftEND:Fn+RightPrtScrn: fn + Shift + F11Alt + PrtScrn : fn + Shift + Opt + F11[@more@]