SQL SERVERÐÔÄÜÓÅ»¯ TempdbÏà¹ØÎÊÌâ
TEMPDB²»Ö§³Ö×Ô¶¯Ñ¹Ëõ£¬ÇÒËüµÄÊý¾Ý¿âºÍÎļþѹËõÄÜÁ¦ÊÇÓÐÏÞÖƵģ»
Èç²»µÃ²»Ñ¹ËõTEMPDBµÄ´óС£¬½¨ÒéʹÓÃÀëÏß¹¦ÄÜ£¬ÈçϲÙ×÷£º
1.Í£Ö¹SQL SERVER·þÎñ£»
2.ÕÒµ½sqlservr.exeÔÚ´ÅÅÌÖеÄλÖã»
3.ʹÓÃsqlservr.exeÊäÈëÃüÁîsqlservr -c -f,ÕâÑùÆô¶¯SQL SERVERʱ£¬TEMPDBµÄ´óСÄܹ»±£³Ö×îС£»
4.ʹÓÃTSQLÃüÁALTER DATABASE TEMPDB MODIFY FILE£¨£©£¬ÕâÑù¾Í¿ÉÒԸıäTEMPDBµÄ´óС£»
5.ÖØÆôSQL SERVER·þÎñ£»
TEMPDB¿Õ¼äÓÐÈýÖÖ¶ÔÏó--Óû§¶ÔÏó¡¢ÄÚ²¿¶ÔÏóÒÔ¼°°æ±¾´æ´¢¶ÔÏó£»
Óû§¶ÔÏó£º
Óû§¶¨ÒåµÄ±¾µØÁÙʱ±íÖÐÁÙʱʹÓõĶÔÏó£»
Àý£ºselect * from sys.all_objects
ÄÚ²¿¶ÔÏó£º
·········10········20········30········40········50········60········70········80········90········100·······110·······120·······130·······140·······150
declare @i int
set @i = 0
create table #myTempTable (keycolumn int, mybigCharColumn char (1000) )
while (@i < 1000000)
begin
insert into #myTempTable values(@i,'x' )
set @i = @i + 1
end
select * from #myTempTable
order by keycolumn
declare @i int
set @i = 0
create table #myTempTable (keycolumn int, mybigCharColumn char (1000) )
while (@i < 100000
Ïà¹ØÎĵµ£º
alert index mem_ct monitoring usage;
desc v$object_usage;
set linesize 190
select * from v$object_usage;
SQL>SET AUTOTRACE ON;
¡¡¡¡*autotrace¹¦ÄÜÖ»ÄÜÔÚSQL*PLUSÀïʹÓÃ
¡¡¡¡ÆäËûһЩʹÓ÷½·¨£º
¡¡¡¡2.2.1¡¢ÔÚSQLPLUSÖеõ½Óï¾ä×ܵÄÖ´ÐÐʱ¼ä
¡¡¡¡SQL> set timing on;
2.2.2¡¢Ö»ÏÔʾִÐмƻ®--(»áÍ¬Ê ......
1¡¢²éѯÁ½¸öʱ¼äÖ®¼ä
select * from [tablename] where date between \'value1\' and \'value2\'
2¡¢ÏÔʾ×îºó»Ø¸´Ê±¼ä
select a.title,a.username,b.adddate from table a,(select max(adddate) adddate from table where table.title=a.title) b
3¡¢Èճ̰²ÅÅÌáÇ°5·ÖÖÓÌáÐÑ
select * from Èճ̰²ÅÅ w ......
·ÖÒ³²éѯµÄÔÀí£º
Õâ¸öÖ»ÄÜÓÃÔÙSql2005¼°ÒÔÉϵİ汾
DECLARE @pagenum AS INT, @pagesize AS INT
SET @pagenum = 2
SET @pagesize = 3
SELECT *
from (SELECT ROW_NUMBER()&n ......
·½·¨(1)
SELECT stuff((select ','+ltrim(ColumnName) from #A for xml path('')
),1,1,'')
/*
102,103,104,105
*/
·½·¨(2)
DECLARE @s NVARCHAR(1000)='';
SELECT @s+=ColumnName+',' from #A;
SELECT @s; ......