Anda di halaman 1dari 442

Syb ase




Sybase
,

,





,

Sybase SQL
Server 4.9.2,
System 10 System 11

Sybase

""

Sybase DBA companion


Brian Hitchcock
Copyright 1997
All rights reserved
Sybase


.
.
., .
.
Copyright 1997
Prentice"Hall, Inc.
A Simon & Schuster Company
Upper Saddle River, New Jersey 07458
ISBN 0"13"652389"7
"", 2000

. N : OAI (03)
N : 070612 30.09.97 .
ISBN 5"85582"066"1
10.04.2000 84x108/16
N1 "
.. 28 3200 N 2221.

"". , . . , . 10, . 1
: (095)259"01"62
WWW.LORY"PRESS.RU
<<>>,
160001, . , . , 3. .: (8172) 72+55+31, 72+61+75, 72+60+72

SQL Server:

SQL Server
SQL Server 4.9.2
SQL Server System 10
SQL Server System 11
Microsoft SQL Server 4.2 6.0
SQL Server


SQL

NULL


SQL Server 4.9.2


SQL Server System 10
(Backup Server)




SQL Server System 11

+
+



2
2
3
3
3
4
4
5
5
5
6
7
8
8
9
10
10
10
20
23
36
40
44
45
45
46
46
47
47
47
48
48
48
48
50
50
50

SQL Server

51
51
51
51
51
52
52
52
52

System 11

53

System 11

+


?
System 11
, System 11

System 11
(MNE) System 11
SQL Server
System 11 +


SQL Server

System 1 1 . .
+



ULC+

System 11
" "

54
54
54
54
54
54
55
56
56
57
..58
58
59
60
60
61
61
61
61
63
63
64
64
69
69
70
70

* System 11

71

+ SQL Server
+
,
( + )

+
,
+

72
72
72
74
75
76
76
77
79

,



+ +


+?
+

+


+ System 11

+

+
+

5

SQL Server System 11

80
80
80
80
82
83
84
84
85
98
98
98
98
99
100
100
101





+



SP_CONFIGURE
sp_configure

sp_configure

read: !
sp_configure
sp_configure
read verify sp_configure


sp_configure

sp_configure

:

128

SQL Server System 11

129


,
System 10

,
,

102
104
105
105
106
106
108
111
111
113
113
114
115
115
116
124
124
125
125
125

130
130
131
133

www.books-shop.com

sp_sysmon



sysattributes
syspartitions
syslogshold

:

136
136
136
136
136
137
137
137
138
138
138
139
139

SQL Server

141


sybsystemprocs
sybsecurity
master
master master
master
(logsegment) master
master
disk init master
master ,

master
master

master


142
142
142
143
143
143
144
144
145
146
147
147
149
150
150

151

SQL Server
SQL Server 4.9.2
SQL Server System 10
SQL Server System 11






Sun

. . . .

152
152
152
152
153
153
153
154
154
155
156
157
157

www.books-shop.com

SQL Server










create database
alter database
,










,

,



SQL Server
SQL Server 4.9.2
SQL Server System 10
SQL Server System 11







master !
dbcc

158
158
163
166
166
167
168
169
175
175
175
176
176
177
178
179
181
181
183
183
183
184
187
200
200
202
204
205
207
208
208
208
209
209
209
210
218
218
223
. 223
228

www.books-shop.com


, . .

(Backup Server)


SQL BackTrack DataTools

10

SQL Server
SQL Server 4.9.2
SQL Server System 10
SQL Server System 11

sp_sysmon

sp_sysmon

sp_sysmon.
(Kernel Utilization)
(Task Management)
(Transaction Management)
(Lock Management)
+ (Data Cache Management)
+
(Procedure Cache Management)
(Recovery Management)
+
(Disk I/O Management)

sp_sysmon
+








SQL Monitor

SQL Server


11 SQL Server

SQL Server

229
229
230
231
232
234
235
238
243
244
244
244
244
244
244
245
246
247
248
248
249
249
251
251
251
252
258
259
260
262
264
265
265
267
269
270
272
274
276

277
278
278
278
281

www.books-shop.com

:
:

12 SQL Server

286
291
295
297

298
SQL Server
298
SQL Server 4.9.2
298
SQL Server System 10
298
SQLServer System 11
298

298

301
SunOS
Solaris
304
Solaris
304
Solaris
SunOS
305
SunOS
Solaris
305
SunOS
305

306
SQL defncopy

308
sysusages .
308

313

314

322
SQL Server
322

b
323

323
1105:

324
13 SQL Server

SQL Server
SQL Server 4.9.2
SQL Server System 10
SQL Server System 11
SQL Server

SQL Server System 11
SQL Server System 10
SQL Server 4.9.2

SQL Server:

SQL Server

329
330
330
330
330
330
330
331
338
342
342
343
348
348
348

%RRNVVKRS

piracy@books-shop.com

,
EBF+
Sybase

EBF+.
SQL Server
SQL Server 4.9.2 System 11
( System 10)
SQL Server 4.9.2 System 11 ( System 10)
SQL Server 4.9.2
System 11 ( System 10)
SQL Server 4.9.2
System 10 11
SQL Server 4.9.2 System 10
SQL Server System 10 System 11
SQL Server System 10 System 11
System 10
14

SQL Server
SQL Server 4.9.2
SQL Server System 10
SQL Server System 11
(dumplog) . . .

SQL Server 4.9.2 (dumpdb_492)
!

SQL Server 4.9.2 (loaddb_492)

(update_statistics_all_tables)

(dump_db_create)
dbcc+ (checkdb)
(dump_systables)
,
(p_dbcreate)

( p_mirror)

( p_devspace)
,
( p_servermap).
(dumpdb)
(loaddb)

( p_dbload)

SQL Server System 11
System 11 (dump_listof_dbs)

349
349
350
350
351
352
356
359
363
365
365
366
367
368
368
368
369
369
369
372
372
374
377
380
381
382
384
386
386
388
390
393
393
394
395
395

www.books-shop.com

(logdump_listof_dbs)
398
(trunclog_listof_dbs) . 401
(remove_old_files)
404
(update_listof_dbs)
406
dbcc+ (dbcc_listof_dbs)
408

SQL Server (scan_errorlog)
412
(dump_server_config)
413
(monitor_report)
416
sp_sysmon (execute_sp_sysmon) . . . . . . . . 417

419
crontab
419

www.books-shop.com

www.books-shop.com


, , "
Sybase. "
:







, SQL Server
System 11, System 10 4.9.2, .

, . "
, "
, ,
, . "
,
,
"
.
, SQL Server Sybase
.
. ,
Sybase. "
Sybase , "
Sybase,
.

Sybase SQL Server
Sun Solaris 2.x. , "
, "
Sybase SQL Server. ,

www.books-shop.com

Sybase,
UNIX. Sola"
ris .
, ,
"
. "

.

"
, "
Sybase.
Solaris.
"
UNIX, Sybase SQL Server.
"
. , "

. "
,
.
"
. , ;") , "
,
"
. ,
,
.

.
Sybase SQL Server ( " SyBooks
AnswerBase) . "
. "
SQL Server, ,
,
Sybase. , "
, "
, Sybase,
SQL Server. Sybase "
"
,
.
"
Sybase System 11.
, SQL Server System 11 "
SQL Server 4.9.2 System 10 System 11, SQL
Server System 11 ,
. System 11 ,

www.books-shop.com

EBF" ( Sybase
, SQL Server,
EBF",
). SQL Server 4.9.2, Sys"
tem 10 System 11, .
Sybase "
, , "
(middleware) ..
, ,
". "
, Sybase ("
), UNIX. ,
Solaris; "

UNIX. "
Solaris,
UNIX.

. ,
Sybase SQL Server. ,
"
, Sybase, ,
. "
, , "
Sybase.

Sybase SQL Server :


disk init
:
sp_helpdb __
sp_helpusersa
sp_addsegment _, __
sp_addsegment myseg0, server_device_1
, Sybase SQL Ser"
ver,
s_<__>
sp_helpdevice
, Sybase (,
14),
_<__>
p_devspace
, , () "
:
master
system
syslogins
segmap

www.books-shop.com

:
prtvtoc
;") , "
.

Sybase SQL Server
, .
(server) "" "
Sybase. SQL Server,
Sybase Open
Server (, SQL Server System 11 "
Backup Server).
, (server machine) "
(, , ,
..), , SQL Server.
(server logical device) "
, . , SQL Ser"
ver ,
.
(server device) ,
.
(spindle) " ", " "
".
(physical device)
,
. "
(logical device),
.
'sa' (SQL Server user 'sa') ,
. , 'sa'
.
(system administrator) ,
, "
, "
Sybase.
(database system) ,
, , ",
.., "
.
(fail over)
,

.

www.books-shop.com

SQL Server

4.9.2, System 10 System 11 Sybase SQL Server "


,
Sybase, , "
SQL Server. "
, ,
, ,
SQL Server. "
" SQL Server,

4.9.2 System 10 SQL Ser"
ver System 11.

www.books-shop.com

www.books-shop.com


SOtool Development, Support ENS,
Sun Service. ,
: , , , "
, , , , ,
. .
"
, .
,
, "
, .
,
. "
. , "
.
, .
, ,
.
, "
.
, . ,
, ,

.
"
.
, , "
.
.
.
, .
, 10 .
.
, "
. . ,
, "
. , ,
, , .
By ,
, , "
. . " .

%RRNVVKRS

piracy@books-shop.com

, , , ,
. , , .
. .
,
.
, , "
. " "
"", . ,
, , : "
Sybase". "
. ,
, .
. , " "
, , .
, , . ,
.
, .
.
, ,
.
, , . , 1996 .

www.books-shop.com

SQL Server:

www.books-shop.com


Sybase SQL Server
() ,
.
Sybase SQL Server;
.
, ,
SQL Server. SQL Server "";
"", SQL Server, ", "
.
SQL Server
SQL Server: 4.9.2, System 10 System 11.
. 1.1, : "
SQL Server 4.9.2 System 10 System 11. SQL
Server
, .
Sybase SQL Server SQL Server System 11.1.
, "
. "
( " , ) Sybase Navigation
Server, Sybase MPP (Massively Parallel Processing),
, "
. Navigation Server SQL",
. Navigation Server
.
SQL Server "
, "
SQL Server .

. 1.1. SQL+ + Sybase

www.books-shop.com

SQL Server 4.9.2


SQL Server 4.9.2 Sybase SQL Server, .
, SQL Server 4.9.2
, . SQL
Server 4.9 4.9.1 4.9.2;
EBF (Emergency Bug Fix level). Sybase , "
. "
SQL Server 4.9 4.9.2,
4.9 4.9.2 .
SQL Server 4.9.2 ;
, SQL Server 4.9.2
Sybase, " 4.9.2.
SQL Server System 10
SQL Server System 10 Sybase SQL Server 5.0. "
, Sybase Oracle Oracle 7.0, "
Oracle, Sybase
,
5.0 10.0. Sybase SQL Server System 10. "" "
,
. , "
. "
System 10
Sybase .

System 11. , Oracle Sybase.
Microsoft,
.
System 10 : , , "
. SQL "
ANSI; "
. SQL Server "

(Backup Server). System 10 SQL Server "
. , System 10
. sybsystemprocs . "
, , sp_who. sybsecurity " "
, ,
System 10.
SQL Server System 11
System 11 Sybase SQL Server,
Sybase SQL Server "
.
,
. , System 11 "

. , "
. System 11 "
,
.
System 11, System 10,
. System 11 "
; ,
(Replication Server). System 11
Sybase.
, System 11 "
.

www.books-shop.com

System 11 .
"
, .
, "
, . Sybase System 11
SQL Server , "
. , System 11

, . , "
30 , System 11 SQL Server "
,
, " . "

( ). , "
, . "
,
102 ".
, "
. , System 11
, SQL.
Microsoft SQL Server 4.2 6.0
, Sybase SQL Server, "
Sybase. "
Microsoft Sybase
, . Sybase "
Sybase SQL Server ,
UNIX, Microsoft "
Microsoft SQL Server Windows NT. , ,
. ,
, , Sybase" Microsoft" SQL Server 4.9.2
, "
,
.
Sybase, Microsoft "
, Microsoft SQL Server 6.0 Windows NT Sybase SQL
Server . Microsoft SQL Server 6.0
Sybase SQL Server System 10, . Microsoft "
,
Sybase SQL Server ,
, Microsoft SQL
Server. Microsoft Sybase, "
.
, Microsoft SQL Server,
"" SQL Server Sybase" SQL Server.
SQL Server

, . "
, "
SQL Server.
. ,
,
" . "
Sybase" , "
System 11.

www.books-shop.com


"
() Sybase SQL Server.
.

"
; , "
(. 1.2).
. , , , "
, . "
, ,
. "
, "
, ,
. , , "
.
,
.
psycho_books
title

title_id

published

made_money

year_published

DBA_Handbook

yes

no

1995

DBA Companion 2
CSP Training
3

yes
no

no
no

1996
NULL

select * from psycho_books where year_published != NULL


title

titlejd

published

made_money

year_published

DBA_Handbook

yes

no

1995

DBA Companion 2

yes

no

1996

select title, year_published from psycho_books


title
year_published
DBA_Handbook 1995
DBA Companion 1996
CSP Training
NULL
. 1.2.
SQL
,
,
. "
(Structured Query Language, SQL). "
", ,
. SQL ,
,
. "
SQL "
.

www.books-shop.com

SQL, (query). 
SQL, , . 
SQL .
SQL :
Select
.
Insert
.
Update
, .
Delete
.
SQL, 
, 
SQL . , 
SQL,
. 
,  .
, SQL,
SQL, , 
, 
.

, , 
. , 
. 1.3.
title

title_id

published

made_money

year_published

yes

no

1995

yes

no

1996

no

no

NULL

+ (title, title_id, published, made_money, year_published)


++
+ published + Y, N
++ made_money = NULL madejnoney = N
++ year_published year_published + 1
++
++ new_total
++
++ titlejd
++ : 1, titl_id=1 id = 1
NULL ++ titlejd = 3 year_published
. 1.3.

www.books-shop.com


(table) , ().
;
, .

(rule) , .
, .

(default) , ,
, . , "
,
$0.00.

SQL SQL" .
, "
. (stored procedure) "
SQL", .
. , "
, ,
,
. "
. " ,
, .
,
".

(trigger) ,
. , , "
, .

"
.
, (index)
, . "
, .

. "
, . , , "
,
. ,
. ,
1002. "
, 1002.
, 1002 ,
, ,
.
NULL
, NULL, "
. , ,
?
NULL
, " . "
, .

www.books-shop.com

NULL ( , "
), . ,
, .
, ,
NULL.
, , "
? NULL , "
?
, ,
.

, .
, "
. "
, .
Sybase "
. , , "
, .
"
, .
.
,
. , "
, .
, "
, .
, ,
.
,
, , ""
, , . "
,
, " ",
,
, .
"
, . "
, , ,
, "
" (. 1.4). , "
.
"
, , ,
.
, , "
. ,
.

, "
, , "
, ,
(, ). "
,
"
(. 1.5). "
, ,

www.books-shop.com

. 1.4.

t1
t2

t3

. 1.5.
. , "
, "
.

,
". , "
, ".
, "
. (locks),

%RRNVVKRS

piracy@books-shop.com

. 1.6.
(. 1"6).

. "
, , , "
. , "
, ,
.

"
. "
,
.
, "
. ,
"
. , System 11 ""
" (dirty reads), ,
.
SQL Server 4.9.2
, SQL Server "
4.9.2, SQL Server System 10 System 11.

SQL Server ,
. SQL Server ,
master, ,
, . SQL Server "
.
, ,
.
. ,

www.books-shop.com

SQL Server "


, .
, .
"
" .
; , "
, .

SQL Server , ,
", "
. .
,
. ,
, .

. 1.7.

(. 1.7) (),
SQL Server. "
.

, .

(), SQL Server .


SQL Server .
, "
. SQL Server "
,
,

www.books-shop.com

. "
.

SQL Server . , SQL
Server ;
, . "
, , .

, "
. "
,
. , "
. "
; , .

SQL Server , "
, , .

"
, "
. SQL Server ,
; . "
, "
. ,
, , .
"
. ,
.
"
.
,
. , "
"
.
"
. ,
"
, "
. ,
, .
, , "
.
. 32" UNIX "
2 , "
2 . ,
. , SQL
Server System 10 11 (Backup Server)
. 4.9.2 "
"
.

SQL Server
(. 1,8),

, "
, .

www.books-shop.com

,

. 1.8.
SQL Server , "

. "
( (patch)), "
.
SQL Server
.

, . "
, ,
SQL Server. "
, .
, , SQL Server
, .
SQL Server
SQL Server ,
. SQL Server "
(threads), ".
SQL Server ,
.
, , SQL Server "
, "
. SQL Server .
, "
, "
, ,
.
SQL Server , "
. "
() SQL Server: 4.9.2, System 10 System 11.
(), "
, .
EBF (Emergency Bug Fix). , "
, ,
SQL Server , "
. EBF ;
, , Sybase.

www.books-shop.com

SQL Server :





. 1.9. SQL Server


SQL Server (. 1.9)
,
". , "
.

SQL Server (engine).
, (
) . "
,
.
, .
, "
. "
, ,
. , N SQL Server
N1 . "
, , "
N1.
SQL Server "
.
, N+1 +
.


, SQL Server (. 1.10). ,
;
"
.

www.books-shop.com

. 1.10. , SQL Server



, , "
, , , . "
; ,
.


"
. "
, , " .
.


"
" , , "
. , , "
, ,
. , "
, " .


SQL Server
(. 1.11). , " "
. , "
, , . "
, , .
, "
. , ,
, ".
, ,
.

SQL Server " , "
. ,
, , "
. SQL Server ("
"" ). ,
.
.
(IP").

, (. 1.12).
, "
, "
,

www.books-shop.com

16

. 1.11. SQL Server


#
PSYCH0492
query tcp sun+ether psycho 1025
#
PSYCH010
query tcp sun+ether thebirds 1025
#
PSYCH011
query tcp sun+ether rearwindow 1025

SunOS.
Solaris (. 12).
. 1.12. ( SQL Server 4.9.2 SunOS)
.
.
, SQL Server
. , "
,
. , .
SQL",
, .
, , "
", (. 1.13).
, , ,
. ", , ,
.

www.books-shop.com

#
PSYCH0492
query tcp sun+ether psycho 1025
+
PSYCH0492

. 1.13.

SQL Server PSYCH0492


psycho
1025

. 1.14.

. 1.14.
" , "
. , " "
.
;
. , " "
.

www.books-shop.com


, "
,
(. 1.15). , "
, .
SQLServer

. 1.15. SQL Server


, "
SQL Server . "
,
. , "
,
, ,
. , "
"
.
.

. ,
"
. , "
,

.


SQL Server , "
. ,
,
(server devices, . . 1.16). Sybase SQL Server
, "
. Sybase , "
,
. "

, .
"
, "
. ,
.

www.books-shop.com

. 1.16. SQL Server


(partitioned)
(partitions, . . 1.17),
. "
, "
(raw partition). ,

. , , ,
, . ,
"
.
, . "
,
.
. ,
"
. ,
. "
8.
Solaris

(slices)
'0' =

'2' =

'1, '3', '4', '5', '6'


1/5 ,
'0' 7'

7 = 50.

. 1.17.

%RRNVVKRS

piracy@books-shop.com


. 1.18.

" " ,
.
(. 1.18).

SQL Server . "
, ,
. ,
.
, , .. "
SQL" master, model tempdb
(. 1.19). master model
, "
.
.

. 1.19. SQL Server

www.books-shop.com

master
master
. ,
, .
master. "
, "
.
model
model "
, .
, .
" , "
model
tempdb
tempdb . "

. tempdb
,
. tempdb, "
.
tempdb.
tempdb "
.

, "
.
Transact+SQL
Transact"SQL SQL, Sybase.
SQL "
, " SQL, "
, ,
SQL. ,
, , "

( "
). SQL .
Sybase SQL Transact"SQL; "
. , "
, . Sybase
Transact"SQL, "
" SQL , "
( )
. , , Transact"SQL "
Sybase, , "
SQL .
,
.

SQL Server , , "
, , , ,
(. 1.3). ,
. Transact"SQL,

www.books-shop.com

. ,
, . , "
. ,
,
. "
, , "
.
", "
". "
"
. , "
; "
. ,
.
, select, update, in"
sert delete; , "
. .
" " ,
. order "
order_detail . order "
; .
order_detail
. order order_detail "
,
. , order
order_detail, . "
, "
,
. , "
, . , "
, ,
,
, "
".
Sybase SQL Server . Sybase SQL
Server , "
. ,
.
, "
, ( )
. ,
, , "
. , "
;
, . "

. ,
.
, "
.

, "
,
. ,
(. 1.15).
.

www.books-shop.com

. ,
, .
"
.
,
, . "
, , , "
(. 1.20).
, "
, .
SQLServer
master



. 1.20. SQL Server

SQL Server , "
.

'sa'
SQL Server 'sa'
( , ..)
. 'sa',
. , "
, , 'sa',
.


(database owner, dbo).
,
. ,
, .
'sa',
.
, .
, "
.

www.books-shop.com


SQL Server , Sybase
. master (
) master, model tempdb,
, "
, 'sa', ,
, , (. 1.21). "
, SQL Server 4.9.2 sybconfig,
SQL Server System 10 11 sybinit.
sybconfig/sybinit
SQL Server

sybinit
sybsystemprocs,
SQLServer System 10 11

. 1.21. SQL Server 4.9.2


isql
Sybase isql ( SQL), "
"
. isql
, SQL Server.
Transact"SQL.

, "
, . DSQUERY SQL Server, "
" , .. (. 1.23).
DSLISTEN ,
.
, DSLISTEN ,
. ,
, . , "
", "
. ,
. , "
.
SYBASE ( ) "
Sybase , . "
, ,
SYBASE.

www.books-shop.com


psycho

PSYCH0492
SQL Server PSYCH0492
psycho
1025
#
PSYCH0492
query tcp sun+ether psycho1025

. 1.22. Isql

,
isql
DSQUERY
isql +Upsycho +Pshower


psycho

SQL Server PSYCH0492


psycho
1025
#
PSYCH0492
query tcp sun+ether psycho1025

DSQUERY,

:
%echo $DSQUERY
PSYCH0492

. 1.23. DSQUERY

SQL Server , "
(. 1.24). SQL Server "
.
, shutdown (. 1.25).
,
SQL" (. 1.26).

www.books-shop.com

RUN PSYCH0492.
:
#!/bin/sh
# :
PSYCH0492
f dslisten:
# master: /dev/rsd1h
# master:
15360
DSLISTEN=PSYCH0492; export DSLISTEN
/dba/sybase/bin/dataserver +d/dev/rsd1h +e/dba/sybase/install/errorlog_PSYCH0492
. 1.24. SQL Server

. 1.25. SQL Server


SQL+ ps:

kill ,
,

. 1.26. SQL+

www.books-shop.com

( dbcc)
SQL Server , "
. "

. dbcc (data"
base consistency check) . "
dbcc ,
. Sybase dbcc (. 1.27). "
, dbcc
. "
dbcc" ; "
.
dbcc
:
+

+
+

. 1.27. dbcc

SQL, SQL Server , "


.
SQL" ,
, SQL , .
, "
. , "
SQL" ,
, . , "
SQL" (.. "
) ,
.
.

, , , , "
SQL Server ("
) .
() . "
", ( , )
( ) (. 1.28). "
", "
.
,
. "

. ,
, , "
.
42221

www.books-shop.com

psycho l

psycho ll

psycho II

. 1.28.
"
.

SQL Server
. , .
SQL Server 2 , 2048 . 2""
. ,
2 . " " ,
. , "
, , , , "
.
*
SQL Server "
, " (. 1.29). "
; , ,
(SQL" insert, select, update delete ). "
, ,

" . ,
(.. ),
, "
. " , ,
, . , ""
, "
, ( )
.
LRU/MRU
, "
" ( ). ,
, , "
.

www.books-shop.com

()

. 1.29. * SQL Server
LRU/MRU, (Least
Recently Used, LRU) , (Most
Recently Used, MRU). , "
, , , "
, .

.
,
(. 1.30). ,
.
; "

(. 1.31).
5,

. 1.30. , *

%RRNVVKRS

piracy@books-shop.com

12,

. 1.31. , +
+
" (. 1.30) "
". (. 1.31)
", "
". , "
,
.

, , "
. "
, , .

" , "
, ", (. 1.32).
" ,
" .

. 1.32. +

,
SQL" .
, .
: , "
. ,

www.books-shop.com

, ,
, , . "
, , "
, . ,
, "
,
. (, "
), , "
. ,

.
, .
SQL Server
. ,
.
(. 1.33),
. SQL Server
, , , "
, ,
, .
(.. ),
. ,
, .

. 1.33.
SQL" Sybase . ,
Sybase SQL Server
. 2" "
( "
).
, "
. "
.
.
, , "
. ,
, (On"Line Transaction Proces"
sing, OLTP), . "

.

www.books-shop.com

. 1.34.


SQL". "
, . 1.34.


SQL Server ;
. , ( "
) , ,
.
, , . , "
, ,
,
.
SQL Server "
. ,
, . "
, , "
.
, .

, , "
.
, "
, , "
.
( )
( ). ,

, .
,
, , "
.
(. 1.35). ,
, "
. "
, ,
, .

www.books-shop.com

. 1.35.

, "
. ,
(. 1.36). ,
, . ,
. "
. ,
, . "
, , "

.
, ,
.

"
.

. 1.36.

www.books-shop.com

, "
Sybase, "
, ..


, .
.


. "
. .

"
. , "
( ,
). (. 1.37).

. "
.
, ,
. "
, "
;
.


( )

,



. 1.37. .
, "
, . ,
,
.
,
(, ) .
, "
, "
(. 1.38).

www.books-shop.com

1: +



; ,
01:00 14:00

2: +


; ,
12:00 14:00

3: +


; ,
01:00 14:00

. 1.38.

SQL Server , "
(. 1.39).

, , "
. "
.
, "
. "
( ,
). "
, . "
(master device) .


, "
. "
(master).
,
. ,
.

www.books-shop.com

sdlb


/dev/rsd6b


( )

sdlb , (/dev/rsd6b),
, +
'sdlb'.
. 1.39.
?
Sybase SQL Server,
. "
, "
, . ,
"
, SQL Server.
,
, . , "
.


"
, . , "
100
. "
200 , "
.

, ,
(server engine).
( ), "
(. 1.40).

, "
.

.

, "
, .. "
.

www.books-shop.com

SQL Server


. 1.40. SQL Server



, Sybase SQL Server
. "
.

*
SQL Server, System 11, 0 (..
, ) ", "
. , "
,
. "

". 0, "
" "
0 (. 1.41).
,
0. , " "
, Sybase SQL Server.


,
, .
.
, "
. SQL Server "
, , ,
(. 1.42).
, "
,
.

www.books-shop.com

. 1.41. *

. 1.42.


" ( ),
.
", ", "
",
, . "
.
,
" . "
(. 1.43).
", " "
. " "
, ,
,
. "
. "
, , ,

www.books-shop.com

+
,

. 1.43. *
(. 1.44). "
(On"Line Transaction Processing,
OLTP), (Decision Support System, DSS). OLTP""
( , )
, .
, , , "
. , "
, , .
, DSS" ,
, DSS" , "
, OLTP". ,
,
OLTP", "
". "
, .

12
1 +7
8
DSS+ ,
,
.
OLTP+
.
. 1.44. OLTP* DSS*
*

%RRNVVKRS

piracy@books-shop.com

. 1.45.

, .. "
( ).
, , "
"
. (. 1.45).


""
. "
", , , "
.
, , , "
..
. , "
", "
".
", "
, , " "
. .
"
, "
,
. , ,
, .
, "
.
, , "
, .

, ,
.
.
, .

www.books-shop.com

SQL+

'exec sproc1'

. 1.46.

. ,
SQL" SQL Server
, (. 1.46). "
SQL", "
.

"
. , SQL Server.


,
(. 1.47). , "
, ,
.
,
, .
,
"
.
. "
, "
,
, , "
. "
, .

www.books-shop.com


m#
( )


. 1.47.
,
, . , "
. "
,
. "

.
"
, ( ,
). , "
, X Y. "
X,
" Y. "
"
, .
. ,
"
, . "

, "
,
.

www.books-shop.com

Emp#, First_Name
( ,
)


. 1.48.

,
. "
.
(. 1.48).

.
, . ,
, "
. ,
"
, .
"
,
. "
( )
.

www.books-shop.com

++

. 1.49.

. "
,
, .
, "
(. 1.49). , "
,
"
. "
, ,
.
. "
, "
.

, , "
. , Sybase
Replication Server ( ), SQL
Server .
, "
Replication Server, .. "
SQL Server. , SQL
Server , , "
.

(Log Transfer Manager, LTM) "
. ,
,
. ,
,
(. 1.50).

www.books-shop.com

. 1.50. Sybase Replication Server


SQL Server System 10
SQL Server System 10 "
, .
(Backup Server)
System 10 "
, . System 10
SQL Server (. 1.51), "
, SQL Server.
, "
. ,
, SQL Server. SQL Server "
"
.

www.books-shop.com

SQL Server


. 1.51. (Backup Server)


SQL Server System 10 , "
4.9.2; , System 10 ,
. , System 10,
System 10. 4.9.2 System 10 "
. System 10
, , .
SQL Server 4.9.2 System 10 "
System 10, , "
4.9.2, 4.9.2
System 10 .
4.9.2
System 10 "
b, System 10. "
, ,
.

System 10 .
, , "
. :
sa_role
sa_role "
( 'sa'), 'sa'.
, , "
.
sso_role
sso_role "
(System Security Officer, SSO),
. sso_role "
'sa'.

www.books-shop.com

operator_role
, .
,
sa_role, sso_role operator_role.
; "
,
.
'

System 10 "
sybsystemprocs. (, sp_who) "
master. System 10 ,
sybsecurity. SQL Server System 10
. 1.52.

master

mode/

tempdb


sybsystemprocs


sybsecurity


,


master

. 1.52. System 10

System 10 ,

, ,
. "
, , .
System 10 sybsecurity, "

. , "
. ,

.
SQL Server System 11
Sybase SQL Server System 11 , "
.
, Sybase SQL Server.

www.books-shop.com

System 11 2"6. "


System 11 Sys"
tem 10
(SMP). "
, "
System 10 ,
. ,
, SQL Server System 10 "
.
, System 11 "
. System 11, System 10, "
,
. ,
, , System 11. "
,
.


System 11
(. 1.41). "
, "
,
". System 11 .
+
SQL Server, System 11, ",
,

, ..
" , "
" , SQL Server
, . "
" ; "
,
. , ""
(
). " ,
.
""
, . SQL Server System 11
"
(. 1.53).
" , "
" .
+
System 11 ""
" 2 16 ( 1 8 "
2 , . . 1.54). (,
) .
SQL Server "
2 .

"
, "
.
. System 11

www.books-shop.com

. 1.53. System 11

. 1.54. System 11
*
" (User Log Cache, ULC;
. . 1.55).

. , "
, "
.

. 1.55. (ULC) System 11

%RRNVVKRS

piracy@books-shop.com



, . Sybase SQL Server "
, , ,
.
,
. System 11 .
, "
(. 1.56).

. 1.56. System 11


System 11
, , "
. System 11 , "
.
"
. System 11 "
.
:
+
" , (wash point)
".

.
: ,
, , .
300 ,
+ +
. , : Sys+
tem 11 .

System 11 System 10 SQL Server 4.9.2. "
System 11 , System 10.
System 10 System 11 System 10,
System 11. System 11 "
.

www.books-shop.com

SQL Server
SQL Server System 11 "
. ,
Sybase. , "
.

SQL Server
.
System 11 " "

. "
, OLTP",
DSS", "
. "
,
, " "
.

SQL Server (resource governor),


, , "
. ,
", ,
.. ,
, "
" .
, "
.

"
(, dbcc", ,
).
.
"
"
.
, "
. Sybase
,
. ,
SQL BackTrack
. , "
DataTools " . ,
, ,
, , "
.


(Decision Support Systems, DSS), (data warehouses).
DSS" , "
,
, "
(Logical Memory Manager), System 11. "
, ,

www.books-shop.com

, , , (,
sum, min, max, avg).

"
Sybase (Sybase Replication Server), "
, "" ""
(publish and subscribe model). "
, ,
. .

Sybase "
, "
.
, .
System 11
, "
.
SQL Server. "

(Very Large Databases, VLDB), ,
, ,
.

Sybase SQL Server 4.9.2 System 11


,
. , "
. Sybase,
.
. "
,
. ,
?

SQL Server: 4.9.2, System 10 Sys"
tem 11. System 10 ,
(Backup Server). System 11 "
SQL Server "
.
; "
. ,
, "
, .
System 11 ,
. System 11,
, "
. System 11
, ,
(SMP).

www.books-shop.com

Ssem 11

www.books-shop.com

Sybase "
, , , "
. ", System 11
.
"
, , "
System 11 .
", , System 11, "
. , , "
, .
, "
, . System 11 "
: , ",
. "
.
, System 11. "
"
Sybase.
System 11 :
System 11

System 11 (Multiple Network Engines, MNE)


System 11
System 11
+
"
" "
" System 11


SQL Server System 11


sp_sysmon


?
, "
,
.
,
System 11 , .
( *)
, , .
, ( "
) "
. , .
, , , .
SQL Server 4.9.2 System 11 "
(last"chance thresholds, . 12).

www.books-shop.com

System 11

(MNE)
, "
.
System 11

(User Log Cache, ULC) 2 . "
ULC".
System 11
(spinlocks).

, "
(promotion) .



" , , "
.

 
"
2 . , " "
2 .

System 11
, "
" , System 11
.
*
System 11 .
System 11 , (
, ) ,
", .

, .
, , "
.

SQL Server System 11
, "
, .
System 11 ( )
<_>.fg
. , "
sp_conf igure, "
<_>. cfg.
<_>.fg. , "
System 11 .

*
(off"line) .
, , "
(on"line) .

www.books-shop.com

sp_sysmon
(, "
, ),
.

, "
"
. "
.
, System 11
, " System 11. "
, System 11
. System 11 '
', create table,
.
(resource governor) "
, 11.0 .
(update"in"place) "
, System 11 , 11.0 Sybase
SQL Server .

, SQL Server System 11 , "


.
"
. , System 11,
.

www.books-shop.com

System 11

www.books-shop.com

(MNE) System 11
SQL Server .
, "
. System 11 "
. ,
, .

0 "
". System 11 ,
".
.
SQL Server
( ) , "
. "
.
, , .
; ,
(spinlocks), , ,
. "
, , ,
, .
,
(online engines), . "
, .
, "
. "
SQL Server,
sp_configure "max online engines", <_>.
System 11 , "
. "
:
1> sp_configure "max online engines"
2> go
Parameter Name
Default Memory Used
Config Value
Run Value
max online engines
1
147
1
1
(return status = 0)
1> sp_configure "max online engines", 2
2> go
Parameter Name
Default Memory Used
max online engines
1
147

Config Value
2

Run Value
1

Configuration option changed. The SQL Server must be rebooted before the
change in effect since the option is static.
( . #
, SQL
Server.)
(return status = 0)
1> sp_configure "max online engines", 3
2> go

Msg 5846, Level 16, State 1:

Server 'PSYCHO', Procedure 'sp_configure', Line 329:


Illegal value '3' specified for configuration option 'max online engines'.
The legal values are between '1' and '2'.

www.books-shop.com

'max online engines'


'1' ' 2 ' .
Msg 5849, Level 16, State 1:
Server 'PSYCHO', Procedure 'sp_configure', Line 329:
Verification failed for parameter 'max online engines'.
'max online engines'.
(return status = 1)
System 11 +
, SQL Server 4.9.2 System 10 " "
0, ,
(. 3.1). "
0 . " "
, "
. SQL Server
", "
".

. 3.1. * , System 11
SQL Server System 11 " , "
"
. , "
,
", , "
, . "
, , , ;
. "
, "
0 (. 3.2)
(. 3.3). (Sun
Solaris, DEC, RS6000, AIX, HP) . "
, "
.

. 3.2. * System 11
62221

%RRNVVKRS

piracy@books-shop.com

. 3.3. System 11
, +

. ,
, +
+,
. , , System 11 +
+,

.

SQL Server "
, "
. SQL Server 4.9.2 System 10 0
",
. "
System 11, "
(MNE),
.
,
1024 . 1024 "
( , "
).
3 1024 = 3072, "
1024 .

, ,
. , "
, SQL Server. "
,
"
. "
,
, .
,
. , "
,
, 100%" "
, .
, "
.

www.books-shop.com

, "
, , "
.
10.
,
.
,
, SQL Server.
, ,

. "
, ,
.
SQL Server
" SQL Ser"
ver , ,
. "
" "
, .
"
; "
.
4.9.2, System 10 System 11 .

System 11 "
.

,
.
, , "
.
System 11
System 11 "
, " .
System 11 , "
.
SQL Server ,
. , , "
. "
.
.

(. 3.4).
, "
,
.
+
System 11 : "
" (User Log Cache, ULC). "
, , ULC (. 3.5),

.

www.books-shop.com

. 3.4.

. 3.5. System 11
Ha ULC" "
; "
,
. ULC" System 11 "
, .
ULC" "
,
, , .
ULC" "
. "
.
. Sys"
tem 11 "
,
. , ULC" "
;
, "
.
"
, , ...
. "
, "

. ,
, select. "
ULC" , "begin tran" "
.

www.books-shop.com

"
,
. ULC",
; , ULC" "
2 .
2
sp_configure "user log cache size", 4096
ULC" "
. "
, . ,
( , " ),
" .
, "
, "

ULC". , ULC" "
, , "
.
.

,
, 2 . System 11 "
", ; "
, 2
16 . ULC", " "
. ""
4 ; "
.
"
. 4" , "
4"
" 4 .
"
",
, " ( ,
").
4" "
2" .
sp_poolconfig. "
"
, sysattributes. ,
", ,
( ) 2 .
sp_logiosize. ,

.

() "
. , "
,
, , "
select. System 11 "
,
, . "
. System 11 "
syslogshold,

www.books-shop.com

64

,
. , 
, ,
.

, System 11,
 . 
, , 
,
,
SQL Server.
 
, ..
, .

, .

syslogshold. , , 
syslogshold select (.
). , 
, , 
, kill
. ,
.
ULC*

ULC
1> sp_configure 'user log cache size'
2> go
Parameter Name
Default
Memory Used
user log cache size
2048
0

Config Value
2048

Run Value
2048

(return status = 0)
ULC

[User Environment]
number of user connections = 50
stack size = DEFAULT
stack guard size = DEFAULT
systemwide password expiration = DEFAULT
permission cache entries = DEFAULT
user log cache size = DEFAULT
user log cache spinlock ratio = DEFAULT
ULC

1> sp_configure 'user log cache size', 2060


2> go
Parameter Name
Default
Memory Used
Config Value
Run Value
user log cache size
2048
0
2060
2048
Configuration option changed. The SQL Server must be rebooted before the
change in effect since the option is static. (
; #
SQL Server.)
(return status = 0)

www.books-shop.com

ULC

00:96/05/30 15:34:34.35 server 'iso_l' (ID = 1).

00:96/06/12 10:13:08.41 server The configuration option 'user log cache


size' has been changed by 'sa' from '2048' to '2060'
00:96/06/12 10:13:08.47 server Configuration file

' /export/home/sybase/11.0.1/VERTIGOll.cfg' has been written and the


previous version has been renamed to
' /export /home/sybase/ 11.0.1/VERTIGO11.017 '
ULC

[User Environment]
number of user connections = 5 0
stack size = DEFAULT
stack guard size = DEFAULT

systemwide password expiration = DEFAULT


permission cache entries = DEFAULT
user log cache size = 2060
user log cache spinlock ratio = DEFAULT

ULC

1> sp_configure 'user log cache size'
2> go
Parameter Name
Default
Memory Used
user log cache size
2048
0

Config Value
2060

Run Value
2060

(return status = 0)




1> sp_logiosize
2>
The transaction log for database 'master' will use I/O size of 2 kbytes.
# 'master'
2 .
(return status = 0 )



1> sp_logiosize 'all'
2> go
Cache name: default data cache
Data base
Log I/O Size
Master

2 Kb

Model
Psycho_db

2 Kb
2 Kb

Sybsecurity
Sybsystemprocs
Tempdb

2 Kb
2 Kb
2 Kb

(return status = 0 )



2 8
1> use psycho_db
2> go
1> sp_logiosize
2> go
The transaction log for database 'psycho_db' will use I/O size of 2 kbytes.

www.books-shop.com

# 'master'
2 .
(return status = 0)
1> sp_logiosize '8'
2> go
Unable to change the log I/O size. The memory pool for the specified log I/O
size does not exist.
# #
.
(return status = 0)



8
1> sp_helpcache
2>
Cache Name
Config Size
Run Size
Overhead
default data cache
0.00 Mb
28.77 Mb
1.47 Mb
Memory Available For
Memory Configured
Named Caches
To Named Caches
28.77 Mb
0.00 Mb
There is 28.77 Mb of memory left over that will be allocated to the default
cache
28.77 #,

Cache Name

Cache Binding Information


Entity Name
Type Index Name

Status

(return status = 0)
1> sp_poolconfig 'default data cache', '2M', '8K'
2> go
00:96/06/12 10:31:46.39 server Configuration file
'/export/home/sybase/ll.O.l/VERTIGOll.cfg' has been written
previous version has been renamed to
'/export/home/sybase/11.0.1/VERTIGO11.018'
(return status = 0)
1> sp_cacheconfig 'default data cache'
2> go
Cache Name
Status
Type
Config Value
default data cache
Active
Default
0.00 Mb
Total
0.00 Mb
Cache: default data cache,
Status: Active,
Config Size: 0.00 Mb,
Run Size: 28.77 Mb
IO Size
Wash Size
Config Size
2 Kb
512 Kb
0.00 Mb
8 Kb
408 Kb
2.00 Mb

and the

Run Value
28.77 Mb
28.77 Mb

Type: Default
Run Size
26.77 Mb
2.00 Mb

(return status = 0)

*
2 8
1> sp_logiosize '8'
2>
The transaction log for database 'psycho_db' will use I/O size of 8 kbytes.
# 'master'
8 .
(return status = 0)

www.books-shop.com

loglosize (8 2 )
sysattributes
Class
attribute
object_type
object_cinfo
object
2

NULL
8
Object_infol
object_info2
object_info3
int_value
NULL
NULL
NULL
8
Char_value
text_value
image_value
comments
NULL
NULL
NULL
NULL

ULC

(
)
[User Environment]
number of user connections = 50
stack size = DEFAULT
stack guard size = DEFAULT
systemwide password expiration = DEFAULT
permission cache entries = DEFAULT
user log cache size = DEFAULT
user log cache spinlock ratio = DEFAULT
. DEFAULT 
, sp_conf igure.


00:96/06/12 10:42:43.47 server Recovering database 'psycho_db'
00:96/06/12 10:42:43.48 server Recovery dbid'6 ckpt (10248,19) old#
est tran= (10248,18)
00:96/06/12 10:42:43.51 server 1 transactions rolled back.
00:96/06/12 10:42:44.11 server The transaction log in the database
'psycho_db' will use I/O size of 8 Kb.
00:96/06/12 10:42:44.15 server Database 'psycho_db' is now online.

ULC

1> sp_configure 'user log cache size'


2> go
Parameter Name
Default
Memory Used
user log cache size
2048
0
(return status = 0)
syslogshold
1> select * from syslogshold
2> go
dbid
reserved
spid
11
0
0
Starttime
Jan 1 1900 12:00AM

page
11971

Config Value
2048

xactid
0x000000000000

Run Value
2048

masterxactid
0x000000000000

name
$replication_truncation__point

(1 row affected)
. ,
dbid=l1 Sybase (Replication Server System Data
base, RSSD), .
begin /ran syslogshold
1> begin tran psycho
2> go
1> use master
2> go

www.books-shop.com

68
1> select * from syslogshold
2> go
dbid
reserved
spid
Starttime

page

xactid
name

masterxactid

(0 rows affected)
: begin tran ULC, 
syslogshold.
syslogshold
1> select * from syslogshold
2> go
dbid
reserved
spid
page
xactid
masterxactid
11
0
0
11971
0x000000000000
0x000000000000
Starttime
name
Jan 1 1900 12:00AM
$replication_truncation_point
(1 row affected)
1> use cmsdb
2> go
1> begin tran psycho

2> go
1> update service_orders set so_number = so_number + 1
2> go
1>
2>
1>
2>

use master
go
select * from syslogshold
go
dbid
reserved
spid
11
0
0
5 0 1 77107
Starttime
Jan 1 1900 12:00AM
Jan 12 1996 10:48AM

page
xactid
masterxactid
11971
0x000000000000
0x000000000000
Ox00012d33000e
0x000000000000
name
$replication_truncation_point
psycho

(2 rows affected)
: dbid = 5 , 
, a spid  1 , .
sysprocesses
spid syslogshold
1> select * from sysprocesses where spid=l
2> go
spid
kpid
enginenum
status
suid
hostname
1
341639182
0
sleeping
1
psycho
program_name
hostprocess
cmd
cpu
physical_io
Isql
13925
UPDATE
17
14325
memusage
blocked
dbid
uid
gid
3
0
5 1
0
tran_name
time_blocked
network_pktsz
Psycho
NULL
512
(1 row affected)

www.books-shop.com

,

1> begin tran psycho
2> go 1> update service_orders set so_number = so_number + 1
2> go (20958 rows affected)
1> use master
2> go
1> select * from syslogshold
2> go
dbid
reserved
spid
page
xactid
masterxactid
11
0
0
11971
0x000000000000
0x000000000000
5
0
1
77107
Ox00012d33000e
0x000000000000
starttime
name
Jan 1 1900 12:00AM
$replication_truncation_point
Jan 12 1996 10:48AM
psycho
(2 rows affected)

1> use cmsdb
2> go
1> rollback tran psycho
2> go
1> use master
2> go
1> select * from syslogshold
2> go
dbid
reserved
spid
page
xactid
11
0
0
11971
0x000000000000
Starttime
name
Jan 1 1900 12:00AM
$replication_truncation_point

masterxactid
0x000000000000

(1 row affected)
System 11
"
, . "
,
. System 11 " " (dirty reads), "
,
(lock promotion), (parallel
lock manager). "
, "
Sybase.
" "
, , 
. System 11 
" ", ,
. " " 
, 
, . ,
. , 
,
.
" " " 0".
3, ,

%RRNVVKRS

piracy@books-shop.com

.
, SQL".
, " " .
, . , "
,
. "
" "
,
. "
, . "
;
.

System 11 , 200
, .
,
"
. System 11 "
, .
System 11 "
. "
(low watermark/high watermark, LWM/HWM)
. "
(LWM),
. ,
(HWM), "
, .

SQL Server "
, . System 11
; "
" .
( )
. System 11
, "
, (deadlocks). , "
,
"
. "
.
"
.

www.books-shop.com

*
System 11

www.books-shop.com

SQL Server ,
(" ) .
(select, insert, update delete) "
(
"), , "
( ""
). , " ",
"
.
SQL Server "
. "
; ,
. OLTP" "
.
. , "
, "
, ,
" .
+
SQL Server
System 11 " ,
. , "
(select, insert, update delete) " "
.
, "
(
), , . "
, "
, " ,
" (. 4.1).

,
. 4.1. *
" (. 4.2),
. " "

.
;
. ,
, (most recently

www.books-shop.com

. 4.2. SQL Server


used, MRU). ,

(least recently used, LRU). ,

( "). "
( "),
, . "
, .
,
..
, .
. , "
OLTP", DSS". OLTP" "
, ,
. , DSS" "
, . "
, ,
OLTP". , LTP" "
, "
, .
; "
, "
" .
System 11 " "
" .
, "
(. 4.3), OLTP" DSS" "
.

. 4.3. * System 11

www.books-shop.com

",
. , " "
" 16 . SQL Server
" 2" .

+
, SQL Server System 11
" , ", , "
. System 11 ,
" "
" . "
.
, "
.
, DSS" OLTP" ,
OLTP" DSS",
.
sa_role. "
,
; "
. , "
() (mixed), " " (data"only) "
" (log"only). , "
. "
, . ,
, , "
. "

, . "
, . ,
, ,
.

. , ,
. , "
. "
.
,
.
. "
.
"
sysattributes. , "
, .

sp_configure. , "
, sp_helpcache <_6>. "
,
. ,
, . "
, ,
. sysattributes
, "
. ,
,
, "
, . "
,
, .

www.books-shop.com

, sysattributes , "
"
. sysattributes
. "
sp_helpcache,
, . "
"
sysattributes
,
. ,
sysattributes
master. "
, master . "
,
sp_helpcache.
, +
. ,
.
. +
, ,
. +
, +
.

, , +
. ,
. , +
. +
,
. ,
sp_conf igure
.
" , "
. " "
. ,
" .
512 . ,
,
. , , "
.
, "
. ,
" , , "
.
" . "
"
. , ,
; . "
, , "
( ).
"
.

,
( * )
" . "
" ( ,

www.books-shop.com

), "
, " . "
,
; .
"
, ,
, .. .
"
.

"
. , , "
, (. 4.4).
;
.
;
. "
;
. "
, "
, " .
, "
. , "
, .
master.

+
. 4.4. *
master, "
. ( ), "
, " "
. sysindexes ,
"
. , "

.
*
, "
, " , "
. "
, "
. "

www.books-shop.com

" . "
, ", "
, ,
" .
,
.
,
.
" ("
). "
;
( , ) "
, "
.
,
+


1> sp_cacheconf ig 'psycho_cachel' , ' 1 0 '
2> go
(), (), ()
(G). "
, "
.

:
[Named Cache: psycho_cache1 ]
cache size = 10M
cache status = mixed cache

"
, "
sysattributes, .
"
sysattributes
sp_helpcache.
, "
,
1> sp_bindcache 'psycho_cachel ' , 'psycho_database' , 'psycho_tablel '
2> go

1> sp_bindcache ' psycho_cachel ' , 'psycho_database' , 'psycho_tablel ' ,
'psycho_tablel_index2 '
2> go
psycho_database.
, , "
:
1> sp_unbindcache 'psycho_cachel' , 'psycho_tablel '
2> go
1> sp_unbindcache 'psycho_cachel' , 'psycho_tablel_index2 '
2> go
, ,
.
, ,

www.books-shop.com

1> sp_unbindcache 'psycho_cachel'


2> go


" :
1> sp_cacheconfig 'psycho_cachel',
2> go
, , .
, , "
sysattributes , . "
,
sysattributes ". "
sysattributes ,
"". "
sysattributes, "
. sysattributes,
""
", .

, :
1> sp_unbindcache_all 'psycho_cachel'
2> go
3> sp_cacheconfig 'psycho_cachel',
4> go
, "
.


", ,

1> sp_helpcache '200 '
2>
, "
, . sp_help"
cache ,
:
1> sp_helpcache
2>
10.38 Mb of overhead memory will be needed to manage a cache of size 200M
200 10.38
(return status = 0)
,
200 .

"
sp_conf igure sp_helpcache. "
sp_configure ,
, "
"
. , ,
, ,
, sp_helpcache.
, "
sysattributes .

www.books-shop.com


" ,
. ,
,
,
. ,
, . "
, "
,
.
"
".
, "
. "

" .
. ,
,
(
). " "
, , "
",

, . ,
" (.. )
", . "
(
), , , "
. , ,
, "
, .
, "
,
. "
,
,
.
, "
,
. "
,
, ,
.
,
. , "
, "
, , .
SQL Server,
". , "
, "
.
""
.
, , "
"
.

%RRNVVKRS

piracy@books-shop.com

,
OLTP+, DSS+. +
. , +
OLTP+
, (DSS).

+. DSS+
,
(OLTP). +


.. +
OLTP+, OSS+, +
.
,

,
, ,
.
tempdb.
, sysindexes,
( , "
sysindexes). ,

". , "
.


"
", "
, "
".
+
+
", ,
. (buffer pool)
.
2" ; ,
4, 8 16 (. 4.5). SQL Server "
" 2 , "
2 . System 11
" 2 16 (.. 8 ); ,
2"
, , 8 . "
, " " ("
" ), " (
) " .

", System 11,
" .
", " ,

www.books-shop.com

2
4
8

16

,
. 4.5. System 11
.
. ( , "
) " .
"
2 . "
4, 8 16 . ,
" 10 5120 2""
. 2" , "
64 16" , ,
": 2" ( 8 )
16" , 2 . "
; ,
" 2, 4, 8 16 .
"
. 4.6.

. 4.6. System 11
:
. , 2+
2 ,
( 2 ). , +
Sybase,
" +
512 , 16 ".
, +
512 , +
16 .

www.books-shop.com

" "
"
. , , "
. ,
2" ,
2 . , "
16" . 16 ,
(
). ,
, , "
set showplan. ( "
System 11) , ,
. ,
("
, ).
LRU/MRU "
" , "
(. 4.7). "
LRU/MRU" , "
". "
(least recently used, LRU) .
,
".
>>

. 4.7.

+?
,
", System 11. 16""
"
, b dbcc.
, ( ) , "
, "
. "
, ,
. :
8 ",
" 8 .
" ,
, ,
. "
4" . , "
" (,

www.books-shop.com

). "
.

+
" ,
"
:
1> sp_poolconfig psycho_cache , '6', '8'
2>
6 , "
8 . 8"
(8 buffer pool). sp_cacheconf ig, sp_poolconf ig "
: 2" (), (), ()
(G). "
2 ,
. "
, . "
( ) " .

. "
, , :
[Named Cache: psycho_cache]
cache size = 10M
cache status = mixed cache
[8K I/O Buffer Pool]
pool size = 6M
, ,
(
, ).
sp_cacheconf ig "
, "
" , .
" ,
. ,
sp_poolconfig psycho_cache, '1M', '4', '8'
1 8" "
4" , 6
5 . , .
, "
: ,
.

, ,
. , "
, ", "
16 .
2 , b
" 2" ,
.
sp_poolconfig psycho_cache, 0, '8'
8" . "
"
2 .

www.books-shop.com

, "
,
OLTP" DSS".
, .
"
. " 2" "
, 512 . "
2, 4, 8 16 ,
2" .

,
(, 2 ). ( "
) (
16 ). System 11 2
, " " "
" ".
System 11 2, 4, 8
16 . " 2" ,
" "
. "
LRU/MRU"
.
, ,
,
. , " "
, "
. " ,
.
System 11 (wash point)
", , "
("") .
, , ""
(.. ),
. " , ,
.
. , "
("")
. , "
.
, ".
+
" , "
, "
, .
,
.
2""
". "

(. . 4.8).

. "
"
,
.

www.books-shop.com

+
2

+ 1
. 4.8. * ,
*
"
", . "
,
"
. ,
" " "
2" .
, "
, "
.
OLTP" DSS", "
" ( ,
). "
"
, . ,
"
.
+
,
+
.
.
,
, ? (
, )
?


" .
" . "
: " "Config Size = 0.00" .
1> sp_helpcache
2>
Cache Name
Config Size
Run Size
Overhead
28.58 Mb
1.18 Mb
default data cache
0.00 Mb
Memory Available For
Memory Configured
To Named Caches
Named Caches
22.58 Mb
0.00 Mb

www.books-shop.com

There is 22.58 Mb of memory left over that will be allocated to the default
cache
22.58 #,

Cache Binding Information
Cache Name
Entity Name
Type
Index Name
Status
(return status = 0)

1> sp_cacheconfig psycho_cache1, '10M'


2> go
0
The change is completed. The SQL Server must be rebooted for the change to
take effect.

SQL Server.
(return status = 0 )




00:96/06/05 19:17:04.13#Server configuration file
'/home/sybase/11.0.1/PSYCHOll.cfg' has been written and the previous
version has been renamed to '/home/sybase/11.0.1/PSYCHO11.002'

sp_helpcache
"Run Size = 0.00" , .
1> sp_helpcache
2>
Cache Name
Config Size
Run Size
Overhead
default data cache
0.00 Mb
28.58 Mb
1.18 Mb
Psycho_cache1
10.00 Mb
0.00 Mb
0.00 Mb
Memory Available
For Memory Configured
Named Caches
To Named Caches
22.58 Mb
10.00 Mb
There is 12.58 Mb of memory left over that will be allocated to the default
cache
12.58 #,

Cache Binding Information
Cache Name
Entity Name
Type
Index Name
Status
(return status = 0)

sp_cacheconfig
. Pend/Act , .
sp_cacheconf ig 
, sp_helpcache 
(overhead),
.
1> sp_cacheconfig
2> go

Cache Name
default data cache

Status
Active

Type
Default

Config Value
0.00 Mb

Run Value
22.58 Mb

www.books-shop.com

Psycho cachel

Pend/Act

10.00 Mb
0.00 Mb
Mixed
10.00 Mb
Total
22.58 Mb
Cache: default data cache, Status: Active, Type: Default
Config Size: 0.00 Mb, Run Size: 22.58 Mb
IO Size Wash Size Config Size Run Size
2 Kb 512 Kb 0.00 Mb 22.58 Mb
(return status = 0)

1> sp_helpcache psycho_cache1


2> go
Cache Name
Config Size
Run Size
Overhead
psycho_cachel
10.00 Mb
0.00 Mb
0.00 Mb

Cache Name

Cache Binding Information


Entity Name
Type

Index Name

Status

(return status = 0)
,

[Named Cache:psycho_cache1]
cache size = 10M
cache status = mixed cache

, .
1> sp_poolconfig psycho_cache1, '6', '8'
2> go

The source pool


request to move

(1p buffers, total size 0) is not large enough to satisfy the


6144Kb of memory
(1# , 0)
6144

(return status = 1)
"Config Size" "Run Size",

.
1> sp_helpcache
2>
Cache Name
Config Size
Run Size
Overhead
default data cache
0.00 Mb
12.56 Mb
0.65 Mb
Psycho_cache1
10.00 Mb
10.00 Mb
0.53 Mb
Memory Available For
Named Caches
22.58 Mb

Memory Configured
To Named Caches
10.00 Mb

There is 12.58 Mb of memory left over that will be allocated to the default
cache
12.58 #,

Cache Binding Information
Cache Name
Entity Name
Type
Index Name
Status
(return status = 0)

6 8
1> sp_poolconfig psycho_cache1, '6', '8'

www.books-shop.com

2>
(return status = 0)


00:96/06/05 19:24:53.30#Server configuration file
' /home/sybase/11.0.1/PSYCHO11 .cfg' has been written and the previous
version has been renamed to ' /home/sybase/11.0.1/PSYCHO11.003 '

1> sp_poolconfig psycho_cachel
2> go
Cache Name
Status
Type
Config Value
Run Value
Psycho_cachel Active
Mixed
10.00 Mb
10.00 Mb
_
Total
_
10.00
Mb
_
10.00
Mb

Cache : psycho_cache1 , Status: Active, Type: Mixed


Config Size: 10.00 Mb, Run Size: 10.00 Mb
IO Size
Wash Size
Config Size
Run Size
2 Kb
512 Kb
0.00 Mb
4.00 Mb
8 Kb
2048 Kb
6.00 Mb
6.00 Mb
(return status=0)
.


:
[Named Cache :default data cache]
cache size = DEFAULT
cache status = default data cache
[Named Cache :psycho_cachel]
cache size = 10M
cache status = mixed cache
[8K I/O Buffer Pool]
pool size = 6.0000M
wash size = DEFAULT

1> sp_bindcache psycho_cache , admindb, def_actions


2> go
(return status = 0)
,
. "Status = V" .
1> sp_helpcache psycho_cache1
2> go
Cache Name
Config Size
Run Size
Overhead
psycho_cache1
10.00 Mb
10.00 Mb # 0.53 Mb
############### cache Binding Information 
Cache Name
Entity Name
Type
Index Name
Status
psycho_cachel
admindb.dbo.def_actions
table
V
(return status = 0)
sysattrtbutes
. "class = 3".

1> select * from sysattributes


2> go
class
3 0

attribute

object_type

object_cinfo
NULL

object
1280007591

www.books-shop.com

(17 rows affected)


1> select object_name(1280007591)
2> go
def_actions
(1 row affected)


1> sp_cacheconfig psycho_cache2, '1'
2> go
0'
The change is completed. The SQL Server must be rebooted for the change to
take effect.
,
SQL Server.
(return status = 0 )



00:96/06/05 19:39:41.36#Server configuration file
'/home/Sybase/11.0.1/PSYCHO11.cfg' has been written and the previous version
has been renamed to '/home/sybase/11.0.1/PSYCH011.004'


.
Pend/Act
2
.
1> sp_cacheconfig
2> go
Cache Name
default data cache
psycho_cachel
psycho_cache2

Status
Active
Active
Pend/Act

Type
Default
Mixed
Mixed
Total

Config Value
0.00 Mb
10.00 Mb
1.00 Mb
11.00 Mb

Run Value
12.56 Mb
10.00 Mb
0.00 Mb
22.56 Mb

Cache: default data cache, Status: Active,


Type: Default
Config Size: 0.00 Mb,
Run Size: 12.56 Mb
I Size
Wash Size
Config Size
Run Size
2 Kb
512 Kb
0.00 Mb
12.56 Mb
Cache:

psycho_cache1, Status: Active,


Type: Mixed
Config Size: 10.00 Mb,
Run Size: 10.00 Mb
Config Size
Run Size
I Size
Wash Size
2 Kb
512 Kb
0.00 Mb
4.00 Mb
6.00 Mb
6.00 Mb
8 Kb
2048 Kb
(return status = 0)

%RRNVVKRS

piracy@books-shop.com



:
[Named Cache: default data cache]
cache size = DEFAULT
cache status = default data cache
[Named Cache :psycho_cache1]
cache size = 10M
cache status = mixed cache
[8K I/O Buffer Pool]
pool size = 6.0000M
wash size = DEFAULT
[Named Cache :psycho_cache2]
cache size = 1M
cache status = mixed cache

:


00:96/06/05 19:49:44.84 kernel
Network and device connection limit is 1014.
00:96/06/05 19:49:44.86 server
Number of proc buffers allocated: 3039.
00:96/06/05 19:49:44.94 server
Number of blocks left for proc headers: 3086.
00:96/06/05 19:49:44.94 server
Memory allocated for the default data cache cache: 11768 Kb
00:96/06/05 19:49:44.96 server
Size of the 2K memory pool: 11768 Kb
00:96/06/05 19:49:44.96 server
Memory allocated for the psycho_cachel cache: 10240 Kb
00:96/06/05 19:49:44.96 server
Size of the 2K memory pool: 4096 Kb
00:96/06/05 19:49:44.97 server
Size of the 8K memory pool: 6144 Kb
00:96/06/05 19:49:44.97 server
Memory allocated for the psycho_cache2 cache: 1024 Kb
00:96/06/05 19:49:44.97 server
Size of the 2K memory pool: 1024 Kb
00:96/06/05 19:49:44.98 kernel Initializing virtual device 0,


1 > sp_helpcache
2 > go
Cache Name
Config Size
Run Size
Overhead
default data cache
0.00 Mb
11.49 Mb
0.60 Mb
psycho_cachel
10.00 Mb
10.00 Mb
0.53 Mb
psycho_cache2
1.00 Mb
1.00 Mb
0.11 Mb
Memory AvailableFor
Memory Configured
Named Caches
To Named Caches
22.52 Mb
11.00 Mb
There is 11.52 Mb of memory left over that will be allocated
to the default cache
11.52 #,

www.books-shop.com

 Cache Binding Information 


Cache Name
Entity Name
Type
Index Name
Status
psycho_cachel admindb.dbo.def_actions table
V
(return status = 0)


sp_cacheconfig. "Active".
1> sp_cacheconfig
2> go
Status
Type
Config Value
Cache Name
Run Value
Active
Default
0.00 Mb
default data cache
11.49 Mb
Active
Mixed
10.00 Mb
10.00 Mb
psycho_cachel
Mixed
psycho_cache2
Active
1.00 Mb
1.00 Mb
Total
11.00 Mb
22.49 Mb
Cache: default data cache, Status: Active, Type: Default
Config Size: 0.00 Mb,
Run Size: 11.49 Mb
IO Size
Wash Size
Config Size
Run Size
2 Kb
512 Kb
0.00 Mb
11.49 Mb
Cache: psycho_cachel,
Status: Active, Type: Mixed
Config Size: 10.00 Mb,
Run Size: 10.00 Mb
Wash Size
Config Size
TO Size
Run Size
512 Kb
2 Kb
0.00 Mb
4.00 Mb
2048 Kb
6.00 Mb
8 Kb
6.00 Mb
Cache: psycho_cache2,
Status: Active,
Type: Mixed
Config Size: 1.00 Mb,
Run Size: 1.00 Mb
IO Size
Wash Size
Config Size
Run Size
2 Kb
204 Kb
0.00 Mb
1.00 Mb
(return status = 0)





1> sp_cacheconfig psycho_cache2, ''
2> go
The change is completed. The SQL Server must be rebooted for the change
to take effect.

SQL Server.
(return status = 0 )



00:96/06/05 19:51:49.62#Server configuration file
'/home/sybase/ll.O.l/PSYCHOll.cfg' has been written and the previous version
has been renamed to '/home/sybase/11.0.1/PSYCHO11.007'

"Config Size = 0.00" ,


.
1> sp_helpcache
2> go
Cache Name
Config Size
Run Size
Overhead
default data cache
0.00 Mb
11.49 Mb
0.60 Mb

www.books-shop.com

psycho_cachel
10.00 Mb
10.00 Mb
0.53 Mb
psycho_cache2
0.00 Mb
1.00 Mb
0.11 Mb
Memory Available For
Memory Configured
Named Caches
To Named Caches
22.52 Mb
10.00 Mb
There is 12.52 Mb of memory left over that will be allocated
to the default cache
12.52 #,

################# Cache Binding Information #############
Cache Name
Entity Name
Type
Index Name
Status
psycho_cachel
admindb.dbo.def_actions
table
V
(return status = 0)

sp_cacheconfig

Act/Del , .
1> sp_cacheconfig
2> go
Cache Name
default data cache
psycho_cachel
psycho_cache2
_
Total
_

Status
Active
Active
Act/Del
10.00

Type
Config Value
Run Value
Default
0.00 Mb
11.49 Mb
Mixed
10.00 Mb
10.00 Mb
Mixed
0.00 Mb
1.00 Mb
Mb
_
22.49
Mb

Cache: default data cache, Status: Active, Type: Default


Config Size: 0.00 Mb,
Run Size: 11.49 Mb
IO Size
Wash Size
Config Size
Run Size
_ 2 Kb _ 512 Kb _ 0.00 Mb _ 11.49 Mb
Cache : psycho_cachel ,
Status: Active, Type: Mixed
Config Size: 10.00 Mb,
Run Size: 10.00 Mb
IO Size
Wash Size
Config Size
Run Size
2 Kb
512 Kb
0.00 Mb
4.00 Mb
_
8
Kb
_
2048
Kb
_
6.00
Mb
_

6.00

Mb

Cache : psycho_cache2 ,
Status: Act/Del, Type: Mixed
Config Size: 0.00 Mb,
Run Size: 1.00 Mb
IO Size
Wash Size
Config Size
Run Size
2 Kb
204 Kb
0.00 Mb
1.00 Mb
(return status = 0)



:
[Named Cache: default data cache]
cache size = DEFAULT
cache status = default data cache
[Named Cache :psycho_cachel]
cache size = 10M
cache status = mixed cache
[8K I/O Buffer Pool]
pool size = 6.0000M
wash size = DEFAULT


,

1> sp_cacheconfig psycho_cachel , ''

www.books-shop.com

2> go
The change is completed. The SQL Server must be rebooted for the change
to take effect.

SQL Server.
(return status = 0)



00:96/06/05 19:56:03.67#Server configuration file
' /home/sybase/11. 0.1/PSYCHOll.cfg' has been written and the previous version
has been renamed to ' /home/sybase/11.0.1/PSYCHO11.008 '



:
[Named Cache: default data cache]
cache size = DEFAULT
cache status = default data cache

"Config Size = 0.00" , 


.  .
1> sp_helpcache
2>
Cache Name
Config Size
Run Size
Overhead
default data cache
0.00 Mb
11.49 Mb
0.60 Mb
psycho_cachel
0.00 Mb
10.00 Mb
0.53 Mb
psycho_cache2
0.00 Mb
1.00 Mb
0.11 Mb
Memory Available For
Memory Configured
Named Caches
To Named Caches
22.52 Mb
10.00 Mb
There is 12.52 Mb of memory left over that will be allocated to the default
cache
12.52 #,

################## Cache Binding Information 
Cache Name
Entity Name
Type
Index Name
Status
Psycho_cachel
admindb.dbo.def_actions
table
V
(return status =0)
.

.
Act/Del , .
1> sp_cacheconfig
2> go
Cache Name
Status
Type
Config Value
Run Value
Default
default data cache
Active
0.00 Mb
11.49 Mb
Psycho_cachel
Act/Del
Mixed
0.00 Mb
10.00 Mb
Psycho cache2
Act/Del
Mixed
0.00 Mb
1.00 Mb
Total
0.00 Mb
22.49 Mb
Cache: default data cache, Status: Active,
Type: Default
Config Size: 0.00 Mb,
Run Size: 11.49 Mb
IO Size
Wash Size
Config Size
Run Size

2 Kb

512 Kb

0.00 Mb

11.49 Mb

www.books-shop.com

Cache: psycho_cachel,
Status: Act/Del, Type: Mixed
Config Size: 0.00 Mb,
Run Size: 10.00 Mb
IO Size
Wash Size
Config Size
Run Size
2 Kb
512 Kb
0.00 Mb
4.00 Mb
8 Kb
2048 Kb
6.00 Mb
6.00 Mb
Cache: psycho_cache2,
Status: Act/Del, Type: Mixed
Config Size: 0.00 Mb,
Run Size: 1.00 Mb
IO Size
Wash Size
Config Size
Run Size
2 Kb
204 Kb
0.00 Mb
1.00 Mb
(return status = 0)


.
1> sp_poolconfig psycho_cachel
2> go
Config Value
Cache Name
Status
Type
Psycho cachel
0.00 Mb
Act/Del
Mixed
Total
0.00 Mb

Run Value
10.00 Mb
10.00 Mb

Cache: psycho_cachel,
Status: Act/Del, Type: Mixed
Config Size: 0.00 Mb,
Run Size: 10.00 Mb
IO Size
Wash Size
Config Size
Run Size
2 Kb
204 Kb
0.00 Mb
1.00 Mb
8 Kb
2048 Kb
6.00 Mb
6.00 Mb
(return status = 0)
sysattrtbutes
class
attribute
object_type
object_cinfo
object
3
0

NULL
1280007591
object_infol
object_info2
object_info3
int_value
NULL
NULL
NULL
1
char_value
text_value
image_value
comments
psycho_cachel
NULL N
ULL
NULL

:


00:96/06/05 20:00:32.05 server
Number of proc buffers allocated: 3042.
00:96/06/05 20:00:32.16 server
Number of blocks left for proc headers: 3091.
00:96/06/05 20:00:32.16 server
Memory allocated for the default data cache cache: 21320 Kb
00:96/06/05 20:00:32.21 server
Size of the 2K memory pool: 23120 Kb
00:96/06/05 20:00:32.21 kernel Initializing virtual device 0,

00:96/06/05 20:00:37.60 server Recovering database 'admindb'


00:96/06/05 20:00:37.61 server

www.books-shop.com

Recovery dbid 4 ckpt (31286,32)


00:96/06/05 20:00:37.61 server
Recovery no active transactions before ckpt.
00:96/06/05 20:00:38.90 server Cache binding for database '4', object
'1280007591', index '0' is being marked invalid in Sysattributes
00:96/06/05 20:00:38.92 server
The transaction log in the database 'admindb' will use I/O size of 2 Kb.
00:96/06/05 20:00:38.97 server
Database 'admindb' is now online.
sysattributes
(int_value) .
class
attribute
object_type
object_cinfo
object

NULL
3
0
1280007591
int_value
object_infol
object_info2
object_info3
NULL
NULL
0
NULL
text_value
image_value
comments
char value
Psycho_cachel
NULL
NULL
NULL

1> sp_helpcache
2> go
Config Size
Cache Name
Run Size
Overhead
default data cache
28.58 Mb
0.00 Mb
1.18 Mb
Memory Available For
Memory Configured
Named Caches
To Named Caches
22.58 Mb
0.00 Mb
There is 22.58 Mb of memory left over that will be allocated to the
default cache
22.58 #,

Cache Binding Information
Cache Name
Entity Name
Type
Index Name
Status
(return status =0)
1> sp_cacheconfig
2> go
Cache Name
Status
Config Value
Type
Run Value
default data cache
Active
Default
0.00 Mb
22.58 Mb
Total
22.58 Mb
0.00 Mb
Cache: default data cache, Status: Active,
Type: Default
Config Size: 0.00 Mb,
Run Size: 22.58 Mb
IO Size
Wash Size
Config Size
Run Size
2 Kb
512 Kb
0.00 Mb
22.58 Mb
(return status = 0)

,
1> sp_cacheconfig psycho_cachel, '10'
2>

The change is completed. The SQL Server must be rebooted for the change
to take effect.

SQL Server,
(return status = 0 )

www.books-shop.com

"Status = I" .
1> sp_helpcache
2>
Cache Name
Config Size
Run Size
default data cache
0.00 Mb
22.58 Mb
Psycho_cachel
10.00 Mb
0.00 Mb

Overhead
1.18 Mb
0.00 Mb

Memory Available For


Memory Configured
Named Caches
To Named Caches
22.58 Mb
10.00 Mb
There is 12.58 Mb of memory left over that will be allocated to the
default cache
12.58 #,

################# Cache Binding Information 
Cache Name
Entity Name
Type
Index Name
Status
psycho_cachel
admindb.dbo.def_actions
table
I
(return status = 0)

:

00:96/06/06 08:16:02.02 server
Memory allocated for the default data cache cache: 12866 Kb
00:96/06/06 08:16:02.04 server
Size of the 2K memory pool: 12866 Kb
00:96/06/06 08:16:02.04 server
Memory allocated for the psycho_cachel cache: 10240 Kb
00:96/06/96 08:16:02.06 server Size of the 2K memory pool: 10240 Kb
00:96/06/06 08:16:02.06 kernel Initializing virtual device 0,

:
. 
. 
.
1> sp_helpcache
2> g
Cache Name
Config Size
Run Size
Overhead
default data cache
0.00 Mb
12.56 Mb
0.65 Mb
psycho_cachel
10.00 Mb
10.00 Mb
0.53 Mb
Memory Available For
Memory Configured
Named Caches
To Named Caches
22.58 Mb
10.00 Mb
There is 12.58 Mb of memory left over that will be allocated to the
default cache
12.58 #,

 Cache Binding Information 
Cache Name
Entity Name
Type
Index Name
Status
Psycho_cachel
admindb.dbo.def_actions
table
V
(return status = 0)

www.books-shop.com



00:96/06/06 08:16:07.49 server Recovering database 'admindb'.
00:96/06/06 08:16:07.50 server Recovery dbid 4 ckpt (31287,2)
00:96/06/06 08:16:07.50 server
Recovery no active transactions before ckpt.
00:96/06/06 08:16:08.80 server Cache binding for database '4' object
'1280007591', index '0' is being marked valid in Sysattributes. 00:96/06/06
08:16:08.82 server
The transaction log in the database 'admindb' will use I/O size of 2 Kb.
00:96/06/06 08:16:08.87 server
Database 'admindb' is now online.
sp_help ,

1> select db_name()


2> go
admindb
(1 row affected)
1> sp_help def_actions
2> go
Name
Owner
Type
Def_actions
dbo
user table
Data_located_on_segment
When_created
Default
Jun 29 1994 8:13PM
Column_name
Type
Length
Prec
path#key
varchar
NULL
20
Nulls
Identity
Default_name
Rule_name
NULL
0
NULL

Scale
NULL

Column_name
Type
Prec
Scale
Length
partner_code
varchar
NULL
NULL
15
Nulls
Default name
Identity
Rule name
1
NULL
NULL
0
Attribute class
attribute
char value
comments
int_value
buffer manager
cache binding
1
psycho_cach
NULL
Index_name
index_description
Def_actions_idx
clustered,unique located on default
Index_keys
index_max_rows_per_page
Path_key,segnum
0
No defined keys for this object.
Object is not partitioned.
(1 row affected, return status = 0)

www.books-shop.com


+ System 11

System 11 "
. , System 11
"
". "
(prefetch) (fetch"and"discard). "

,
, .
+
System 11 " ,
( ,
(. 4.9)). (prefetch) "
,
.
" .
", "
. "
,
. "
, "
"
.
,

16+
+

+
8

. 4.9.

(fetch"and"dis"
card, . . 4.10). LRU" , "
,
.
LRU/MRU" , "
, , "

LRU" ( ).
, "
, "
DSS". ,
, OLTP" "
DSS".

www.books-shop.com

. 4.10.


+
(.. ""
) . ", "
(hints), .
",
", . "
", "
.
, , "
..
" .
, OLTP" "
" ,
.
sp_cachestrategy. "
SQL" select
( ") . "
, "
, showplan.
"
,
,
.
" "
.
", ".
,
, , . "
, " "
".
"
", ( "
)
.
, "
.
". "
", , .
, "
2" ,
". , "
"

%RRNVVKRS

piracy@books-shop.com

. "
.
System 11
( DSS"). "
.
System 11 , "
.

. "
302 310.
*
System 11 ,
". System 11 "
.
, , "
,
. "
.
. OLTP" DSS""
,
.
" "
.
, +
.
,
?
, "
, "
.
, . ,
. "
showplan , "
.

Sybase
, . "
,
Sybase " SQL Server 11" ("What's New in SQL Server 11?"). "
"
, ,
.
, , System 11 "
. "
,
, .
13.

www.books-shop.com


SOL Server Sustem 11

www.books-shop.com

SQL Server System 11 "


120 30. , "
.
, "
, . "

. . "
, System 11
sp_conf igure, . sp_conf igu"
, "

.
11 " " Sybase
SQL Server (Sybase SQL Server System Administration Guide) , "
System 11 "
Sybase.

, "
, . "
.
"
.
, , " "
sysconfigures syscurconfigs master, "
master.
"
, . "
" dataserver,
.
, SYBASE,
<_>.fg. SYBASE "
, , "
System 11 (System 11.0 System 11.0.1)
. ,
, ; "
, .
SQL Server "
buildmaster"r. , , "
(, " ). System 11
<_
sepa>.cfg .

, , ,
OLTP" "
. "
.
.
, System 11 "
. , , "
,
. . ", "
sp_conf igure (
). ", "

. , sp_conf igure
, "
.

www.books-shop.com

ASCII", "
. "
, "
.
. ,
master ( , "
master).
, "
, .

<_cepepa>.bak
, . , "
,
, "
. , <_>.bak. "
. ,
sp_conf igure.
"
. "
(config values), ,
(run values). <_
Bepa>.bak ( ),
<_>.fg,
, SYBASE (. 5.3). ,
(config)
(run) .
sp_conf igure "
,
<_>.fg. <_
>., XXX "
(. 5.1). 001;
999, <_>.001 "
. , "
, , ,
. ( 1000
),
<_>.001, 999.
.
sp_configure,
. "
<_>.bak, .
,
<_>.fg, ,

. 5.1. System 11

www.books-shop.com

SYBASE. , "
(. 5.2). <_
pa>.bak, sp_configure

. , , . ,
" ,
" sp_conf igure.
, "
.
(
) ,
, master. ,
"
, .

PSYCH011
. 5.2.

PSYCH011.cfg

PSYCH011 .cfg ( )
PSYCH011.032
( )
. 5.3.
. " , +
", . "
+ ?" " !
. ?" ! PSYCHO_KNOWS,
, NEW_NAME (
+s startserver),
NEW_NAME.cfg, , , . +
.

, +
( NEW_NAME.cfg)
.

"
,
, .

www.books-shop.com

"
. ,
OLTP",
.
, ("
, dbcc") , "
. System 11
. , "
",
16" . , "
,
System 11.
"" , "
,
. "
.
"
, "
.
,
. sp_conf igure "
. ("
, , ),
. "
master buildmaster "r, "
.
sp_conf igure "
. System 11 "
.


SQL Server System 11 "
.
,
.
master. System 11 "
,
(. 9).
"
. "
.


, , "
. ,
"
. ,
.
,
, ,
. , "
, , "
, . ,
"
(, "

www.books-shop.com

) , 
.
*

. ,

.

, ,
DEFAULT,
sp_conf igure.
DEFAULT.

. SQL Server. (,

(number of user connections) .)
#
#

#
#
#
#
#
#
#
#
#
#
#

Configuration File for the Sybase SQL Server


Please read the System Administration Guide (SAG)
before changing any of the values in this file.
Sybase SQL Server

.

[Configuration Options]
[General Information]
[Backup/Recovery]
recovery interval in minutes = DEFAULT
print recovery information = DEFAULT
tape retention in days = DEFAULT
[Cache Manager]
number of oam trips = DEFAULT
number of index trips = DEFAULT
procedure cache percent = DEFAULT
memory alignment boundary = DEFAULT
[Named Cache:default data cache]
cache size = DEFAULT
cache status = default data cache
[Disk I/O]
allow sql server async i/o = DEFAULT
disk i/o structures = DEFAULT
page utilization percent = DEFAULT
number of devices = DEFAULT
[Network Communication]
default network packet size = DEFAULT
max network packet size = DEFAULT
remote server pre#read packets = DEFAULT
number of remote connections = DEFAULT
allow remote access = DEFAULT

www.books-shop.com

number of remote logins = DEFAULT


number of remote sites = DEFAULT
max number network listeners = DEFAULT
tcp no delay = DEFAULT

[O/S Resources]
max async i/os per engine = DEFAULT
max async i/os per server = DEFAULT
[Physical Resources]
[Physical Memory]
total memory = DEFAULT
additional network memory = DEFAULT
lock shared memory = DEFAULT
shared memory starting address = DEFAULT
[Processors]
max online engines = DEFAULT
min online engines = DEFAULT
[SQL Server Administration]
number of open objects = DEFAULT
number of open databases = DEFAULT
audit queue size = DEFAULT
default database size = DEFAULT
identity burning set factor = DEFAULT
allow nested triggers = DEFAULT
allow updates to system tables = DEFAULT
print deadlock information = DEFAULT
default fill factor percent = DEFAULT
number of mailboxes = DEFAULT
number of messages = DEFAULT
number of alarms = DEFAULT
number of pre#allocated extents = DEFAULT
event buffers per engine = DEFAULT
cpu accounting flush interval = DEFAULT
i/o accounting flush interval = DEFAULT
sql server clock tick length = DEFAULT
runnable process search count = DEFAULT
i/o polling process count = DEFAULT
time slice = DEFAULT
deadlock retries = DEFAULT
cpu grace time = DEFAULT
number of sort buffers = DEFAULT
sort page count = DEFAULT
number of extent i/o buffers = DEFAULT
size of auto identity column = DEFAULT
identity grab size = DEFAULT
lock promotion HWM = DEFAULT
lock promotion LWM = DEFAULT
lock promotion PCT = DEFAULT
housekeeper free write percent = DEFAULT
partition groups = DEFAULT
partition spinlock ratio = DEFAULT
[User Environment]
number of user connections = 200
stack size = DEFAULT
stack guard size = DEFAULT
systemwide password expiration = DEFAULT
permission cache entries = DEFAULT
user log cache size = DEFAULT

www.books-shop.com

user log cache spinlock ratio = DEFAULT


[Lock Manager]
number of locks = DEFAULT
deadlock checking period = DEFAULT
freelock transfer block size = DEFAULT

max engine freelocks = DEFAULT


address lock spinlock ratio = DEFAULT
page lock spinlock ratio = DEFAULT
table lock spinlock ratio = DEFAULT
, "
, "
. ,
<_>.fg, <_>..
, "
, . "
.
UNIX, .. "
"#". ,
[_], , , "
, . "
. ,
" ; , . "
, " "
, (wash size).
, (, , ),
:
#
[Named Cache:default data cache]
cache size = DEFAULT
cache status = default data cache
, ""
.
" ,
.
#
[Named Cache:default data cache]
cache size = DEFAULT
cache status = default data cache
[Named Cache:psychol_cache]
cache size = 2M

cache status = mixed cache


[16K I/O Buffer Pool]
pool size = 1M
wash size = DEFAULT


"
,
, .

, ,
<_>.fg. , "
, , "
,
. <_>.fg

www.books-shop.com

,
sp_conf igure / 
.
, 

. , , WEEKDAY_conf ig.cfg,
/
 WEEKDAY_con"
f ig.cfg, WEEKDAY_config.XXX. ,
.

<_>.fg 
<_>..

.
, 
,
.
, ,
.
. 
, .
1. . 
,
.
#
[Named Cache: psychol_cache]
cache size = 2M
cache status = mixed cache
[16K I/O Buffer Pool]
pool size = 2M
16. .
0 0 : 9 6 / 0 5 / 2 2 1 0 : 2 0 : 2 9 . 3 5 kernel Configuration Error: A named cache with 'cache
status=default data cache.' does not exist in the configuration f i l e .
00:96/05/22 10:20:29.35 kernel :
", 'cache
status=default data cache ' .
2a. 'cache status = mixed cache'.
#
[Named Cache: default data cache]
cache size = DEFAULT
cache status = default data cache
[Named Cache: psychol_cache]
cache size = 2M
cache status = mixed cache
[16K I/O Buffer Pool]
pool size = 2M
26. .
00:96/05/22 10:02:18.09 server Number of proc buffers allocated: 1869.
00:96/05/22 10:02:18.14 kernel Configuration Error:
Configuration file
' /home/sybase/11.0.1/THEBIRDSll_test2 ' has an unknown format on line 38.
(lack of a blank line)
00:96/05/22 10:02:18.14 kernel :
38
'/home/sybase/11.0.1/THEBIRDSll_test2' .

%RRNVVKRS

piracy@books-shop.com

( )
. ,
.
#
[Named Cache:default data cache]
cache size = DEFAULT
cache status = default data cache
[Named Cache:psychol_cache]
cache size = 2M
cache status = mixed cache
[16K I/O Buffer Pool]
pool size = 2M
36. .
0 0 : 9 6 / 0 5 / 2 2 10:00:44.18 kernel Network and device connection limit is 1014.
0 0 : 9 6 / 0 5 / 2 2 1 0 : 0 0 : 4 4 . 2 0 server Number of proc buffers allocated: 1869.
0 0 : 9 6 / 0 5 / 2 2 1 0 : 0 0 : 4 4 . 2 5 kernel Configuration Error:
Configuration f i l e
'/home/sybase/11.0.1/THEBIRDSll_test2'
has an unknown format on line 37.
0 0 : 9 6 / 0 5 / 2 2 1 0 : 0 0 : 4 4 . 2 5 kernel :
37
'/home/sybase/11..l/THEBIRDSll_test2'.
4. 
.
16
,  512 
2 (. 4).
#
[Named Cache:default data cache]
cache size = DEFAULT
cache status = default data cache
[Named Cache:psychol_cache]
cache size = 2M
cache status = mixed cache
[16K I/O Buffer Pool]
pool size = 2M
wash size = DEFAULT
46. .
00:96/05/22 10:03:22.48 kernel Network and device connection limit is 1014.
00:96/05/22 10:03:22.49 server Number of proc buffers allocated: 1869.
00:96/05/22 10:03:22.55 kernel Invalid pool size of Ok (0 buffers)
encountered for the 2k pool in cache psychol_cache. Buffer pools must have
a minimum total size of 512k or 25 buffers, whichever is greater.
00:96/05/22 10:03:22.55 kernel # psychol_cache
2 0 (0 ).

25 512 .
5. .
#
[Named Cache:default data cache]
cache size = DEFAULT
cache status = default data cache
[Named Cache:psychol_cache]
cache size = 2M

www.books-shop.com

cache status = mixed cache


[16K I/O Buffer Pool]
pool size = 1M
wash size = DEFAULT
SP_CONFIGURE
sp_configure , , 
. 

sp_conf igure .
sp_configure
SQL Server sp_conf igure "
30 . "
buildmaster dbcc,
. sp_conf i"
gure "
. ,
buildmaster "yall.
sp_configure SQL Server 4.9.2
1> sp_configure
2> go
Name
minimum
maximum
run_value
config_value
1
recovery interval
1
32767
1
1
allow updates
0
1
1
2147483647
100
user connections
5
100
2147483647
Memory
3850
8192
8192
2147483647
open databases
5
0
10
2147483647
Locks
5000
0
5000
2147483647
open objects
100
0
500
procedure cache
1
0
99
20
fill factor
0
0
100
0
time slice
50
0
1000
100
database size
2
10000
0
2
tape retention
0
0
0
365
recovery flags
0
1
0
0
serial number
1
999999
999999
999999
nested triggers
0
1
1
1
Devices
4
256
0
10
remote access
0
1
1
1
remote logins
0
2147483647
0
20
remote sites
0
2147483647
0
10
0
remote connections
0
2147483647
20
pre#read packets
0
2147483647
3
0
upgrade version
0
2147483647
492
492
default sortorder id
0
50
50
255
default language
0
2147483647
0
0
language in cache
3
3
3
100
1
1
max online engines
1
32
1
1
32
min online engines
1
engine adjust interval 1
32
0
0
default character set id 0
1
1
255
2147483647
28672
stack size
20480
0
(30 rows affected, return status = 0)

www.books-shop.com

sp_configure SQL Server System 10


1> sp_configure
2> go
run_value
config_value
Name
minimum
maximum
32767
0
5
recovery interval
1
0
1
0
allow updates
0
2147483647
0
25
user connections
5
20000
2147483647
20000
Memory
3850
2147483647
12
0
open databases
5
2147483647
5000
0
Locks
5000
2147483647
500
0
open objects
100
0
20
99
procedure cache
1
0
0
100
fill factor
0
100
1000
0
time slice
50
2
0
10000
database size
2
0
0
tape retention
0
365
1
0
0
recovery flags
0
1
1
1
nested triggers
0
0
10
256
Devices
4
1
1
1
remote access
0
2147483647
20
0
remote logins
0
2147483647
10
0
remote sites
0
2147483647
0
20
remote connections
0
2147483647
3
0
pre#read packets
0
2147483647
1002
1002
upgrade version
0
50
50
default sortorder id
0
255
2147483647
0
0
default language
0
3
language in cache
3
100
3
1
32
1
max online engines
1
1
1
min online engines
1
32
engine adjust interval
1
0
0
32
2147483647
200
cpu flush
1
200
2147483647
i/o flush
1
1000
1000
1
1
default character set id
0
255
28672
2147483647
stack size
20480
0
0
password expiration interval 0
32767
0
100
100
audit
queue
size
1
65535
0
2147483647
additional netmem
0
0
default network packet size
512
512
524288
0
maximum network packet size
512
512
0
524288
2147483647
0
extent i/o buffers
0
0
identity burning set factor
1
5000
5000
9999999
(38 rows affected, return status = 0)
, sp_configure,
, .
,
. SQL
Server 4.9.2 System 10 memory ( ) user connections (
).
sp_conf igure , "
"
, (config_value) (run_value) .
sp_configure
(config).
,
. sp_conf igure "
, , "
.

www.books-shop.com


SQL Server 4.9.2 'sa'
. System 10
, sa_role. System 11 sa_role "
, ,
sso_role.
sp_configure
System 11 sp_conf igure ,
. sp_conf igure
1> sp_configure
2> go
, "
.
$SYBAS/<_>.fg, ( )
.
sp_conf igure <_>
:
1> sp_configure 'total memory'
2> go
, sp_conf igure "
, "
( . ).
sp_conf igure
:
sp.configure 'configuration file', 0, '.', '_*
_'
, ,
'configuration file'
.
0;
sp_conf igure ( ). "
: write (), restore ("
), read () verify (). ,
( read verify) ( write restore).
,
sp_configure 'configuration file'
, .
. "
( , ), "
: syscurconfigs,

select value2 from syscurconfigs where config=114
write () , "
(run) :
1> sp_configure 'configuration f i l e ' , 0, ' w r i t e ' , '__"
_ '
2> go
, , "
SYBASE.
, (config)
, restore ():
1> sp_conf igure 'configuration f i l e ' , 0, 'restore', '_"
__ '
2> go

www.books-shop.com

write restore ,
. , "
, "
.

, ,
write, (run) .
, restore (config) "
, . ",
, , "
"
. (run)
, (config) "
. "
write , ,
(.. DEFAULT). restore "
(config) , "

. , restore

.
", restore , "
. "
(config) ,
(run) . "
restore "
.
verify ()
. "
, "
.
1> sp_configure 'configuration f i l e ' , 0, ' v e r i f y ' ,
' ___ '
2> go
, read ("
):
1> sp_configure 'configuration f i l e ' , 0, 'read',
' ___ '
2> go
, ,
SYBASE. read
, "
.
"
. ,
: (
) read "
, , .


"
. "
. .
, "
" , <_>.fg, "
$SYBASE.

www.books-shop.com

, ""
. SYBASE
<_>.fg
. "
, "
.
read "
sp_conf igure "
. , read
" ,
" (, , ).
"
, "
,
, .
System 11 "
sp_conf igure. System 11 "
" .
" , "
. , "
config.one ",

. , "
config.one, sp_conf igure "
.
read: !
,
, "
, , "
.
. ", "
, ( ""
, ).
. ", "
. , "
, ,
<_>.fg
.
sp.configure
, sp_conf igure,
.
, : sp_conf igure <_"
>. ,
. , "
number of devices ( )
Disk I/O ( / ), Memory Use ( ). "
:
Configuration Options ( ; )
Backup/recovery (/)
Cache manager ( ")
Disk I/O ( /)

General information ( )
Languages ( )
Lock manager ( )

www.books-shop.com

Memory Use ( )
Network communication ( /)
O/S resources ( )
Physical resources ( ; )
Physical memory ( )
Processors ()
SQL Server Administration ( )
User environment ( )

sp.configure

"
, sp_conf igure: (basic), (intermedi"
ate) (comprehensive; ).
. , "
(.. "
, sso_role),
. ,
, sa_role, sp_conf igure "
, ,
(
sso_role).
sp_configure
sp_conf igure (comprehensive) "
:
1> sp_configure
2>
Group: Configuration Options
Group: Backup/Recovery
Run
Memory
Config
Value
Value
Default
Used
Parameter Name
1
1
1
0
allow remote access
print recovery information
0
0
0
0
recovery interval in minutes
5
5
5
0
tape retention in days
0
0
0
0
Group: Cache Manager
Parameter Name
memory alignment boundary
number of index trips
number of oam trips
procedure cache percent
total data cache size
total memory

Default
2048

20

7500

Memory
Used
0
0
0
990
3812
15000

Config
Value
2048
0
0
20
0
7500

Run
Value
2048
0
0
20
3812
7500

Memory
Used
0
19
4

Config
Value
1
256
10

Run
Value
1
256
10

Group: Disk I/O


Parameter Name

allow sql server async i/o


disk i/o structures
number of devices

Default
1
256
10

www.books-shop.com

page utilization percent

95

95

95

Group: General Information


Parameter Name
configuration file

Default

Memory
Used

Config
Value

Run
Value
/home/sybas

Group : Languages
Parameter Name
default character set id
default language id
default sortorder id
number of languages in cache

Default

1
0
50
3

Memory
Used

0
0
0
4

Config
Value

1
0
50
3

Run
Value

1
0
50
3

Group: Lock Manager


Parameter Name
address lock spinlock ratio
deadlock checking period
freelock transfer block size
max engine freelocks
number of locks
page lock spinlock ratio
table lock spinlock ratio

Default

100
500
30
10
5000
100
20

Memory
Used

0
0
0
0
469
0
0

Config
Value

Run
Value

100
500
30
10

100
500
30
10

5000
100
20

5000
100
20

Config
Value

Value

Group: Memory Use


Parameter Name
Default
additional network memory
0
audit queue size
100
default network packet size
512
disk i/o structures
256
event buffers per engine
100
executable codesize + overhead
0
max number network listeners
15
max online engines
1
number of alarms
40
number of devices
10
number of extent i/o buffers
0
number of languages in cache
3
number of locks
5000
number of mailboxes
30
number of messages
64
number of open databases
12
number of open objects
500
number of remote connections
20
20
number of remote logins
number of remote sites
10
number of user connections
25
partition groups
1024
permission cache entries
15
procedure cache percent
20
remote.server pre#read packets
3
stack guard size
4096
stack size
34816
0
total data cache size

Memory
Used

0
42
#135

19
#10
4941
1124
147
1

#4
0
4
469
1
1
396
489
33
22
749
1868
21
#28
990
#32
#240
#2041
3812

0
100
512
256
100
0
15
1
40
10
0
3
5000
30
64
12
500
20
20
10
25
1024
15
20
3
4096
34816
0

Run
0
100
512
256
100
4941

15
1
40
10
0
3
5000
30
64
12
500
20
20
10
25
1024
15
20
3
4096
34816
3812

www.books-shop.com

total memory
Group: Network Communication

7500

Parameter Name
Default
additional network memory
0
allow remote access
1
default network packet size
512
max network packet size
512
max number network listeners
15
number of remote connections
20
number of remote logins
20
number of remote sites
10
remote server pre#read packets
3
tcp no delay 0 0 0 0

15000

7500

7500

Memory
Used

Config
Value

Run
Value

0
0
#135

0
1124

33
22
749
#32

0
1
512
512
15
20
20
10
3

0
1
512
512
15
20
20
10
3

Group: O/S Resources

max
max
o/s
o/s
tcp

Parameter Name
async i/os per engine
async i/os per server
asynch i/o enabled
file descriptors
no delay

Default
2147483647
2147483647
0
0
0

Memory
Used

0
0
0
0
0

Config
Run
Value
Value
2147483647 2147483647
2147483647 2147483647
0
0
0
1024
0
0

Group: Physical Resources


Group: Physical Memory
Parameter Name
Default
additional network memory
0
lock shared memory
0
shared memory starting address
0
total memory
7500

0
0
0

0
0
0

15000

7500

Run
Value
0
0
0
7500

Memory
Used
147
0

Config
Value

Run
Value

Memory
Used
0
0
42
0
0
0
0
0
#10
0

Config
Value

Memory
Used

Config
Value

Group: Processors
Parameter Name
max online engines
min online engines

Default
1
1

1
1

1
1

Group: SQL Server Administration


Parameter Name
Default
allow nested triggers
1
allow updates to system tables
0
audit queue size
100
cpu accounting flush interval 200
cpu grace time
500
deadlock retries
5
default database size
2
default fill factor percent
0
event buffers per engine
100
housekeeper free write percent
1

i/o accounting flush interval 1000


i/o polling process count
identity burning set factor
identity grab size

1:0
5000
1

0
0
0
0

Run
Value

1
0
100
200
500
5
2
0
100
1

1
0
100
200
500
5
2
0
100

1000

1000

10
5000
1

5000
1

10

www.books-shop.com

lock promotion HWM


200
200
lock promotion LWM
100
lock promotion PCT
number of alarms
40
number of extent i/o buffers
0
number of mailboxes
30
64
number of messages
12
number of open databases
500
number of open objects
2
number of pre#allocated extent
number of sort buffers
0
1024
partition groups
10
partition spinlock ratio
0
print deadlock information
runnable process search count 2000
10
size of auto identity column
sort page count
0
sql server clock tick length 100000
100
time slice
1100
upgrade version

0
0
0
1
0
1
1
396
489
0
0
21
0
0
0
0
0
0
0
0

200
200
100
40
0
30
64
12
500
2
0
1024
10
0

200
200
100
40
0
30
64
12
500
2
0
1024
10
0

2000

2000

10
0

10
0

100000

100000

100
1100

100
1100

Config
Value
512
2
25
15
4096
34816
0
2048
20

Run
Value
512
2
25
15
4096
34816
0
2048
20

Group: User Environment


Parameter Name
Default
default network packet size
512
number of pre#allocated extent
2
number of user connections
25
permission cache entries
15
stack guard size
4096
stack size
34816
systemwide password expiration
0
user log cache size
2048
user log cache spinlock ratio
20
(return status = 0)

Memory
Used
#135
0
1868
#28
#240
#2041
0
0
0

sp_configure
sp_conf igure (basic)
(intermediate) . 
. ,
sso_role, , 
. ,
sp_displaylevel.
1> sp_displaylevel
2> go
The current display level for login 'sa' is 'comprehensive'.
'sa' 'comprehensive'.

(return status = 0)
1> sp_displaylevel sa, basic
2> go
The display level for login 'sa' has been changed to 'basic'.
'sa' 'basic'.
(return status = 0 )
1> sp_configure
2> go
Group: Configuration Options
Group: Backup/Recovery

%RRNVVKRS

piracy@books-shop.com

Parameter Name
recovery interval in minutes

Default

Memory
Used

Config
Value

Run
Value

Group: Cache Manager


Default
Parameter Name
total data cache size 0 3812 0 3812

Run

Memory
Used

Config
Value

Value

Memory
Used

Config
Value

Value

#4

10

10

Memory
Used

Config
Value
5000

Value
5000

Group: Disk I/O


Parameter Name
number of devices

Default

10

Run

Group: General Information


Group : Languages
Group: Lock Manager
Parameter Name
number of locks

Default
5000

469

Run

Group: Memory Use


Parameter Name
Default
executable codesize + overhead
0
number of devices
10
5000
number of locks
12
number of open databases
number of open objects
500
25
number of user connections
34816
stack size
0
total data cache size

Memory
Used
4941

Config
Value

0
10

Run
Value
4941

10

#4
469
396
489
1868
#2041
3812

5000

5000

12
500
25
34816
0

12
500
25
34816
3812

Default
12
500

Memory
Used
396
489

Config
Value
12
500

Run
Value
12
500

Default
25
34816

Memory
Used
1868
#2041

Config
Value
25
34816

Run
Value
25
34816

Group: Network Communication


Group: O/S Resources
Group: Physical Resources
Group: Physical Memory
Group: Processors
Group: SQL Server Administration
Parameter Name
number of open databases
number of open objects
Group: User Environment
Parameter Name
number of user connections
stack size
(return status = 0)

www.books-shop.com

sp.configure
1> sp_displaylevel
2> go
The current display level for login 'sa' is 'basic'.
'sa' 'basic'.
(return status = 0)
1> sp_displaylevel sa, intermediate
2> go
The display level for login 'sa' has been changed to 'intermediate'.
'sa' 'intermediate'.
(return status =0)
1> sp_displaylevel
2> go
The current display level for login 'sa' is 'intermediate'.
'sa' 'intermediate'.
(return status = 0)
1> sp_configure
2> go
Group: Configuration Options
Group: Backup/Recovery
Parameter Name
allow remote access
print recovery information
recovery interval in minutes
tape retention in days

Default
1
0
5
0

Memory
Used
0
0
0
0

Config
Value
1
0
5
0

Run
Value
1,
0
5
0

Default
0
7500

Memory
Used
3812
15000

Config
Value
0
7500

Run
Value
3812
7500

Default
10

Memory
Used
#4

Config
Value
10

Run
Value
10

Default
1
0
3

Memory
Used
0
0
4

Config
Value
1
0
3

Run
Value
1
0
3

Default
5000

Memory
Used
469

Config
Value
5000

Run
Value
5000

Group: Cache Manager


Parameter Name
total data cache size
total memory
Group: Disk I/O
Parameter Name
number of devices
Group: General Information
Group: Languages
Parameter Name
default character set id
default language id
number of languages in cache
Group: Lock Manager
Parameter Name
number of locks
Group: Memory Use

www.books-shop.com

Parameter Name
Default
additional network memory
0
audit queue size
100
default network packet size
512
executable codesize + overhead
0
max online engines
1
number of devices
.
10
number of languages in cache
3
number of locks
5000
number of open databases
12
number of open objects
500
number of remote connections
20
number of remote logins
20
number of remote sites
10
number of user connections
25
remote server pre#read packets
3
stack size
34816
total data cache size
0
total memory
7500

Memory
Used

0
42

Config
Value

Run
Value

0
100
512
0
1
10
3

4941

5000

5000

12
500
20
20
10
25
3

12
500
20
20
10
25
3

#2041
3812
.15000

34816

34816
3812
7500

Memory
Used

Config
Value

#135
4941

147
#4
4
469
396
489
33
22
749
1868

#32

0
7500

0
100
512
1
10
3

Group: Network Communication


Parameter Name
Default
additional network memory
0
allow remote access
1
default network packet size
512
max network packet size
512
number of remote connections
20
number of remote logins
20
number of remote sites
10
remote server pre#read packets
3

0
0
#135

0
33
22
749
#32

0
1
512
512
20
20
10
3

Run
Value

0
1
512
512
20
20
10
3

Group: O/S Resources


Group: Physical Resources
Group: Physical Memory
Parameter Name
additional network memory
total memory

Default
0
7500

Memory
Used

Config
Value

Run
Value

15000

7500

7500

Memory
Used

Config
Value

Value

Group: Processors
Parameter Name
max online engines
min online engines

Default
1
1

147
0

1
1

Run
1
1

Group: SQL Server Administration


Parameter Name
Default
allow nested triggers
1
audit queue size
100
deadlock retries
5
default database size
2
default fill factor percent
0
housekeeper free write percent
1

Memory
Used

0
42
0
0
0
0

Config
Value

1
100
5
2
0
1

Run
Value

1
100
5
2
0
1

www.books-shop.com

identity burning set factor


identity grab size
lock promotion HWM
lock promotion LWM
lock promotion PCT
number of open databases
number of open objects
print deadlock information
size of auto identity column

5000
1
200
200
100
12
500
0
10

0
0
0
0
0
396
489
0
0

5000
1
200
200
100
12
500
0
10

5000
1
200
200
100
12
500
0
10

Config
Value

Value

Group: User Environment


Memory
Parameter Name
Default
Used
#135
default network packet size
512
number of user connections
25
1868
stack size
34816
#2041
systemwide password expiration
0 0 0 0
user log cache size
2048 0 2048 2048
user log cache spinlock ratio
20 0 20 20
(return status = 0)

Run

512
25

512
25

34816

34816

sp_configure
1> sp_configure 'Physical Memory'
2> go
Group: Physical Memory
Memory
Config
Run
Parameter Name
Default
Used
Value
Value
additional network memory
0
0
0
0
0
0
lock shared memory
0
0
0
0
shared memory starting address
0
0
0
0
0
0
total memory
7500
15000
7500
7500
(return status = 0 )
sp.configure
, sp_configure
. , .
1> sp_configure 'configuration f i l e '
2> go
Memory
Config
Run
Parameter Name
Default
Used
Value
Value
configuration f i l e

/home/sybas
(return status = 0)


1> select db_name()
2> go
master
(1 row affected)
1> select value2 from syscurconfigs where config=114
2> go
value2

/home/sybase/11.0.1/THEBIRDS11.cfg
(1 row affected)

www.books-shop.com

read verify sp.configure



1> sp_configure 'configuration file', 0, 'verify', '/home/sybase/ll.O/con#
fig_test.001'
2> go
Msg 5852, Level 16, State 1:
Server 'THEBIRDS11', Procedure 'sp_configure', Line 199:
Changing the value of 'total memory' is not allowed since it is a static
option.
'total memory' ,
.
(return status = 1 )
*
1> sp_configure 'configuration file', 0, 'read', '/home/sybase/ll.O/con#
fig_test.001'
2> go
WARNING: Dynamic loading of caches and pools through loading a new file are
not supported. However, the loadfile '/home/sybase/11.0/config_test.001' will
be inspected for consistency. Refer to 'sp_cacheconfig' and 'sp_poolconfig'
to create or alter pools and caches.
. #

. '/home/sybase/11.0/config_test.001'
.
# 'sp_cacheconfig' 'sp_poolconfig'.
Msg 5852, Level 16, State 1:
Server "THEBIRDSll', Procedure 'sp_configure', Line 199: Changing the value
of 'total memory' is not allowed since it is a static option.
'total memory' ,
.

(return status = 1)
,
1> sp_configure 'configuration file', 0, 'verify', '/home/sybase/11.0/THE#
BIRDSll.cfg'
2> go
(return status = 0)

, sp_conf igure System 11, 
, . 
(config) (run) , (
Default), ,
( Memory Used). , 
sysconfigures, 
.
, 
. , 
, syscurconfigs.
ep_configure , 
. , (total memory)
2 , ,
(memory used), . ,
(number of user connections)
. , 
7500 2 , , "

www.books-shop.com

( 7500 ), 15 000 . "


"#", Memory Used. "
, ,
, . , , "
( event buffers per engine),
. , "
, 0. ,
( ) "
.

sp_conf igure
SQL Server, System 11 "
. , total memory ( ) me"
mory, , sp_conf igure 'memory',
. , "
cron", "
. ,
. , System 11 "
sp_conf igure "
reconfigure. System 11 reconfigure , ,
, Sybase
. reconfigure
.
1 , +
, +
System 11. Sybase
.
sp_configure

sp_conf igure "
.
sp_conflgure
00:96/05/15 10:58:04.06 server The configuration option 'number of user
connections' has been changed by 'sa' from '25' to '30'.
00:96/05/15 10:58:04.17 server Configuration file '/home/syba#
se/ll.O/THEBIRDSll.cfg' has been written and the previous version has been
renamed to '/home/sybase/ll.O/THEBIRDSll.019'.
sp_configure

sp_conf igure "


, .
, $SYBASE
<_>.cfg
thebirds:Sybase 16: more RUN_THEBIRDS11
#!/bin/sh
#

SQL Server Information:

THEBIRDS11

#
#

master:
master:

/dev/rdsk/cOt2dOs7
45056

www.books-shop.com

#
:
/home/sybase/11 .0/install/errorlog
#
:
/home/sybase/11.0
#
/home/sybase/11.0/bin/dataserver #d/dev/rdsk/cOt2dOs7 #sTHEBIRDSll \
#e/home/sybase/11.0/install/errorlog_THEBIRDSll #i/home/sybase/11.0
thebirds: Sybase 14: 00:96/05/15 11:02:09.68 kernel Using config area
from primary master device.
00:96/05/15 11:02:09.72 kernel Warning: Using default file
' /home/sybase/11.0/THEBIRDSll.cfg' since a configuration file was not
specified. Specify a configuration file name in the RUNSERVER file to
avoid this message.
00:96/05/15 11:02:09.72 kernel .
,
' /home/sybase/11.0/THEBIRDSll.cfg' .

.
00:96/05/15 11:02:10.10 kernel Using 1024 file descriptors.
00:96/05/15 11:02:10.10 kernel SQL Server/11.0/P/Sun_svr4/OS
5.4/1/OPT/Thu Dec 7 23:58:01 PST 1995
00:96/05/15 11:02:10.10 kernel Confidential property of Sybase, Inc.
00:96/05/15 11:02:10.12 kernel (c) Copyright Sybase Inc., 1987, 1995.
00:96/05/15 11:02:10.12 kernel All rights reserved.
00:96/05/15 11:02:10.12 kernel
00:96/05/15 11:02:10.12 kernel Use, duplication, or disclosure by the
United States Government
00:96/05/15 11:02:10.13 kernel is subject to restrictions as set forth
in FAR subparagraphs
00:96/05/15 11:02:10.13 kernel 52 .227#19 (a) # (d) for civilian agency con#
tracts and DFARS
00:96/05/15 11:02:10.13 kernel 252 .227#7013 (c) (1) (ii) for Department of
Defense contracts.
00:96/05/15 11:02:10.13 kernel Sybase reserves all unpublished rights
under the copyright
00:96/05/15 11:02:10.13 kernel laws of the United States.
00:96/05/15 11:02:10.13 kernel Sybase, Inc. 6475 Christie Avenue,
Emeryville, CA 94608 USA.
00:96/05/15 11:02:10.13 kernel Using ' /home/sybase/11 . 0/THEBIRDS11 .cfg'
for configuration information.


thebirds: Sybase 17: more RUN_THEBIRDSll_config
#!/bin/sh
#
#
SQL Server Information:
#
:
THEBIRDS11
#
master:
/dev/rdsk/cOt2dOs7
#
master:
45056
#
:
/home/sybase/11. 0/install/errorlog
#
:
/home/sybase/11.0
#
/home/sybase/11.0/bin/dataserver #d/dev/rdsk/cOt2dOs7 #sTHEBIRDSll \
#e/home/sybase/11.0/install/errorlog_THEBIRDSll #i/home/sybase/11.0 \
#c/home/sybase/11.0/THEBIRDSll.cfg_moved
thebirds: Sybase 20:00:96/05/15 11:04:38.90 kernel Using config area
from primary master device.
00:96/05/15 11:04:38.90 kernel Using 1024 file descriptors.
00:96/05/15 11:04:38.94 kernel SQL Server/11.0/P/Sun_svr4/OS
5.4/1/OPT/Thu Dec 7 23:58:01 PST 1995
00:96/05/15 11:04:39.15 kernel Confidential property of Sybase, Inc.

www.books-shop.com

00:96/05/15 11:04:39.16 kernel (c) Copyright Sybase Inc., 1987, 1995.


00:96/05/15 11:04:39.16 kernel All rights reserved.
00:96/05/15 11:04:39.16 kernel
00:96/05/15 11:04:39.16 kernel Use, duplication, or disclosure by the
United States Government
00:96/05/15 11:04:39.16 kernel is subject to restrictions as set forth
in FAR subparagraphs
00:96/05/15 11:04:39.16 kernel 52.227#19 (a) # (d) for civilian agency contracts
and DFARS
00:96/05/15 11:04:39.16 kernel 252 .227#7013 (c) (1) (ii) for Department of
Defense contracts.
00:96/05/15 11:04:39.16 kernel Sybase reserves all unpublished rights
under the copyright
00:96/05/15 11:04:39.16 kernel laws of the United States.
00:96/05/15 11:04:39.16 kernel Sybase, Inc. 6475 Christie Avenue,
Emeryville, CA 94608 USA.
00:96/05/15 11:04:39.16 kernel Using
' /home/sybase/11. 0/THEBIRDS11 .cfg_moved' for configuration information.
, $SYBASE
THEBIRDSll.cfg.
thebirds: Sybase 27:00:96/05/15 11:11:34.44 kernel Using config area
from primary master device.
00:96/05/15 11:11:34.46 kernel Configuration Error: Configuration file,
1
/home/sybase/ll.O/THEBIRDSll.cfg', does not exist.
00:96/05/15 11:11:34.53 kernel :
' /home/sybase/11.0/THEBIRDS11.cfg' .
00:96/05/15 11:11:34.53 kernel Warning: A configuration file was not
specified and the default file ' /home/sybase/11.0/THEBIRDS11. cfg' does not
exist. SQL Server creates the default file with the default configuration.
00:96/05/15 11:11:34.53 kernel .
; ' /home/sybase/ll.O/THEBIRDSll.cfg' .
SQL Server .
00:96/05/15 11:11:34.90 kernel Using 1024 file descriptors.
00:96/05/15 11:11:34.90 kernel SQL Server/11.0/P/Sun_svr4/OS
5.4/1/OPT/Thu Dec 7 23:58:01 PST 1995
00:96/05/15 11:11:34.90 kernel Confidential property of Sybase, Inc.
00:96/05/15 11:11:34.90 kernel (c) Copyright Sybase Inc., 1987, 1995.
00:96/05/15 11:11:34.90 kernel All rights reserved.
00:96/05/15 11:11:34.90 kernel
00:96/05/15 11:11:34.90 kernel Use, duplication, or disclosure by the
United States Government
00:96/05/15 11:11:34.90 kernel is subject to restrictions as set forth
in FAR subparagraphs
00:96/05/15 11:11:34.90 kernel 52.227#19 (a) # (d) for civilian agency contracts
and DFARS
00:96/05/15 11:11:34.90 kernel 252 .227#7013 (c) (1) (ii) for Department of
Defense contracts.
00:96/05/15 11:11:34.90 kernel Sybase reserves all unpublished rights under
the copyright
00:96/05/15 11:11:34.90 kernel laws of the United States.
00:96/05/15 11:11:34.90 kernel Sybase, Inc. 6475 Christie Avenue, Emeryville,
CA 94608 USA.
00:96/05/15 11:11:34.90 kernel Using ' /home/sybase/11 . 0/THEBIRDS11.cfg' for
configuration information.

www.books-shop.com

128

:

System 11 ", 4, "
. "

s_figure. System 11
", sp_configure. , "
, "
DEFAULT
sp_configure. ,
sp_configrure .

sp_configure.

www.books-shop.com

SQL Server
System 11

%RRNVVKRS

piracy@books-shop.com


System 11 , "
. ", System 11 "
, System 10. ",
System 11 (offline) .
(online) .
System 10
, SQL Server System 10 "
SQL Server 11.
, master.
SQL Server System 11 System 10 "
System 11 ,
System 11 System 10 System 11.
.
", System 10 System 11 ".
. , System 10 " "
", System 11
. System 11 ,
System 10, , System 10,
. "
, ,
System 10 System 11.
, System 10 System 11 "
"
. ,
System 11.
, (last"chance thresholds, . "
12 13).
",
, System 10. SQL Server 4.9.2
System 10 , 4.9.2, SQL
Server 4.9.2, ( "
System 10, System 10 "
System 10). System 11
System 10.
, System 10.
, SQL
Server " .
System 10 System 11. , SQL Server 4.9.2, "
, System 10, System 11. , "
SQL Server . ,
System 11 System 10, 4.9.2;
System 10 SQL Server 4.9.2. ,
System 10 System 11, "
. "
, System 10 System 11. ,
. , System 10, "
Hewlett"Packard HP"UX, System 11,
Sun Solaris.

www.books-shop.com

SunOS Solaris
, Sybase. +
, +
; .
+ , , +
.

SQL Server
(. 6.1). , "
,
. ,
... , " "
insert, update dele"
te.
.
,
, , "
.
.
, "
sp_dboption "dbo user only",
( dbo). ,
dbo, ,
, .


(
dbo)

. 6.1.
System 11
. System 11 "
(. 6.2). "
sp_helpdb sysdatabases,
master. "
; "
load database.
online database,
.
online database ,
dbo, ,
oper_role. System 11 dbo "
,
online database. dbo

www.books-shop.com




. 6.2. System 11
, "dbo user only", ,
.

,
. ,
. ,
, ,
online
database.
, "
System 11, "
. ,
, online database,
. "
, "
. ,
online database master.
online database System 10
System 11 (. 6.3),
System 11. , "
.
System 10, System 11 ( "
online
database) . "
. System 10 System 11

SQLServer
PSYCH010

System 10

PSYCH011






. 6.3. System 10
System 11

www.books-shop.com

System 10, ,
online database System 11.
System 11 System 10 ,
System 11.

, (standby server), 
online database (. 9).
,
( ) . 
, ,

, 
. System 10 System 11

.

,
,


1> sp_helpdb devdb
2> go
name
db_size
owner
dbid
created
status
devdb
30.0 MB
sa
7
Apr 04, 1996
no options set
device_fragments
size
usage
free kbytes
'
cOt2dOs4
20.0 MB
data only
19344
cOt2dOs6
10.0 MB
log only
8720
(return status = 0)
1> select * from sysdatabases where name='devdb'
2> go
name
dbid
suid
status
version
logptr
devdb
71
0
1
10278
crdate
dumptrdate
status2
Apr 4 1996 10:58AM
May 21 1996 12:47PM
0
audflags
deftabaud
defvwaud
defpraud
0
0
0
0
(1 row affected)

1> load database devdb from '/home/dbdump/devdb_52896.dmp'
2> go
Backup Server session id is: 16. Use this value when executing the
'sp_volchanged' system stored procedure after fulfilling any volume change
request from the Backup Server.
: 16.
'sp_volchanged'
.
Backup Server: 6.28.1.1: Dumpfile name 'devdb9614909246' section number
0001 mounted on disk file '/home/dbdump/devdb_52896.dmp'
Backup Server: 4.58.1.1: Database devdb: 14342 kilobytes LOADed.
Backup Server: 4.58.1.1: Database devdb: 30726 kilobytes LOADed.
Backup Server: 4.58.1.1: Database devdb: 30734 kilobytes LOADed.
Backup Server: 3.42.1.1: LOAD is complete (database devdb).

www.books-shop.com

Remirroring the affected portions of the usage map that are on mirrored
devices.
,
.
Use the ONLINE DATABASE command to bring this database online; SQL
Server will not bring it online automatically.
ONLINE
DATABASE; SQL Server .

sp_helpdb status2 sysdatabases


, status2 offline.

1> sp_helpdb devdb


2> go
name
db_size
devdb
30.0 MB
device_fragments
cOt2dOs4
cOt2dOs6

owner
sa
size
20.0 MB
10.0 MB

dbid
created,
status
7
Apr 04, 1996
offline
usage
free kbytes
data only
19344
log only
8720

(return status # 0)
1> select * from sysdatabases where name='devdb'
2> go
name
dbid
suid
status
version
7
1
1
devdb
0
crdate
dumptrdate
status2
Apr 4 1996 10:58AM
May 21 1996 12:47PM
16
audflags
deftabaud
defvwaud
defpraud
0

logptr
10278

(1 row affected)



1> load tran devdb from '/home/dbdump/devdb_52896. trandmp_l'
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.
: 19.
) 'sp_volchanged'
.
Backup Server: 6.28.1.1: Dumpfile name 'devdb9614909272 ' section number
0001 mounted on disk file '/home/dbdump/devdb_52896.trandmp_l'
Backup Server: 4.58.1.1: Database devdb: 1490 kilobytes LOADed.
Backup Server: 4.58.1.1: Database devdb: 1498 kilobytes LOADed.
Backup Server: 3.42.1.1: LOAD is complete (database devdb).
Use the ONLINE DATABASE command to bring this database online; SQL
Server will not bring it online automatically.
ONLINE
DATABASE; SQL Server .
1> load tran devdb from '/home/dbdump/devdb_52896.trandmp_2'
2> go
Backup Server session id is: 21. Use this value when executing the
'sp_volchanged' system stored procedure after fulfilling any volume change
request from the Backup Server.

www.books-shop.com

: 21.
'sp_vol changed'
.
Backup Server:
0001 mounted on
Backup Server:
Backup Server:

6.28.1.1:
disk file
4.58.1.1:
3.42.1.1:

Dumpfile name 'devdb961490927C ' section number


' /home/dbdump/devdb_52896 .trandmp_2 '
Database devdb: 10 kilobytes LOADed.
LOAD is complete (database devdb).

1 transactions rolled forward.


1 transactions rolled back.

Use the ONLINE DATABASE command to bring this database online; SQL
Server will not bring it online automatically.
ONLINE
DATABASE; SQL Server .
1> online database devdb
2> go
Database 'devdb ' is now online.

.
sp_helpdb sysdatabases

1> sp_helpdb devdb


2> go
name
devdb

db_size
30.0 MB

device_fragments
cOt2dOs4
cOt2dOs6

owner
sa

size
20.0 MB
10.0 MB

dbid
7

created
Apr 04, 1996

usage
data only
log only

free kbytes
19344
10224

(return status = 0 )
1> select * from sysdatabases where name=' devdb'
2> go
name
dbid
suid
status
version
devdb
7
1
0
1
crdate
dumptrdate
Apr 4 1996 10:58AM

Audflags
0

logptr
11024
status2

May 28 1996 10:25AM

deftabaud
0

defvwaud
0

status
no options set

defpraud
0

(1 row affected)
online database ,
System 10, System 11

1> online database cmsdb


2> go
,

Database 'cmsdb' appears to be at an older revision than the present
installation; SQL Server will assess it, and upgrade it as required.

'cmsdb' , ,
; SQL Server
.
Database 'cmsdb': beginning upgrade step: creating table (table
sysattributes) [ID 80]
Database 'cmsdb': beginning upgrade step: dropping index (table
sysreferences, index csysreferences) [ID 1003]
Database 'cmsdb': beginning upgrade step: dropping index (table
sysreferences, index ncsysreferences) [ID 1004]

www.books-shop.com

Database 'cmsdb': beginning upgrade step: dropping index (table


sysreferences, index nc2sysreferences) [ID 1005]
Database 'cmsdb': beginning upgrade step: checking database references
in sysreferences [ID 1006]
(0 rows affected)
(0 rows affected)
(0 rows affected)
Database 'cmsdb': beginning upgrade step: creating index (table
sysreferences, index csysreferences) [ID 1007]
Database 'cmsdb': beginning upgrade step: creating index (table
sysreferences, index ncsysreferences) [ID 1008]
Database 'cmsdb': beginning upgrade step: creating index (table
sysreferences, index nc2sysreferences) [ID 1009]
Database 'cmsdb': beginning upgrade step: changing column name (table
sysindexes, column rowpage:maxrowsperpage) [ID 1011]
(1 row affected)
Database 'cmsdb'
beginning upgrade step: creating table (table
syspart it ions)
[ID 1013]
Database 'cmsdb' : beginning upgrade step: noting the present database upgrade
level [ID 1015]
Database 'cmsdb' is now online
sp_sysmon

System 11 (, SQL Server 11.0.1) Sybase 


sp_sysmon, SQL Server
. sp_sysmon 
, System 11.
sp_sysmon , 
SQL Server,
sp_monitor, System 11
. System 11
System 10 sp_sysmon sybsys
temprocs.

sp_sysmon . 
10. sp_sysmon , SQL Monitor
(. 6.4); ,
.
sp_sysmon SQL Monitor 
.

System 11 ,
. , 
, , 
.
sysattributes

master
, , 

www.books-shop.com

,

sp_sysmon

sp_sysmon
,

. 6.4. SQL Monitor sp.sysmon System 11


syspartitions


syslogshold

(Replication Server truncation
point)
master

"
, .
. "
(heap table); , , "
. ,
, update
delete insert, . "
, , "
(, 6.5). ,
, , "
.
, ,
, .
nsert 1

insert 2

insert 3

SQL Server
. 6.5. SQL Server

www.books-shop.com

:
System 11 ("
). System 11 , "
( ),
(. 6.6).
, "
, . "
/ .
, , "
. ,
insert, 
.
.

insert 1

insert 2

insert 3

. 6.6. System 11

, "
, . "
.
"
b, . "
,
, .
"
. , "
,
(update"in"place). "
"
.

, alter table ( "
).
, alter table :
alter table psycho_data partition 6
, "
. "
,
. sp_helpartition.
, "
. sp_addsegment sp_extendsegment
, ,
.

www.books-shop.com

, . "
, , .

alter table psycho_data unpartition
.

, , , "
. ; "
.
sp_placeobject,
. , "

. ,

.
, "
, Sybase SQL Server System 11 .


, . , "
, "
, ,
. "
. "
, ,
.
, ,

.. ,
.

. "
, "
.
,
insert.

%RRNVVKRS

piracy@books-shop.com

www.books-shop.com


SOL Server


sybsystemprocs
sybsecurity
master
master master
master
(logsegment) master
master
disk init master
master ,
master
master
, master

www.books-shop.com


SQL Server. , ,
master, ,
SQL Server System 10: sybsystemprocs sybsecurity.
SQL Server System 10 System 11.
sybsystemprocs
SQL Server 4.9.2 master.
Sybase , "
. sp_who , sp_helpdb , sp_conf igure sp_helpuser . System 10 "
;
master . master
master,
. master "
, master ,
.
, SQL Server 4.9.2, "
master , "
master .
master "
. , master
SQL Server System 10. "
, Sybase "
, sybsystemprocs.
sybsystemprocs master , "
. , "
sybsystemprocs .
,
sybsystemprocs, . "
sybsystemprocs
, , "
. , "
, sybsystemprocs
.

sybsystemprocs, master , SQL
Server 4.9.2.
. "
s_<_>, ,
sybsystemprocs.
sybsecurity
SQL Server System 10 System 11 ,
.
sybsecurity, "
, . sybsecurity "
System 11 ( System 10),
. "
sybsecurity .
sybsecurity "
SQL Server System 10 System 11. Secure SQL Server
"
, . , SQL Server
System 10 System 11, SQL Server.
sybsystemprocs, sybsecurity
master , .

www.books-shop.com

sybsystemprocs, sybsecurity
, ,
, "
. sybsecurity :
, . sybsecu
rity .
master
master master
Sybase.
master master
master , :
,
.. , .
master, ( master ) "
, master
.
master master,
sybinit . master
, ; "
. master disk init, "
. master
, master. ,
master alter database
master .
master master , ..
. .
, master . ,
master ,
( ) "
master, sysdevices (. ""
master ").
, . ", master "
.
sybinit master, master
, master. ", "
master,
. ,
master,
, (. ). , mas"
ter, master, model 2 tempdb.
master
master , "
, ? , "
50 . ,
master 2" model 2 tempdb,
master 46
master. , master "
,
master.
, " "
, , "
master . ,
model

www.books-shop.com

, . "
50" master .
master . "
master 50
,
master 50 . "
, 50
master ( 50"
). , "
, ,
50" master (. 8). "
, , "
, ,
master ( , "
).
(logsegment)
master
master "
master, "
. (
, "
) :
.

. , , "
. ,
master, "
, ( master "
). master
truncate_only ( ).
master "
truncate_only. , ,
,
.
master

master
. master
sp_helpdevice master, "
. (device_name ) "
"master ", physical_name
"d_master ", , "
master. master,
. master sp_helpde"
vice, sysdevices ,
master. "
: "
(. 12), RUN_<_>,
. master
System 10 (. 13), System 11 "
sysdevices ,
master. sp_helpdevice master
, disk mirror sp_hel"
pdevice master master.

www.books-shop.com

1> sp_helpdevice master


2> go
device_name
physical_name
master
d_master

description
special, default disk,
physical disk, 32.00 MB
status
cntrltype
device_number
low
high
3
0
0
0
16383
(1 row affected, return status =0)
1> disk mirror
2> name="master",
3> mirror = '/dev/rdsk/c0t0d0s7',
4> writes=serial
5> go
Creating the physical file for the mirror Starting Dynamic Mirroring of 16384
pages for logical device 'master'.
512 pages mirrored...
1024 pages mirrored...
1536 pages mirrored...
2048 pages mirrored...
2560 pages mirrored...
3072 pages mirrored...
3584 pages mirrored...
4096 pages mirrored...
4608 pages mirrored...
5120 pages mirrored...
5632 pages mirrored...
6144 pages mirrored...
6656 pages mirrored...
7168 pages mirrored...
The remaining 9216 pages are currently unallocated and will be mir# rored as
they are allocated.
1> sp_helpdevice master
2> go
device_name
physical_name
description
master
/dev/rdsk/cOtOdOs7
special, MIRROR ENABLED,
mirror =
'/dev/rdsk/c0t0d0s7',
serial writes.,
reads mirrored,
default disk,32.00 MB

status
cntrltype
device_number
739

(1 row affected, return status = 0)

low

high
16383

disk init master


,
master, 
disk init. , 
master sp.nelpdevice master
(device_name ="master"), ( 
) : physical_name= "d_master". SQL Server
,
disk init ,
. , 
sybinit 
master,

www.books-shop.com

disk init. , "


master "
. , disk
init , , .
, sysdevi"
ces. " sysdevices
, master (physical_name = "d_master ").
, , master "d_master",
disk init, , "
master , "
. , "
master ,

master. , dbcc"
master 605 . master
: "
.
, disk init .
"
, master. , "
disk init ,
, disk init. , "
sysdevices, "
master (
),
master.
master ,

SQL Server sybinit "
master, . "
, ,
, "
.
. "
, (default pool)
, "
"
. , ,
, , "
.
. ,
, "
"
.
, , , "
, master, "
.
sp_diskdefault; master
( ) . , "
, sp_helpde"
vice. sp_helpdevice sp_diskdeault
master , .

www.books-shop.com

1> sp_helpdevice master


2> go
device_name
physical_name
master
d_master

description
special, default disk,
physical disk, 32.00 MB
status
cntrltype
device_number
low
high
3
0
0
0
16383
1> sp_diskdefault master, defaultoff
2> go
(return status = 0)
1> sp_helpdevice master
2> go
device_name
physical_name
description
master
d_master
special, physical disk,
32.00 MB
status
cntrltype
device_number
low
high
2
0
0
0
16383
(1 row affected, return status = 0)

master
master (.
9). master "
. master,
,
. "
RUN_<_> (
$SYBASE/install), "
". , "
master . , "
master . , master
; "

.

master

, master
. mas"
ter ( !) master

. master 50 ,
"
. , , "
(. 8).
master master
. , "
.
master master
( ) "
master, .
. "
master ,
master. , master master "
.

www.books-shop.com

, , , . "
master
master,
master sysdevices "
master. , master ,
master "
sysdevices.

1.
Sybase. ,
, "
SQL Server .
2.
Sybase.
3. , . "
, "
.
4.
.
, "
"
Sybase. sysdevices
. , , "
, "
.
12.
master
master. , "
, sysdevices.
master 25600 2" ( 50 ). "
, (low), 0, ,
(high), 25600 " 1 = 25599. ,
25999 25600 .
1> sp_configure "allow", 1
2> go
Configuration option changed. Run the RECONFIGURE command to install.

RECONFIGURE.
(return status = 0)
1> reconfigure with override
2> go
1> select * from sysdevices where name='master'
2> go
low
high status
cntrltype
name
phyname
mirrorname
0
7904
2
0
master
/dev/rdsk/c0t0d0s7
NULL
(1 row affected)
1> begin tran psycho
2> go
1> update sysdevices set high=25599 where name='master'
2> go
(1 row affected)

1> select * from sysdevices where name='master'


2> go

www.books-shop.com

low
high status
cntrltype
name
0
25599
2
0
master
(1 row affected)
1> commit tran psycho
2> go
1> sp_helpdevice master
2> go
device_name
phys ical_name
Master
/dev/rdsk/c0t0d0s7

phyname
/dev/rdsk/c0t0d0s7

mirrorname
NULL

description
special,physical disk,
50.00 MB
low
high
25599

status
cntrltype
device_number
2
0
0
0
(1 row affected, return status = 0)
1> sp_configure "allow", 0
2> go
Configuration option changed. Run the RECONFIGURE command to install.

RECONFIGURE,
(return status = 0 )
1> reconfigure
2> go

master , master.
master

SQL Server System 11
System 11 SQL Server . 

. , $SYBASE
<_>.fg ( ).

. ,

<_>.bak (. 5).
SQL Server 4,9.2 System 10
mas
ter. sp_conf igure
, 
. 
, , (user connections),
. 
shutdown ,
sp_configure,
. buildmaster "r,
. : buildmaster 
, 
master, . ,
buildmaster,

Sybase.

%RRNVVKRS

piracy@books-shop.com


1. buildmaster
Sybase.

2. buildmaster ,
, "
.
, buildmaster "r
( ) "
, ,
.
( 14 , "
n). buildmaster "r "

( ) .

, master .
sybsystemprocs sybsecurity, "

. 8
.

SQL
Server. master . sybsystemp
rocs , "
, . ,
sybsecurity , ,
sybsecurity .
, "
. master mas
ter, ( Solaris
slice). sybsystemprocs sybsecurity
,
.

www.books-shop.com

SQL Server



Sun


SQL Server








www.books-shop.com



UNIX. "
, "
. , ,
,
.

.
: ,
SQL Server. "
, "
, .
"
. ,
"
, "
.
.
SQL Server
, , SQL Server.
,
. . SQL Server "
System 10 System 11 , master,
sybsystemprocs sybsecurity. , sybsystemprocs "
System 10 11 ,
sybsecurity ,
System 10. System 11
() Sun. 7;

.
SQL Server 4.9.2
SQL Server 4.9.2 master "
master.
.
SQL Server System 10
System 10,
sybsystemprocs sybsecurity. "
master, , "
sybsystemprocs sybsecurity (
).
System 10 create database alter database "with
override",
. "
.
, "
. Sybase "
"with override"
.

www.books-shop.com

SQL Server System 11


System 11 , System 10.
4.9.2 System 10 Sybase "
Sun SunOS Solaris, SQL Server System 11 Solaris.
System 11 Sun,
,
.
,
. , , , "
, . ,
,
,
. .

, ,

.

SQL Server
, "
( . 12). "
,

. "
. , "
, " ( ,
) ,
. "
. ,
( , "
) "
. ,
, "
.
8.1.
8.1. _

SQL Server

SQL

Server

Monitor

4.9.2)

()

() Open Server

5002

5005
_

5010

SQL BackTrack DataToote

5001

( 4.9.2)
SQL

5050
_

5070
_

5071,

5072,

_
5073.

...

5100, 5101, 5102, ...

www.books-shop.com



,
.
, "
, . "
"
, , "
. ,
,
.
, "
, 7 /dev/rdsk/c0t0d0, "
c0t0d0s7.

SQL
Server , "
. ""
( , spindle),
(. 8.1).
cOtOdO cOtOd4. "
(. 8.2). "
, , . ,
Solaris 0 7; , "
Solaris (slice). "
, .
, /dev/rdsk/cOtOdOs3 () 3 cOtOdO. "
"r" rdsk , (raw
partition) , "
.
SQL Server.

. 8.1.

www.books-shop.com

. 8.2. Solaris
( /dev/dsk/c0t0d0s3), "
, . "
,
. , "
3 c0t0d0 "
/dev/rdsk/cOtOdOs3 /dev/dsk/cOtOdOs3. /dev/rdsk
,
. , , ,
:
.


,
,
. "
, , "
:
.
, "
, "
. ,
, ( 8.2, . 8.3).

8.2.
0
2

7
1, 3, 4, 5, 6

www.books-shop.com

. 8.3.


, , 0 ,
.
, "
.

2
2 , "
"
.
7
7 (, 30 50 ). "
,
.
master, sybsystemprocs sybsecurity .
"
, , , "
.
"
.
1, 3, 4, 5, 6
1/5 , "
0 7.
"
"
.
,
( ) . "
, , "
. , ,
.

Sun
SQL Server Sun , "
Sun SQL Server 4.9.2 System 10 "
SunOS, Solaris, SQL Server System 11 Solaris.

www.books-shop.com

SunOS h, Solaris
0 7. "
, . , Solaris
2 cOtldO /dev/rdsk/c0tld0s2,
SunOS , "", /dev/rsd4c.
SunOS Solaris
( 8.3).
, Solaris. , SQL Server SunOS, "
.
8.3. SunOS
Solaris

(partition) SunOS

(slice) Solaris

g
h

6
7


, ,
4,2 . 800" 1, 3 6 88"
7. 2,1 7 30 ,
1,3 6 400 . , 4,2",
2,1 ( 7). "
master .
30 88 "
(, SQL Server System 10/11
sybsystemprocs sybsecurity, ).


"
SQL Server "
(raw partition).
, . "
,
. "
, "
.
.
. "
SQL Server ; "
, ,
(. 9).
, , "
" . "
. ,

www.books-shop.com

"
, .


. , "
, ,
, "
.
,
, , "
. "
tempdb,
(. 9), "
, .
, "
,
.
SQL Server
, "
. ( "
, )
SQL Server ( , "
), .

.
.
, ,
, . ,
. ,
" ", , , "
; "
, ,
.
, SQL Server,
, "
(. 8.4). "
;
2" ( "
2048 , , , ,
SQL Server). "
, . "
,
, ,
. :
,
, "
. , "
,
.


"
, . "
, ;
, SQL Ser"
ver. , ,

www.books-shop.com

()
'1', '3', '4' 400
'5' 800
1) c0t0d0s1 200
2) c0t0d0s1
/dev/rdsk/c0t0d0s3
3) 800+ c0t0d0s5
/logdump
SQL Server:
200+ cOtOdOsI
c0t0d0s3
. 200
c0t0d0s1,
,
.
,
;
c0t0d0s0, s6 s7.


:
(C0t0d0s1,c0t0d0s3 c0t0d0s4),
400
+
c0t0d0s5,
/logdump 800

. 8.4.
, "
.
Solaris 2.x,
UNIX, ".
Solaris
Solaris 0 7.
, 2, "
.
, , "
" "
. ,
, , ,
. , ,
.

.
, , "
,
. "
2.
prtvtoc,
. ,
. ,
,
. "
.

%RRNVVKRS

piracy@books-shop.com



format. format ( "
),
: format "
. "
.
, "
, . , "
.
,
,
( ). "
.
, :
Last
*
First
Sector
Sector
* Partition
Tag
Flags
Sector
Count
1639439 (1)
1
3
01
0
1639440
8380799
2
5
01
0
8380800
3278879 (2)
3
0
00
1639440
1639440
4918319
4
0
00
3278880
1639440
6557759
5
0
00
4918320
1639440
8197199
6
4
00
6557760
1639440
8380799 (3)
7
0
00
8197200
183600
Mount Directory
(1) #> includes cylinder 0 # don't use for raw!
1
: 0!
(2) "> 800.51 Mb 800 Mb = 409600 2 pages
(3) "> 89.65 Mb 89 Mb = 45568 2K pages
, ( ) 1
.
, .

, . "
, , "
.

0 ,
, .. 0
, "
. "
(raw) , ,
disk init "
, . "
, " .
. , "
, "

, , , .
,
0 , "
.
. , "
, ,

www.books-shop.com

, . , "
(,
).
0 , "
. , "
" .
, ,
( ,
) .
, "
, , "
(, ,
0 disk init).
, "
. , ,
"
. , master, "
.
0, master (
), master. "
, master
master.
, master "
(.. "
). ,
master, , , , "
. "
(,
dump_systables, 14).
, "
master. ,
"
, . "
, 0 ,
.

,
, "
(. 8.5). 0
0 , ,
'2' =
'0' =

'1', '3', '', '5', '6'


1/5 ,
'0' '7'

= 50
. 8.5. ,

www.books-shop.com

, "
. ,
.
,
, . "
0; ,
.
.
, 0 " "
.
, 2
.
, 1, 3, 4, 5, 6 7, "
.
, 7 ,
1, 3, 4, 5, 6. "
master
.
master 20 ,
, master ,
master "
(. 7). , , "
50" . , (
, master ) ,
System 11 (.
13), . , "
, "
, 50" 7.
(1, 3, 4, 5, 6) "
, , "
0 0 50" 7.
, ; ,

.

, "
:
.
, "
,
(. 8.6). ",

:
,
"
, .
"
, .
, "
, . ",
"
.
"
. , "

,
. , , "
.

www.books-shop.com


cOtOdO + 1
cOtOdO

cOtOdl + 1

c0t0d2 + 2

c0t0d3 + c1t0d5

c1t0d5
c1t0d4 + 2
c1t0d4

c1t0d5 + 3

c1t0d6 + c0t0d1

c0t0d1
1 t0d7 + c0t0d2

c0t0d2
.
,
, .
. 8.6. :
, ,


, "
, , "
.

; "

. , "
, "
. ; ,
Solaris "
. ,
"
. , , "
(fast) SCSI SCSI (slow SCSI). ,
,
. , SCSI" SCSI" (
), .
format , .

www.books-shop.com

, , "
. format "
"root", UNIX
, . ,
format .

"
. "
, ,

(. 8.7).
1

. 8.7.


. , , "
,
. ,
(. 8.8).
, "
. "
,
.

(
).
, . , ,
, "
, .
,
. "

( ). , "
,

www.books-shop.com

c0t0d0 + 1
c0t0d1 + 2
c0t0d2 + 3
0t0d + 4
c1t0d4 + 1
c1t0d5 + c1t0d4
c1t0d6 + 2
1t0d7 + c1t0d6
c2t0d8 + 3
c2t0d9 + 4
c2t0d10 + 5
c2t0d11 + 6
c3t0d12 + c2tOd8
c3tOd13 + c2tOd9
c3tOd14 + c2tOd10
c3tOd15 + c2tOd11

, ,
.

, .
. 8.8.
, ,
, . "
, "
, (. 8.9).


,
, , , "
. "
,
.
; "
, .
,
. , "
. , "
,
.
, "
.
, "
.

www.books-shop.com

cOtOdO + 1
cOtOd1 + 1
0t0d2 + 2
0t0d3 + c1tOd5
c1tOd4 + 2
c1tOd5 + 3
c1tOd6 + cOtOd1
c1tOd7 + cOtOd2
c2tOd8 + 3
c2tOd9 + 4
c2tOd10 + 5
c2t0d11 + c3tOd13
c3tOd 12 + 4
c3tOd 13 + 6
c3tOd14 + c2tOd9
c3tOd15 + c2tOd10

. 16 ,
12 .
. 8.9.



, "
.
. "
.


(logsegment) "
, . "
, , ,
.
. "
(, ) "
, ,
, .
/ ,
,
(. 10).
.
,
:

www.books-shop.com

, "
. , , "
. ,
. "
, "
, .
, , "
, , , "
.

,
. , "
"
, .
(, , )
.
, "
.
master master, model "
tempdb. , "
/. ,
.
, /
.
, ,
,
. , , "
. "
,
, .
, "
.
, ,
, /, "

. , . "
,
"
. ,
, "
, "
, , .
, ,
, .
. ,
"
,
.
, "
" "
,
. ,
,
. "
,
, , ,
, "
, .

www.books-shop.com

"
"
. ,
, "
. " ; "
,
. "
.

master, sybsystemprocs sybsecurity .
,
. .
, "
. ,
, 2,1" ()
400 50" . , 4,2" 800"
80" .


master, . "
sybsystemprocs sybsecurity ,

(. 8.10). , Solaris " " (partition)
"" (slice).


( )

.
0 .
2 .

.
sybsystemprocs sybsecurity 6
disk init .
1,3,4,5 ,
.

. 8.10.

www.books-shop.com

. 8.11.

,
master . "
sybsystemprocs,
. sybsecurity "
, (. 8.11).
, , "
.
master,
master, model tempdb.
sybsystemprocs sybsecurity ( "
) , .

,
. "
, "
.
disk init
, "
disk init " , "
: .
disk init;
(. 8.12).

%RRNVVKRS

piracy@books-shop.com

disk init
name = "device_name",
physname = "physical_name",
vdevno = vlrtual_device_number,
size = number_of_blocks
(device_name)
disk init. (device_name) "
,
(physical_name)
, ,
. , disk init "
, , ,
. , virtual_device_number
,
. , number_of_blocks
2" . ,
, "
.
c0t0d0
disk init
name = "device_name",
physname = "physical_name",
vdevno = virtual_device_number,
size = number of blocks
,
/dev/rdsk/c0t0d0s1
name = "c0t0d0s1"
physname = "/dev/rdsk/c0t0d0s1"
vdevno =15
size = 204800
( 2+ , .. 400 )
( name) .
( physname) ,
;
'Sybase'.
vdevno 'devices',
sp_configure, .
. 8.12.
, , "
, , create database, alter database . "
.
. "
"root" format "
,
. , format ,
c0t0d0 c0t0d1 c0t0d6. "
8 cOtOdl
name = "c0t0d1s3". "
/dev/rdsk/c0t0d1s3, ,

www.books-shop.com

"
format.
"
" , "
, .
, ("
).
+
baddog1. ,
, baddog1 (
). sp_helpdevice +
, . : +
.

. . +
,
.
(physical_name)
. "
, "
. ,
: , "
. SQL Server, "
, ,
. , "
. /dev/rdsk "
, ""
. , 1 cOtOdO "
/dev/rdsk/cOtOdOs1. "
, .
(/<
>/<_>), , "
.
(vdevno)
,
. "
N 2" "
0 N"1.
.
vdevno . , "
vdevno , disk init
, vdevno "
, ( )
sp_helpdevice . , "
:
vdevno

disk init,



( devices)

www.books-shop.com

vdevno
sp_help"
device ( ). , "
sysdevices, sp_helpdevice ,
sysdevices.
disk init
vdevno
, disk init, "
(, " ,
).
vdevno

,
.
disk init, sp_dropdevice.


"
devices, sp_conf igure. "
devices , 10,
0 9 . , disk init "
" vdevno ,
"
. ,
vdevno.
sp_c on figure . ,
devices , "
. , vdevno "
devices, master vdevno = 0. ,
, devices,
. devices
vdevno.
,
. ,
disk init : size.
, disk init, ,
+ vdevno.
vdevno , +
, devices (
vdevno N+1, N devices, +
sp_configure). +
+ ,
size (
), (
vdevno), ,
vdevno =10, devices 10. ,
disk init +
.

www.books-shop.com

, vdevno. +
, ,
tempdb ( 2 ,
master) ,
(,
!). ,
. ... +
: , +
sp_configure . ,
buildmaster >+r
, +
+ . ? ,
, tempdb
vdevno = 20. +
,
, . build+
master +r
10, vdevno = 9. +
, ,
tempdb. , +
,
. +
isql sp_configure devi+
ces. , sp_helpdevice
tempdb .
, +
.
(number_of_blocks)
number_of_blocks ,
2" . "
: , 2" , (allocation units). "
, ( 256 ).
disk init 2" .
prtvtoc /dev/rdsk/<Haa"
_> .
, , prtvtoc
/dev/rdsk/cOtOdOs1. prtvtoc "
, . , "
( Sybase)
. prtvtoc
, .
prtvtoc . 13.
, "
. "
512 ,
1024*1024 ( 1 ). ,
, "
2" , disk init. "
,
create database alter database.

0,5" (allocation units).
256 2" . create database alter database
,
0,5" .
, , . , , "
" ( ), "
.

www.books-shop.com

, (
). " disk init
, (. ), . "
0,5 ,
. , ,

( ). ,
,
. "
,
.
, "
0,5" .
disk init , "
, .
"
,
. , "
, 2"
disk init.
df "k. ,
. "
, "
, disk init ,
(, ,
).
, 2+
, ,
/. , +
2 ,
, .
disk init
, disk init
master, . "
SQL Server buildmaster. "
sybinit .
, disk init ,
master, "
. , master "
. disk init
, master, , "
. ,
master. "
. , disk init "
, " .
disk mirror.
,
SQL Server. ! +
. , +
, ? , ,
. disk init, +
. master
( , ). +
. dbcc
. , +
... , ,

www.books-shop.com

master, , ,
disk init. , ,
disk init , master.
, , . ,
, .
, ,
master ,
. (
, ).
disk init
, .
, " "
. "
,
"
. "
, disk init
sp_diskdefault.
disk init "
, / "
. ,
1 cOtOdO /dev/rdsk/cOtOdOs1
( "sybase").

"
, .
, , ,
,
. , "
. "
, ,
. , "
. "
, .

, , "
.

, "
. , "
.
.
, "
. , "
;
,
. , "
. "
, ,
.

"
, , "
. SQL Server ,

www.books-shop.com

( "
9).

, "
. , "
, ,
, "
/ (
). ,
, "
, . "
. ,
"" ( , "
), "
.
"
create table create index on <_>.
, "
: ,
. "
,
.
create database
. "
create database alter database . , "

create database <__>
on <__> = <__>
"
system, default logsegment. system "
, logsegment
, default . ,
(system, default logsegment) ; "
, (. 8.13). "
sp_helpdb <__>,
, , , "
.
, , use <__>
cOt0dO
| create database db1 on cOtOdOs1 = 100 \

'1' cOtOdO cOtOdOs1


disk init
cOt0dOs1
db1:
default
system
logsegment

. 8.13. ,

www.books-shop.com

. "
,
. ,
, , , "
.
, .
,
, . ,
, "
(
. 11).
, master,
(logsegment) . ,
:
create database <__>
on <___1> = <___1>,
log on <___2> = <___2>
logsegment , default
system (. 8.14). , "
, default system.
"
sp_logdevice, (System
Administration Guide). ,
. "
master ,
. , system, default logsegment master
master, .
cOtOdO
create database db1 on cOtOdOs1 = 80
log on cOtOdOs3 = 20
cOtOdOs1 cOtOdOs3
disk init
cOtOdOsI
db1:
default
system
cOt0dOs3
db1:
logsegment
logsegment ,
,

. 8.14.

alter database
, system default
1, 2
(logsegment).
, , "
. "
alter database , 1,
default system, .

www.books-shop.com

2 "
.
,
, default system. , "
, , "
.
,
, default, system
logsegmenf? , (user"defined); "
, .
, "
, , . mysegO "
1

sp.addsegment myseg0, __1


:
sp.addsegment <_>, <__>
sp_helpdb <__> , "
__1 system, default mysegO.
,
.
alter database <__>
on <___3> size= <>
, 3 "
, system default (. 8.15).
,
2. alter database 3 "
myseg1 ep_addsegment myseg1, __3.
sp_helpdb <__>, , 3 "
: system, default mysegl. , mysegl
, 3
, system default.
, . ", "
mysegl (
cOtOdO
create database db1 on cOtOdOs1 = 80
log on cOt0dOs3 = 20
alter database db1 on cOtOdOs4 = 50
cOtOdOsI
db1:
default
system
cOtOdOs3
db1:
logsegment
cOtOdOs41
db1:
default
system

logsegment ,
,

. 8.15.

www.books-shop.com

, , "
), , . "
3 system default
. "
3 system default "
myseg1.
", 3, alter database, "
system default, "
mysegl.
, "
sp_dropsegment default system 3. "
:
sp_dropsegment system, __3
sp.dropsegment "default", __3
default, ,
default SQL Server. , "
, 3 , "
system default , .
3 , "
mysegl , system
default . ,
, "
. "
: ,
, default. "
,
.

, "
, , "
mysegl. ,
, (
) "
. "
, 3,
alter database <__> on "
__3 size = < ' >, ,
( mysegl). "
, , ,
,
. "
(, , system default).
,
alter database <__> on __4 50
4 system default
( logsegment, ). ,
system default .
sp_extendsegment.
sp_extendsegment logsegment, <__> logsegment
("
, system default), . ,
sp_extendsegment "
. , sp_extendsegment "
, logsegment,
. "

%RRNVVKRS

piracy@books-shop.com

cOtOdO

create database db1 on cOtOdOs1 = 80


log on cOtOdOs3 = 20
alter database db1 on cOtOdOs4 = 50
sp_addsegment myseg1, cOtOdOs4
sp_dropsegment system, cOtOdOs4
sp_dropsegment "default", cOtOdOs4
cOtOdOsI
db1:
default
system
cOtOdOs3
db1:
logsegment
cOtOdOs41
db1:
mysegl

logsegment ,
,

. 8.16. ,
, : alter da"
tabase , "
, system default.
, , , , +
, +
.
(
), ,
, ,
: system, default data.
, data .
, +
data, +
, . +
system default
data . +,
, data
, ,
. data
, ,
, . +,
system default, ,
data. +
. data, +
,
, data.
b , , +
, .. , +
, . :
, +
.

www.books-shop.com


, "
(. 11) .
, , "
(. 8.16). "
default system,
, myseg1.
,

, . , ,
; "
.
,
, , "
.

, "
:

system default
system default







,
( system default,
). , "
. ,
databasel, system default
database2, mysegl database3 (. 8.17).
t0d0

cOt0dOs1 :
logsegment db1
system default db2
myseg1 db

. 8.17.

www.books-shop.com

system default
system default .

( ), system default
.
system default

Sybase "default" ; ,
default , (default server
device). , create database
system default ,
, "
. "
.

SQL Server (data
devices) (log device);
, , "
.

,
"
sp_logdevice . logseg
ment , .
, logsegment ,
, , "
system, default , .

system default "
, ( "
). ,
.


, create database alter
database, "
. ,
; , "
system default.

system, default logsegment
, .
.
, .
,
, .
; "
.

. , "
, , , "
.

www.books-shop.com


( ) "
, .
, "
. "
, , , .


Sybase SQL Server,
, "
. ,
, "
. (logsegment)
, , ,
. , "
.
,
,
( 9 "
). "
, ; , "
,
.
"
. ,
. , "
; ,
. "
(truncation), .

.
,
. , ,
sysdatabases, master.
,
. , "
, "
.


"
. "
.
. ,
"
, , (, "
,
). "
, "
.
,
cron" "
,
. , "
.

www.books-shop.com

,

. , "
: "
,
, "
. , "
,
, . "
create database
log on. ,
.

"
. "
, 12, (thresholds),
.

( ). "
, , . ,

, . "
, "
.

, "
,
. "
no_log ( , "
; . 12). no_log
, , .. "
. "

, . , "
no_log "
,
. , "
. "
no_log (
, " ). "
( "
). ,
,
no_log. , "
, . , , "
: .
.

, , "
, .

(. 9). , "
20% , . ,
. 20%
? 10"
2 ? , ,

www.books-shop.com

. 20% ,
"
.
. "
, .
, "
, . "
, ,
. , "
, . "
.
, . "
, . "
, , .
, " "
, .
, 200 . "
, , "
, ,
. , ,
( 9 ,
).


, "
. "
. ,
. "
, , . "
, : .
.
, . "
,
, "
. ,
. "
, , "
. ,
, ,
. , "
dump transaction. , "
.
() .

"
. ", "
, (
select " , "
).
1105 ( ,
12). 1105
,
. 12 , , "
1105; , 1105
dump transaction
no_log . ,
; ,
.

www.books-shop.com

, "
. "
,
.
, "
. "
, .


no_log. "
, "
(. 9).
no_log " "
.
, "
. no_log
"
. , , "
, .


1105. ,
( 12),

dump transaction <__> with no_log


, , "
no_log . ? "
,
() . ,
.
, no_log.
, "
, kill (
, "
). kill "
(spid), ,
, . ,
,
, . "

.
:
, "
, . "
,

dump transaction <__> with no_log
,
. , "
" ( , "
), .
: "
.

www.books-shop.com


, . "
, , 20% . "
, , ,
, ,
alter database. , "
20% .
5 ,
200 ( 4% ).
30 . "
(, "
) ? ,
, ,
. , "
,
, 200" . , "
,

. 20% ,
100 . ,
, ,
, " . ,
,
. , "
" . "
,
, .

:
. "
, "
.
. , "
, " ,

.

,
.

, . "
. ,

.

SQL Server "
. , ,
, ,
(. 8.18). SQL Server
, . ,
, , "
. , , SQL Server "

. "
,
142221

www.books-shop.com

cOtOdOs1


/dev/rdsk/cOtOd6s1


( )
cOtOdOs1 cOtOd6s1 ,
+
'cOtOdOs1'.
. 8.18.
(Redundant Array of Inexpensive Drives, RAID).
. ,
RAID ( , RAID", "
RAID" ..),
.

, "
, . "
.
, , "
. ,
, , , "
. SQL Server "
, ( , ,
master ,
). , , "
. , SQL Server
.

, ,
.
master

master, master, 2 "
tempdb model master "
. ", "
master master, "
. master, "
. ", master
.
master "
master, ,
(, SQL Server 4.9.2

www.books-shop.com

, ),
master . "
master "
master. ,
master. master ,
.


master,
, .
,
. "
, ,
. "
, "
(. 9).
, . "
,
"
,
.
, "
.


"
. , "

. , " "
(. 8.19). , "
.
" , "

.
( ) .
, .
, "
. , "
, . ,
" ,
. ,
, "
, .
,
.
, ,
.
25 . . , +
.
... +
, , + *
.
, +
, +
.
, ,

%RRNVVKRS

piracy@books-shop.com

.

, . +
, , +
+ .
,
. ,
, +
, . ,
,
.
cOtOd2s1
cOt0dO 1
cOtOd1 1

cOtOd2 2

cOtOd3 + cOtOd1

C0t0d2s1
cOtOdO 1
cOtOdl 1

cOtOd2 2
cOtOd3 cOtOd2
, cOtOd1, 0t0d2 cOtOd3 .
cOtOd3 cOtOdl cOtOd2.
cOtOd2s1 t0d3 ,
cOtOd2, .
cOtOd2, ,
cOtOd3 cOtOd2.
, 0t0d2, .
. 8.19.



,
( master) "
disk unmirror ( "
)
(. 8.20). , "

www.books-shop.com

0
cOtOdO + 1
cdtOd1 1

cOtOd2 + 2

cOt0d3 c1t0d5
(, )

c0tOd4 + 2
c1tOd5 + 3
c1tOd6 + cOtOd1
(, )
c1t0d7 + cOt0d2
(, )

mode = retain. ,
,
.
,
.
. 8.20.
, . "
UNIX "

.
, "
. , "
,
(. 13).


"
,
, ,
.
,
, . "

(. 8.21). , "
, "
(
).

www.books-shop.com


cOtOdO 1
cOtOd1 + 1 (
, c1tOd6)
cOtOd2 + 2 (
, c1tOd7)
cOtOd3 c1tOd5 (
c1tOd5 )

c1tOd4
c1t0d4

1t0d5

c1tOd6

c1tOd7

c1tOd4 c1tOd4,
c1t0d5, c1tOd6 c1tOd7 .
cOtOdl dtOd6, c1tOd2 c1tOd7 cOtOd3 c1tOd5, c1t0d4
. c1tOd5 ,
cOtOd3 , c1tOd5 cOtOd3.
cOt0dO, cOtOd1, cOtOd2 cOtOd3 .
. 8.21.


, 
, . , 

.
.
, 
. ,
, 
. , , 
.


, . 
,
, ,
()
.

www.books-shop.com

"
master (, , master), "
master.
master, , .
master .
master,
. "
. "

. "
, .
, ,
"
"
. ,
"
.

, . "

, . , "

() : "
, .
tempdb.
, , "
, . , "
tempdb ( )
tempdb "
. "
tempdb, .
, /, "
, tempdb "
. ,
tempdb, "
.

"
, ,
. "
, , .
, disk init
,
. "
, , "
disk init ,
. ,
, .
, , "
. "

. , "
. , "
,
. "

disk mirror
name = "device_name",

www.books-shop.com

mirror = "physical_name",
writes = { serial I noserial}
, disk
mirror:
device_name ( )
physical_name ( )
writes


disk mirror
device_name ( )
device_name ,
. , , SQL
Server, UNIX.
, device_name, "
.
physicaLname ( )
mirror ,
. , "
,
, .
disk init. "
" ,
, .
writes
writes . "
writes = serial,
, "
. writes = serial .


, "
, "
.
, .




writes = serial, "
writes = noserial. writes = se"
rial, noserial disk mirror .
, "
.
disk mirror
, disk init "
cOtOdlsl, 1
cltOd6. ,
UNIX, ,
/dev/rdsk/cltOd6s1, cOtOd1 cltOd6
c1, writes = serial.
disk mirror :
disk mirror
name = "cOtOd1s1,
mirror = "/dev/rdsk/c1tOd6s1",
writes = noserial

www.books-shop.com

,

, ( ) 
, (. 8.22). 
.
* disk init.
,
disk mirror.
disk unmirror, 
, .
( )
side ( , , 
). disk unmirror:
disk unmirror
name = "device_name",
side = {primary I secondary},
mode << {retain I remove}
disk mirror, disk unmirror
:
device_name ( )
side
mode

, (/dev/rdsk/cOtOd1s1)
(/dev/rdsk/c1tOd6s1),
'Sybase'.
cOtOd1s1


/dev/rdsk/c1tOd6s1


( )
cOtOdOs1 c1tOd6s1 ,
no+
'cOtOd1s1'.

. 8.22.

www.books-shop.com

device_name ( )
, disk mirror.
side
side , ""
(primary) (secondary). , "
, .
mode
mode : "
.
, :
, disk unmirror mode =
retain , mode = remove. retain, SQL Server
, ,
, "
disk remirror (. ). , mode = remove
, disk remirror
( disk mirror
). , disk
mirror, disk remirror "
,
.

, , "
, disk unmirror, "
device_name. ,
, .
,
: mode = retain mode = remove.
. ( )
:
disk unmirror
name << "cOtOd1s1",
side = primary,
mode * retain
, (
, ) disk unmirror

disk unmirror
name = "cOtOd1s1",
side = secondary,
mode = retain


. ,
. disk unmirror
cOtOdlsl. ,
cOtOdlsl, ,
, "
/dev/rdsk/cltOd6s1 (. 8.23).
mode >> retain " "
cOtOdlsl /dev/rdsk/cltOd6s1,
cOtOdlsl disk unmirror. "
. mode = remove "
,

www.books-shop.com


/dev/rdsk/cOtOd1s1


'cOtOd1s1'

( )

/dev/rdsk/c1tOd6s1

disk unmirror name = "cOtOd1s1", side = secondary, mode = retain



/dev/rdsk/cOtOd1s1


'cOtOd1s1'

( )

/dev/rdsk/c1tOd6s1

+ /dev/rdsk/cOtOd1s1
disk unmirror, .
mode = remove /dev/rdsk/c1tOd6s1 .
. 8.23.

cOtOdlsl /dev/rdsk/cOtOd1s1. 
, mode 
cOtOdlsl. disk init
, 1
c O t O d l , UNIX
/dev/rdsk/cOtOd1s1. 
, mode =
retain.
,
disk remirror
name = "cOtOd1s1"
, 
disk unmirror, /dev/rdsk/cOtOdlsl 
, /dev/rdsk/cltOd6sl .

, . ,
disk unmirror ,
cOtOdlsl, 1 cOtOdl, 
/dev/rdsk/cOtOd1s1; 
dev/rdsk/cltOd6sl (. 8.24). mode >>

www.books-shop.com


/dev/rdsk/cOt0d1s1


'cOtOd1s1'

( )



/dev/rdsk/c1tOd6s1

I disk unmirror name = "cOtOd1s1", side = primary, mode = retain



/dev/rdsk/cOtOd1s1


'cOtOd1s1'

( )
.
/dev/rdsk/c1tOd6s1

+ /dev/rdsk/c1tOd6s1
disk unmirror, .
mode = remove /dev/rdsk/cOtOd1s1 .
. 8.24.
retain  cOtOdls1,
, .. . , 1 
cltOd6 disk init
disk unmirror .
, SQL Server
, 
, disk init. 
(
) . 

, .
,
disk remlrror
name = "cOtOd1s1"
,
disk unmirror: /dev/rdsk/cOtOd1s1 
/dev/rdsk/cltOd6sl.


disk remirror, :
disk remirror
name = "device_name"

www.books-shop.com

device_name, disk remirror, "


device_name .
, disk remirror ,
:

. , disk remirror ,
mode = remove.
, (/dev/rdsk/cOtOdlsl)
(/dev/rdsk/cltOd6sl) .
mode = remove
disk mirror
name = "c1t0d6s1",
mirror = /dev/rdsk/cOtOd1s1",
write = serial
, .
/dev/rdsk/cltOd6sl, /dev/rdsk/cOtOdlsl "
. cltOd6sl.
, cOtOdlsl
/dev/rdsk/cOtOdlsl, /dev/,rdsk/cltOd6sl.
cOtOdlsl
/dev/rdsk/cltOd6sl. , "
disk init cOtOdlsl.
disk unmirror mode = retain, "
. , "
.
,
. "
disk remirror
disk mirror:
. , disk remirror "
, .

, (, 100" cOtOdlsl)
(, /dev/rdsk/cltOd6sl 200 ). "
" . "
100 (. 8.25).
, (
),
, . "
disk init 100"
200" /dev/rdsk/cltOd6sl, "
. ,
, . , "
. ,
, "
.
. "
. ,
. "
,
.
, "
"
,
. , , "
,
.

%RRNVVKRS

piracy@books-shop.com


/dev/rdsk/cOtOd1s1 (100 ) *


'cOt0d1s1'

( )

/dev/rdsk/c1tOd6s1 (200 )

disk unmirror name = "cOtOd1s1", side = primary, mode = retain


/dev/rdsk/cOtOd1s1 (100 )


'cOtOd1s1'

( )

/dev/rdsk/c1tOd6s1
,
100 200+ .

. 8.25.
,


(. 8.26).
" , ,
. ,
. ,
,
,
, .
. "

, .
,

, ,
,
.
, . "
, ,
,

www.books-shop.com


'cOtOd1s1'

'cOtOd1s3'


/dev/rdsk/c1tOd6s1

/dev/rdsk/1tOd6s3

create database db1 on cOtOd1s1 = 100


disk mirror name = "cOtOd1s1",
mirror = "/dev/rdsk/c1tOd6s1",
write = serial
db1
alter database db1 on cOtOd1s3 = 100
db1
. 8.26.
. , .
. "
, , "
.
, .
, ,
. , +
. , +
.
, , , +
. , , , +
, +
. , , +
, . .

, .
, +
, .
,
. ,
, .
,

disk init ,
. , +
.

www.books-shop.com



, . "
. "
.
, "
. ,
, "
master . p_mirror "
.
(. 14).
p_mirror, sp_helpdevice sysdevices "
master ( status). "
status
, "
.
, +
. ,
, .
, +
, +
, . ,
p_devspace , +
df
+k. ? , , +
, master +
, . master
,
p_devspace ,
master, , , +
. ,
master . ,
, master.
, , +
master
+ . , master
. , master
(, , ) .
master
, master
.
.
. .
.

, ,
, 11.
, ( ,
) ,
. , "
( "
master ..).
, . "
(, "
). ,

www.books-shop.com

cOtOdO + 1
cOtOd1 + 1 (
default system db1)
cOtOd2 + 2
cOtOd3 + cOtOd5
1tOd4 + 2
1tOd5 + 3 (
db1)
1tOd6 + cOtOdl
1tOd7 + cOtOd2

c2tOd8 + 3
c2tOd9 + 4 (
ncindexes db1)
c2tOd10 + 5
c2tOd11 + c3tOd13
c3tOd12 + 4
c3tOd13 + 6 (
bigtable db1)
c3tOd14 + c2tOd9
c3tOd15 + c2tOd10
db1 system/default, logsegment
'ncindexes' 'bigtable'.
. 16 ,
12 .
. 8.27. ,

. ,
/.
, . "

, , ,
.
. 8.27, "
dbl. (system, default logsegment), "
: ncindexes, , bigtable,
.
ncindexes bigtable "
, , system/default, "
.
( "
). "
, /
( Sun). ( )
12
, . ,
"
dbl. , , dbl

www.books-shop.com

, ,
, "
/ "
dbl, .
, ncindexes, c2tOd9
c2tOd10 ( 2, )
ncindexes . "
ncindexes .
ncindexes , 1 3
dbl. ,
ncindexes cOtOd2, 0, "
/ default/system. , "

.
. ,
, "
. , "
,
.



. , "
.
, "
. "
,
, " . , , , "
. "
, ,
.
no_log "
. "
.
"
, . "
.
.
, "
, . "
. ,
,
. "
. , , "

, "
( , ) "
.
"
, ,
, "
. "
.
master, master
. master
master. ,

www.books-shop.com

master , "
. ,
,
.
, "
, .


, , ,
. .
"
. , "

. "
,
, "
. , "
master .

www.books-shop.com

www.books-shop.com

SQL Server




master !
dbcc


,

(Backup Server)


SQL BackTrack DataTools

www.books-shop.com


SQL Server. "
, , , "
, , (
). "

.
, ,
. "
Sybase,
. "
. "
SyBooks, System 11, SQL Server, Open Ser"
ver, SQL Server (SQL Server Troubleshooting Guide).
System 11, SQL Server
4.9.2. " AnswerBase. "
, "
, Sybase. , Sybase
. "
System 11 (Advanced DBA for System 11).
" SyBooks AnswerBase,
, CD"ROM,
. , ,
. , " "
, , .. .
, AnswerBase , "
Sybase.
SQL Server (SQL Server
Troubleshooting Guide). ,
, .
.
SQL Server
, , SQL Server. "
"
. ", System 11
". "
. , SQL Server . "
master, SQL Server System 10 11 sybsystemprocs sybsecurity.
sybsystemprocs System 10 11
. sybsecurity , "
SQL Server System 10 System 11.
. , , "
Sun System 11 Solaris.
7. 8 "
"
.
SQL Server 4.9.2
4.9.2, "
". "
master. , SQL Server 4.9.2
.

www.books-shop.com

SQL Server System 10


SQL Server 4.9.2, System 10 ""
. sybsystemprocs sybsecurity.

master , sybsystemprocs ( sybsecu
rity, ). System 11 ""
",
dbcc"; .
System 10 create database alter database "with
override",
.
. , "
.
Sybase "with override" ,
, "
, . "
dump transaction
<__> with no_truncate,
, .

.
, "with over"
ride" . "
, .
SQL Server System 11
System 11 ", "
. , "

( "
" ). System 11
System 10. , SQL Server System 11 Sybase
SunOS, "
Sun Solaris.
4.9.2 System 10, SQL Server System 11
master ,
sybsystemprocs sybsecurity ( ).


, "
, dbcc" , "
. ,
.

, , "
.
"
.
( dbcc"
..) . "
, .
, . ,
, "
.
, . ,

%RRNVVKRS

piracy@books-shop.com


, , . "
.


,
Sybase, "
.
, "
. "
. .
, (checkpoints).
SQL Server . ,
.
SQL Server
, , "
. , , ,
,
, (. . 9.1). ,
, , .
( "
, ) "
.
,
. ,
. , "
, "
.
. , "
. "
{ ,
.
, "
" .
. "
,
(, , ). "
"
.
(Least Recently Used).
LRU".
SQLServer

( )


(
)
. 9.1.

www.books-shop.com

, "
. " 10
, . 9.2 20 .
, , "
" . , "
,
" . "
,
, " (. . 9.2). "
,
( ). ,
,
(. . 9.3), (,
). ,
, . ( "

*

:
*

1 **

2 **

3 **

4 **

5 **

6 **

7 **

8 **

9 **

10

10 ** 10

11
12
13
14
15
16
17
18
19
20



+

** , + ,
,
+,

+
+

. 9.2. *

www.books-shop.com

"

11 11

2 **

3 ** 3

4 **

5 **

6 ** 6

7 ** 7

8 **

9 ** 9

10

10 ** 10

11

11

12
13
14
15
16
17
18
19
20
+ ,
+

11 +

** +
,
+

11 , ,
+,
+
1

+



+
;
, +
+
,

+

. 9.3. ,
*
.) , "
. "
,
, . "
. ( ) "
: 20 ,
10 (. . 9.4).

www.books-shop.com

1**

11 **

2**

12 **

3**

13 **

4**

14**

5**

15 **

6**

16 **

7**

17 **

8**

18 **

9**

19 **

10**

20 **

10
10

11

11

12

12

13

13

14

14

15

15

16

16

17

17

18

18

19 /|

19

20

20

+ , + ,
+ 11 20
,

11


**
,
+



+
;
+
,
, +

+

. 9.4. ,

www.books-shop.com

"
. "
.
(, ) , "
. UNIX "
, ,
, . "
, , "
,
, .
,
, ,
, .
, ,
,
, . "

. . ",
,
. ", "
, ,
. ,
, .
, "
. "
.
"
. (checkpoint) "
, , ",
. ,
. "
,
, ,
. , ,
. "

. , , "
, ,
. ,
, , "
.
.
,
, .
.
, "
, ,
.
, " (. . 9.5). "

, , "
".
. ,
, "
. , "
,
.

www.books-shop.com



1**


+
11 **

2**

12 **

3**

13 **

4**

14 '**. 4

5**

15 **

6**

6 **

7**

( 7 **

8**

8 **

9**

9
9

10 ** 10
10

10**

9 **

11**

11


11

12**

12


12

13**

13


13

14**

14


14

15**

15


15

16
17
18
19
20
+ + , +
6 15
, +
,

; ,
+

,

**
,
+



("")
+
,
+

. 9.4. ,

www.books-shop.com

. ", "
. "
, , ,
. "
, "
( recovery_interval
sp_configure), checkpoint .
, . "
,
, , .
", checkpoint . ,
, shutdown nowait (
shutdown nowait ).
dump database. "
, "
. , . ,
, ,
, dump database.
, "
. ,
. ( "
. .) "
"", use
<_6_>, " . ""
. " , dbcc"
, ,
, . , "
sysdatabases ""
" .
. ,
. , "
( Sy"
base).
. , ,
. ,
, "
master.
, , "
, . "
,
. "
"
. dump transaction "
, dump transaction <_6_>
with no_truncate. , master, "
. , "
dump transaction no_truncate
master (. . 9.6).
, "
. , "
. .
, "
, ,
. , "
, .

master master.
(,
, ). ,

www.books-shop.com

dump transaction db1 with no_truncate


master

db1 ,


SQL Server
db1, .
,
.
master, ,
.
. 9.6.

(. 8).
, "
, "

. ,
.
"
. ,
,
.
, , "
.
, "
master .

. "
,
.


begin transaction A


+ .
,

, .


begin transaction

,
.


commit transaction A


, ,
.

checkpoint
. 9.7.

www.books-shop.com



"
"
.
, . "
, "
, ".

. ,
. ,
, . ,

,
, . "
, "
.
, "
.
"
. , "
,
. , "
"
. ,
"
. , "
.


. , "
. "
, ,
"
. ,
. , "
.
, , "
. "
, .
, , "
,
. "
, ,
, , , "
, , "
, cron", ..
, . "
.
"
, , "

. ,
,
, "

www.books-shop.com

. , "
, .
, , "
.
, .
, .

. , , "
,
. "
. , , "
,
, . "
, ,
, .
" , , "
, . "

, , .
, "
.

. "
.
"
. , , ,
.
( "
). , "
, , . ,
, , "
. "
,
.
"

( load transaction <_6_>). "
,
(. . 9.8).
"
"
, .
1) ,

2) ,

. 9.8.

%RRNVVKRS

piracy@books-shop.com

. , "

. "
,
.
, .
.
, .
,
. , "
, "
. , , .
"

.
, .
"
. "
,
"
.
, "
.
, "
.
. , , "
, "
, .
,
.
. ",
, "
( ) "
.
", ,
, "no chkpt on recovery". , SQL Server
.

"" . (""
" , "
.) "
.
. "
.
"
.
, "
. "
, ,

. , "
"
, .
,
( )
( . 11). "
,

.

www.books-shop.com

. , SQL
Server System 10 ,
, "
( striping).
, "
,
. "
,
"
. mas
ter ( System 10 sybsystemprocs sybsecurity).

. , "
. syslogins master
. b ". "
,
, 'sa'.
( ). b , "
syslogins, . ,
, syslogins "
"probe". "
syslogins 'sa'.
"
syslogins , syslogins
, 'sa' (, ,
'probe'). syslogins ,
, (, "
b) .
"
. , "
.
, "
.

, "
DSQUERY . ( DSQUERY
, , ,
).
, , "
. "
, .
dbcc". "
,
. "
,
.
"
, , . "

,
"
. "
, . .
", "
.
, "
"
. ",
(. 8).

www.books-shop.com



( )



.
,
.

1
( )

. 9.9.

. ", "
,
. ,
, . "
"
, .
,
p_dbcreate (. 14). "
"
(. . 9.9).
, OLTP"
,
dbcc". "

, .
. ,
, "
"
.
, , , "
Replication Server.
; , "
.

www.books-shop.com

master !
master ( "
). master,
. ,
.
buildmaster . ( "
sp_conf igure.) To .
. "
,
master, . , ,
buildmaster, "
, master.
, , "
dbadb,
( ,
master,
master ).
SQL Server System 10 11
sybsystemprocs. "
. "
.
dbcc
dbcc" "
. , ,
. .
dbcc "
SQL" (Sybase SQL Server System Administration Guide),
SQL Server (SQL Server Troubleshooting Guide).
.
dbcc"
. , "
dbcc, "
. dbcc"
. , mastertSK
dbcc". "
master (. 7).
"
. " dataserver. , dbcc"
.
(
, OLTP") "
,
dbcc". "
. "
, .
dbcc"
". dbcc sp_poolconfig
. " (default data cache) "
16" . (, "
", ,
2" , 512 .) "
16 dbcc". ,
dbcc, ,
16
.

www.books-shop.com

, dbcc".

.
,
. , "
. , "
dbcc" ,
. , dbcc" "
.
: , "
( . 10).
dbcc" , "
. dbcc" "
, .
DBCC" <
(. . 9.10). "
dbcc" . "
, ,
(,
dbcc ).
dbcc" . "
, "
.

. 9.10.
dbcc+

master model ( sybsys


temprocs sybsecurity SQL Server System 10). , DBCC" "
master ,
. , "
DBCC" master model .
dbcc "
, master model.
,
"
. , master model ,
"
. , master
model ,
master .
DBCC"
. , dbcc"
dbl 8 30 ,
7 . "
37 .
, . ,
. , ,
. ,

www.books-shop.com

,

. , , "
dbcc, . "

. ,
, .

"
( , "
).
, "
, ,
dbcc ,
DBCC" . "
sysusages ( .
12). , "
,
DBCC". DBCC" "
,
. ,
, "
. , "
, .
(. . 9.11) "
, .
DBCC" , "
, "
p_dbcreate (. 14). ,
DBCC" . , p_dbcreate
, "
DBCC" .

cOt0dO + 1
cOtOd1 + 1
cOtOd2 + 2
cOt0d3 + c1tOd5
c1tOd4 + 2
c1tOd5 + 3
c1tOd6 + cOtOd1
c1tOd7 + cOtOd2

DBCC+
.
.
DBCC+
.
. 9.11. DBCC*

www.books-shop.com

, DBCC".
,
dbcc" .
( ), "
DBCC"
, .. . "
,
.
,
dbcc+. .
, DBCC++
dbcc.
605 ( 605 ,
+ ; . +
SQL Server). , dbcc++
30 ,
. , ,
,
.
dbcc ,
605 . dbcc +
605. . +
, +
. ?
, +
.
. dump database , +
, +
. .
DBCC+
+ . , +
dbcc ( +
)
605. dbcc +
.
,
, +
. dbcc+
, , +
.
605 .

,
(
). , +
, dbcc
. , +
, +
. .
"
. dbcc",
. "
"
.
dbcc" , . "
.
, , "
.

www.books-shop.com

,
, .
, +
+
?
dbcc+ , +
.
. "

, "
dbcc". "
.
. "
, .

dbcc". , Platinum Technologies " "
Image Analyzer
SQL Server.
, "
Image Analyzer. Image Analyzer "
SQL Server (
), UNIX"
.
Image Analyzer , "
, dbcc".
dbcc ,
. , Image Analyzer, .
, .
Image Analyzer , "
SQL Server. "
.
dbcc"
, Sybase, . , Image Analy"
zer , SQL Server>> dbcc.
Image Analyzer . Image
Analyzer "
, . , Image Analy"
zer dbcc",
SQL Server. (
) ,
dbcc" .
.
Sybase. , "
. SQL Server.
dbcc" ,
. SQL Server "
.
. Image Analy"
zer , "
.
SQL Server .
Image Analyzer .
2" ,
UNIX. , Image
Analyzer , .
Image Analyzer . "
,

www.books-shop.com

dbcc" . Image Analy"


zer ,
, dbcc .


. .
, ,
"
.
, "
.
, . "
master,
. , "
master,
master. , SQL Server System 10 11
, sybsystemprocs sybsecurity.
( ), "
. ,
. "
,
. ,
.
, "
. "
. , ,
,
. "
, .
, , tempdb "
. . ,
, "
. , "
tempdb .
.
, "
"
.
.
(. 8).
,
.
, .
, ,
.
,
.
, , "
.
. ,
, ,
"
.
p_mirror (, 14).

www.books-shop.com


(.. "
) "
.
. "
, . ,
, dbcc". ,
.


(. . 9.12). ,

DBCC", dbcc". "
, . "
, . ,
dbcc" , . "
, dbcc
.


.
, .
,
.

(4 ).

( ).
,
.
,
.
,
.

. 9.12.
,
, "
(, , ) .

( ).
. . , "
.
, "
. , "
, .

%RRNVVKRS

piracy@books-shop.com

. ,
. ,
.
. SQL Server
. , "
. ,
"
.

, "
.
syslogins b "
".
(, 'sa' 'probe'). "
probe "
. syslogins master
, syslogins
. syslogins "
b. syslogins
, , (
's'; , 'probe' ).
. syslogins "
'sa' "
b " .

. , . 14
, "
cron", .
. "
cron" .
RUN_<_>, sybinit
, master "
. , "
. RUN_<_>
.
.
sybinit master,
dbcc. , dbcc
master.
, "
. , "
. 12 sysusages
p_dbcreate,
.
SQL Server System 11 , "
. "
.
, .
, SYBASE <_"
pa>.cfg. , (, "
, dbcc") ,
. , SQL Server master
, ,
.
, UNIX.
SQL Server System 11,
sp_conf igure,

www.books-shop.com

(SQL Server 4.9.2 System 10)


. System. 11 sp_configure
", (
, 14) sp_help"
cache, sp_cacheconfig sp_poolconfig <_> "
, .
, System 11 ,
sp_configure . "
, . "
", ,
.
sysattributes, .
sp_helpcache. ,
, "
. "
. ,
,
".
(Backup Server)
, "
. SQL Server .
, SQL Server no
, SQL Server
. ,
. SQL Server,
sybinit. SQL Server .
, SQL Server "
. SQL Server
.
, . SQL Server
SYB_BACKUP...sp_who
.
, , "
( ) . ,
SQL Server.
RUN_<_>, SQL
Server. SQL Server "
.

cron", .
SQL Server SYB_BACKUP.
sysservers srvna
, SYB_BACKUP,
SQL Server. sybinit "
. sybinit SYB_BACKUP ("
srvnetname sysservers).
. SQL Server, "
SYB_BACKUP. "
, .
( sysservers 12).
SQL Server 4.9.2, "
( 4.9.2 ).


SQL Server. ,

www.books-shop.com

. ,
. 4.9.2 "
, ,
.
SQL
Server, .
. .
"
.

( striping). ,
,
. , "

. 5" .
2,5 ,
20 .
,
, , "
dump database. , dump database
. "
. load database with lis"
tonly, , .
,
. , "
, , "
.
, ,
dump database dump transaction.
( capacity).
with init, "
.
. "
.
SQL Server 4.9.2 dump database
dump transaction sp_who
" .
.
, ,
, sybmultbuf . "
.

.
( , "
, ). "
, SQL Server
. ,
"
. , "
,
.
.
,
.
, .
, SQL Server 4.9.2 . "
, SQL Server System 10.

www.books-shop.com

14 , "
. .
,
. , "
. , "
.
. "

, dump database.
. 32" UNIX, "
, 2 . 64" "
UNIX .
, , "
. "
.
,
UNIX.
,
. ,
. "
. "
, .
, ,
, .
,
. , ,
, .
. "
"
.
(. 10) DBCC" (. ), "
. "
, .
, "
. ,
( )
.
dbcc" .
, "

(. 8).

master. "
, .
( "
). master
master
dump transaction master with truncate_only
( . 7).
He model , "
sybinit, "
master, model ,
model, SQL Server
(SQL Server Troubleshooting Guide).
"
1105. , (
, 12), .
1105 ,

www.books-shop.com

dump transaction, "


.
dump transaction <__> with no_og
.
. ,
dump transaction with no_log
. "
. . , "
(,
),
.
, "
.
System 10 System 11 1105 "
(. 12). "
, dump transaction with no_log.
( "
) . "

.
,
,
.
.
, , "
.
10 , 100 ,
90 , "
. , "
, . ,
, .

, "
. .
"

. , "
, "
.
, . "
, UNIX. "
2" ( System 10 11
, "
, 2 ). , .
. "
. ,
. , "
,
.
"
. , "
sysdatabases master. , ,
. "
.
master , "
.

www.books-shop.com

; "
.
"
.
sysdatabases master " ( "
, , master),
dump transac"
tion no_truncate. "
, .
, , "
.
, "

. . "
, , "
.
, , , ( "
) .
,
,
.
,
, select into/bulkcopy trun"
cate log on checkpoint. select into/bulkcopy
, .
( , "
, ). truncate log on checkpoint
, "
.
,
.
, master
. system, default logsegment "
master , .
master
, (.
7).
,
(thresholds). ,
, 15 .
. , "
(last"chance threshold), "

(, . 12).
SQL
DataTools
, "
. , "
.
, "
SQL Server, .
,
, , "
. SQL Server "
.

www.books-shop.com

. , "
" .
, "
.
, .
,
. ( . 11.)

, "
. ,
b , . "
.
b
.
,
. , ,
,
, .
. , "
, , "
, , , .. "
.
, .
.

. ", "
, "
, .
.

(
, ). ",
"
. , "

. ,
, SQL Server,
. ",
, .. "
SQL Server 4.9.2 System 10 System 11. ",
, , "
.
, ,
. ,
,

disk init; , ,

; , "
. , "

'
.
, . "
,
, , "
. ,
, , " .
,

www.books-shop.com

. "
. , "
, ,
.
"
.
DataTools SQL BackTrack, "
, . "
SQL BackTrack SQL Server

. , SQL BackTrack "
. , SQL Back"
Track ,
. SQL BackTrack "
. , "
,
. SQL Back"
Track .
, "
UNIX. , "
.
, SQL BackTrack "
. "
b; ,
, , , "
; b . SQL
BackTrack ,
. ( ). SQL Bac"
kTrack ,
b", .
5,6
. , +
, +
, . , ,
+ , 10
, .
. , +
10 , +
, ,
, ,
bcp+ 800 , . +
dbcc+ DBCC+, +
.
DBCC+ , 5,6 +
. +
.
10 +
+
. ( ,
), ,
. +
, +
,
.
. , .

www.books-shop.com

, SQL BackTrack 3.0 ,


,
. SQL BackTrack
( cron"),
, SQL Server System 10 11. "
. "
"
.
(logsegment). logsegment,
sp_thresholdaction , .
,
logsegment . "
SQL BackTrack, "
. SQL BackTrack 3.0. (
. 12.)


, . "
. "
,
. "
, .
, DBCC". "
.
,
.
. +
: ,
dbcc+
,
. ,
30
dbcc+ 8 ,
15 .
,
Sybase ( ,
).

"
, .
1105
1105 , "
, . "
1105 ,
12, .
"
. , "
1105 " .
1105 . ,
master .
master. "
1105 ,
. , , "

. ,

www.books-shop.com

, . "
, . 1105.
, , "
. ,
"
, "
. ( . 12.)
1105 " tempdb

dump transaction tempdb with no_log
"
"
. ,
tempdb .
tempdb dump transaction with no_log, .
tempdb.

,
, ,
, .
, "
,
.

,
,
. , "
.
.
("dump out of sequence"), .

. .

. , "
, .
dbcc*
dbcc , "
, ( ,
master) . "
.
dbcc , "
. , (. ).

master ,
, ,
dump transaction no_truncate.
,
. , "
. "
,
.

, , "
,

%RRNVVKRS

piracy@books-shop.com

(. 8).
,
, (. ).
, "
(. ).

.
, "
. disk remirror, "

.
, ,
. , "
.

, , "
.
.
master " ,
, . "
. , "
,
master. , "
, , "
.
, , "
.

. "
, "
mode = remove. He disk unmirror,
. "
, .

.
"
: .
, master,
, master, (. ).

, , "
, . "
,
. "
"
, master .
(. 13) "
disk init
, .
, ,
(, ,
). "
master syslogins. "
. master
.

www.books-shop.com


,
. ( "
, SQL BackTrack.)
master master
.
master ,
buildmaster ( ).
master, "
RUN_<_>, sybinit .
. master
buildmaster . "
SQL Server (SQL Server Troubleshooting
Guide), master.
master "
.
, . "
master " , "
. master
.
.
/
, "
( "
, DBCC"). ,
"
. (
. 11.)

, , "
. SQL Server "
. ,
, SQL BackTrack DataTools.


, SQL Server 4.9.2 System 11 " "
, ,
4.9.2. , "
,
4.9.2 ( ),
. SQL Ser"
ver System 11, , "
.

www.books-shop.com

www.books-shop.com

10

SQL Server
sp_sysmon
sp_sysmon
sp_sysmon
sp_sysmon









SQL Monitor
SQL Server

www.books-shop.com


. "
. "

, . "
, "
. Sybase SQL Server (SQL
Server Performance and Tuning), SQL Server System 10 "
", System 10 System 11 (Performance
and Tuning Migration System 10 to System 11), " SKILS
Sybase. , "
. "
SQL Server.
SQL Server
SQL Server,
, sp_sysmon, SQL Server
System 11.
SQL Server 4.9.2
4.9.2 SQL Server (Backup Server),
System 11, sp_sysmon.
SQL Server System 10
System 10 ,
. .
System 10 , "
SQL Server System 10 "
4.9.2. , SQL Server
System 11 sp_sysmon.
SQL Server System 11
System 11 , ""
, . ,
. SQL Server System 11 "
.
sp_sysmon, System 11, "
,
. SQL Server System 11
( housekeeper function), "
"" ". ""
, .
sp_sysmon
sp_sysmon Sybase SQL
Server System 11, SQL Server 11.0.1. "
. "

Sybase SQL Monitor. , , "
sp_sysmon. , SQL Monitor,
sp_sysmon.
SQL Monitor sp_sysmon , , "
, . sp_ sysmon, SQL Monitor
. , sp_sysmon "
,
SQL Monitor. ,

www.books-shop.com

, , SQL Monitor sp_sysmon


SQL Server. SQL Monitor sp_sysmon
, sp_sysmon. SQL
Monitor sp_sysmon , , .
sp_sysmon .
Sybase 5"7% . sp_sysmon "
,
. , sp_sysmon
, "
. sp_sysmon "
, ,
.
sp_sysmon
. 1 10 . sp_sysmon "
SQL Server. "

. sp_sysmon, , "
, . sp_sysmon "
, , ,
".
sp_sysmon , "
, "
, sp_sysmon .
sp_sysmon
, . "
sp_sysmon cron", "
, "
. , , "
, . "
. ,
",
. "
. "
" ,
.
sp_sysmon "
"
.
sp_sysmon. ,
,
.
sp_sysmon
, sp_sysmon , "
. , "
.
,
. sp_sysmon "
,
. "
sp_sysmon .
sp_sysmon "
, . "
:
(Kernel Utilization)
(Task Management )
(Transaction Profile)

www.books-shop.com

(Transaction Management)
(Index Management)
(Lock Management)
" (Data Cache Management)
" (Procedure Cache Management )
(Memory Management)
(Recovery Management)
" (Disk I/O Management)
" (Network I/O Management)
sp_sysmon
sp_sysmon
SQL Server (Sybase SQL Server Performance and Tuning Guide). "
, "
.
. , "
, , ,
, "
sp_sysmon.
, "
. sp_sysmon "
,
.
( sp_sysmon . .) , "
, , :
1. : (Kernel Utilization Engine Busy
Utilization)
2. : "
(Task Management " Task Context Switches Due To Voluntary Yields)
3. : " (Task
Management Task Context Switches Due To Group Commit Sleeps)
4. :
(Task Management Task Context Switches Due To Last Log Page Writes)
5. : (Task Management Task
Context Switches Due To Other Causes)
6. : " "
(Transaction Management ULC Flushes to Xact Log by Full ULC)
7. : "
(Transaction Management ULC Flushes to Xact Log by End Transaction)
8. : "
(Transaction Management ULC Flushes to Xact Log by Change of Da"
tabase)
9. : " "
(Transaction Management ULC Flushes to Xact Log by Other)
10. : " "
(Transaction Management ULC Semaphore
Requests Waited)
11. : (Transaction Management
Avg # Writes per Log Page)
12. : (Lock Management
Lock Detail < > Waited/Total Requests)

www.books-shop.com

13. " : ""


(Data Cache Management Cache Statistics Summary (All Caches), Cache Search Sum"
mary, Total Cache Hits)
14. " : "" ,
(Data Cache Management Cache Statistics Summary (All Caches), Cache Turnover,
Buffers Grabbed Dirty)
15. " : ""
(Data Cache Management Cache Statistics Summary (All Caches), Large I/O Effective"
ness, Pages by Lrg I/O Used)
16. " : (Data Cache Mana"
gement Default Data Cache Utilization)
17. " : , (Data
Cache Management Default Data Cache, Cache Searches, Found in Wash)
18. " : (Data
Cache Management Default Data Cache, Cache Searches, Cache Misses)
19. " : "" ,
(Data Cache Management Default Data Cache, Pool Turnover, Grabbed
Dirty)
20. ": " (Large I/O
Usage Large I/Os Denied)
21. ": "
(Large I/O Usage Large I/O Detail Pages Used/Pages
Cached)
22. " : (Procedure Cache Mana"
gement Procedure Removals)
23. : "
(Recovery Management Checkpoints, # of Free Checkpoints/# of Normal Checkpoints)
24. ": " (Disk I/O Manage"
ment I/Os Delayed by)
25. ": (Disk I/O Management
Total Requested Disk I/Os)
26. ": ""
(Disk I/O Management Completed Disk I/O's)
27. ": (Disk I/O
Management Total Completed I/Os)
28. ": (Disk I/O Management Devi"
ce Activity Detail, Reads)
29. ": (Disk I/O Management
Device Activity Detail, Writes)
30. ": "
(Disk I/O Management Device Activity Detail, Device Semaphore Waited)
(Kernel Utilization)
(Engine Busy Utilization)
,
. "
, . 100%" "
, ,
. 80%,
, , . "
, .

www.books-shop.com


, , .
, "
, . 100%
, ,
.
(Task Management)
(Task Context Switches Due To:)
, , "
( " " "Other Causes"),
10%.
, .
(Voluntary Yields)
, , "
, "
"time slice".
(Group Commit Sleeps)
, "
.
(Last Log Page Writes)
,
.
(Other Causes)
.
, . " "
, .

(Transaction Management)

(ULC Flushes to Xact Log):
. (by Full ULC)
, 20%, "
(User Log Cache).
"user log cache size" sp_configure "
.
(End Transaction)
, " "
" (' Full ULC") " " ("by Change of Data"
base").
(by Change of Database)
. ,
, . "
, , "
.
(by Other)
20%, "
.

www.books-shop.com

*
(ULC Semaphore Requests)
(Waited)
5%. "
, "

.

(Transaction Management Avg # Writes per Log Page)
1 . ,
. ,
.
(Lock Management)
(Lock Detail)
< >
(Waited)
, .
"
.
(Total Requests)
, (
"waited"). "total". "
,
.
, .
* (Data Cache Management)
(Cache Statistics Summary
(All Caches))
. (Cache Search Summary)
(Total Cache Hits)
" 80%. "

.
(Cache Turnover)
, "" (Buffers Grabbed Dirty)
0. "
(buffer wash size) ", "
"" .
+
(Large I/O Effectiveness)
,
(Pages by Lrg I/O Used)
""
" .
50%, " , "
. ,
( , ).

%RRNVVKRS

piracy@books-shop.com

* (Default Data Cache)


(Utilization)
"
. ,
.
(Cache Searches)
, (Found In Wash)
, ,
. "
sp_poolconf ig.
(Cache Misses)
0.
" .
, 20% 80%
("Cache Hits"). " , "
, .
(Pool Turnover)
, "" (Grabbed Dirty)
0. , ""
", (wash size) "
.
sp_poolconig.

sp_sysmon , "
" .

* (Large I/O Usage)


* (Large l/Os Denied)
"
". "
" .

(Large I/O Detail)


, ( 2, 4, 8
16 ), ".
, (Pages Cached)
(Pages Used)
, . 50%,
. "
.

www.books-shop.com

*
(Procedure Cache Management)
(Procedure Removals)
10%, " "
. "procedure cache", "
, " .
, , " "
" .
(Recovery Management)
(Checkpoints)
(# of Normal Checkpoints)
(# of Free Checkpoints)

. "housekeeper
free write percent". .
*
(Disk I/O Management)
* (l/Os Delayed by)
.
.
* (Total Requested Disk l/Os)
" (To"
tal Completed I/Os). "
" .
*,
(Completed Disk l/O's)
", "
" .
*:
(Disk I/O Management Total Completed l/Os)
""
(Total Requested Disk l/Os).
" .

(Device Activity Detail)
(Reads)
, "
. "

.
(Writes)
.


(Device Semaphore Waited)
0 ,
".
182221

www.books-shop.com

sp_sysmon
DBCC execution completed. If DBCC printed error messages, contact a user with
System Administrator (SA) role.
DBCC . DBCC
, ,
.
Sybase SQL Server System Performance Report
Jul 29 , 1996
16:41: 36
16:42: 36
1 min.

Run Date
Statistics Cleared at
Statistics Sampled at
Sample Interval
Kernel Utilization
1) Engine Busy Utilization:
Engine 0

95. 5 %

CPU Yields by Engine


Engine 0
Network Checks
Non#Blocking
Blocking

per sec
0.0

per xact

12831.2
0.9

29572.5

768886

2.0

53

Total Network I/O Checks:


Avg Net I/Os per Check

12832.1
n/a

29574.6

Disk I/O Checks


Total Disk I/O Checks
Checks Returning I/O
Avg Disk I/Os Returned

12832.1
12797.9
n/a

29574.6
29495.7

per sec
0.0

per xact

Task Management
Connections Opened

Task Context Switches by Engine


Engine 0
43.8
Task Context Switches Due To:
2) Voluntary Yields
0.5
Cache Search Misses
17.2
System Disk Writes
0.2
I/O Pacing
15.9
Logical Lock Contention
0.0
Address Lock Contention
0.0
Log Semaphore Contention
0.0
3 ) Group Commit Sleeps
0.9
4) Last Log Page Writes
0.5
Modify Conflicts
0.0
I/O Device Contention
0.0
Network Packet Received
0.2
Network Packet Sent
1.1
SYSINDEXES Lookup
0.0
5) Other Causes
7.3

0.0

n/a

n/a

count

768939
0.00010
768939
766887
0.01121
count

0.0

100.8

2622

1.1

29

39.7

1033

0.5

12
952
1
0
0
53
29
2
0
11
64
0
436

36.6

0.0
0.0
0.0
2.0
1.1
0.1
0.0
0.4
2.5
0.0
16.8

% of total

n/a
100.0 %
0.0 %

n/a
n/a
99.7 %

n/a
% of total

n/a
100 %
1.1
39.4
0.5
36.3
0.0
0.0
0.0
2.0
1.1
0.1
0.0
0.4
2.4
0.0
16.6

%
%
%
%
%
%
%
%
%
%
%
%
%
%
%

www.books-shop.com

Transaction Profile
Transaction Summary
Committed Xacts

per sec
0.4

per xact
n/a

count
26

% of total
n/a

Transaction Detail
Inserts
Heap Table
Clustered Table
Total Rows Inserted

per sec

per xact

count

% of total

75.5 %
24.5 %
1.9 %

Updates
Deferred
Direct In#place
Direct Cheap
Direct Expensive
Total Rows Updated
Deletes
Deferred
Direct
Total Rows Deleted
Transaction Management
ULC Flushes to Xact Log
6) by Full ULC
7) by End Transaction
8) by Change of Database
by System Log Record
9) by Other
Total ULC Flushes

1.9
0.6
2.5

4.4
1.4
5.8

114
37
151

0.3
0.0
127.4
0.0
127.6

0.6
0.0
293.6
0.0
294.2

15
0
7634
0
7649

0.5
0.1

1.2
0.1

30
3

0.6

1.3

33

0.2
0.0
99.8
0.0
97.7

%
%
%
%
%

90.9 %
9.1 %
0.4 %

per sec
108.4
0.5
0.0
2.7
0.1
111.6

per xact
249.8
1.0
0.0
6.3
0.1
257.3

count
6494
27
1
164

3
6689

513.2
n/a

1182.7
n/a

30751
2048

ULC Semaphore Requests


Granted
10) Waited
Total ULC Semaphore Req

899.9
0.0
899.9

2074.0
0.0
2074.0

53924
0
53924

100.0 %
0.0 %

Log Semaphore Requests


Granted
Waited
Total Log Semaphore Req

149.4
0.0
149.4

344.3
0.0
344.3

8952
0
8952

100.0 %
0.0 %

Transaction Log Writes


96.9
Transaction Log Alloc
122.6
11) Avg # Writes per Log Page n/a

223.3
282.5
n/a

5807
7344
0.79071

ULC Log Records


Max ULC Size

% of total

97.1
0.4
0.0
2.5
0.0

%
%
%
%
%

n/a
n/a

n/a
n/a
n/a

Index Management
Nonclustered Maintenance
Ins/Upd Requiring Maint
# of NC Ndx Maint
Avg NC Ndx Maint / Op
Deletes Requiring Maint
# of NC Ndx Maint
Avg NC Ndx Maint / Op

per sec
127.4
0.1
n/a
127.4
127.4
n/a

per xact
293.7
0.1

n/a
293.7
293.7
n/a

count
7637
3
0.00039
7637
7637
1.00000

% of total
n/a
n/a

n/a
n/a
n/a
n/a

www.books-shop.com

RID Upd from Clust Split


# of NC Ndx Maint
Page Splits
Page Shrinks
Lock Management
Lock Summary
Total Lock Requests
Avg Lock Contention
Deadlock Percentage
Lock Detail
Exclusive Table
Granted
12) Waited
Total EX#Table Requests

0.0
0.0
0.0 .
0.0
per sec
1234.4

0.0
0.0
per sec

0.0
0.0
0.0
0.0

per xact
2844.8

0.0
0.0
per xact

0
0
0
0

n/a
n/a
n/a
n/a

count
73966

% of total

1
0

0.0 %
0.0 %
% of total

count

n/a

1.2
0.0
1.2

2.8
0.0
2.8

74
0
74

100.0 %

Shared Table
Granted
Waited
Total SH#Table Requests

0.1
0.0
0.1

0.2
0.0
0.2

4
0
4

100.0 %
0.0 %
0.0 %

Exclusive Intent
Granted
Waited
Total EX#Intent Requests

0.1
0.0
0.1

0.2
0.0
0.2

6
0
6

100.0 %
0.0 %
0.0 %

12.1

28.0

0.0

0.0

100.0 %
0.0 %

12.1

28.0

728
0
728

Exclusive Page
Granted
Waited
Total EX#Page Requests

0.6
0.0
0.6

1.3
0.0
1.3

33
0
33

100.0 %
0.0 %
0.0 %

Update Page
Granted
Waited
Total UP#Page Requests

0.7
0.0
0.7

1.5
0.0
1.5

38
1
39

97.4 %
2.6 %

583.3

1240.7

32258

0.0

0.0

583.3

1240.7

32258

100.0 %
0.0 %
43.6 %

402.3

927.2

24108

0.0

0.0

402.3

927.2

24108

100.0 %
0.0 %
32.6 %

279.0

642.9

16716

100.0 %

0.0

0.0

0.0 %

279.0

642.9

16716

22.6 %

Shared Intent
Granted
Waited
Total SH#Intent Requests

Shared Page
Granted
Waited
Total SH#Page Requests
Exclusive Address
Granted
Waited
Total EX#Address Requests
Shared Address
Granted
Waited
Total SH#Address Requests

0.0 %
0.1 %

1.0 %

0.1 %

www.books-shop.com

Last Page Locks on Heaps


Granted
1.9
Waited
0.0
Total Last Pg Locks 1.9 4.4 114 0.2 %
Deadlocks by Lock
Deadlock Detection
Deadlock Searches

per sec
0.0

4.4
0.0

per xact
0.0

114
0

count
0

100.0 %
0.0%

% of total
n/a

0.0

0.0

n/a

0.0

0.0

n/a

2906.0
327.7
3233.7

75556
8520
84076

89.9 %
10.1 %

39.7
0.0

1033
0

n/a
0.0 %

Lock Promotions
Data Cache Management
Cache Statistics Summary (All Caches)
Cache Search Summary
13) Total Cache Hits
Total Cache Misses
Total Cache Searches
Cache Turnover
Buffers Grabbed
14) Buffers Grabbed Dirty

1260.9
142.2
1403.1
17.2
0.0

Cache Strategy Summary


Cached (LRU) Buffers
3464.3
Discarded (MRU) Buffers
0.0
Large I/O Usage
Large I/Os Performed
1.4
Large I/Os Denied
12.1
Total Large I/O Requests
13.5
Large I/O Effectiveness
Pages by Lrg I/O Cached
15) Pages by Lrg I/O Used
Dirty Read Behavior
Page Requests

100.8
59.5
0.0

7984.2
0.0

207589
0

100.0 %
0.0%

3.2
27.8
31.0

83
723
806

10.3 %
89.7 %

232.3
137.1

6040
3565

n/a
59.0 %

0.0

n/a

default data cache

16) Utilization

per sec
0.0
n/a

per xact
0.0
n/a

Cache Searches
Cache Hits
17) Found in Wash
18) Cache Misses
Total Cache Searches

1260.9
6.7
142.2
1403.1

2906.0
15.4
327.7
3233.7

75556
400
8520
84076

89.9 %
0.5 %
10.1 %

4.6
0.0

10.7
0.0

278
0

26.9 %
0.0,%

Pool Turnover
2 Kb Pool
LRU Buffer Grab
19) Grabbed Dirty

count
0
n/a

% of total
n/a
100.0 %

www.books-shop.com

16 Kb Pool
LRU Buffer Grab
Grabbed Dirty
Total Cache Turnover

12.6
0.0
17.2

29.0
0.0
39.7

755
0
1033

73.1 %
0.0%

Buffer Wash Behavior


Buffers Passed Clean
Buffers Already in I/O
Buffers Washed Dirty

57.3
0.0
7.9

132.1
0.0
18.2

3434
0
472

87.9 %
0.0%
12.1 %

Cache Strategy
Cached (LRU) Buffers
Discarded (MRU) Buffers

3464.3
0.0

7984.2
0.0

207589
0

100.0 %
0.0%

1.4
12.1
13.5

3.2
27.8
31.0

83
723
806

10.3 %
89.7%

100.8
59.5

232.3
137.1

6040
3565

n/a
59.0 %

0.0

0.0

Large I/O Usage


Large I/Os Performed
20) Large I/Os Denied
Total Large I/O Requests
Large I/O Detail
16 Kb Pool
21)
Pages Cached
Pages Used
Dirty Read Behavior
Page Requests

n/a

psychocache_l

Utilization

per sec
0.0
n/a

per xact
0.0
n/a

count
0
n/a

% of total
n/a
0.0 %

Cache Searches
Total Cache Searches

0.0
0.0

O.D
0.0

0
0

n/a

0.0
0.0

0.0
0.0

0
0

n/a

Pool Turnover
Total Cache Turnover

Buffer Wash Behavior


Statistics Not Available # No Buffers Entered Wash Section Yet

Cache Strategy
Statistics Not Available # No Buffers Displaced Yet

Large I/O Usage

0.0

0.0

n/a

Large I/O Detail


No Large Pool(s) In This Cache
Dirty Read Behavior
Page Requests
0.0

0.0

n/a

Procedure Cache Management per sec


Procedure Requests
0.3

per xact
0.6

count
15

% of total
n/a

www.books-shop.com

Procedure Reads from Disk


Procedure Writes to Disk
22) Procedure Removals
Memory Management
Pages Allocated
Pages Released

0.0
0.0
0.0
per sec
0.0
0.0

0.0
0.0
0.0

per xact
0.0
0.0

1
0
1

6.7 %
0.0 %
n/a

count

1
1

% of total
n/a
n/a

count
2
0
2

% of total
100.0 %
0.0 %
n/a

count
34
34

% of total
n/a
n/a

Recovery Management
Checkpoints
per sec
per xact
23) # of Normal Checkpoints
0.0
0.1
# of Free Checkpoints
0.0
0.0
Total Checkpoints
0.0
0.1
Avg Time per Normal Chkpt
0 .00000 seconds
Disk I/O Management
Max Outstanding I/Os
Server
Engine 0

per sec
n/a
n/a

24) I/Os Delayed by


Disk I/O Structures
Server Config Limit
Engine Config Limit
Operating System Limit

n/a
n/a
n/a
n/a

25) Total Requested Disk I/Os 129.9


26) Completed Disk I/O's
Engine 0
143.4
27) Total Completed I/Os
143.4
Device Activity Detail
/dev/rdsk/cOt2dOs4
cOt2dOs4
28) Reads
29) Writes
Total I/Os

per sec
16.1
27.4
43.5

Device Semaphore Granted


30) Device Semaphore Waited
/dev/rdsk/cOt2dOs5
cOt2dOs5

73.2
0.0

per xact
n/a
n/a
n/a
n/a
n/a
n/a

0
0
0
0

n/a
n/a
n/a
n/a

299.4

7785

n/a

330.5
330.5

8593
8593

100.0 %

count
964
1641
2605

% of total
37.0 %
63,0 %
30.3 %

4388
0

100.0 %
0.0 %

per xact
37.1
63.1
100.2
168.8
0.0

Total I/Os

per sec
0.0
0.0

per xact
0.0
0.0

count
0
0

% of total
n/a
0.0 %

/dev/rdsk/cOt2dOs6
cOt2dOs6
Reads
Writes
Total I/Os

per sec
0.9
97.9
98.8

per xact
2.2
225.6
227.7

count
56
5865
5921

% of total
0.9 %
99.1 %
68.8 %

5921
0

100.0 %
0.0 %

Device Semaphore Granted 98.8


Device Semaphore Waited
0.0

227 .7
0.0

www.books-shop.com

d_master
master
Reads
Writes
Total I/Os

per sec
0.2
1.1
1.3

Device Semaphore Granted


Device Semaphore Waited

per xact
0.5
2.5
3.0

count
13
66
79

% of total
16.5 %
83.5 %
0.9%

1.3
0.0

3.0
0.0

79
0

100.0 %
0.0%

1.2
0.0

2.8
0.0

73
0

n/a
0.0%

Network I/O Management


Total Network I/O Requests
Network I/Os Delayed
Total TDS Packets Receive
Engine 0
Total TDS Packets Rec'd

per sec
0.2
0.2

per xact
0.4
0.4

count
11
11

% of total
100.0 %

Total Bytes Received


per sec
Engine 0
5.4
Total Bytes Rec'd
5.4
Avg Bytes Rec'd per Packet
n/a

per xact
12.4
12.4
n/a

count
322
322
29

% of total
100.0 %

Total TDS Packets Sent


Engine 0
Total TDS Packets Sent

per sec
1.1
1.1

per xact
2.5
2.5

count
64
64

% of total
100.0 %

Total Bytes Sent


Engine 0
Total Bytes Sent

per sec
484.4
484.4

per xact
1116.4
1116.4

count
29026
29026

% of total
100.0 %

Avg Bytes Sent per Packet

n/a

n/a

453

n/a

(return status = 0 )

*

. 
, 
.
1. sysindexes .
2. syslogs (.. ) 
(deferred) .

Replication Server.
3. tempdb. , group by
order by ,
.
4. .
(spinlocks), 
 ,
.
5. , . 
, . , 
, . SQL Server

www.books-shop.com

System 11
.
6. ( ).
7. , (
).
8. ( ,
).
9. sysobjects, syscolumns sysprotects ( "
(ad hoc) , .. , ). "
.
.
10. "
16 .
11. ", ",
".

, "
, , "
. ,
.
,
,
.
.
, "
, "
. , ,
.
"
(update in place). "
SQL Server
, . "
. , , ,
. .
, , "
, . ,
, ,
. "
? "
?
? . "
, "
, . ,
, .
, SQL Server.
, .
,
. "
". , , "
, , "
, SQL Server.
, "
SQL Server. SQL Server "
. ,
.

%RRNVVKRS

piracy@books-shop.com


, "
, . "
, , ,
, . , "
,
"?
, ?
. "
,
. ,
. , ,
.
, "
. "
. , .
, , "
. . ,
, . "
, "
. , , ,
.
, "
.
, "
. ,
. "
.
, , "
. isql "
,
. , , "
.
, .
. ,
. , "
, , . "
,
( ). ("
, "
) .
, . "
, .
, ,
( ), "

.
OLTP" "
. "
, .
, , , "

DSS",
(. ).
, "
, "" "
( ). ,

www.books-shop.com

(. ). "
, .
". "
.
" , "
. , " "
, (
). ,
,
. "
(. 11).
, "
. "
, OLTP"
, .
, , "
, (. 9).
, "
. "
. ,
. "
, (, , ) .
, ,
.
+
(, ). +
, . , +
, +
+, .
,
: 100%
+
noserial ( +
). . (
serial , . 8). +
. , +
,
, noserial. ,
+
.
, , +
, "".
, . , +
+
. ,
,
. ,
+
.
, +
, , +
.

www.books-shop.com


, "
SQL Server "
, .

. , "
, , "
.

. , "
, . "
.

, . , , "
. "
, .. , ,
,
. , "
. "
. ",
. , "
, "
,
.
, , .
, ,
, 20%
. , "
, , "
. ( set
showplan

" SQL Server".) "
, , "
OLTP".
. "
, .
,
. ,
, . , "
"
. , (
),
. ,
.
,
. "
, ,
. ,
, "
, . ( sp_who
, .) "
. ,
,
, . ,
.
, . "
"
.
.

www.books-shop.com

. "
"
, .

. , , "_"
". , , "
, .
, ,
. "
. "
(.. ) _ = 999990,
,
( 10 "
). _ = 10.
, , "
. "
.
. "
, , "
, ,
. , "
. , , "
.
with recompile, "
. "
. ,
"
.
,
' ,
. , "
, .
"
. . "
.
,
. , , "
. "
.
"
.
, "
.
,
. SQL Server "
, ( "
). ,
, , , "
.
(distribution page), .
update statistics sp_re"
compile
. , sp_recompile "
, "
.
, (
). "
"
.

www.books-shop.com

. ,
. "
, ,
. ,
( , update
statistics , ). "

select object_name(ld) from sysindexes where distribution >> 0 and indid > 0 and id > 100
sysindexes distribution, (
). id > 100 "
. , ,
indid = 0. ,
. indid > 0.
+
. ,
. +
: .
, ,
. ? , .+
.
System 11 SQL Server.
System 11 ,
(id) . , +
, +
, ,
.
. , SQL
Server .

"
. "
,
.
dbl, . "
system default, (logsegment); "
(ncindexes)
dbl. ,
. "
"
. , ,
.
.
, "
. "
, . ,
,
. "
.
,
. , ,
"
. , , "
, ,
.

www.books-shop.com

ncindexes. , , "
, "
. , ,
,
. ,
, . "
, . ", "
.
,
ncindexes " , "
". , , , "
,
. , "
.
" ,
.
system/ default.

. , "
.
ndndexes . "
system/ default ( ,
). ,
.
, , , "
,
.
,
. "
. "

.

, "
.
, . ,
"
, . , "
,
. "
. " ", "
,
.


. "
. .
, "
( "
).
, , ,
. . ", "
, , dbcc"
.
. ",

www.books-shop.com

. "
. .

. ,
. "
, "
.
, .
"
. ,
. , "
.
, ,
. ,
.
. ,
. , , "
.
, ,
.
.
, (. . 10.1).
, "
, "
. dbcc"
, ,
.
, .
,
(. 9).

OLTP+

N

.
, .
,
.

(4 ).

( ).
,
.
,
.
,
.

(N+1)+

(N+2)+

(N+)+

(N+4)+

(N+5)+
IL _

_ _
__

. 10.1. OLTP*

www.books-shop.com

"
, "
. , ,
"
. , "
, OLTP"
. ,
. ,
.

, "
. "
OLTP".
, , "
. "
. , ,
.
. , "
"
,
.
OLTP""
. ,

. "
, "
OLTP". ,
.
"
.
. , "
,
, "
, . (, , "
, . ,
OLTP" .) , "
, " .

.

OLTP". "
, OLTP".
OLTP"
.
, "
. "
.
, OLTP"
"
. "
.
, "
. , "
.
UNIX . System 10/11
. "
SQL Server. ,
192221

www.books-shop.com

, "
.
OLTP" "
, . OLTP" "
,
. , "
. "
, .
,
.
( , "
load database load transaction
.) , "

. "
, ..
. , "
(. . 10.2).
1) ,

2)
,

3} ( )

. 10.2.

"
.
"
OLTP" . "
, ,
OLTP" . , "
"
, .
, .
,
( ). ,
OLTP" . , "
. OLTP" "

.

OLTP", "
. "
,
.

www.books-shop.com

, "
,
. "
. ,
.

. "
, . , "
.
, , "
master. "
. .
master "
.
.
,
, . "
, "
OLTP".
. "

. , "
. . "

Replication Server. "
OLTP",
. "
.
OLTP" "
. . ,
OLTP""
. ,
OLTP".

"
, , "
.
, . "
, . ,

. "
,
. , "
( SQL Monitor) .
. "
" .
"
. "
"" .
,
. ,
, "
.
.
, ,
( ) .

%RRNVVKRS

piracy@books-shop.com

.
, "
.

.
SQL Monitor
SQL Monitor Sybase, SQL Server "
. "
. SQL Monitor
11.0.1 ,
. SQL Monitor 11.0.1 SQL Server, 4.9.2
System 11. "

SQL Server System 10 System 11. , "
SQL Server System 11.
SQL Monitor 11.0.1 "
, "
.
, SQL Monitor.
SQL Monitor : ,
SQL Server , , "
, . "
SQL Monitor , ,
.
SQL Monitor , "
dbcc memusage, .
sqlmon ( SQL Monitor) "nomem.
SQL Monitor "
. ,
SQL Monitor
, . "
SQL Monitor.
, 20 "
"2 0. "
buildmaster .
SQL Server. ( "
. SQL Monitor Server
Supplement.)
SQL Monitor . , , "
"
, .
.
, , "
, . , "
, ,
" . "
,
, . "
.
SQL Monitor "
. 60 "
.
.
"
. , , "
.
,

www.books-shop.com

,
, "
.
SQL Monitor , "

.
(. ). , SQL Monitor
. SQL Monitor , "
, .
SQL Monitor , , "
.
SQL Monitor (Main Window)
, . , sglmon
SQL Monitor "nomem,
.
* (Cache)
, " . "
" " ,
, , "
, . , "
, , " ,
" .
* , SQL Server System 11 (Data Cach)
" "
", .
/ (Device I/O)
.
"
.
, "
, , ,
.
, SQL Server System 10 11 (Network Activity)
" ,
..
, SQL Server System 10 11
(Object Lock Status)
, "
, , ..
* , SQL Server System 10 11
(Object Page I/O)
" "
. SQL Monitor "
. sp_sysmon.
(Performance Summar)
SQL Server
, , ,
", .

www.books-shop.com

(Performance Trend)

, Performance Summary.
(Process Activit)
"
" .
(Process Detail)
.
(Process List)
"
. sp_who.
(Process Lock Activity)
.
(Stored Procedure Activity)
.
(Transaction Activity)
, "
. , ,
(update in place).

SQL Server
"
SQL Server.
. sp_monitor "
, .

sp_monitor. : "
, , ("
' )
sp_monitor. , "
.
, sp_monitor
(total_write) 3472865, 3472895(30).
seconds ( , sp_moni"
tor) 28. , 28
30 , 1 .
cron", sp_monitor "
.
, , "
.
1> sp_monitor
2> go
_
last_run
Apr 1 1995 1:20PM
cpu_busy

18489(0)#0%
packets_received
740556(10)

current_run
Apr 1 1995 1:21PM
io_busy
_

74797(l)#2%
packets_sent
1056871(10)

seconds
35
idle

1707049 (34) #97%


packet_errors
0(0)

www.books-shop.com

total_read
2141401(2)
(return status = 0)

1> sp_monitor
2> go
last_run
Apr 1 1995 1:21PM
cpu_busy
18491(2)#7%
packets_received
740562(6)
total_read
2142628(1227)
(return status = 0)

total_write
3472865(83)

total_errors
0(0)

connections
19377(1)

current_run
seconds
Apr 1 1995 1:22PM
28
io_busy
idle
74801(4)#14%
1707072(23)#82%
packets_sent
packet_errors
1057195(324)
0(0)
total_write
total_errors
connections
3472895(30)
0(0)
19378(1)

.
, SQL SQL",
set showplan. ,
,
.
"
. "
,
.
" "
, . "

. .
, 200
, .
"
.
"
. 200 "
" . ,
. , "
, .
, "
set showplan. "
.
C. , "
. set showp"
lan set noexec.
D. " ( ,
" "), set statistics io
on set statistics time on. "
.

www.books-shop.com


"
,
. , , "
. ,
, , , , "
. "
.

""
, .
" , ,
. "
.
""
. "
, .
, ..
, ,
. " " "
, SQL Monitor "
. ,
"procedure cache percent" sp_conf igure.
20%. , " 20% "
, ,
. , "
. , "
.

, "
" .

(Solid State Device, SSD) "

. , "
, , "
. ,
, . SQL Monitor "
.
tempdb, "
, . "
,
.
,

, "
. "
(. 8.) tempdb.
, "
. " "
tempdb. ,
tempdb. , tempdb "
, . "
tempdb ,
, .

www.books-shop.com



"
( . 8). , ,
"
.
.

, (, , ) "
. , , "
.
.
A. ,
.
SQL Monitor. , "
,
. "
"
. Solaris
,
(. 8). "
. ,
, .
B. SQL Server
. ,
. , "
"
.
. , "
. , "
, .
, "
. , "
,
.
vdevno SQL Server 4.9.2
System 10
SQL Server System 11.
, SQL Server
". , "
vdevno. "
" vdevno = 10,
0 9.
1, 10.
. ,
vdevno, , disk init
. , ,
, . ,
.
"
.
"
.
, "
.

www.books-shop.com


"
. . "
, ,
. ,
, dbcc", "
,
, "
.
. , , "
, .

www.books-shop.com

11


SQL Server

SQL Server


:
:

www.books-shop.com


. "

, ... "
, .
, "
.
.
. .
, +
. ,
, +
. .
, :
" , ?" . +
. , +
. ,
.
"
, "
.
2 , "
. , "
, ,
, .
, , .
, :
.
SQL Server
SQL Server. SQL Server
System 10 System 11 , "
. " "
,
. . "
"
.
. ,
. , "
, ".
,
.
SQL Server System 11 ( )
, . System 11 "
, SQL Server 4.9.2
System 10.

"
.
,
. "
, . .
"
. , "
.

www.books-shop.com

OLTP*
"
(On"Line Transaction Processing, OLTP).
, ,
,
..
, "
, .

, "
, "
. , , ,
. , "
,
, "
.
, .
,
. "
, "
OLTP", ,
. ,
.
( )
OLTP" "
,
, (Decision Support Server, DSS). DSS""
OLTP", , "
. ,
DSS" "
. DSS"
( "
). "
. DSS"
OLTP" .
, ,
. ,
"
, DSS".

OLTP" "
. , "
. ,
,
. , , "
, ,
. "
OLTP". , "

, .
, " "
.

%RRNVVKRS

piracy@books-shop.com


"
,
.
, "
. ,
.
DBCC*
,
"
. dbcc"
, ,
.
"
. , "
. , DBCC",
, dbcc", "
, ..

, "
. "
, .
. ,
, "
"
. ,
. DBCC". "
"
, .

(Replication Server) . "
, Sybase "
, SQL",
. ,
. ,
SQL Server , "
, .. "
SQL Server. ,
, .
"
. (stable queues)
"
. ,
"
.

,
. "
. "
",
. , "
, "
. , ,
.

www.books-shop.com

, ,
, .
. "
"
,
.

,
SQL Server . "
, ,
.
. , "
.
, "
.
, "
. "
.
. , "
, ,
.
, .

" "
. . "
,
. "
, . , "
,
. , "
.

,
. , ,
. (. "
8). "
, ,
, "
. "
. ,
. ,
, , .
, (logsegment)
, "
. (, , ) "
.
(, )
" . ,
, ,
, , , "
. ,
. "
.
"
, , .

www.books-shop.com


, "
( "
. 8).
, , "
. "

. , "

, . "
,
, .. , "
.

"
, .
.
"
, () .
, "
.
10" , . 4,2"
,
. "
.
, ,
. "
. "
,
.

.
. "
, "
" .
, . "
(. 10) ,
". "
". ,
" , . "
,
. "
,
.
, SQL Server System 11 "
, . System 11
, ", "
". , "
System 11, , SQL
Server 4.9.2 System 10.


, , "
. ,
SQL Server , ,

www.books-shop.com

, , , "
.. "
.
(. 13), "
.
"
. ,
.
, .. "
, , 10% "
.

,
. ,
. ", "
, , .
,

(. 9). , "
, "
.
.
, .


(. 9).
. "
.
. "
, . "
,
, . "
. "
,
. , , ,
. ,
, .
"
. , "
.
"
,
.
. "
, . ,
. "
.

www.books-shop.com

+
,
. , +
. ,
. ,
, +
, .
, .
, +
+
. .

, , +
.

"
.
. , , "
, ,
. 120% "
.
. , +
+
. ,
+
. : +
,
. ,
.
,
.
, , +
. , +
. ,
.
, "
,
. "
. "
.

, "
.
. "
, , "
, . ,
10" 70
. , ,
.
? , "
.

www.books-shop.com



.

. , 10 "
, , "
, .
, SQL Server, .. "
, .
( , "")
, , "
"
. .
, "
. . "
.
,
, ,
. "
, ,
. ,
Transact"SQL. , "
. ( , , "
.) , SQL Server
.
" , SQL BackTrack DataTools ( .
9).

"
. ,

.
,
.
.
,
,
(, "
). , "
. ", ,
.
, "
, . , ,
. , "
.

Replication Server
. "
(stable queues),
,
. SQL Server, "
"
. ,
. , "
"
(, " ).

www.books-shop.com

, , "
. , "
, Sybase Replication Server
,
. , "
.

.
, , "
.
(, ) ,
. , "
, .. . "
,
.
.
,
. , "

( ). . "
, , "
.
:

. ,
. ,
OLTP" .
, , "
.
, .
OLTP+
OLTP" "
, "
. ,
. "
OLTP", "
, ,
. OLTP", "
, "
.
, .
OLTP" 17 ,
.
12 , 8 , 4 "
. 4 "
. ,
"
, . ,
, 5
100" , 4 "
. ( "
).
,
. OLTP" 16
2,4 , 4 .

www.books-shop.com

4" . "
( "
, ).
,
32 , 8 ( ) . "
"
. 24 , 12
, 12 . "
.
, .
OLTP" "
, ,
"
. , ,
. "
, . "

, " ,
.
( , ) ,
, .

"
, . " "
", , " ",
.
, .
"
. "
.
, "" , "
, . "
,
OLTP", .
, , "
, "
..
"
.
, "
32
. "
"
disk init
p_dbcreate. .
, "
. "
.
"
OLTP".
( )
, ( "
Decision Support Server, DSS)
OLTP". , DSS"
, OLTP", "
. "
OLTP", . ,

www.books-shop.com

, . "
, OLTP"
. . ,
DSS" "
, OLTP", .
DSS"
, . "
DSS"
OLTP". DSS"
, OLTP". "
, OLTP"
DSS". DSS" 20
, 8 " , 12
. , DSS" "
master. "
DSS" OLTP". ,
,
. DSS" "
OLTP" (,
p_dbcreate), , "
DSS" ( "
14).
DSS"
. DSS" ,
, , DSS" "
, .., . "

. , DSS" "
. DSS", ,
OLTP""
.

"
. ,
,
OLTP". "
OLTP" (
) .
, "
, ,
. "
( . ) , "
.
, "
, "
.
, 20
, 8 , 12
. , "
,
OLTP". ,
OLTP", . "
. "
. ,
, .
, "
OLTP" . DSS",
,

www.books-shop.com

OLTP". , "
, "
. ,
p_dbcreate
OLTP". , "
,
OLTP".
"
. ,
.

. "
, OLTP", "
.

,
" .
, , "
. , "
(")
. "
"
. ,
(
).
OLTP" . "
,
.
.
, "
.
"
. 20
8 12" . "
,
,
, p_dbcreate.
, "
.
DBCC*
"
DBCC".
(database
consistency checks, dbcc), "
. (
dbcc")
. dbcc" "

( dbcc" . 9). dbcc"
DBCC". ,
, , "
. SQL Server
,
.
DBCG". , "
, , .

%RRNVVKRS

piracy@books-shop.com

DBCC"
OLTP" , "
dbcc" . DBCC" 20 "
,
(8 /12 ). ,
, OLTP" DBCC" "
, .
DBCC"
OLTP" (, p_dbcreate),
,
DBCC".
DBCC"
, dbcc" .
dbcc" , "
.

"
, .
, . "
, SQL Server 4.9.2 System 11,
4.9.2.
4.9.2 SQL Server "
4.9.2. , ,
SQL Server (. 13).
, "
, SQL Server System 10
.
5 , SQL Ser"
ver 4.9.2 10 . , SQL Server "
(
DBCC").

.
, .

Replication Server
. "
, "
, , ,
.
SQL Server "
. "
.
,
, Replication Server. "
(stable queues) . "
, 10
, 4 , 6 "
Replication Server. ,
. ; "
;
;
.
, "
.

www.books-shop.com

"

. , "
"
.
:
, "
OLTP" .

. , OLTP"
.

OLTP",
, , .
.
"
, "
, . , ( )

. 8 , ,
, 12 .
50%. "
"
.
, , 2,5 5 . "
, . "
, , .

, OLTP". "
. default, system logseg
ment,
ncindexes data. , "
.
, "
. , "
(
, 16 ). 8 ,
Solaris 4" "
".
. default, system, logsegment, "
ncindexes, .
. "
(
). "
, ,
.
, . ",
. ", "
.
.
"
" .

www.books-shop.com


.
, "
,
, .
, "
, . "

,
. , , SQL Server
. "
, "
.
. 12 " "
, (. 8).

.
, , , ,
, , "
.
, 128 (
500 ). , ,
.
, ""
. "
, . ,
, "
". "
"
SQL Monitor . "
"procedure cache percent",
sp_configure. , 20%. "
" 20% , "
, . "
, " , "
.

,
. (. ), "
; "
(
); SQL Server ,
;
. , "
, . , "

. , . "
, .

"
, .
5, 2 1 , 8 . "
, 8 "
.

www.books-shop.com

, "
.
SQL Server System 10,
Backup Server,
. "
. , "
", ,
. "
.

.


.
, , "
, .
, "
.
.
,
. "
, .

, "
. "
.
"
. "
150%
. 800 , "
1,2 . ,
.
, . "
, "
.

. cocaa . ,
.
. +
.
. ,
,
. + , , +
. .
, +
, . ,
, , +
. , ,
.

"
. ,
, "
.

www.books-shop.com

, . ,
.

, "
. "
(. 9).
. , "
. "
, , ,
,
.
. 50% "
. 6 (
12 , ).

"
. ,
, . "
"
. ,
DBCC" , "
.
dbcc". DBCC", "
20 , 12 "
, 8 . ,
DBCC" . "
DBCC" OLTP"
.
DBCC". 5 . "
DBCC" 5 8 "
. ,
, "
DBCC".
,
, , ,
. , "
.
. "
, "
, . "
" .
, "
.

(Replication Server) .
"
OLTP".


, "
. , , "
, . "
.

www.books-shop.com

, ,
. , "
, "
.
.
, "
. ,
. ,
, . "
. (
SQL Server 4.9.2, 14 , "
.) "
, , .
, .

, OLTP",
8 . , "
, , "
. " Replication Server
.
OLTP" .
"
, . "
164 .

. . "
, "
. 1 ,
"
1 (
). ,
. ,
.
, , ,
, .
, "
.
+
OLTP+, 48 .
32 .
,
, . +
, .
, . , +
. (
.)


"
. . "

.
.

www.books-shop.com

. , "
, . "

. "
, , . "
.

www.books-shop.com

12

SQL Server

SQL Server


SunOS Solaris

SQL defncopy

sysusages



SQL Server
b

1105:

www.books-shop.com


SQL Server "
. , "
.
SQL Server
SQL Server 4.9.2
sp_helpdb sp_helpsegment SQL Server "
4.9.2 . ,
. SQL Server 4.9.2 SunOS,
Solaris .
SQL Server System 10
, SQL Server System 10 SunOS, Solaris,
,
sp_helpdb sp_helpsegment. "
SQL Server 4.9.2 System 10
(last"chance threshold).
Sybase SQL Server (Sybase SQL Server System
Administration Guide) System 10.
SQL Server System 11
SQL Server System 11 Solaris, "
Solaris. System 11 c SQL
Server 4.9.2 ( System 10, System 10 "
4.9.2) "
.
Sybase SQL Server System 11 ( "
).

, "
. "

, . , Sybase "
, . ,
(logseg
ment). . "
, print
raiserror .
SQL Server .
, ;
; ,
.
(last"chance thresholds) "
(logsegment) .
"
dump transaction. "
,
. ("
logsegment) "
.

sp__thresholdaction. "
, ,

www.books-shop.com

sp_thresholdaction.
sp_modifyth"
reshold. , Sybase sp_thres"
holdaction. , ,
. dump
transaction ,
print raiserror. "
sp_thresholdaction sybsystemprocs,
. "
, . "
, SQL Server
System 10 System 11. ,
System 10 System 11. SQL Server 4.9.2
System 10 System 11 (. 13)
.
select lct_admin ("lastchance", db_id())
"
. SQL Server System 11:
1> use psychodb
2> go
1> sp_helpthreshold
2> go
segment name
free pages
last chance?
threshold procedure
logsegment
744
1
sp_thresholdaction
(1 row a f f e c t e d , return status = 0)
, psychodb , "
. :
1> use psychodb2
2> go
1> sp_helpthreshold
2> go
segment name
free pages
last chance?
threshold procedure
(0 row affected, return status = 0 )
? , "
System 11 SQL Server System 10, "
. System 10,
System 11 . , System 10 "
SQL Server4.9.2. System 10 psychodb2
, "
System 11.
.
"
psychodb2.
select lct_admin ("lastchance", db_id())
db_id() , , "
. "
. .
sp_helpthreshold "
. ( sp_helpthreshold
select.) psychodb2
db_id() = 9. select 1232,
, . , "
.

212221

%RRNVVKRS

piracy@books-shop.com

1> select lct_admin ("lastchance", 9)


2> go
1232
(1 row affected)
1> sp_helpthreshold
2> go
segment name
free pages
last chance?
threshold procedure
iogsegment
1232
1
sp_thresholdaction
(1 row a f f e c t e d , return status = 0)
, , psychodb2 "
. ,
, sp_helpthreshold:
sp_helpthreshold <_>
1> sp_helpthreshold Iogsegment
2> go
segment name
free pages
last chance?
threshold procedure
Iogsegment
1232
1
sp_thresholdaction
(1 row a f f e c t e d , return status = 0)
select :
1> select lct_admin ("lastchance", 13)
2> go

(1 row affected)
. "
, db_id() = 13.
, , "
, "
. ,
, select
. , "
,
, , , .
.
"
, "
.
, " insert,
update delete. sp_who
"suspended" ( ).
. "
, "
.
,
.
" ."
,
select lct_admin("unsuspend", db_id())
. "
, " , " "
.
.
,
. ,
1105 "
.

www.books-shop.com

,
,
.
sp_dboption <__> , "abort tran log on log full", true
. "
, "
, .
, "
. "
. "abort tran log on log full"
, , "
.
"
. 15
. "
.
.
Sybase SQL Server "
,
sp_threeholdaction. "
, "
).
"
Sybase SQL Server.

SQL Server
. , "
SQL Server, Open Server, , "
Backup Server Replication Server.

.
, , "
SunOS, . ,
SQL Server System 11 SunOS, "
Solaris. ""
SunOS Solaris".
, "
"master", "query" "console" ( , "
). ,
.
", SQL Server. "
, . ,
DSLISTEN,
dataserver ( "s, . 14).
, "master",
. , "
( "console"), . "
, SQL Server (.
. 12.1), "master", "query" "console". "
, SQL Monitor, "
<_>_SV, "master" "query". ( ,
SQL Server System 10 11 , "
"console" (. 13)). , SQL Server
, sysservers . "
, ,

www.books-shop.com

#
DDSDBA1
query tcp sun+ether machinel 1025
master tcp sun+ether machine1 1025
console tcp sun+ether machinel 1026
#
DDSDBA2
query tcp sun+ether machine2 1025
master tcp sun+ether machine2 1025

#
DDSDBA1
query tcp sun+ether machinel 1025
#
DDSDBA2
query tcp sun+ether machine2 1025

. 12.1. ( SunOS)
. "
sysseruers,
select @@servername
", SQL Server, "
. " , "
.
, ,
. , "
SYBASE. (, SYBASE ,
"interfaces".) "
, SQL Server "query" "
.
", ", (log in) SQL Server, "

. (.
. 12.1). , , ,
DSQUERY. , isql
, , "
DSQUERY.
. , ,
DSQUERY ( ) "
.
SQL Server
( + ) "
.
.
. "
, , ",
. ,
, "
, .
, "
.

www.books-shop.com



DDSDBA1_TESTING
query tcp sun+ether machine1 1925
master tcp sun+ether machine1 1925
console tcp sun+ether machine1 1926
#
DDSDBA2
query tcp sun+ether machine2 1025
master tcp sun+ether machine2 1025

#
ODSDBA1
query tcp sun+ether machine1 1025
#
DDSDBA2
query tcp sun+ether machine2 1025

. 12.2. ,
DDSDBA1 ( SunOS)
, . , "
. ,
. ,
? "
dbo. "
,

.. "
, (. . 12.2).
DDSDBA1_TESTING,
1925 machine1. "
,
. , DDSDBA1_TESTING, "
, "
.
, . "
, ,
DDSDBA1 1025 machine1.
,
. , . " "
"
. ,
, . "
,
, .

DDSDBA1_TESTING, ,
DDSDBA1 ( , "
, ). , "
. DDSDBA1_TESTING
"server not found in interface file" "
".

www.books-shop.com

304

12

,
.
, "master", "query" "console" "
. "
. ,
. " , "
. , "
. ,
ftp, "
(binary mode). ,
, "
. , "
, , , .
SunOS
Solaris
, SunOS Solaris,
. ,
Solaris .
"
. Solaris
sybtli ( $SYBASE/bin). , sybinit System 10 (
sybconfig SQL Server 4.9.2) "
SunOS, Solaris. , sybinit System 11 "
Solaris (, , SQL Server System 11
SunOS). , "
,
.
Sybase SQL Server
SunOS. Solaris,
+
. ,
Sybase.
SunOS Solaris. .
Solaris
, "
Solaris. SQL Server System 11 Backup
Server, SQL Server 4.9.2

## THEBIRDS11 on thebirds
##
Services:
##
query tcp (5001)
##
mastertcp (5001)
THEBIRDS11
query tli tcp /dev/tcp \x000213898196c4510000000000000000
master tli tcp /dev/tcp \x000213898196c4510000000000000000
## THEBIRDS11_BCK on thebirds
##
Services:
##
query tcp (5002)

##

master tcp (5002)

THEBIRDS11_BCK
query tli tcp /dev/tcp \x0002138a8196c4510000000000000000
master tli tcp /dev/tcp \x0002138a8196c4510000000000000000
#

# THEBIRDS492 on thebirds (129.150.196.81) using tcp

www.books-shop.com

#
services: query (1025) master (1025) console (1026)
#
THEBIRDS492
query tli tcp /dev/tcp \x000204018196c4510000000000000000
master tli tcp /dev/tcp \x000204018196c4510000000000000000
console tli tcp /dev/tcp \x000204018196c4510000000000000000
Solaris
SunOS
SunOS
Solaris:
THEBIRDS492
master tli tcp /dev/tcp \x000204018196c4510000000000000000


0002
SunOS
0401
1025 (0401 = 4*16*16 + 1*1)
81
IP 1
129 (81 = 8*16 + 1*1)
96
IP 2
150 (96 = 9*16 + 6*1)
4
IP 3
196 (4 = 12*16 + 4*1)
51
IP 4
81 (51 = 5*16 + 1*1)
, SunOS
THEBIRDS492
master tcp sun"ether thebirds 1025
thebirds IP 129.150.196.81.
SunOS
Solaris
, 
SQL Server System 11. System 11 SQL Server
Solaris, , System 10.
THEBIRDS_BCK
master tcp sun"ether thebirds 1026
thebirds IP 129.150.196.81:


1026
0402 (1026/16*16 = 4, 1026 " (4*16*16) = 2)
129
81 (129/16 = 8, 129 " 8*16 = 1)
150
96 (150/16 = 9, 150 " 9*16 = 6)
196
4 (196/16 = 12, 196 " 12*16 = 4)
81
51 (81/16 = 5, 81 " 5*16 = 1)
, 
(1026 > 0402).
SunOS
SunOS, 
Solaris. SQL Server System 11
SunOS, , System 10 SQL Server .
#
THEBIRDS11
query tcp sun#ether thebirds 5001
master tcp sun#ether thebirds 5001
#
THEBIRDS11_BCK
query tcp sun#ether thebirds 5002
master tcp sun#ether thebirds 5002

www.books-shop.com

#
THEBIRDS492
query tcp sun#ether thebirds 1025
master tcp sun#ether thebirds 1025
console tcp sun#ether thebirds 1026

"
(Remote Procedure Calls, RPC) RPC"
.
, "
.
,
(. . 12.3). "
, , sp_configure "remote access", 1.
", .
, "
.
. ,
. RPC"
, ,
.
, 
sysseruers (. . 12.3). , ,
.
1> sp configure
2>go
name

minimum

maximum

4
0
0
0
0
0
0

256
1
2147483647
2147483647
2147483647
2147483647
2147483647

devices
remote access
remote logins
remote sites
remote connections
pre+read packets
upgrade version

1> select * from sysservers


2>go
srvid srvstatus srvname srvnetname
0
1
2

0
1
1

config_value

30
1
64
10
128
0
491

run_value

30
1
64
10
128
3
491

sysservers

serverB SERVERB
serverA SERVERA
serverC SERVERC

1 > select * from sysremotelogins


2>go
remoteserverid remoteusemame
NULL
NULL

sysremotelogins
suid

status

+1
+1

. 12.3.

www.books-shop.com

sysseruers .
. srvname
. () srvnetname "
. ,
( "servernamel"). sysseruers
servernamel "
, ,
.
, , Backup
Server. SQL Server System 10 System 11
. . "
SQL Server .
SYB_BACKUP SQL Server. ,
SQL Server, SQL Server "
SYB_BACKUP. SQL Server
sybinit (. 13) SYB_BACKUP srvname
srvnetname sysservers. (srvname)
SYB_BACKUP , (srvnet
) SYB_BACKUP. "
SYB_BACKUP
,
. , "
, SYB_BACKUP.
, ,
. "
(srvnetname) sysservers SQL Ser"
ver. <_>_B.,
_ SQL Server.
SYBJBACKUP (srvname sysservers) SQL Server "
<_>_B. (srvnetname sysservers).
,
. , , (srvname =
SYB_BACKUP), SQL Server.
", sysremotelogins , "
(remote logins), "
. . 12.3 suid = "1 status = 0.
, RPC" , "
, . "
.

RPC". "
, . "

sp_remotelogin , "
. , "
,
.
, , sysservers,
srvid, remoteserverid sysremotelogins.
sysservers
, . "
srvid = 1 sysservers. sysremotelogins remoteserve
rid = 1 suid = "1 status = 0.
", SQL Server, RPC", "
. sysservers srvid = 0
select @@servername (.. NULL).
; , , "
RPC" ,

www.books-shop.com

. sp_remotelogin
.
, isql "
execute server ... sp_who.
, . "
, isql
execute server A. . .sp_who. , , execute
. . . sp_who, sysseruers .
, , execute server ... sp_who
, sysseruers server . "
, (srvname) , "
. , srvnetname sysseruers,
. (
.)
SQL
defncopy
SQL"
.
SQL
create procedure <__> as
. , ,
create procedure
drop procedure <__> as
.
defncopy SQL" "
,
drop procedure create procedure ( drop trigger
create trigger), go.
sysusages
master sysusages .
. sysusages
.
(),
, , create database alter data"
base. sysusages "
,
( segmap).
sysusages .
,
sysusages. . 12.4 sysusages
.

dbid sysusages dbid sysdatabases "
(database name) "
. , dbid
sysusages . . 12.4 "
, db1 dbid= 4. ,
sysusages, (..
dbid), . dbl
sysusages. "
, .

www.books-shop.com

1> select * from sysusages


2>go
dbid segmap start size vstart

1
1
2
2
2
3
4
4
4

0 1536 4
1024 3588
1536
0 1024 2564
1024 51200 251658240
52224 51200 268435456
0 1024 1540
0 5120 201326592
5120 2560 218103808
7680 5120 201331712

7
7
1
3
4
7
3
4
3

sysdatabases

dbid database name


1
2
3
4

sysusages

master
tempdb
model
db1

low.
184549376
201326592
218103808
234881024

high
184733445
201510661
218287877
235132235

device_fragments
sd4f
sd4f
sd4g

status

cntrltype

738
738
738
738

0
0
0
0

size

usage

10 MB
10MB
5 MB

data only
data only
log only

device

segment

sd4f
sd4f

default
system

name phyname
sd4e
sd4f
sd4g
sd4h

sysdevices

/dev/rsd4e
/dev/rsd4f
/dev/rsd4g
/dev/rsd4h

. 12.4. sysusages

, sysusages ,
size. db1 5120, 2560 5120 2" "
. dbl, 12800 2" ,
25 .


vstart.
(vdevno), "
disk init. 2"
,
. ,
. sysusages Istart
, .
Istart sysusages "
. , dbl
Istart = 0 5120 , 0 (
Istart) 5119. , "
Istart = 5120 2560 ( 5120 7679)
.. .
( vstart). vstart

%RRNVVKRS

piracy@books-shop.com

sysusages . "
Istart,
vdevno, ,
.
. vstart "
vdevno .

. sysdevices. "
( "
) (low) (high)
. vstart sysusages,
, .
sysusages . ,
create database alter database,
sysusages,
. ,
,
sysusages, , . ( "
vstart sysusages
(low high) .)
db1 vstart = 201326592,
sd4f (low = 201326592, high = 201510661,
. . 12.4).

8.
, , sysusa
ges, . , "
, segmap.
sysusages
segmap . ,
segmap ,
. "
segmap
(. . 12.2).
. , "
"" , .. ,
, . "
segmap "
. .
12.2. segmap

system

000001

default

logsegment

000100

001000

16

010000

32 ..

100000

000010

,
( 12.2). segmap
, . "
system, default logsegment ( master) "
segmap = 7. ,

www.books-shop.com

logsegment, segmap = 4. , "


, 8
16, 32, 64, 128 .. segmap = 128 "
128 . , segmap "
(, 1 128). 3 (1+2), 4 8.

( tempdb)
sysusages, , "
. "
tempdb.
sysusages tempdb, "
master 2" tempdb ( "
). tempdb,
sysusages .
SQL Server (SQL Server Troubleshooting Guide).
sysusages
"
(. "
SQL Server " ).
!
1. Sybase. "
,
. , SQL Server,
.
2.
Sybase.
3. , , "
, "
.
4. "
.
sp_addsegment, sp_extendsegment sp_dropsegment "
sysusages,
, . seg"
map . "
, .
(, logsegment segmap = 4.) log"
segment , . "
create database alter
database (.. sysusages
, ) segmap 7 3 (.. "
system, default logsegment system default).
" , system default,
.
segmap = 4, .. "
, ,
, .
system default. "
dump transaction. "

, segmap,
, .
. ,
segmap = 4
, .

www.books-shop.com

sysusages.
, ,
.
. "
.
"
. Sy"
base, .
create database
for load. seg
= 3, segmap = 4 ( ,
create database log on). create database for
load, . , sp_addsegment,
sp_extendsegment sp_dropsegment,
. sysusages
segmap .
( ) "
, , . "
sysusages,
Istart sysusages, .
, vstart vdevno.
, "
disk init . Istart
, "
. Istart
segmap . segmap Istart.
db1. , create
database for load. sysusages , "
.
segmap . ,
sysusages ( ) "
, .. begin tran <_"
>, sysusages.
sysusages, dbid = 4, segmap = 3 "
Istart 0 5119. , dbl (. . 12.4)
segmap = 3 5120 (10 ).
" Istart 0 5119". " "
10
.
, , 7 3 , sysusages
. sysusages, "
dbl (dbid = 4), segmap = 4 Istart,
5120 7679, a segmap = 3 Istart, 7680 ( "
). "
.
,
sysusages.
sp_createeegment . "
.
p_dbcreate, "
for load "
sysusages (. 14).
.
,
. ,
. "
, "
p_dbcreate.
"
.

www.books-shop.com

load database sysusages


, "
sysusages. , sysusages, "
,
. ,
. ( ,
) "
. db1 10"
system default (segmap = 3). 5" , "
(segmap = 4), , , 10" segmap = 3.
"
, sysusages. ,
segmap "
. dbl 10
system default (segmap = 3); 5 (segmap = 4); 10
, system default. "
, . "
, ,
, .
,
, . ,
logsegment system default ( ).
, "
. default
, sysusages
(segmap = 4). "
, "
.

, ,
. sp_hel"
psegment. .
(sp_helpsegment <"
_>) , "
, 2" :
machinel: isql "Usa "STHEBIRDS11
Password:
1> use psychodb
2> go
1> sp_helpsegment
2> go
segment name
' status
0 system
0
1 default
1
2 logsegment
0
(return status = 0)
1> sp_helpsegment system
2> go
segment name
0 system

status
0

www.books-shop.com

device
cOt2dOs4
table_name
sysalternates

size
350.0MB
index_name
sysalternates

(return status = 0)
1> sp_helpsegment "default"
2> go
segment name
status
1 default
1
device
size
cOt2dOs4
350.0MB
table_name
index_name
psycho_actions
spray_idx

(return status = 0 )
1> sp_helpsegment logsegment
2> go
segment name
status
2 logsegment
0
device
size
C0t2d0s6
'
50.0MB
table_name
index_name
syslogs
syslogs
(return status = 0)

free_pages
21400
indid
1

free_pages
21400
indid
1

free_pages
25504
indid
0


SQL Server , 
. 

.
, .
SQL Server 
4.9.2, System 10 System 11.
1. SQL Server
2.
3.
4. master
5. master
6.
7.
8.
9. 
10.
11. ,

www.books-shop.com

SQL Server
SQL Server "
, (Emergency Bug Fix level, EBF).

.
, , ,
, , .

"
. ,
. ,
.
. ; "
(Sybase SQL Server Installation Guide) "
(System Administration Guide Supplement).
master
"
, master. 7, "
master
sysdevices. ,
. "
buildmaster , .
, master
" 0" ( , master "
vdevno = 0).
master
master ( "
)
. "
master .

,
.

,
sysservers. sp_addserver
local. , , "
"server is unnamed". , , "
sybinit,
RUN_<_>, .

(
) vdevno
.
"mirror: <__>".
+
, "
" . ,
". , "
, . ,
".
222221

www.books-shop.com


, ,
(roll forward) (roll back) 
. ., 
.

,

, .
, 
, .

SQL Server 4.9.2



/* ... */.
/home/DDSDBAl/errorlog 57 % more errorlog
/* 1) SQL Server */
00: 95/04/01 14:53:42.20 kernel: SQL Server/4.9.2/EBF 2825
Rollup/Sun4/OS 4.1.2/1/OPT/Sat Apr 9 10:25:53 PDT 1994
/* 2) */
00: 95/04/01 14:53:42.27 kernel: Logging SQL Server messages in file
'/home/DDSDBAl/bin/errorlog'.
00: 95/04/01 14:53:42.27 kernel: Using config area of disk for boot
information
00: 95/04/01 14:53:42.39 kernel: kdconfig: opening secondary master device
00: 95/04/01 14:53:42.43 kernel: Using config area from primary
master device.
/* 3) */
00: 95/04/01 14:53:42.69 kernel: Using 2048 file descriptors.
00: 95/04/01 14:53:42.69 kernel: Network and device connection limit is 2043.
00: 95/04/01 14:53:42.71 kernel: Dump/Load buffers configured with 8 pages.
/* 4) master */
00: 95/04/01 14:53:42.99 kernel: Initializing virtual device 0, "/dev/rsd4b"
/* 5) master */
00: 95/04/01 14:53:43.00 kernel: mirror: /dev/rsd5b
00: 95/04/01 14:53:43.00 kernel: Virtual device 0 started using
asynchronous i/o.
00: 95/04/01 14:53:43.10 kernel: network name ddsdbal, type sun#ether,
port 1025
00: 95/04/01 14:53:43.23 server: Number of buffers in buffer cache: 5393.
00: 95/04/01 14:53:43.23 server: Number of proc buffers allocated: 1797.
00: 95/04/01 14:53:43.23 server: Number of blocks left for proc
headers: 1943.
00: 95/04/01 14:53:43.81 server: Opening Master Database ...
00: 95/04/01 14:53:44.17 server: Loading SQL Server's default sort
order and character set
/* 6) */
00: 95/04/01 14:53:44.19 kernel: network name machinel, type
sun#ether, port 1025
'
00: 95/04/01 14:53:44.26 server: Recovering database 'master
00: 95/04/01 14:53:44.33 server: Recovery dbid 1 ckpt (2391,23)
00: 95/04/01 14:53:44.33 server: Recovery no active transactions
before ckpt.
/* 7) */
00: 95/04/01 14:53:44.59 server: server name is 'ddsdbal'
00: 95/04/01 14:53:44.65 setver: Activating disk 'sdld'.
/* 8) */
00: 95/04/01 14:53:44.65 kernel: Initializing virtual device 18, "/dev/rsdld"

www.books-shop.com

00: 95/04/01 14:53:44.65 kernel: mirror: /dev/rsd10e


/* 9) # */
00: 95/04/01 14:53:44.66 kernel: Virtual device 18 started using
asynchronous i/o.
00 95/04/01 14:53:44.66 server: Activating disk 'sdle'.
00 95/04/01 14:53:44.66 kernel: Initializing virtual device 19,
"/dev/rsdle"
00: 95/04/01 14:53:44.67 kernel: Virtual device 19 started using
asynchronous i/o.

/*

10) */
00: 95/04/01 14: 53 :44. 84 server: Recovering database 'model'
00: 95/04/01 14: 53 :44. 86 server : Recovery dbid 3 ckpt (266,25)
00: 95/04/01 14: 53 :44. 86 server: Recovery no active transactions
before ckpt .
00: 95/04/01 14: 53 :45. 01 server : Clearing temp db
00: 95/04/01 14: 53 :57. 38 server: Recovering database 'dbl'.
00: 95/04/01 14: 53 :57. 43 server: Recovery dbid 4 ckpt (6401,1)
oldest tran= (6401 ,0)
00: 95/04/01 14:53 :57. 50 server: 1 transactions rolled forward.
00: 95/04/01 14: 53 :57. 84 server: Recovering database 'db2'.
00: 95/04/01 14: 53 :57. 90 server: Recovery dbid 5 ckpt (51206,23)
oldest tran= (51206 ,22)
00: 95/04/01 14:53 :57. 91 server : 1 transactions rolled forward.

00: 95/04/01 14:53:57.84 server: Recovering database 'dbn'


00: 95/04/01 14:53:57.90 server: Recovery dbid 5 ckpt (51206,23)
oldest tran=(51206 ,22)
00: 95/04/01 14:53:57.91 server: 1 transactions rolled forward.
00: 95/04/01 14:59:42.38 server: Recovery complete.
/* 11) , */
00: 95/04/01 14:59:42.38 server: SQL Server's default sort order is:
00: 95/04/01 14:59:42.38 server: 'bin_iso_l' (ID = 50)
00: 95/04/01 14:59:42.38 server: on top of default character set:
00: 95/04/01 14:59:42.39 server: 'iso_l' (ID = 1).
SQL Server System 10

/* ... */.
/home/DDSDBAl/errorlog 53 % more errorlog
00:95/04/01 14:26:02.69 kernel Using config area of disk for boot
information
00:95/04/01 14:26:02.89 kernel Using config area from primary master device.
/* 1) SQL Server */
00:95/04/01 14:26:03.05 kernel SQL Server/10.0.2/P/Sun4/OS
4.1.x/l/OPT/Fri Oct 28 10:22:26 PDT 1994
/* 2) */
00:95/04/01 14:26:03.07 kernel Logging SQL Server messages in file
'/home/DDSDBAl/errorlog/errorlog'.
/* 3) */
00:95/04/01 14:26:03.07 kernel Using 2048 file descriptors.
00:95/04/01 14:26:03.08 kernel Network and device connection limit is 2045.
/* 4) master */
00:95/04/01 14:26:03.45 kernel Initializing virtual device 0,
'/dev/rsd4h'

www.books-shop.com

/*

5) master #>
master */
00: 95/04/01 14:26:03.46 kernel Virtual device 0 started using
asynchronous i/o.
00: 95/04/01 14:26:03.46 server Disk I/O affinitied to engine: 0
00: 95/04/01 14:26:03.60 server Number of buffers in buffer cache: 4978.
00: 95/04/01 14:26:03.60 server Number of proc buffers allocated: 1659.
00: 95/04/01 14:26:03.61 server Number of blocks left for proc
headers: 1518.
00: 95/04/01 14:26:04.83 server Opening Master Database ...
00: 95/04/01 14:26:05.08 server Loading SQL Server's default sort
order and character set
/* 6) */
00: 95/04/01 14:26:05.15 kernel network name machinel, type
sun#ether, port 1025
00: 95/04/01 14:26:05.18 server Recovering database 'master'
00: 95/04/01 14:26:05.21 server Recovery dbid 1 ckpt (1385,19)
00:95/04/01 14:26:05.24 server Recovery no active transactions
before ckpt.
/* 7) */
00:95/04/01 14:26:05.67 server server name is 'ddsdbal'
00: 95/04/01 14:26:06.73 server Activating disk 'sd4b'.
/* 8) #
*/
00:95/04/01 14:26:05.73 kernel Initializing virtual device36, '/rsd4b'
/* 9) # */
00: 95/04/01 14:26:05.74 kernel Virtual device 36 started using
asynchronous i/o.
00: 95/04/01 14:26:05.74 server Activating disk 'sd4d'.
00: 95/04/01 14:26:05.74 kernel Initializing virtual device 10, '/dev/rsd4d'
.00 :95/04/01 14:26:05.75 kernel Virtual device 10 started using
asynchronous i/o.

00:95/04/01 14:26:06.04 server Activating disk 'sybsecurity'.


00:95/04/01 14:26:06.04 kernel Initializing virtual device 2, '/dev/rsd6h'
00:95/04/01 14:26:06.05 kernel Virtual device 2 started using
asynchronous i/o.
00:95/04/01 14:26:06.05 server Activating disk 'sysprocsdev'.
'
00:95/04/01 14:26:06.05 kernel Initializing virtual device 1, '/dev/rsdSh
00:95/04/01 14:26:06.06 kernel Virtual device 1 started using
asynchronous i/o.
/* 10) */
00:95/04/01 14:26:06.18 server Recovering database 'sybsecurity'.
00:95/04/01 14:26:06.21 server Recovery dbid 5 ckpt (365,2) oldest
tran=(365,l)
00:95/04/01 14:26:06.23 server 1 transactions rolled forward.
00:95/04/01 14:26:06.64 server audproc: Loading global audit
options from sysauditoptions.
00:95/04/01 14:26:06.66 server audproc: Global audit options
successfully loaded.
00:95/04/01 14:26:06.69 server Recovering database 'model'.
00:95/04/01 14:26:06.70 server Recovery dbid 3 ckpt (323,7)
00:95/04/01 14:26:06.70 server Recovery no active transactions
before ckpt.
00:95/04/01 14:26:06.82 server Clearing temp db
00:95/04/01 14:26:09.94 server Recovering database
'sybsystemprocs'.

www.books-shop.com

00:95/04/01 14:26:09.95 server Recovery dbid 4 ckpt (4122,27)


00:95/04/01 14:26:09.95 server Recovery no active transactions
before ckpt .
00:95/04/01 14:26:10.40 server Recovering database 'dbl'.
00:95/04/01 14:26:10.41 server Recovery dbid 6 ckpt (5299,6)
00:95/04/01 14:26:10.41 server Recovery no active transactions
before ckpt .
00:95/04/01 14:26:12.46 server Recovering database 'db2'.
00:95/04/01 14:26:12.48 server Recovery dbid 7 ckpt (2381666,9)
00:95/04/01 14:26:12.48 server Recovery no active transactions
before ckpt .

00:95/04/01 14:26:36.72 server Recovering database 'dbn'.


00:95/04/01 14:26:36.75 server Recovery dbid 8 ckpt (42729,5)
00:95/04/01 14:26:36.75 server Recovery no active transactions
before ckpt.
00:95/04/01 14:26:57.56 server Recovery complete.
/* 11) , */
00:95/04/01 14:26:57.56 server SQL Server's default sort order is:
00:95/04/01 14:26:57.58 server
'bin_iso_l' (ID = 50)
00:95/04/01 14:26:57.58 server on top of default character set:
00:95/04/01 14:26:57.58 server
'iso_l' (ID = 1).
SQL Server System 11

/* ... */.
machinel: more errorlog_PSYCHOll
00:96/07/15 12:14:54.07 kernel Using config area from primary
master device.
00:96/07/15 12:14:54.20 kernel Warning: Using default file
'/home/sybase/PSYCHO11.cfg' since a configuration file was not
specified. Specify a configuration file name in the RUNSERVER
file to avoid this message.
00:96/07/15 12:14:56.22 kernel Using 1024 file descriptors.
/* 1) SQL Server */
00:96/07/15 12:14:56.31 kernel SQL Server/11.0.l/P/Sun_svr4/OS
5.4/EBF6158/OPT/Fri Apr 5 20:30:14 PST 1996
00:96/07/15 12:14:56.31 kernel Confidential property of Sybase, Inc.
00:96/07/15 12:14:56.31 kernel (c) Copyright Sybase Inc., 1987, 1996.
00:96/07/15 12:14:56.31 kernel All rights reserved.
00:96/07/15 12:14:56.31 kernel
00:96/07/15 12:14:56.31 kernel Use, duplication, or disclosure by
the United States Government
00:96/07/15 12:14:56.31 kernel is subject to restrictions as set
forth in FAR subparagraphs
00:96/07/15 12:14:56.31 kernel 52.227#19(a)#(d) for civilian agency
contracts and DFARS
00:96/07/15 12:14:56.31 kernel 252.227#7013(c) (1) (ii) for
Department of Defense contracts.
00:96/07/15 12:14:56.31 kernel Sybase reserves all unpublished
rights under the copyright
00:96/07/15 12:14:56.31 kernel laws of the United States.
00:96/07/15 12:14:56.31 kernel Sybase, Inc. 6475 Christie Avenue,
Emeryville, CA 94608 USA.
00:96/07/15 12:14:56.31 kernel Using /home/sybase/11.0.1/
PSYCHOll.cfg' for configuration information.
/* 2) */

%RRNVVKRS

piracy@books-shop.com

320

12

00:96/07/15 12:14:56.33 kernel Logging SQL Server messages in file


'/home/sybase/install/errorlog_PSYCHOll'.
/* 3) */
00:96/07/15 12:14:56.38 kernel Network and device connection limit is 1014.
00:96/07/15 12:14:56.41 server Number of proc buffers allocated: 3041.
00:96/07/15 12:14:56.56 server Number of blocks left for proc
headers: 3091.
00:96/07/15 12:14:56.57 server Memory allocated for the default
data cache e: 12866 Kb
00:96/07/15 12:14:56.60 server Size of the 2K memory pool: 12866 Kb
00:96/07/15 12:14:56.60 server Memory allocated for the
psycho_cachel cache: 10240 Kb
00:96/07/15 12:14:56.61 server Size of the 2K memory pool: 9216 Kb
00:96/07/15 12:14:56.62 server Size of the 8K memory pool: 1024 Kb
/* 4) master */
00:96/07/15 12:14:56.64 kernel Initializing virtual device 0,
'/dev/rdsk/cOt2dOs7'
00:96/07/15 12:14:56.65 kernel Virtual device 0 started using
asynchronous i/o.
00:96/07/15 12:14:56.84 server Opening Master Database ...
/* 5) master HE */
00:96/07/15 12:14:57.65 server Loading SQL Server's default sort
order and character set
00:96/07/15 12:14:57.69 kernel ninit:0: listener type: master
00:96/07/15 12:14:57.69 kernel ninit:0: listener endpoint: /dev/tcp
/* 6) */
00:96/07/15 12:14:57.69 kernel ninit:0: listener raw address:
\x000204018196c4500000000000000000
00:96/07/15 12:14:57.69 kernel ninit:0: transport provider: T_COTS_ORD
'
00:96/07/15 12:14:57.84 server Recovering database 'master
00:96/07/15 12:14:57.91 server Recovery dbid 1 ckpt (1955,28)
00:96/07/15 12:14:57.91 server Recovery no active transactions
before ckpt.
00:96/07/15 12:14:58.02 server 3 transactions rolled forward.
00:96/07/15 12:14:58.39 server Database 'master' is now online.
00:96/07/15 12:14:58.41 server The transaction log in the database
'master' will use I/O size of 2 Kb.
/* 7) */
00:96/07/15 12:14:58.52 server server name is 'PSYCHO11'
/* 8) ,
*/
00:96/07/15 12:14:58.55 server Activating disk 'cOt2dOs4'.
00:96/07/15 12:14:58.55 kernel Initializing virtual device 1,
'/dev/rdsk/cOt2dOs4'
/* 9) # */
00:96/07/15 12:14:58.58 kernel Virtual device 1 started using
asynchronous i/o.
00:96/07/15 12:14:58.58 server Activating disk 'cOt2dOs5'.
00:96/07/15 12:14:58.58 kernel Initializing virtual device 2,
'/dev/rdsk/cOt2dOs5'
00:96/07/15 12:14:58.59 kernel Virtual device 2 started using
asynchronous i/o.
00:96/07/15 12:14:58.59 server Activating disk 'cOt2dOs6'.
00:96/07/15 12:14:58.59 kernel Initializing virtual device 3,
'/dev/rdsk/cOt2dOs6'
00:96/07/15 12:14:58.60 kernel Virtual device 3 started using
asynchronous i/o.
/* 10) */
00:96/07/15 12:14:59.00 server Recovering database 'model'.

www.books-shop.com

00:96/07/15 12:14:59.01 server Recovery dbid 3 ckpt (442,15)


00:96/07/15 12:14:59.01 server Recovery no active transactions
before ckpt.
00:96/07/15 12:14:59.16 server The transaction log in the database
'model' will use I/O size of 2 Kb.
00:96/07/15 12:14:59.19 server Database 'model' is now online.
00:96/07/15 12:14:59.21 server Clearing temp db
00:96/07/15 12:15:02.51 server Recovering database 'sybsystemprocs'.
00:96/07/15 12:15:02.53 server Recovery dbid 10 ckpt (8075,20)
00:96/07/15 12:15:02.53 server Recovery no active transactions
before ckpt.
00:96/07/15 12:15:03.21 server The transaction log in the database
'sybsystemprocs' will use I/O size of 2 Kb.
00:96/07/15 12:15:03.25 server Database 'sybsystemprocs' is now online.
00:96/07/15 12:15:03.51 server Recovering database 'admindb'.
00:96/07/15 12:15:03.53 server Recovery dbid 4 ckpt (31287,19)
oldest tran=(31287,17)
00:96/07/15 12:15:03.58 server 1 transactions rolled forward.
00:96/07/15 12:15:04.95 server The transaction log in the database
'admindb' will use I/O size of 2 Kb.
*
00:96/07/15 12:15:04.99 server Database 'admindb' is now online.
00:96/07/15 12:15:05.08 server Recovering database 'cmsdb'.
00:96/07/15 12:15:05.10 server Recovery dbid 5 ckpt (84917/6)
00:96/07/15 12:15:05.10 server Recovery no active transactions before ckpt.
00:96/07/15 12:15:05.29 server 2 transactions rolled forward.
00:96/07/15 12:15:07.50 server The transaction log in the database
'cmsdb' will use I/O size of 2 Kb.
00:96/07/15 12:15:07.54 server Database 'cmsdb' is now online.
00:96/07/15 12:15:07.62 server Recovering database 'curgtr_db'.
00:96/07/15 12:15:07.64 server Recovery dbid 6 ckpt (102487,27)
00:96/07/15 12:15:07.64 server Recovery no active transactions before ckpt.
00:96/07/15 12:15:09.47 server The transaction log in the database
'curgtr_db' will use I/O size of 2 Kb.
00:96/07/15 12:15:09.51 server Database 'curgtr_db' is now online.
00:96/07/15 12:15:09.59 server Recovering database 'pagedb'.
00:96/07/15 12:15:09.60 server Recovery dbid 7 ckpt (12720,15)
00:96/07/15 12:15:09.60 server Recovery no active transactions before ckpt.
00:96/07/15 12:15:10.01 server The transaction log in the database
'pagedb' will use I/O size of 2 Kb.
00:96/07/15 12:15:10.05 server Database 'pagedb' is now online.
00:96/07/15 12:15:10.13 server Recovering database 'guedb'.
00:96/07/15 12:15:10.14 server Recovery dbid 8 ckpt (13081,15)
00:96/07/15 12:15:10.15 server Recovery no active transactions before ckpt.
00:96/07/15 12:15:11.25 server The transaction log in the database
'quedb' will use I/O size of 2 Kb.
00:96/07/15 12:15:11.29 server Database 'guedb' is now online.
00:96/07/15 12:15:11.37 server Recovering database 'cms_map'.
00:96/07/15 12:15:11.38 server Recovery dbid 9 ckpt (4127,12)
00:96/07/15 12:15:11.38 server Recovery no active transactions before ckpt.
00:96/07/15 12:15:11.67 server The transaction log in the database
'cms_map' will use I/O size of 2 Kb.
00:96/07/15 12:15:11.70 server Database 'cms_map' is now online.
00:96/07/15 12:15:11.76 server Recovering database 'PSYCHORS_RSSD'.
00:96/07/15 12:15:11.78 server Recovery dbid 11 ckpt (12000,4)
00:96/07/15 12:15:11.78 server Recovery no active transactions before ckpt.
00:96/07/15 12:15:12.39 server The transaction log in the database
'PSYCHORS_RSSD' will use I/O size of 2 Kb.
00:96/07/15 12:15:12.44 server Database 'PSYCHORS_RSSD' is now online.
00:96/07/15 12:15:12.49 server Recovering database 'corruptable'.

www.books-shop.com

00:96/07/15 12:15:12.51 server Recovery dbid 12 ckpt (13733,10) .


00:96/07/15 12:15:12.51 server Recovery no active transactions before ckpt.
00:96/07/15 12:15:13.23 server The transaction log in the database
' corruptable ' will use I/O size of 2 Kb.
00:96/07/15 12:15:13.27 server Database 'corruptable' is now online.
00:96/07/15 12:15:13.28 server Recovery complete.
/* 11) , */
00:96/07/15 12:15:13.28 server SQL Server's default sort order is:
00:96/07/15 12:15:13.28 server
'bin_iso_l' (ID = 50)
00:96/07/15 12:15:13.28 server on top of default character set:
00:96/07/15 12:15:13.28 server
'iso_l' (ID = 1).
00:96/07/19 10:50:36.10 server DBCC TRACEON 8399, SPID 1

8 "
. , ,
.

cron", , "
, dbcc" , "
. , ,

.
I
SQL Server

.
Sybase,
master.
!
1. Sybase. "
, "
. SQL
Server .
2.
Sybase.
3. , , "
, "
.
4. "
.
sp_reconf igure
allow updates.
, "
, "
. ,
, , "
.
.
, allow updates, "
. "
7.

www.books-shop.com

bcp
bcp ,
. , (
) , .
, bcp, UNIX
Sybase SQL Server Utility Programs for UNIX.

, , 
. , ,
.
system , .
cmsdb, , 350
50 . 
. sp_helpdb,
sp_spaceused, ,
:
1> sp_helpdb cmsdb
2>
name
db_sizeowner
dbid
created
status
cmsdb
400.0 MB sa
9
Apr 25, 1996
no options set
device_fragments
size
usage
free kbytes
cOt2dOs4
150.0 MB
data only
0
cOt2dOs4
200.0 MB
data only
42800
cOt2dOs6
50.0 MB
log only
51008
device
cOt2dOs4
cOt2dOs4
cOt2dOs6
(return status = 0 )
1> sp_spaceused
2> go
database_name
cmsdb

segment
default
system
logsegment

database_size
400.0 MB

reserved
data
index_size
unused
314544 KB
113282 KB
167800 KB
33462 KB
(return status = 0)
, :
113282 "
167800 "
33462 " ,
314544
, 400 , 50
:
400 = 409600
50 = 51200
409600

#51200 ( 51008 )
358400

www.books-shop.com

"314544
43856 = 42,8 '
sp_helpdb <__>:
42800 = 41,8 ( 2 , 5 %
42,8 )
51008
93808 = 91,6
( )
:
service_orders? , sp_spaceused <"
_> :
1> sp_spaceused service_orders
2> go
name
rowtotal
reserved
data
index_size
unused
service_orders
20599
116654 KB
17028 KB
84602 KB
15024 KB
(return status = 0)
, 17028 , "
, 20% , ..
1,2 * 17028 = 20434 ( 20 ). , "
system default 42800 (41,8 ),
.
1105:

, ,
. "
" .
.
. ", , "
, 1105. ,
, "
, . ", "
, . SQL
Server 4.9.2 System 10 System 11 "
,
, "
1105. ", "
, .
,
1105.
9 11 .
1105, ,
.
. ,
1105. , "
, .
. , , , , 1105, "
1105 . "
, , ,
. , "
,
1105, .
1105. "
" , , .

www.books-shop.com

,
1105, , "
. "
. , ,
, , "
.

, 1105,
. , "
.
1. .
2. , "
.
3. system default,
.
4. ,
.


sp_helpdb sp_helpeegment.
sp_helpdb <__>
( ), . ("
, System 10 System 11). "
, 1105,
, .
sp_helpsegment <_>. "
2" ( " "
" ). sp_helpdb :
machinel: isql #Usa #STHEBIRDS11
Password:
1> use psychodb
2> go
1> sp_helpdb psychodb
2> go
name
db_size owner
dbid
created
status
psychodb
400.0 MB sa
9
Apr 25, 1996
no options set
device fragments
cOt2dOs4
cOt2dOs4
C0t2d0s6
device
cOt2dOs4
cOt2dOs4
cOt2dOs6

size
150.0 MB

200.0 MB
50.0 MB

usage
data only
data only
log only

free kbytes
0
42800
51008

segment
default
system
logsegment

(return status = 0)


, chec"
kpoint.
.

www.books-shop.com

no_log dump transaction. ,


dump transaction with no_log
. "
:
1. , . 1105 "
(logsegment),
, .
2. 1105 . , "
, . ,

1105.
3. " .
, 1105
.
checkpoint 1105
"
. "
" .
system default
.
, :
create table psycho1 (a int)
"
, sysobjects. (
, , ).
create table
( , ,
system default).
create table 1105 "
, .
. " "
" .
, . "
, , "
.


,
. "
, :
create table psycho1 (a int) on <_>
, create table "
1105 "
(. "
" ).
, .
, ,
.

dump transaction " "
. "
(.. ) .

www.books-shop.com

checkpoint. . "
, , "
:
sp_spaceused syslogs
sp_helpdb <__>
sp_helpsegment logsegment
"
. "
, , .
(, "
.)
, "
1105, dump transaction "
no_log (
), checkpoint.
, sp_spaceused
syslogs , . ,
,
. (, "
dump transaction with no_log
,
. 9.)
"
, , "
.
, , "
, .
, "
. , , ,
. . "
, (, "
), "
. "
.
, (logsegment)
, "
1105.
(, ). , "
(. 8).
.

, "
, (logsegment . "
). , ,
. "
"
( ) .
"
" , , "
. ,
, . ( . 8.)
, 11 "
.

www.books-shop.com


, "
( )
. "
, logsegment "
, system default
, .
1105, system, "
( default)
1105.
, "
.

www.books-shop.com

13


SQL Server

SQL Server
SQL Server
SQL Server:
EBF
SQL Server

%RRNVVKRS

piracy@books-shop.com


SQL Server
. . "
,
EBF" (Emergency Bug Fix ; ""
" , EBF" ).
, ,
"" (rollup) . ,
. ,
,
.
SQL Server
SQL Server
. .
SQL Server 4.9.2
SQL Server 4.9.2 SunOS, Solaris. "
SQL Server 4.9.2 sybconfig.
SQL Server SQL
Server 4.9.2,
Sybase.
SQL Server System 10
System 10 sybinit.
sybsystemprocs, ( )
sybsecurity. , SQL Server System 10
SunOS, Solaris.
SQL Server System 10 4.9.2
, , "
,
sybsystemprocs sybsecurity, .
SQL Server System 11
System 11 Sun "
Solaris 2.4 . System 10,
System 11 sybinit. sybsystemprocs.
sybsecurity ,
.
System 11 SQL Server System 10, SQL Server 4.9.2. "
Solaris.
System 10 System 11 . "
System 10, System 11,
System 10 . "
System 11 .
System 11 c SQL Server 4.9.2 4.9.2
System 10, .. , sybsystemprocs sybsecurity ..
SQL Server
SQL Server "
. ,
, "
. , Sybase "
, ,
. ,

www.books-shop.com

.

.
, .
, sybinit ("
, ).
sybinit , "
master ( ,
sybsystemprocs sybsecurity). sy"
binit , ,

. , sybinit
; "
.

Sybase SQL Server,
. :
' ,

Sybase


root

SYBASE /home/sybase

sybinit
,



(Sybase SQL Server Installation Guide), (Release
Notes) (System Administration Guide
Supplement). "
, ""
. Sybase
, .
, "
SQL Server "
" .
+
. +
,
. SQL Server
, +
, , +
.
, .
, +
, .
232221

www.books-shop.com


Sybase
, "
Sybase.
,
Sybase. "
,
"
Sybase. ,
, "
, , "
.

, "
. , , "
.
. "
. "
SQL Server, UNIX,
. "
,
. ,
. ,
, "
. "
,
, . , "
, ,
SQL Server. "
" , "
",
SQL BackTrack, .

.

, +
. " ",
. ,
, . +
,
, ,
: " ? +
?"

.
.
" , "
, " .
, "
. , "
,
"
. "
,
.

www.books-shop.com

root

root".
su ( root),
format "
. , "
, .
root", "
. "
.


, ,
.


. , "
. "

. "
. "

.


,
. root, "
format. , "
format.
,
( , , )
format " , "
. , "
. ,
format "
Ctrl"D ( ^D)
" .
format . ", format
, . ", "
, "
. ",
format , , "
, . "
,
,
. , Sun . "

machinel (, format ro"
ot", , su). , "
format :
0. cOt3dO <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
/iommu@f,eOOOOOOO/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
, ( 0) t3dO. "
. . ,
; , SCSI" 0 sdO. "
format , "
, (, cl), ,
:

www.books-shop.com

machinal# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. cOt3dO <SUN2.1G cyl 2733 alt 2 hd 19 sec 80>
/iommu@f,eOOOOOOO/sbus@f,e0001000/espdma@f,400000/esp@f,
800000/sd@3,0
1. cOt5dO <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>
/iommu@f,eOOOOOOO/sbus@f,e0001000/espdma@f,400000/esp@f,
800000/sd@5,0
2. cltOdO <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>
/iommu@f,eOOOOOOO/sbus@f,e0001000/QLGC,isp@0,10000/sd@0,0
3. cltldO <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>
/iommu@f,eOOOOOOO/sbus@f,e0001000/QLGC,isp@0,10000/sd@l,0
4. clt2dO <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>
/iommu@f,eOOOOOOO/sbus@f,e0001000/QLGC,isp@0,10000/sd@2,0
5. clt3dO <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>
/iommu@f,eOOOOOOO/sbus@f,e0001000/QLGC,isp@0,10000/sd@3,0
Specify disk (enter its number):

,
, "
,
.
. "
, "
:
1. 0 0, "
UNIX"
Sybase, :
/dev/dsk/<_>a

/dev/r<_>a
SunOS
(, /dev/dsk/sdOa /dev/rsdOa sdO) /dev/dsk/<Ha3Ba"
_>s0
/ d e v / r d s k / < _ > s O Solaris (,
/dev/dsk/cOt3dOsO /dev/rdsk/cOt3dOsO cOtSdO
).
2. 7 , 50 "
.
3. 1, 3, 4, 5 6. ,
. "
7.
4. 2. 0,
sybase.
5. UNIX" Sy"
base
, 0 2 .


"
prtvtoc , .
prtvtoc . ,
, .
, 512 1024*1024 "
. , (sector count) 1 "
1 639 440 , 800.51 .
2" (
1 = 512 ),
disk init. ,

www.books-shop.com

,
.
machinel: /usr/sbin/prtvtoc /dev/rdsk/cOt5dOsl
* /dev/rdsk/cOt5dOsl partition map
*
* Dimensions:
*
512 bytes/sector

*
*
*

135 sectors/track
16 tracks/cylinder
2160 sectors/cylinder

* 4392 cylinders
* 3880 accessible cylinders
*
* Flags:
*
1: unmountable
*
10: read"only
*

Partition
0
1

First

Tag
0

Flags
00
01
01
00

Sector

Sector
Count
2160
1639440
8380800
1639440

Last
Sect or Mount

Directory
2159 #> cylinder 0
3
1641599
2
5
8380799
3
0
3281039 #> 800.51 Mb
800 Mb = 409600 2K pages
4
0
00
1639440
3281040
4920479
0
5
00
1639440
4920480
6559919
6
4
00
1639440
6559920
8199359
7
0
00
8199360
181440
8380799 #> 88.59 Mb
88 Mb = 45056 2K pages
1, 3, 4, 5 6, "
1 639 440 , 7, 181 440 . "
512 (
Sun Solaris ), "
1024*1024 ( !).
( ) 512
2" , . ,
2048 (2 ). Sun
Solaris .
:

2
1639440
839393280
800.508
409600
181440
92897280
88.594
45056
( Solaris (1 = 1024*1024 ( Solaris
1 = 5 1 2 )
= 1048576 )
1 = 2048
1 = 512 )
, 8.
. 30"
500 470
. "
(, 50 ).
, SQL Server System 10 11 master, sybsystemprocs sybsecurity "
( "
), 50 .
,
. disk init "
(, , ) "
(. 8). , disk init

0
2160
0
1641600

www.books-shop.com

, master.
sybinit buildmaster, "
,
Sybase.
SQL Server System 10 sybinit, master,
syspwcsdev sybsecurity. "
disk init. sybinit
master
, .

,
df "k ( df "k ). , "
(mount)
. , "

/ .
machinel : df "k
Filesystem
kbytes
used
avail
capacity
Mounted on
/dev/dsk/cOt3dOsO
674471
262434
344597
44%
/
/proc
0
0
0
0%
/proc
fd
0
0
0
0%
/dev/fd
swap
501984
8
501976
1%
/tmp
/dev/dsk/cOt3dOs7
1032142
217464
711468
24%
/export/home
/dev/dsk/cltOdOsl
806647
35190
690797
5%
/export/diskl
He , , "
, . "
( ) Sybase
machinel : /home/ Sybase ( SYBASE).
( "
) . "
Sybase,
, . "
Sybase " ,
. "
. ,
SQL Server UNIX"
sybase. ,
.


/home/sybase
, "
Sybase, sybinit
SQL Server.
, SQL Server "
UNIX" root.
sybinit, "
, root. , "
sybinit SQL Server,
.
( "
sybase). , "
sybinit master, sysprocsdev sybsecurity,
(raw)
UNIX" sybase.

www.books-shop.com

( slices), :
machinel: cd /dev/rdsk
machinel: Is
Clt0d0s4
cltldOs3
cOt3dOs7
cOt5dOs6
cOt6dOs5
cOt3dOsO
Clt2d0s2
clt3dOsl
cltldOs4
cOt5dOsO
cOt5dOs7
cOt6dOs6
cltOdOs5
cOt3dOsl
Clt2d0s3
clt3dOs2
cOt6dOs7
cltOdOs6
cltldOs5
cOt3dOs2
cOt5dOsl
cOt6dOsO
Clt2d0s4
clt3dOs3
clt0d0s7
cltldOs6
cltOdOsO
cOt3dOs3
cOt5dOs2
cOt6dOsl
Clt2d0s5
clt3dOs4
cltldOs7
cOt3dOs4
cOt6dOs2
cltOdOsl
cltldOsO
cOt5dOs3
clt2dOs6
Clt3d0s5
Clt2d0s0
cltOdOs2
cOt3dOs5
cOt5dOs4
cOt6dOs3
cltldOsl
clt2dOs7
Clt3d0s6
cltldOs2
clt2dOsl
cOt3dOs6
cOt6dOs4
cltOdOs3
cOt5dOs5
clt3dOs7
Clt3d0s0

:
machinel: 1s "1 cOt5dOs3
1rwxrwxrwx 1 root
other
88 Jul 22 16:49 cOt5dOs3 ">
../../devices/iommu@f,eOOOOOOO/sbus@f,e0001000/espdma@f,400000/esp@f,
800000/sd@5,0:d,raw
, root; 
. Solaris L:
machinel: 1s #L1 cOt5dOs3
crw#r
1 sybase sys 32, 43 Jul 22 16:49 cOt5dOs3
SYBASE /home/sybase
, SYBASE
Sybase, /home/sybase. "
SYBASE echo $SYBASE
setenv SYBASE /home/sybase. SYBASE "
sybinit.

SQL Server "
/home/sybase. SQL Server
Sybase . ,
SQL Server System 10 /home/sybase/10 . . 2, "
System 11 /home/sybase/11.0.1. "
,
, (
,
" ).
sybinit

sybinit, SQL Server, .
sybinit master, master, model,
tempdb sybsystemprocs ( sybsecunty),
(, sp_who), "
, ( RUN_<_>),
, , ,
.
sybinit
, "
,
.

www.books-shop.com

SQL Server System 11


, SQL Server System 11 SUN
Solaris, SQL Server 4.9.2
System 10 Solaris, SunOS. "
System 11 "
Solaris.
SQL Server System 11 sybinit, "
. .
System 11, "
SQL Server 4.9.2, "
SQL Server. , SQL Server 4.9.2
master, Sys"
tem 11 . master,
sysprocsdev, sybsystemprocs. sybsys
temprocs , SQL Server 4.9.2
master. "
System 11. "
master master
SQL Server 4.9.2 System 11.
master , "
. Sybase
sybsystemprocs
, sybinit SQL Server Sys"
tem 11, sybsecurity , "
System 11 .
,
. ,
sybsecunty .
sybsecurity, master sysprocsdev,
(
).
( 30 ) "
sybsecunty,
"
. , "
( )
sybsecurity, , "
. , sybsecunty
SQL Server.
, SQL Server sybinit "
, .
SQL Server System 11 "
Backup Server, .
sybinit "
SQL Server, ,
sybinit.
, SQL Server System 11 "
.
(customer authorization string) "
Sybase.
.
(Release Directory)
,
.
SYBASE, /home/sybase.

www.books-shop.com

(Server Name)
.
, "
, "
.


(Configure Server Interfaces File Entry)
sybinit , "
. , "
,
.
, "
(. 8).
sybinit , . ,
sybinit .
, (Retry Count), "
,
(Retry Delay). , .
,
, .
.

master (File for Master Device Raw Partition)
, , "
master.
master
(Size of Master Device in Megabytes)
, master sybinit
, , sybconf ig
SQL Server 4.9.2. , , "
(. 8).

sysprocsdev (File for Sysprocsdev Device Raw Partition)
, "
, sysprocsdev. "
sybsystemprocs,
. sysprocsdev master;
, "
.
sysprocsdev
(Size of Sysprocsdev Device in Megabytes)
sybinit sysprocsdev . ,
, "
(. 8).
(Errorlog Location)
.
install Sybase (.. / home/ sybase/ ins "
tall/errorlog) . sybinit
, "
, , "
, .

%RRNVVKRS

piracy@books-shop.com


.
,
(
/home/<_>/1), ,
.
.
(Backup Server Name)
. , "
, , sysservers
SQL Server ( SYB_BACKUP). "
sybinit
SQL Server. "
<_SQL_Server>_BCK.,

(Languages Installed and Default)
, , ,
. ,
. "
. , "
SQL Server.

(Character Sets Installed and Default)
,
. , "
.

. "
, SQL Server.
(Sort Order Installed)
, "
, .
. ""
"
(. 9) . ,
, "
. ,
. "
,
.
, "
Sybase .
,
(
),
, . "
"
.

. , "
,
.

www.books-shop.com


sybsecurity (File for sybsecurity Device Raw Partition)
, , "
sybsecurity. "
sybsecurity,
SQL Server System 11. , "
.
( 30 ) , "
.
, . sybsecurity
master sysprocsdev.
, .
sybsecurity
(Size of sybsecurity Device in Megabytes)
sybsecurity . ,
, (. 8).
Backup Server
System 11 sybinit. "
SQL Server, sybinit.
"
SQL Server.
(Backup Server Release Directory)
, .
SYBASE, /home/sy"
base.
(Backup Server Name)
"
, <_SQL_Server>BCK.. "
, SQL Server
, .

(Backup Server Errorlog)
, SQL Server, "
"
.

(Backup Server Interfaces File Information)
sybinit , "
. sybinit "
,
. sybinit
,
(. 8). "
sybinit , . , "
sybinit .

(Backup Server Language and Character Set)
SQL Server.

www.books-shop.com

SQL Server System 10


SQL Server System 10 System 11
, , Solaris, System 10
Sun SunOS.
SQL Server System 10 sybinit
" SQL Server System 11".
, sybinit "
, "
. System 11
, .
SQL Server 4.9.2
SQL Server 4.9.2 sybconf ig,
. "
.
SYBASE "
Sybase (/home/sybase ). "
sybconf ig SYBASE,
. "
SYBASE UNIX" echo $ SYBASE.
sybconf ig
.
, "
, sybcon"
f ig .
master
(Type of Master Device Raw Partition or Regular File)
master
( 8).
master,
(Path Name for Master Device)
, "
" , master.

(Size of Partition in Sectors)
, ,
prtvtoc (. ). , "
. , "
512 (
). 2048 512""
.
(Server Name)
,
SQL Server. SQL Server 4.9.2 psycho
PSYCHO_492.
(Server Query Port Number)
( 5001)
, "
(. 8).
(Default Language)
, , , "
. .

www.books-shop.com

,
,
.
(Default Character Set)
, "
. "
, .

.
(Sort Order)
, . "
"
. "
(. 9)
.
, . "
, . "

, . "
, "
Sybase
.
, "
, "
, ,
. "
"
.
"
. "
.
(Additional Languages)
.
(Additional Character Sets)
.
(Serial Number)
SQL Server. ,
, 99999. ,
sp_configure.

sybinit
.
. , "
SQL Server. ,
.
master
1

'sa


( SQL Server 4.9.2)

www.books-shop.com



sysservers
(
)
syslogins
model ,
( SQL Server 4.9.2)

master


master

master, .
, master "
, "
, ,
. "
UNIX" Sybase.
sybinit ,
. mas
ter, sp_helpdevice ,
, "
. SQL Server 4.9.2
master . "
master.
'sa'
'sa'. "
, "
'sa' . ,
, "
.

, "
.
80% , . , "
10 20 (
, "
" ). ("
,
) ,
.

( )
10. "
sp_configure "
.
, ,
.

www.books-shop.com


( SQL Server 4.9.2)
SQL Server 4.9.2 "
. ,
master.


, "
disk init, "

. 8, 2" "
. "

. "
, .
, . ,
disk init vdev
, .

, "
. "
,
.
, master "
disk init. , "
, .


, , "
disk mirror.
.

, , "
. . "
,
, .
sp_configure, "
.


sysservers
sysservers "
, .
,
. , sysservers "
, ,
.
(
)
, "
,
. ,
.
(/home/sybase).

www.books-shop.com

. "
. "
, .
syslogins
"
( ). "
,
syslogins " , sp_addlo"
gin .
b syslogins "
. "
. ,
'sa' suid = 1. suid
syslogins,
b, .
syslogins .
, . "
syslogins ,
'sa'.
'sa' ( suid= 1). ,
(suid) "
. , "
suid.
, ,
.
suid.
,
suid ,
.
model ,
( SQL Server 4.9.2)
, , "
. "
.
SQL Server 4.9.2 , "
model, "
(
master). model , "
, "
, , .
, "
.

, ,
, disk init
model , , "
. ,
, . "
, .
master
master. "
, "
.

www.books-shop.com


, ,
, .
, "
.

,
, dbcc" "
update statistics (. 14).

sybinit (sybconfig SQL Server 4.9.2) "
. , ,
, ,
sybinit, .
, SQL Server:

$SYBASE





. sybinit "
, ,
, (master ).
UNIX" Sybase ,
sybinit "
sybinit, sybinit ( "
sybinit),
, .
, UNIX" Sybase
. "
Sybase /home/Sybase "
,
, master, sysprocsdev sybsecurity.
$SYBASE
SYBASE
. , SYBASE
(/home/sybase). , sybinit ( syb"
conf ig) (release directory), "
( ) Sybase.

,
. "
UNIX" Sybase
, master, sysprocsdev sybsecurity.

" " (insufficient space on device).
sybinit
.
242221

www.books-shop.com


( sy"
binit),
. ,
, , ,
.. "
. sy"
binit, " "
(waiting for server to boot) . "
,
(.. sybinit) "
RUN_<_>, "
.
. , "
.
, "
(. 12). , "
,
.

, SQL Server, "
. , "
,
. /home/sy"
base/bin , "
EBF .. ""
.

sybinit "
,
. " , sybinit "
, . ", "
,
sybinit. , ,

($SYBASE/install). , "
, "
.

SQL Server:

SQL Server ,
.
EBF" (Emergency Bug Fix
; EBF" , ""
). , "
, "" (rollup) .
. "
, "
.
SQL Server
SQL Server 4.9.2
, "
SQL Server 4.9.2. SQL Server

www.books-shop.com

, Sybase,
SQL Server System 10 11 SQL Server 4.9.2.
SQL Server System 10
SQL Server System 10 SunOS, Solaris, System 10
. "
, "
sybsystemprocs sybsecurity. , System 10
Backup Server,
.
SQL Server System 11
SQL Server System 11 SQL Server 4.9.2 "
System 10. System 11 ( )
, , , "
. , SQL Server System 11 "
Solaris, , SunOS,
Solaris.
,

EBF*
EBF" SQL Server "
, (Sybase SQL Server Installation Guide)
(Release Notes).
EBF" "
(EBF Cover Letter), EBF".
(, SQL Server 4.9.2 System 11)

( Release Bulletin).
, ,
, , "
.
Sybase
EBF" "
EBF . "
isql
select @@version
(, 4.9.2),
EBF" .
EBF", Syba"
se , (, , ) "
EBF". , EBF",
, EBF".
Sybase,
"" (one"off) EBF", Sybase
, . "
EBF", , EBF"
"" (rollup) . "
, , ,
Sy"
base EBF" SQL Server.
, EBF"
, Sybase. "
,
, . ", EBF"

%RRNVVKRS

piracy@books-shop.com

, (
). ", ,
EBF", "
, EBF".
EBF" " "
.

,
.
EBF", , EBF" "
EBF". ., "
,
. "
, EBF""
, ,
EBF".

SQL Server (, 4.9.2 System 10 11). "
, ,
System 10, System 10 , "
SQL Server 4.9.2 " "
.
Sybase "
SQL Server.
EBF*
EBF" SQL Server . "
,
EBF" , , "
EBF" . , "
EBF"
.

"
(Release Notes) (EBF Cover Letter). "
.
,

.
EBF*
EBF" SQL Server "
, ("
, /home/sybase/bin). EBF"
, . <_
>. <ep_ep>datasvr. <_F> "
, ddsdbal.1101datasvr. 6158.
EBF*
EBF"
isql
select version
:
machinel: isql #Usa #SREARWINDOWll
Password:

www.books-shop.com

1> select @@version


2> go
SQL Server/11.0.l/P/Sun_svr4/OS 5.4/EBF6158/OPT/Fri Apr 5 20:30:14 PST 1996

(1 row affected)
, SQL Server 11.0.1, EBF" 6158.
EBF" ( ) , "
. "
, EBF"
. EBF" ,
EBF" ( ) ,
, .

EBF" ,
, EBF". , SQL Server
/home/Sybase/install/RUN_<_>, "
dataserver. dataserver
<_>. <_>datasrvr.<_F> ("
, ddsdbal.1101datasvr .3434).
. "
. , "
EBF" SQL Server EBF"
, .

. , "
9 , .
EBF*


<_>. <_>datasvr.<__F>, ddsdbal.1101p2da"
tasvr .6158 ( ). ,
EBF" "
dataserver.
RUN_<_> EBF".
EBF" SQL Server "
UNIX. " ,
("
, ).

,
EBF". , "
, 12.
EBF*
isql
EBF" select version.
EBF*
EBF" ,
.
SQL Server
EBF" , SQL Server "
. ,
,

www.books-shop.com

, (, 4.2 SQL Server 4.8


4.9 System 10) ,
. , "
. "
SQL ANSI"
. "
"
.

.
. , ,
,
OLTP" "
. "


.
,
,
. SQL Server 4.9.2
System 11 ( System 10).
SQL Server 4.9.2 System 11
( System 10)
"
4.9.2. "
, .
"
, "
.
, , "
.
"
, 4.9.2 "
System 11. ,

. , . "
,
.


, ( ,
"options set" sp_helpdb ).
tempdb, select into/bulkcopy.
sybinit
SQL Server 4.9.2 Sybase "
sybinit ( sybconf ig!)
SQL Server (Upgrade an existing SQL Server), "
(Test SQL Server upgrade eligibility now).
sybinit:
SQL SERVER UPGRADE

1. Test SQL Server upgrade eligibility now


2. Check for reserved word conflicts
3. sybsystemprocs database configuration
4 . Upgrade SQL Server now

www.books-shop.com

(...)
Ctrl#a Accept and Continue, Ctrl#x Exit Screen, ? Help.
Enter the number of your choice and press return: 1 (
return:) Testing SQL Server "THEBIRDS492 ' for eligi#
bility to upgrade to release '11.0'.
......................... Done
Server "THEBIRDS492 ' passed preupgrade eligibility test.

sybinit

4.9.2
System 11 
sybinit, UNIX Sybase. sybinit 
(Upgrade an existing SQL Server),
(Check for reserved word conflicts). 
.

sybinit
sybinit 
, , 
" SQL SERVER" (SQL SERVER UPGRADE). ,
SQL Server System 11 /home/sybase/11 . 0,
4.9.2 () 
Sybase /home /Sybase.
SQL SERVER UPGRADE
1. Test SQL Server upgrade eligibility now
2. Check for reserved word conflicts
3 . sybsystemprocs database configuration
4 . Upgrade SQL Server now

(...)
Ctrl#a Accept and Continue, Ctrl#x Exit Screen, ? Help.
Enter the number of your choice and press return: 2 (
return:) ...Done The log file for sp_checkreswords
output is ' /home/sybase/11. 0/init/logs/checkres.dmp' .
Warning: 2 conflicts with 11.0 reserved words were found. Sybase suggests
that you resolve these conflicts before upgrading the SQL Server. Run
' sp_checkreswords ' on each database for more information. Press <return> to
continue .
(. 2 11.0,
.
' sp_checkreswords '
. <return>.)
/home/sybase/ 11. 0/init/logs/checkres.dmp
:
machinel: more checkres .dmp
Reserved Words Used as Database Objects for Database 'admindb'
Database#wide Objects
Reserved Words Used as Database Objects for Database 'cms_map'
Database#wide Objects

Reserved Words Used as Database Objects for Database 'cmsdb'


Owner
dbo

www.books-shop.com

Object Type
user table
Database#wide Objects

Reserved Word Object Names


references

Reserved Words Used as Database Objects for Database 'curqtr_db'


Owner
dbo

Object Type
user table
Database"wide Objects

Reserved Word Object Names


references

Reserved Words Used as Database Objects for Database 'master'


Database"wide Objects
Reserved Words Used as Database Objects for Database 'model'
Database"wide Objects
Reserved Words Used as Database Objects for Database 'pagedb'
Database"wide Objects
Reserved Words Used as Database Objects for Database 'guedb'
Database"wide Objects
Reserved Words Used as Database Objects for Database 'suneds_sunu'
Database"wide Objects
Reserved Words Used as Database Objects for Database 'tempdb'
Database"wide Objects
,
SQL Server System 11 "
Transact"SQL, , .
sysobjects SQL Server 4.9.2
schema, SQL Server System 11.
schema2 ( "
4.9.2 System 11, sysobjects).

System 11, "
(, ..). "
System 11 .
System 11 (
set quoted_identifier on),
. ,
, "
.
,
,
. , ,
,
. "
.
, cmsdb curqtr_db
references,
SQL Server System 11. , "
,
.

www.books-shop.com


, (+
'sa').
+
. +
.
, +
.

"
,
, . "
, "
.
System 11
SQL Server System 11 sysprocsdev "
sybsystemprocs, "
System 11. , System 11
sybsecurity .
,
( 30 ),
.
master " ,
. ,
, ( "
, System 11, 8). "
.
sybinit , "
( ), .
30+ ,
+
.
, ,
. +
, 8
, SQL Server
System 11.


( ) , "
System 11, "
.
System 11 SQL Server 4.9.2,
.
,
System 11
, sybinit,
UNIX" sybase.
dbcc
"
dbcc".

www.books-shop.com



(, )
, ( 10%
). sp_spaceused "
, , 10%
. , sybi"
nit .
sysindexes sysobjects
.
" , "
, sysindexes, , "
sysobjects. , dbcc
,
. sysindexes sysobjects "
Sybase "
sysindexes. :

select id from sysobjects


where (type >> 'U' or type << 'S')
and id not in (select id from sysindexes)
select id from sysindexes
where id not in (select id from sysobjects)



checkpoint. "
, ,
.

, .
SQL Server 4.9.2 System 11 ( System 10)
, "
. , ;
, "
, 4.9.2. "
.
SQL Server 4.9.2
System 11.
Sybase "
, , EBF".

.
(, "
), ( 12 "
, ).
" "
. "
, .
, .

"
checkpoint. ,

www.books-shop.com

"
. "
.
,
sp_spaceused syslogs ,
.
,
, "
.


, "
" . ,
master model ,
"
. "
. , .
"
, , "
.

14 dump_systables
.
, cron" . "
,
. , sp_helpdb .
isql "
use dbl sp_helpdb dbl, .

syslogins "

. , suid, "
, SQL Server 4.9.2.

'sa' 'probe', b "
".

master

master. 4.9.2,
, ,
.
dump_<_cepepa>_master_4.9.2_withmirrors_<a>_<pe>. out,
sysdevices
.


master, . "
p_mirror (. 14)
.

, , :
disk unmirror name = '<_>',
side = secondary,

www.books-shop.com

mode = remove
. "
8 (
). ,
,
4.9.2. "
, disk unmirror.

p_mirror
.

, .
tempdb select into/bulkcopy.
's' NULL
NULL.
's'
, NULL.
isgl 'sa'.
, 'sa'
master
,
master.
master

master. 4.9.2,
master ,
dump_<_>_master_4.9.2_1_<>_<>.1;.
sysdevices
(. . 13.16).
TIMEOUTCOUNT

("
10 ) , "
TIMEOUTCOUNT .
Sybase.
,
"
, ( user connec"
tions) 10, (stack size) 286 720.
.
<_>_SYS11
, "
, 4.9.2.
, RUN_<_>.

<_cepeepa>_SYS11.

www.books-shop.com

master
master. "
4.9.2, master
, dump_<_>_master_4 . 9 . 2_nomirrors_ne"
wconfig_<>_<>.ut. , sysdevices
, ""
4.9.2.
sybinit
sybinit ,
.
sybinit
sybinit,
.

sybinit

, "
" . "
s y b i n i t ,

.

sybsystemprocs
, sybinit (
) , sysprocs"
dev, sybsystemprocs.

" SQL SERVER" (SQL SERVER UPGRADE) sybinit "
" SQL Server" (Upgrade SQL Server now)
.

SQL Server Backup Server
System 11. sybinit "
sybinit " SQL
SERVER" (NEW OR EXISTING SQL SERVER).
SQL Server 4.9.2
System 11 ( System 10)
master
'sa'





master


%RRNVVKRS

piracy@books-shop.com




master
Backup Server master.
SQL Server System 11 "
, , .. "
( ).
master
dump_<_cepepa>_master_11x _<>_<>.out. ,
sysdevices "
, System 11.
's'
"
(, NULL). "
SQL Server System 11 , syslogins,
" " (, ,
, 'sa' NULL). "
, , syslo
gins 4.9.2, .

, .
(. 14).


(, SQL Server "
10 286 720 ).
, "
, . , , "
10 800, 286 720
40 960,
800 , 286 720. "
, ,
.

<_>_SYS11, "
, 4.9.2 "
.
"
, . ,
, sysservers (
"" 12).

www.books-shop.com

, +
. +
4.9.2
System 10.
(
). +
... , . , +
.
"" , ,
4.9.2 master, System 10.
, , +
,
. ,
+ .

SQL Server System 11 . ,
(last"chance threshold). "
4.9.2 System 11 ,
select lct_admin ("lastchance",
db_id ( ) ) .
. ,
,
Sybase. ,
,
" . "
1105 (
segment full), sp_dboption
abort tran on log full.

System 11.
(oper_role) "
, "
, SQL Server 4.9.2
. , "
. , sso_role
sa_role , 'sa', "
. , "
,
'sa'. , ,
.
master
master. SQL Server System 11

, ( "
). master
dump_<_cepepa>_master_llx_oldconfig_<>_<>.ut:.

( ,
). ,
System 11 (
SQL Server 4.9.2).

System 11
cron"

www.books-shop.com

. , System 11 ("
, ).

, ,
.
4.9.2
, .
"
System 11
. Sys"
tem 11 .
, "
System 11 . "
, 4.9.2,
.

14 update statis"
tics sp_recompile .

System 11 ,
( "
12). ,
, "
" .

" SQL Server System 11 , "
, "
, .
, System 11 SQL Server 4.9.2 System 10. "

, "
, .
System 11 , "
, .
, ,
, System 11.
SQL Server System 11 Sybase
sp_procmode, ,
. . , "
sp_procqmode,
. , "
:
1> sp_procqmode
2> go

Object Owner.Name
dbo.actions_trigger
dbo.assignments_trigger
dbo.attachments_trigger
dbo.cover_hist_trigger
dbo.customers_trigger
dbo.labor_trigger

Object Type
trigger
trigger
trigger
trigger
trigger
trigger

Processing
pre#System
pre#System
pre#System
pre#System
pre#System
pre#System

dbo.parts_trigger

trigger

pre#System 11

dbo.reference_trigger
dbo.service_order_trigger
dbo.states_trigger

trigger
trigger
trigger

System 11 or later
pre#System 11
pre#System 11

Mode
11
11
11
11
11
11

www.books-shop.com

dbo.action_status_proc
dbo.cms_who
dbo.sp_disks

stored procedure
stored procedure
stored procedure

pre#System 11
pre#System 11
pre#System 11

(return status = 0 )
SQL Server 4.9.2
System 10 11
System 11 , "
4.9.2, master, a
. "
(. 13.1). , "
, 4.9.2 .
, "
master 4.9.2.
System 11 "
Sybase. ,
. "
, System 11 "
, .
, "
.

4.9.2 master
master 4.9.2


' 4.9.2

, .
master 4.9.2 ,
master System 10 11.
4.9.2 master
master 4.9.2. "
SQL Server 4.9.2, , ,
master buildmaster (
master, System 10/11).
master 4.9.2
buildmaster "d /dev/rdsk/ <_> "s <__master>
master 2" . ,
buildmaster, SQL
Server 4.9.2, System 10/11.
master 4.9.2
( " "
RUN<_>). , 4.9.2,
System 10/11, " . "
master dump_<_cep"
sepa>_master_4 . 9 .2_withmirrors_<a>_<>.out (,
!). master
SQL Server (SQL Server Troubleshooting Guide). master
.
252221

www.books-shop.com

. 13.1. 4.9.2 SQL Server

www.books-shop.com

master sysdevices "


, 4.9.2 (. "
master " " SQL Ser"
ver 4.9.2 System 11 ( System 10)").
,
4.9.2 ( ,
System 10 System 11, . . 13. 1).

(, , )
, "
. UNIX" Sybase .

SQL Server 4.9.2 sysde
vices . "
( System 10/11)
, , "
SQL Server 4.9.2. "
master
(. . 13. 1).

4.9.2
,
. 4.9.2 "
, "
4.9.2 (
). "
4.9.2.
, . 13.1 SQL Server
4.9.2 "
master ( "
) .
SQL Server 4.9.2 System 10
SQL Server 4.9.2 SQL Server System 10
System 11 (. ).
SQL Server System 10 System 11
System 10 System 11 , SQL Server 4.9.2, "
SQL Server 4.9.2 System 11 "
4.9.2 System 10. , System 10
sybsystemprocs sybsecurity. ,
System 10 System 11 , System 11
. "
SQL Server System 10 System 11. "
, SQL Server 4.9.2 System 11.

sybinit
sybinit


System 11

dbcc

www.books-shop.com


checkpoint

SQL Server System 10 System 11
System 10
System 10 System 11 ": SQL
Server System 11, , "
, System 10. System 10 "
System 11 SQL Server System 11.

"
. ,
, , "
.
SQL Server System 10
System 10,
System 11.
SQL Server System 11
System 11, . "
b syslogins System 10
SQL Server System 11 (
9).
System 11
System 11 , "
. , "

. System 10 "
p_dbcreate (. 14). , "
p_dbcreate ,

. create database for load ("
p_dbcreate).
System 10 System 11
, System 11.

(off"line) "
, (on"line) online database
<__>. System 11 "
System 10 System 11,
System 10.

System 11, "
, .
" ".

www.books-shop.com

14

SQL Server
(dumplog)
SQL Server 4.9.2 (dumpdb_492)
SQL Server 4.9.2 (loaddb_492)

(update_statistics_all_tables)
(dump_db_create)
dbcc (checkdb)
(dump_systables)

( p_dbcreate)
( p_mirror)

( p_devspace)
(dumpdb)
(loaddb)
( p_dbload)

SQL Server System 11
System 11 (dump_listof_dbs)
(logdump_listof_dbs)
(trunclog_listof_dbs)
(remove_old_files)
(update_listof_dbs)
dbcc (dbcc_listof_dbs)
SQL Server
(scan_errorlog)
(dump_server_config)
(monitor_report)
sp_sysmon (execute_sp_sysmon)

crontab

www.books-shop.com

, .
, "
, SQL Server 4.9.2 System 10, "
, .
"
System 11.
"
, #. "

.
, "
. "
.
, , "
. "
, ,
. "
,
. , "

.
,
Sybase isql $SYBASE/bin. "
", "
.


. "
. "
. , ,
, .
SQL Server
( ) "
.
SQL Server 4.9.2
, "
, 4.9.2 SQL Server, "
.. ,
sybsystemp
rocs, . SQL Server "
4.9.2 ,
, "
( master).
dump_systables System 11. "
SQL Server 4.9.2 System 10 ,
UNIX" :
$SYBASE/bin/buildmaster "d<___master> "yall
buildmaster "
SQL Server (Sybase SQL Server Error Messages). , "
.
, Backup Server, "
SQL Server 4.9.2.

www.books-shop.com

SQL Server System 10


sybsystemprocs.
SQL Server System 11
sybsystemprocs.

(dumplog)
, 
. ,
cron, . 
'sa' UNIX dba,
dumplog "
tab. dumplog crontab, 
dumplog 10 22 :
10"22 * * * /dba/<_cepepa>/scripts/dumplog 'cat
/usr/dba/ . <_> ' dbl
, crontab,
dumplog (, 0 )
10 22 . dumplog 
dbl.
/usr/dba/.<_cepepa> .
dumplog :
dumplog <s_> <dbl, db2, db3 , ... , dbn>

.
# ! / b i n / c s h "f
#
#
#
#
#
#
#
#

# ,

( , ) .
.
0
, 1 ,
2 .

if ($#argv < 2 ) then


#
#
#
#
#

echo ; ,
echo $ { 0 }
( , )
.
.
echo ${0}: invalid format: $#argv parameters provided, at
least 2 required
echo ${0}: required format: ${0} '<sa password> <database (s) . . . >'
exit(l)

# exit(l)
# 1, .
# .
endif
# , 'dba'.

%RRNVVKRS

piracy@books-shop.com

# , .
if 'whoami' != "dba") then
echo you must be UNIX user dba to dump the transaction log
# UNIX# dba
exit(1)
endif
#
#
#
#
#
#
#
#
#

umask ,
,
.
'umask' XOR 666, 'umask' ,
umask ( 006).
unalias ,
rm # UNIX rm
,
.

umask 006
unalias rm
#
#
#
#

,
.
SYBASE
Sybase.

setenv SYBASE /home/sybase


# SERVER , ,
setenv SERVER PDSOPS21
# BIN $SYBASE,
# Sybase.
set BIN=${SYBASE}/bin
#
#
#
#
#
#
#
#

logdir ,
.
outfile
, .
password ,
.
shift ,
.

set logdir=/diskdump
set outfile=${logdir}/dumplog.out
set password=$l
shift
' .
# dmptime ,
set dmptime='date +%y%m%d%H%M%S'
#
#
#
#

, dumplog.
,
.

# dumplog.
# dumplog, cron#. ,
# ,
# .

www.books-shop.com

#
#
#
#
#

ps #ef ,
.
grep ,
'dumplog'. wc #1
( #1 wc ).

ps #ef > /tmp/ps.dumplog


set cnt = 'grep dumplog /tmp/ps.dumplog

wc

#1'

# cnt 2 (
# dumplog, # cron#).
# r ,
# '.
set cntl = 'expr $cnt # 2'
if ($cntl > 0) then
# mail dba ,
# "Subject:" ,
# s.
mail #s "${SERVER} dumplog aborted" dba < /tmp/ps.dumplog
exit 1
endif
# , ps #ef.
rm /tmp/ps.dumplog
# dbs_to_trandump ,
# dumplog.
set dbs_to_trandump=($argv)
# ,
echo "dumplog:${SERVER}: started at 'date'." > $outfile
# ,
.# .
foreach dbname ($dbs_to_trandump)
# , ,
set logfile=${dbname}.log_${dmptime}
#
#
#
#
#
#

isgl
(
cron#). # ,
.
isgl ( finish_sql)
.

${BIN}/isql #Usa #S${SERVER} #I$SYBASE/interfaces #e >


${dbname}_logdump.out << finish_sql
$password
dump tran $dbname to '${logdir}/${logfile}'
go
exit

finish_sgl
# isql ,.
# dba.

www.books-shop.com

if ($status) then
echo dumplog:${SERVER}: log dump of $dbname failed
at 'date'. >> $outfile
mail #s "${SERVER}: log dump of $dbname failed" dba
< $outfile
endif
#
# .
echo dumplog:${SERVER}: completed xact log dump of $dbname
at 'date' >> $outfile
end
# dumplog
# dba.
echo "dumplog:${SERVER}: exiting at 'date'." >> $outfile
mail #s "${SERVER}: log dump cronjob complete" dba < $outfile
exit

SQL Server 4.9.2 (dumpdb_492)
!
"
SQL Server, Sybase.
dumpdb_492 "
. Sybase SQL Server 4.9.2 , "
,
. ,
, .
, dumpdb_492 , "
Sybase.
, dumpdb_492 "
.
dumpdb_492.
, :
dump database. SQL Ser"
ver 4.9.2 "
model ,
, "
.
dumpdb_492
cron". ,

dumpdb_492 <_> <>.
dumpdb_492 "
, .
#!/bin/csh #f
umask 006
setenv SYBASE /home/sybase
#
#
#
#
#

.
echo #n
.

set username = $<

www.books-shop.com

# stty #echo .
# clear .
echo #n Please
set username =
stty #echo
echo #n Please
set password =
stty #echo
clear

enter your SQL Server login:


$<
enter your SQL Server password:
$<

# outfile.
set outfile=/diskdump/public_dumpdb.out
# dumpdb_492
# .
echo "dumpdb:PDSOPS21: started at 'date'."
echo "dumpdb:PDSOPS21: started at 'date'." > $outfile
#
#
#
#
#
#
#

UNIX
mt. #f
(nrst8).
,

.
.

mt #f /dev/nrst8 rewind
#
#
#
#
#
#
#
#
#
#
#
#
#
#

,
,' dumpdb_492.
.
,
SQL Server 4.9.2.

dumptape_header,
UNIX# dd,
. dd if
, of , bs
, a count
, .
uname #
.

echo '/usr/bin/uname #a'" "'/usr/bin/date' >/tmp/dumptape_header


dd if=/tmp/dumptape_header of=/dev/nrst8 bs=80 count=l
#
#
#
#
#
#


,
, dumpdb_492 ,
. ,
,
, .

foreach dbname (master dbl db2 db3 db4 model)


echo "dumpdb:PDSOPS21: dump of $dbname started at

'date'."
echo "dumpdb:PDSOPS21: dump of $dbname started at
'date'." >> $outfile

www.books-shop.com

#
#
#
#
#
#
#
#
#
#
#


ntapedump8,
nrst8.
dumpdb_492

. dumpdb_492 ,
UNIX# 'dba',
isgl ($SYBASE/bin/isql)
, .

isgl .

/usr/local/sybase/bin/isgl #U$username #SPDSOPS2 # >> ${outfile}


<<finish_sgl
$password
dump database $dbname to ntapedump8
go
exit
finish_sgl
# isgl
# .
if ($status) then
echo "dumpdb:PDSOPS21: database dump
at 'date'."
cat ${dbname}_dbdump.out
echo "dumpdb:PDSOPS21: database dump
at 'date'." >> $outfile
cat ${dbname}_dbdump.out >> $outfile
else
echo "dumpdb:PDSOPS21: database dump
at 'date'
echo "dumpdb:PDSOPS21: database dump
at 'date'." >> $outfile
endif
end

of $dbname has FAILED


of $dbname has FAILED

of $dbname completed
of $dbname completed

#
#
# .
echo "dumpdb:PDSOPS21: exiting at 'date'."
echo "dumpdb:PDSOPS21: exiting at 'date'." >> $outfile
# dba.
mail #s "dumpdb:PDSOSP21: output" dba < $outfile
# UNIX# mt offline
# .
mt #f /dev/nrst8 offline
exit


SQL Server 4.9.2 (loaddb_492)
loaddb_4 92 , 
dumpdb_492.
SQL Server 4.9.2,

www.books-shop.com

. SQL Server 4.9.2 "


load database
, . lo"
addb_492 .
dumpdb_492
,
.
, , dumpdb_492 "
master, db1, db2, db3, db4 model dbl
, (
count = 0) . dbl
; count = 2.
UNIX" mt.
rn""
, loaddb_492 "
( ,
, ). 1"
addb_492 :

loaddb_492 <_> <s_> <_6_>


loaddb_492 "
, "
.
. ", , "
, dumpdb_492, "
, switch loaddb_492 , ",
, ,
loaddb_492. "
dumpdb_492,
. , "
, dumpdb_492, "
, ,
loaddb_492.
# ! / b i n / c s h "f
umask 006

#rw#rw

# .
# ,
# 1 .
if ! ($#argv) then
dd if=/dev/rst8 bs=80 count=l
echo loaddb: format: loaddb.PDSOPS21 '<Server Name> <Server
Password> <Database (s) >'
exit (1)
endif
setenv SYBASE /home /Sybase
setenv SERVER PDSOPS21
set BIN=${ SYBASE} /bin
#
# srvname password, shift
# .
set srvname = $1
shift

set password = $1
shift
set databases_to_load = ($argv)
echo "loaddb: started at 'date'."

www.books-shop.com

#
#
#
#
#
#

.
,
rst8
. loaddb_492
rst8
, .

mt #f /dev/rst8 rewind
#
#
#
#
#

.
,
, counter.

, 1.

foreach dbname ($databases_to_load)


echo loaddb: beginning load of $dbname
switch ($dbname)
case master:
set counter = 1
breaksw
case dbl:
set counter = 2
breaksw
case db2:
set counter = 3
breaksw
case db3:
set counter = 4
breaksw
case db4:
set counter = 5
breaksw
case model:
set counter = 6
breaksw
default:
echo invalid database name $dbname
exit (1)
endsw
# n# ( n=counter+l).
# ,
# counter=0.
mt #f /dev/nrst8 fsf $counter
#
# .
if ($status) then
echo database load script failed during positioning
of tape contact DBA for help
exit (1)
endif
# .

echo "loaddb: started at 'date'." >


/dba/${SERVER}/diagnostics/${dbname}_loaddb.out
# isql .

www.books-shop.com

# ntapedump8
# .
${BIN}/bin/isql #Usa #S${srvname} #e >>
/dba/${SERVER}/diagnostics/${dbname}_loaddb.out <<finish_sql
$password
load database $dbname from ntapedump8
go
exit
finish_sql
# isql
# .
if ($status) then
echo load of $dbname failed at 'date'. >>
/dba/${SERVER)/diagnostics/${dbname}_loaddb.out
exit (1)
endif
echo load of $dbname completed at 'date'. >>
/dba/${SERVER}/diagnostics/${dbname}_loaddb.out
# .
mt #f /dev/rst8 off

end

# loaddb_492
# .
echo "loaddb: ended at 'date'." >>
/dba/${SERVER}/diagnostics/${dbname}_loaddb.out
mail #s 'load of database complete' dba <
/dba/${SERVER}/diagnostics/${dbname}_loaddb.out
exit

(update_statistics_all_tables)
update sta
tistics sp_recompile ,
. 
.
, , 
update_statistics_all_tables 
.
, , 
.
, , ,
update statistics.
update_statistics_all_tables ron
. crontab :
21 * *
/dba/<_cepepa>/scripts/update_statistics_all_tables
<_> 'cat
/usr/dba/.<_>'
crontab 
update_statistics_all_tables 21:00 .

, crontab ( 0)
( 6). , :
update_statistics_all_tables <_> <s_>

www.books-shop.com

#!/bin/csh "f
#
#
unalias rm
setenv SYBASE /home/sybase
setenv BIN ${SYBASE}/bin
set SERVER = $1
set PASSWORD = $2
set outfile=/dba/$${server}/diagnostics/update_statistics.out
cp /dev/null $outfile
#
set TEMPFILE=/tmp/${SERVER}_databases.list
cp /dev/null $TEMPFILE
${BIN}/isql #Usa #P$PASSWORD #S$SERVER #I$SYBASE/interfaces
<< finish_sgl >> $TEMPFILE
use master
go
select name from sysdatabases where name != "tempdb" order by name
go
finish_sgl
# ,
# ,
echo " " >> $outfile
echo "all databases in server...." >> $outfile
echo " " >> $outfile
cat $TEMPFILE >> $outfile
echo " "
${BIN}/isgl #Usa #P$PASSWORD #S$SERVER #I$SYBASE/interfaces
<< finish_sgl >> $outfile
select @@servername
go
select getdate()
go
finish_sgl
#
# dump_db_create
set num_lines='wc #1 $TEMPFILE
cut #cl#9'
set last_line='expr $num_lines # 2'
set first_line='expr $last_line # 2'
set databases_list='tail #$last_line $TEMPFILE I head #$first_line'
rm #f $TEMPFILE
#
foreach dbname ($databases_list)
#
#
set TEMPFILE2=/tmp/${dbname}_tables.list
cp /dev/null $TEMPFILE2
${BIN}/isgl #Usa #P$PASSWORD #S$SERVER #I$SYBASE/interfaces #e
<< finish_sgl >> $TEMPFILE2
use $dbname

www.books-shop.com


select name from sysobjects where type="U" order by name
go
finish_sql
echo " " >> $outfile
echo "gggggggggg@@g@gggggggg>> >> $outfile
echo "all tables in database $dbname...." >> $outfile
echo "@ggggggg@g@@@ggggggggg" >> $outfile
echo " " >> $outfile
cat $TEMPFILE2 >> $outfile
echo " " >> $outfile
#
#
set num_lines='wc #1 $TEMPFILE2 I cut #cl#9'
set last_line='expr $num_lines # 4'
set first_line='expr $last_line # 2'
set tables_list='tail #$last_line $TEMPFILE2 I head #$first_line'
rm #f $TEMPFILE2
#
# ,
#
echo >>gggggggggggg@@gggg@@ggg@gggggggg@@gggg@@gg" >> $outfile
echo "updating statistics for tables in database $dbname" >> $outfile
echo >>g@giggggggggggg@gg@ggggggggggg@ggggg@@gggg" >> $outfile
echo " " >> $outfile
foreach table_name ($tables_list)
${BIN}/isql #Usa #P$PASSWORD #S$SERVER #I$SYBASE/interfaces.#e
<< finish_sql >> $outfile
use $dbname
go
select getdate()
go
update statistics $table_name
go
sp_recompile $table_name

go
select getdateO

go
finish_sql
# end ,
# end
end
end
mail "s "$SERVER update statistics" dba < $outfile
exit(O)

%RRNVVKRS

piracy@books-shop.com


<dump_db_create)
dump_db_create trun
sactSQL,
(, 
, dump_db_create, 
). dump_db_create
cron, crontab
23 * * * /dba/<ttM>>_cepsepa>/scripts/dump_db_create <_> 'cat
/usr/dba/.<_>'
( dump_db_create 23:00.) 
:
dump_db_create <_> <s_>
# ! / b i n / c s h "f
#
# .
unalias rm
setenv SYBASE /home/sybase
setenv BIN ${SYBASE}/bin
set SERVER = $1
set PASSWORD = $2
set outfile=/dba/${SERVER}/diagnostics/dump_db_create.out
cp /dev/null $outfile
# (c)
# , .
set TEMPFILE=/tmp/${SERVER}_databases.list
cp /dev/null $TEMPFILE
${BIN}/isql #Usa #P$PASSWORD #S$SERVER #I$SYBASE/interfaces
<< finish_sql >> $TEMPFILE
use master
go
select name from sysdatabases where name != "tempdb" order by name
go
finish_sql
# ,
# , .
echo " " >> $outfile
echo "all databases in server...." >> $outfile
echo ". " >> $outfile
cat $TEMPFILE >> $outfile
echo " "
${BIN}/isql #Usa #P$PASSWORD #S$SERVER #I$SYBASE/interfaces
<< finish_sql >> $outfile
select @@servername

go
select getdate()
go
finish_sql
# ,
# ,
# . wc #1

www.books-shop.com

#
#
#
#
#
#
#
#
#

$TEMPFILE,
( #1 , wc
(word count) , ).
cut # wc #1
num_lines, tail
(num_lines # 2) $TEMPFILE (..
) , head
. ,
$TEMPFILE, .

set num_lines='wc #1 $TEMPFILE I cut #cl#9


set last_line= ' expr $num_lines # 2'
set first_line='expr $last_line # 2'
set databases_list='tail #$last_line $TEMPFILE I head #$first_line'
rm #f $TEMPFILE
# ,
# p_dbcreate.
foreach dbname ($databases_list)
${BIN}/isql #Usa #P$PASSWORD #S$SERVER #I$SYBASE/interfaces

<< finish_sql >> $outfile


#
#
#
#
#
#

,
p_dbcreate sybsystemprocs,
4.9.2. p_dbcreate
,
( SQL Server 4.9.2 ,
, master) .

use sybsystemprocs
go
p_dbcreate $dbname
go
finish_sql
end

exit (0)

dbcc (checkdb)
checkdb dbcc 
, DBCC.
dbl, . ,

p_dbcreate (. ),
(

). , p_dbcreate
for load.
checkdb
:
checkdb <s_>
.
, . 
, checkdb
, . , 
dbcc . 
, , ,
.

www.books-shop.com

#!/bin/csh #f
#
#
#
#
#
#
#
#
#
#
#
#

select @@servername ,
.
select db_name() .
select getdate() .
dbcc traceon (3604) dbcc#
(
).
checkdb
dbcc#,
dbcc
(, ,
DBCC#).

isql #Usa #P$l #SDDSMAIN1 > dbcc_dbl.out << finish_sql


select @@servername
go
use dbl
go

select db_name()
go
select getdate()
go
dbcc traceon (3604)
go
dbcc checkalloc (dbl)

go
select getdate()
go
dbcc checkdb (dbl)

go
select getdate()
go
dbcc checkcatalog (dbl)
go
select getdate()
go
finish_sql
mail #s "dbcc runs for dbl completed" dba < dbcc_dbl.out
exit(0)


(dump_systables)
cron dump_systables 
, 
. dump_systables .
SQL Server System 11 ,
dump_systables
UNIX.

, , 
, .
crontab dump_sys
tables 20:00;
20 * * * /dba/<_cepepa>/scripts/dump_systables <_> 'cat
/usr/dba/.<_>'

www.books-shop.com

dump_systables
,
:
dump_systables <_> <s_>
, .
# ! / b i n / c s h "f
if ($#argv < 2) then
echo ${0}: invalid format, $#argv parameters given, 2 required.
echo ${0}: required format: ${0} '<svrname> <password> .'
exit (1)
endif
umask 006
#

#rw#rw

setenv SYBASE /home/sybase


setenv BIN ${SYBASE}/bin
set SERVER=$1
shift
set PASSWORD=$1
shift
# ,
# dump_systables .
set dir=/dba/${ SERVER} /diagnostics
cd $dir
#
#
#
#
#
#
#
#
#
#

isql,
'' .
master,

sp_configure sybsystemprocs.
p_mirror p_devepace

. ,
syslogins
.

${BIN}/isql #Usa #S${SERVER} > ${dir} /${SERVER}_dump_systables.out


<< finish_sql
$PASSWORD
use master
go '
select * from sysusages
go
select * from sysdevices

go
select * from sysdatabases

go
select * from sysservers
go
select * from sysremotelogins
go
exec sp_configure

go
exec sp_helpdevice
go

exec sp_helpdb
go
select * from syslogins
go

www.books-shop.com

use sybsystemprocs
go
exec p_mirror
go
exec p_devspace
go
exec p_servermap
go
exit
finish_sql
# .
date >> ${dir}/${SERVER}_dump_systables.out
chmod 600 ${SERVER}_dump_systables.out
exit
,
(p_dbcreate)
sybsystemprocs
p_dbcreate, ,
, dump_db_crea"
te, .
for load create database,
"
, " . "
,
create database,
.
create database for load, p_dbcreate
Transact"SQL, sysusages master "
, .
sysusages 12. , "
sysusages "
,
, "
.
sybsystemprocs p_dbcreate "
, sp_dbcreate. ,
'sa', ,
( sa_role SQL Server System 10/11), p_dbcreate
sybsystemprocs
grant execute on p_dbcreate to public

p_dbcreate :
isql Usa $<_> <s_>
use sybsystemprocs
go
p_dbcreate <__>
go
use sybsystemprocs

go
create proc p_dbcreate @dbname varchar(40) as
# select
# create database, sysusages

www.books-shop.com

# , ,
#
# (1 = 1024*1024 ; SunOS
# 2048 ).
#
# ,
# , 12
#
# vstart sysusages
# (lowhigh) ,
# sysdevices.
select 'create database ' + @dbname + ' on'
select
name + '=' + convert (char (4) , (size*2048) / (1024*1024) ) +
',' from master .. sysusages u, master. .sysdevices d
where u. vstart >= d.low
and u.vstart <= d.high
and d.cntrltype=0
and u.dbid=(select dbid from master. .sysdatabases where
name=@dbname)
order by u.lstart
select 'for load'
#
#
#
#
#
#
#
#
#
#
#
#

,
sysusages ,

. segmap (
) sysusages
.
sysusages,

segmap,
vstart sysusages
(lowhigh) ,
sysdevices.

select 'update sysusages set segmap=' +


convert (char (4) ,u. segmap) + ' where
dbid=( select dbid from master . .sysdatabases where name="'
+ @dbname +

'") and Istart >= ' + convert (char (9) ,lstart) +


'and Istart < ' +
convert (char (9) , 1start+size) from
master .. sysusages u, master .. sysdevices d
where u. vstart >= d.low
and u. vstart <= d.high
and d.cntrltype=0
#
# sysusages,
# .
# dbid sysusages
# ,
# ,
# .

# select dbid ... where = @dbname.


and u.dbid= (select dbid from master . .sysdatabases where name=@dbname)
go

www.books-shop.com


( p_mirror)
sybsystemprocs p_mirror,
( status) .

. p_mirror dump_sys"
tables (. ) , , "
, . ,
status ,
. ""
p_mirror, "
( status) . ,
(
, ).
, p_mirror sp_mirror,
. p_mirror
, , sybsystem
procs
grant execute on p_mirror to public

p_mirror :
isql Usa S<_> <s_>
use sybsystemprocs
go
p_mirror
go
SQL, p_mirror , .
(), (phyname), 
(mirrarname) (status) 
master sysdevices.
SQL Server, cntrltype = 0.
use sybsystemprocs
go
create procedure p_mirror as
select getdate()
select @@servername
select db_name()
select "logical"=substring(name,l,10) , "physical "=substring (phyname, 1,20) ,
"mirror "=substring(mirrorname, 1,20) , status from
master. .sysdevices where cntrltype=0
go


( p_devspace)
sybsystemprocs p_devspace,
, "
. p_mirror, p_devspace "
dump_systables.
, "
.
p_devspace sp_devspace
. p_devspace ,
:

www.books-shop.com

grant execute on p_devspace to public


p_devspace :
isql Usa S<_> <s_>
use sybsystemprocs

go
p_devspace
go
use sybsystemprocs

go
create procedure p_devspace as
select device_name = sysdev.name,
total_Mb = (sysdev.high # sysdev.low + 1) / 512,
used_Mb = sum(sysuse. size) /512,
free_Mb =
(sysdev.high # sysdev.low + 1)/512 #
sum(sysuse. size) /512
into #space_on_devices
from sysdevices sysdev,
sysusages sysuse
where
sysdev.cntrltype = 0
and
sysuse.vstart
between
sysdev.low
and
sysdev.high
group by
sysdev.name
/* ,
*/
insert #space_on_devices
select sysdev.name,
total_Mb = (sysdev.high # sysdev.low + 1) / 512,
used_Mb = 0 ,
free_Mb = (sysdev.high # sysdev.low + 1) / 512
from sysdevices sysdev, sysusages sysuse
where
sysdev.cntrltype = 0
and not exists
(select * from sysusages sysuse2
where sysuse2.vstart between sysdev.low and sysdev.high)
/* */
select distinct * from #space_on_devices
order by device_name
compute sum(total_Mb),
sum(used_Mb) , sum(free_Mb)
return
go

www.books-shop.com

,

( p_servermap)
sybsystemprocs
p_servermap, ,
. p_servermap "
dump_systables. "
, ,

, , .
p_mirror p_devspace p_servermap
. , ,
, "
, , "
:
Isql *Usa *S<_> *<s_>
use <__>

select * from syssegments

, p_servermap "
, . "
/ p_devspace.
, p_servermap sp_servermap
,
, :
grant execute on p_servermap to public
p_servermap:
Isql *Usa *S<_> *<s_>
use sybsystemprocs
go
p_servermap
go
use sybsystemprocs
go
# .
# sysusages
# #smap.
create procedure p_servermap as
select device_name =substring( sysdev.name,1,11) ,
database_name=substring(sysdb.name,1,20),
seg#=substring( convert (char (4) , sysuse.segmap),1,4),
size_Mb = substring (convert (char(7),sysuse. size/512),1,7)
into #smap
from sysdevices sysdev,
sysdatabases sysdb,
sysusages sysuse
where
sysdev.cntrltype = 0
and
sysuse.vstart

www.books-shop.com

between
sysdev. low
and
sysdev.high
and
sysuse.dbid = sysdb.dbid
#
#
#
#
#

#smap,
, ,
#smap2. ,
,
, .

select device_name,database_name,
seg#, space_per_seg=sum( convert (int ,size_Mb) )
into #smap2
from #smap
group by device_name,database_name,seg#
#
#
#
#
#
#
#
#
#
#
#
#

segmap. segmap
1 7
,
, .
syssegments .
, SQL Server System 10
(sybsecurity) auditsegment segmap = 8.
sybsecurity
system (segmap = 1) ,
default (segmap = 2) logsegment (segmap =4), segmap
sybsecurity ,
15 (segmap = 1 + 2 + 4 + 8 ) .

set nocount on
select "segmap values 1 through 1
seg# and segment name
1 system
2 # default
3 default/system
4 log only
5 # log/system
6 log/default
7 # log/system/default
8 user defined
15 audit/log/sys/def
16 user defined"
set nocount off
#
# #smap2
# .
select device_name,database_name,
seg# , space_per_seg
from #smap2
order by device_name,database_name, seg#
compute sum(space_per_seg)
by device_name
return
go

%RRNVVKRS

piracy@books-shop.com

(dumpdb)
Backup Server
. , "
, (
" ).
,
. , db1 , "
; db2 ,
master, "
. , "
.
master "
, "
.
master , "
() , "
dumpdb dump transaction truncate_only.
master dump
database master (. 7). , "
master , "
.
dumpdb_492 (. ), dumpdb "
cron". "
,
. dumpdb_492,
dumpdb . , , "
, oper_role, .
dumpdb

dumpdb
<_>
<>
#!/bin/csh #f
umask 006
setenv SERVER PDSOPS21
setenv SYBASE /home/sybase
#
#
#
#
#


,
TAPEDEVNO. REWINDINGTAPE NONREWINDINGTAPE

.

setenv TAPEDEVNO 8
setenv REWINDINGTAPE /dev/rst${DEVNO}
setenv NONREWINDINGTAPE /dev/nrst${DEVNO}
echo #n Enter Your Server Username:
set username = $<
stty #echo
echo #n Enter Your Server Password:
set password = $<
stty echo
clear
echo dumpdb:${SERVER}: beginning dump of ${SERVER} system 10 server
set dir=/diskdump
set outfile=${dir}/${srvname}_dumpdb.out

www.books-shop.com

#
#
#
#

tee, ,
,
( ).
.

setenv COPYINPUT '/bin/tee #a '${outfile}


mt #f ${NONREWINDINGTAPE} rewind
#
# .
set dbname=db1
echo "dumpdb:${SERVER}: [${dbname}] started at 'date'." > ${outfile}
#
#
#
#
#
#
#
#
#

db1.
, System 10 dump
database capacity=5000000,
,
5 .
with init
(
).
, .

$SYBASE/bin/isgl #U${username} #S${SERVER} #e <<finish_sql_tape1 |


$COPYINPUT
${password}
dump database ${dbname} to '${NONREWINDINGTAPE}'
capacity=5000000
with init

go
exit
finish_sql_tape1
#
# 1.
if ($status) then
echo "dumpdb:${SERVER}: database dump of ${dbname} has
FAILED at 'date'." | $COPYINPUT
cat ${dbname}_dbdump.out | $COPYINPUT
exit(1)
else
echo "dumpdb: ${SERVER}: dump of ${dbname} completed at
'date'." | $COPYINPUT
endif
# .
mt #f ${NONREWINDINGTAPE} off
# .
echo #n "Load 2nd PDSOPS21 server tape. Press return when ready to continue."
# " PDSOPS21 return."
set waiting = $<
echo #n "Are you sure the 2nd tape is loaded? Press return if ready
to continue. "
# " , return."

www.books-shop.com

set waiting = $<

mt #f ${NONREWINDINGTAPE} rewind

# db2 master.
# , with init
# dump database .
set dbname=db2
set dbname2=master
echo "dumpdb:${SERVER}: [${dbname}] started at 'date'." |
$COPYINPUT
$SYBASE/bin/isql #U${username} #S${SERVER} #e <<finish_sql_tape2 |
$COPYINPUT
${password}
dump database ${dbname} to '${NONREWINDINGTAPE}'
capacity=5000000
with init

go
dump database ${dbname2} to '${NONREWINDINGTAPE}'
capacity=5000000

go
dump tran master with truncate_only
go
exit
finish_sgl_tape2
if ($status) then
echo "dumpdb:${SERVER}: database dump of $dbname has FAILED
at 'date'." | $COPYINPUT
cat ${dbname}_dbdump.out | $COPYINPUT
else
echo "dumpdb:${SERVER}: dump of $dbname completed at
'date'." | $COPYINPUT
endif
# .
mt #f ${NONREWINDINGTAPE} off
#
#
#
#
#


,
dump database. SQL Server System 10

.

foreach dbname (db3 db4 db5 db6 db7)


echo "dumpdb:${srvname}: [${dbname}] started at 'date'." I $TEE
$SYBASE/bin/isgl #U${username} #S${SERVER} #e <<finish_sql_diskdumpdb
| $COPYINPUT
${password}

dump database ${dbname} to ''/diskdump/${dbname}_databasedump.out"


go
exit
finish_sql_diskdumpdb
if ($status) then

echo "dumpdb:${SERVER}: database dump of $dbname has FAILED


at 'date'.# I $COPYINPUT
cat ${dbname}_dbdump.out I $COPYINPUT

else
echo "dumpdb:${SERVER}: dump of $dbname completed at
date'." I $COPYINPUT

www.books-shop.com

endif
# .
end

echo " dumpdb:$ {SERVER}: exiting at 'date'." I $COPYINPUT


# dba.
mail #s "dumpdb:${srvname} : output" dba < $outfile
clear
exit
(loaddb)
SQL Server 4.9.2, System 10 "
. System 10 "
,
.
SQL Server, "
. "

load database db1 with listonly
, "
, . ,
,
, . "
, "
,
.
dumpdb "
file= '_' dump
database.
switch, . "
, "
.

( p_dbload)
sybsystemprocs "
p_dbload, ,
p_dbload. ,
, "
. p_dbload , "

grant execute on p_dbload to public
, sp_dbload
. p_dbload :
isql *Usa *$<_> *<s_>
use sybsystemprocs
go
p_dbload
go
SQL, p_dbload, :
Use sybsystemprocs

go

www.books-shop.com

create procedure p_dbload as


#
#
#
#

sysprocesses
,
(
physical_io ) .

select spid,cmd,(convert(int,physical_iO))*2048/(1024*1024) "Mb


loaded" from master..sysprocesses where cmd="LOAD DATABASE"
go

p_dbload, 
.
trainwreck% isgl #Usa #SPSYCHO_DB
Password:
1> p_dbload
2> go

spid
1

cmd
LOAD DATABASE

Mb loaded
.

60

Time
Apr 01 1996 11:59AM

(1 row affected, return status = 0)


1> p_dbload
2> go
spid
cmd
Mb loaded
1

LOAD DATABASE

62

Time
Apr 01 1996 12:00PM

(1 row affected, return status = 0)


1> p_dbload
2> go
spid
cmd
Mb loaded
1

LOAD DATABASE

103

Time
Apr 01 1996 12:04PM

(1 row affected, return status = 0)



, SQL Server 11.O.l.
#!/bin/sh
#

# SQL Server Information:


# :

PSYCHO11

# master:
/dev/rdsk/cOt2dOs7
# master:
10752
# :
/home/sybase/11..1/install/errorlog
# :
/home/sybase/11.0.1
#
/home/sybase/11.0.1/bin/dataserver #d/dev/rdsk/cOt2dOs7 #sPSYCHOll \
#e/home/sybase/11.0.l/install/errorlog_PSYCHOll #i/home/sybase/11.0.1
Backup Server ll.O.l
#!/bin/sh
#
# Backup Server Information:
# :

PSYCHO11_BCK

#
#
#
#

/home/sybase/11..I/install/backup.log
/home/sybase/11.0.I/interfaces

:
:

multibuf:

/home/sybase/11..1/bin/sybmultbuf

# :

us_english

# :

iso_l

#
# :

/home/sybase/11..l/backup_tape.cfg

www.books-shop.com

#
#
/home/sybase/ll.O.l/bin/backupserver
"SPSYCHO11_BCK
\
"e/home/sybase/11 . . 1 /install /backup. log "I/home/sybase/11 . 0 . 1/interfaces \
"M/home/sybase/11 .0 . 1/bin/sybmultbuf "Lus_english "Jiso_l \
"c/home/sybase/11 .0 .l/backup_tape.cfg
SQL Server System 11
"
System 11.
4.9.2 System 10.
SQL Server System 11.
. "
Bourne.
, "
, .
UNIX SQL Server, "
sed, awk perl. , "
, .
, 'sa' . kparm ("
). , , "
,
. UNIX" Sybase. "
,
, . , "
, (*****).
System 11 (dump_listof_dbs)
dump_listof_dbs
. , "
. ,
. "
isgl, ,
isgl. isql
isql, . "

dump database "
.
,
, . , "
, System 10 11.
dump_listof_dbs SQL Server 4.9.2
,
, .
#!/bin/sh
#
# Bourne ,
# , .
# 30.8.96
#
if [ $# #lt 2 ]
then
echo $0: invalid format: $# argv parameters provided, at least 2

required
# 2
echo $0: required format: $0 ' <SERVER> <database(s) . . .>'
exit 1
272221

www.books-shop.com

fi
#
#
#
# *****
# SYBASE PWD.
SYBASE=/export/home/Sybase
SERVER=$1
PWD='cat /export/home/sybase/.kparm'
# ***** .
dumpdir=/export/home/dbdump
outfile=${dumpdir}/${SERVER}_dumpdb.out
outfile2=${dumpdir}/${SERVER}_dumpdb.out2
shift
dbs_to_dump ="$ *"

#
# .
#
echo "database dump:$(SERVER}: started at 'date'." > $outfile
echo "database dump:${SERVER}: started at 'date'." > $outfile2
echo " " >> $outfile
echo " " >> $outfile2
#
# .
#
for dbname in $dbs_to_dump
do
dmptime='date +%m%d%y_%H%M%S'
dumpfi1e=${SERVER}_${dbname}_${dmptime}.dmp
proc_name=dump_temp_sproc_${dmptime}
# ***** isql .
# SQL,
# ,
# .
# dump database.
# ***** SQL Server 4.9.2
# ${dumpdir}/${dumpfile}
# .
#
# isql SQL Server.
#
$SYBASE/bin/isgl #Usa #S${SERVER} #P${PWD} #I$SYBASE/interfaces
#e >> ${outfile} << finish_sql
create procedure $proc_name as
declare @status int
dump database $dbname to '${dumpdir}/${dumpfile}'
go
declare @return_status int
execute @return_status=$proc_name
drop procedure $proc_name
if @return_status = 0
begin
print "************************************************"
print "Stored Procedure Execution Complete no errors"
#print " "
end
else
begin

www.books-shop.com

print
"!!!!!!!!!!!!!!!!!!!!!!!!!!!"
print "FAILURE of Stored Procedure"
#print " "
end
go
exit
finish_sgl
#
# isql.
# #
# , #
# .
#
isql_status=$<
#
# SQL#,
# .
#
sproc_status= ' tail #l ${outfile}'
#
# isql :
#
if [ $isql_status #ne 0 ]
then
echo " " >> $outfile
echo database dump: $ {SERVER }: isql for dump of $dbname failed at
'date' >> $outfile
echo " " >> $outfile
echo " " >> $outfile2
echo database dump: $ {SERVER }: database dump of $dbname failed at
'date' >> $outfile2
echo " " >> $outfile2
# ***** .
/usr/ucb/mail #s "${SERVER}: database dump of $dbname failed"
psychoDBA@dbahost < $outfile
#
# isql
# .
#
else
#
# :
#
if [ "$sproc_status" = "Stored Procedure Execution Complete # no errors" ]
then
echo " " >> $outfile
echo database dump :$ {SERVER }: completed database dump of $dbname at
'date' >> $outfile
echo " " >> $outfile2
echo database dump: ${SERVER}: completed database dump of $dbname at
'date' >> $outfile2
fi
#
# :
#

if [ "$sproc_status" = "FAILURE of Stored Procedure" ]


then
echo " " >> $outfile
echo database dump :${SERVER}: sproc for database dump $dbname failed

www.books-shop.com

at 'date' >> $outfile


/usr/ucb/mail #s "${SERVER}: database dump of $dbname failed"
psychoDBA@dbahost < $outfile
echo " " >> $outfile2
echo database dump:$(SERVER}: sproc for database dump $dbname failed
at 'date' >> $outfile2
fi
fi
#
#
#
done
#
#
# .
#
echo " " >> $outfile
echo "database dump:${SERVER}: exiting at 'date'." >> $outfile
echo " " >> $outfile
echo " " >> $outfile2
echo " " >> $outfile2
echo "database dump:${SERVER}: exiting at 'date'." >> $outfile2
echo " " >> $outfile2
echo " " >> $outfile2
echo "******************************************************<< >> $outfile2
cat $outfile >> $outfile2
# ***** .
/usr/ucb/mail #s "${SERVER}: database dump cronjob complete"
psychoDBA@dbahost < $outfile2
exit

(logdump_listof_dbs)
1ogdump_listf_dbs
. ,
, . 
, SQL Server System 10 11. 
logdump_listof_dbs SQL Server 4.9.2

.
#!/bin/sh
#
# Bourne,
# , .
# 6.9.96
#
if [ $# #lt 2 ]
then
echo $0: invalid format: $# argv parameters provided, at least 2 required
# 2
echo $0: required format: $0 '<SERVER> <database(s)...>'
exit, 1
fi
#
#
#
# *****

www.books-shop.com


# SYBASE PWD.
SYBASE=/export/home/Sybase
SERVER=$1

PWD='cat /export/home/Sybase/.kparm'
# ***** .
durnpdir=/export/home/dbdump
outfile=${dumpdir}/${SERVER}_dumplog.out
outfile2=${dumpdir}/${SERVER}_dumplog.out2
shift
dbs_to_logdump="$*
#
# .
#
echo "transaction log dump:${SERVER}: started at 'date'." > $outfile
echo "transaction log dump:${SERVER}: started at 'date'." >
$outfile2
echo " " >> $outfile
echo " " >> $outfile2
#
# ,
#
for dbname in $dbs_to_logdump
do
dmptime='date +%m%d%y_%H%M%S'
dumpfile=${SERVER}_${dbname}_${dmptime}_log.dmp
proc_name=dlog_temp_sproc_${dmptime}
# ***** isgl .
# SQL,
# ,
# .
# dump transaction.
# ***** SQL Server 4.9.2
# ${dumpdir}/${dumpfile}
# .
#
# isql SQL Server.
#
$SYBASE/bin/isql #Usa #S${SERVER) #P${PWD} #I$SYBASE/interfaces
#e >> ${outfile} << finish_sgl
create procedure $proc_name as
declare @status int
dump tran $dbname to '${dumpdir}/${dumpfile}'

go

declare @return_status int


execute @return_status=$proc_name
drop procedure $proc_name
if @return_status=0
begin
print "************************************************"
print "Stored Procedure Execution Complete no errors"
#print " "
end
else
begin
print "!!!!!!!!!!!!!!!!!!!!!!!!!!!"
print "FAILURE of Stored Procedure"
#print " "
end

%RRNVVKRS

piracy@books-shop.com

399


exit
finish_sql
#
# isql.
# #
# , #
# .
#
isql_status=$<
#
# SQL#,
# .
#
sproc_status='tail #1 ${outfile}'
#
# isql :
#
if [ $isql_status #ne 0 ]
then
echo " " >> $outfile
echo database 1ogdump:${SERVER}: isql for logdump of $dbname failed
at 'date' >> $outfile
echo " " >> $outfile
echo " " >> $outfile2
echo database logdump:${SERVER}: database logdump of $dbname failed
at 'date'>> $outfile2
echo " " >> $outfile2
# ***** .
/usr/ucb/mail #s "${SERVER}: database logdump of $dbname failed"
psychoDBA@dbahost < $outfile
#
# isql
# .
#
else
#
# :
#
if [ "$sproc_status" = "Stored Procedure Execution Complete # no errors" ]
then
echo " " >> $outfile
echo database logdump:${SERVER}: completed database logdump of
$dbname at 'date' >> $outfile
echo " " >> $outfile2
echo database logdump:${SERVER}: completed database logdump of
$dbname at 'date' >> $outfile2
fi
#
# :
#
if [ "$sproc_status" = "FAILURE of Stored Procedure" ]
then
echo " " >> $outfile
echo database 1ogdump:${SERVER}: sproc for database logdump $dbname
failed at 'date' >> $outfile
# ***** .
/usr/ucb/mail #s "${SERVER}: database logdump of $dbname failed"
psychoDBA@dbahost < $outfile

www.books-shop.com

echo " " >> $outfile2


echo database logdump:${SERVER}: sproc for database logdump $dbname
failed at 'date' >> $outfile2
fi
fi
#
#
#
done
#
#
# .
#
echo " " >> $outfile
echo "database logdump:${SERVER}: exiting at 'date'." >> $outfile
echo " " >> $outfile
echo " " >> $outfile2
echo " " >> $outfile2
echo "database logdump:${SERVER}: exiting at 'date'." >> $outfile2
echo " " >> $outfile2
echo n" " >> $outfile2
echo ******************************************************"
>> $outfile2
cat $outfile >> $outfile2
# ***** ,
/usr/ucb/mail #s "${SERVER}: database logdump cronjob complete"
psychoDBA@dbahost < $outfile2
exit

(trunclog_listof_dbs)

. , ,
, o. SQL Server 
, , 

. , 
,
, 
. , ( 
tempdb,
) logdump_listof_dbs trunclog_lis
tof_dbs.
!/bin/sh
#
# Bourne,
# , .
# 6.9.96
#
if [ $# #lt 2 ]
then
echo $0: invalid format: $# argv parameters provided, at least 2 required
# 2

echo $0: required format: $0 '<SERVER> <database(s)...>'


exit 1
fi
#

www.books-shop.com

#
#
# *****
# SYBASE PWD.
SYBASE= /export /home /Sybase
SERVER=$1
PWD= ' cat /export /home /sybase/.kparm'
# ***** .
dumpdir=/export /home/dbdump
outfile=${dumpdir}/${SERVER}_trunclog.out
outfile2=${dumpdir}/${SERVER}_trunclog.out2
shift
dbs_to_trunclog= " $* "
#
# dump transaction.
#
echo "transaction log truncate: $ {SERVER} : started at 'date'." >
$outfile
echo "transaction log truncate: $ {SERVER} : started at 'date'." >
$outfile2
echo " " >> $outfile
echo " " >> $outfile2
#
#
#
for dbname in $dbs_to_trunclog
do
dmptime='date +%m%d%y_%H%M%S'
dumpfile=${SERVER}_${dbname}_${dmptime}_log.dmp
proc_name=tlog_temp_sproc_${dmptime}
# ***** isgl .
# SQL,
# ,
# .
# dump transaction.
# ,
#
# .
#
# isgl SQL Server.
#
$SYBASE/bin/isgl #Usa #S$ {SERVER} #P${PWD} #I$SYBASE/interfaces
#e >> ${outfile} << finish_sgl
create procedure $proc_name as
declare status int
dump tran $dbname with truncate_only
go
declare @return_status int
execute ireturn_status=$proc_name
drop procedure $proc_name
if @return_status = 0
begin
print "************************************************"
print "Stored Procedure Execution Complete no errors"

#print " "


end
else
begin

www.books-shop.com

print "I!!!!!!!!!!!!!!!!!!!!!!!!!!"
print "FAILURE of Stored Procedure"
#print " "
end
go
exit
finish_sql
#
# isql.
# #
# , #
# .
#
isql_status=$<
#
# SQL#,
# .
#
sproc_status='tail #l ${outfile}'
#
# isql :
#
if [ $isql_status #ne 0 ]
then
echo " " >> $outfile
echo transaction log truncate:$(SERVER): isql for logtrunc of
$dbname failed at 'date' >> $outfile
echo " " >> $outfile
echo " " >> $outfile2
echo transaction log truncate:${SERVER}: database logtrunc of
$dbname failed at 'date' >> $outfile2
echo " " >> $outfile2
# ***** .
/usr/ucb/mail #s "${SERVERJ: transaction log truncate of $dbname failed"
psychoDBA@dbahost < $outfile
#
# isql
# .
#
else
#
# :
#
if [ "$sproc_status" = "Stored Procedure Execution Complete no errors"
then
echo " " >> $outfile
echo transaction log truncate:${SERVER}: completed database logtrunc
of $dbname at 'date' >> $outfile
echo " " >> $outfile2
echo transaction log truncate:${SERVER}: completed database logtrunc
of $dbname at 'date' >> $outfile2
fi
#
# :
#

if [ "$sproc_status" = "FAILURE of Stored Procedure" ]


then
echo " " >> $outfile
echo transaction log truncate:${SERVER}: sproc for database logtrunc

www.books-shop.com

$dbname failed at 'date' >> $outfile


# ***** ,
/usr/ucb/mail #s "${SERVER}: transaction log truncate of $dbname
failed" psychoDBA@dbahost < $outfile
echo " >> $outfile2
echo database dump:${SERVER}: sproc for database logtrunc $dbname
failed at 'date' >> $outfile2
fi
fi
#
#
#
done

#
#
# .
#
echo * * >> $outfile
echo "transaction log truncate:${SERVER}: exiting at 'date'." >>
$outfile
echo " " >> $outfile
echo " " >> $outfile2
echo " " >> $outfile2
echo "transaction log truncate:${SERVER}: exiting at 'date'." >>
$outfile2
echo " " >> $outfile2
echo " " >> $outfile2
echo "******************************************************>> >>
$outfile2
cat $outfile >> $outfile2
# ***** ,
/usr/ucb/mail #s "${SERVER}: transaction log truncate cronjob
complete" psychoDBA@dbahost < $outfile2
exit

(remove_old_files)
remove_old_f iles ,
. 
, 
. ,
UNIX.
remove_old_files 
, (
).
#!/bin/sh
#

# Bourne,
# , X
# 11.9.96
#
if. [ $# #lt 2 ]
then
echo $0: invalid format: $# argv parameters provided, at least 2 required
# 2
echo $0: required format: $0 '<"/path/filename pattern to remove">
<days old>'
exit 1

www.books-shop.com

fi
#
#
#
remove_file=$l
days_old=$2
# *****
dumpdir=/export/home/dbdump
outfile=${dumpdir}/remove_flies.out
outfile2=${dumpdir}/remove_flies.out2
#
#
#
echo "remove old files ${remove_file}: started at 'date'." >
$outfile
echo "remove old files ${remove_file}: started at 'date'." >
$outfile2
echo " " >> $outfile
echo " " >> $outfile2
#
#
#
find ${remove_file) #mtime +${days_old} #a #exec ls #1 {} \; >>
$outfile
#
# ...
#
num_files='find ${remove_file} #mtime +${days_old) #exec ls #1 {}
\;

wc

#1'

# ...
#
find ${remove_file} #mtime +${days_old} #a #exec rm #rf {} \;
#
# :
#
remove_dir='dirname "${remove_file}"'
if [ ! #d "${remove_dir}" ]
then
echo " " >> $outfile
echo remove old files ${remove_file}: find failed at 'date'. >>
$outfile
echo "
> directory not found!" >>
$outfile
echo " " >> $outfile
echo " " >> $outfile2
echo remove old files ${remove_file}: find failed at 'date'. >>
$outfile2
echo "
> directory not found!" >>
$outfile2
echo " " >> $outfile2
# *****
/usr/ucb/mail #s "${SERVER> remove old files ${remove_file} failed"
psychoDBA@dbahost < $outfile
#

# :
#
else
#

www.books-shop.com

#
#
echo " " >> $outfile
echo remove old files ${remove_file}: number of files deleted =
${num_files} >> $outfile
echo " " >> $outfile2
echo remove old files ${remove_file}: number of files deleted =
${num_files} >> $outfile2
fi
#
#
#
echo " " >> $outfile
echo "remove old files ${remove_file}: exiting at 'date'." >>
$outfile
echo " " >> $outfile
echo " " >> $outfile2
echo " " >> $outfile2
echo "remove old files ${remove_file}: exiting at 'date'." >>
$outfile2
echo " " >> $outfile2
echo " " >> $outfile2
echo "****************************************************** >>
$outfile2
cat $outfile >> $outfile2
# *****
/usr/ucb/mail #s "${SERVER} remove old files ${remove_file} cronjob
complete" psychoDBA@dbahost < $outfile2
exit

(update_listof_dbs)
update statistics sp_recompile
. update_listf _dbs 
, .
#!/bin/sh
#
# Bourne,
# update statistics sp_recompile
# , .
# 18.10.96
#
if [ $# #lt 2 ]
then
echo $0: invalid format: $# argv parameters provided, at least 2 required
# 2
echo $0: required format: $0 '<SERVER> <database(s)...>'
exit 1
fi
#
#
#
# *****

# SYBASE PWD.
SYBASE=/export/home/sybase
SERVER=$1
PWD='cat /export/home/sybase/.kparm'

www.books-shop.com

# ***** .
dumpdir= /export/home/dbdump
outfile=$ {dumpdir}/${SERVER}_updatestats.out
outfile2=${dumpdir}/${SERVER}_updatestats.out2
tempfile=${dumpdir}/${SERVER}_updatestats.tempi
shift
dbs_to_update="$*"
#
# .
#
echo "update statistics:${SERVER}: started at 'date'." > $outfile
echo "update statistics:${SERVER}: started at 'date'." > $outfile2
echo " " >> $outfile
echo " " >> $outfile2
#
#
#
for dbname in $dbs_to_update
do
#
#
# .
#
$SYBASE/bin/isql #Usa #S$ {SERVER} #P${PWD} #I$SYBASE/interfaces
#e > ${tempfile} << finish_sqll
use $dbname
go
select name from sysobjects where type="U" order by name
go
finish_sgll
#
#
#
echo " " >> $outfile
echo "@@@@@@@@@@@@@@@@@@@@@@@" >> $outfile
echo "all tables in database $dbname...." >> $outfile
echo "@@@@@@@@@@@@@@@@@@@@@@>> >> $outfile
echo " " >> $outfile
cat ${tempf ile} >> $outfile
echo " " >> $outfile
#
#
# .
#
# dump_db_create.
#
num_lines= ' wc #l ${tempfile} I cut #cl#9'
last_line= 'expr $num_lines # 4'
first_line= 'expr $last_line # 2'
tables_list=' tail #$last_line $ {tempfile} I head #$first_line'
rm #f $ {tempfile}
#
#
# #,
# .
#
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" >> $outfile
echo "updating statistics for tables in database $dbname" >> $outfile
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" >> $outfile

www.books-shop.com

echo " " >> $outfile


#
#
#
for table_name in $tables_list
do
$SYBASE/bin/isgl #Usa #S${SERVER} #P${PWD} #I$SYBASE/interfaces
#e >> ${outfile} << finish_sql2
use $dbname

go
select getdate()

go
update statistics $table_name

go
sp_recompile $table_name
go
select getdateO
go
finish_sql2
#

# done ,
# done # .
#
done
#

#
#
done
#
#
# .
#
echo " " >> $outfile
echo "update statistics:${SERVER}: exiting at 'date'." >> $outfile
echo " " >> $outfile
echo " " >> $outfile2
echo " " >> $outfile2
echo "update statistics:${SERVER}: exiting at 'date'." >> $outfile2
echo " " >> $outfile2
echo " " >> $outfile2
echo "******************************************************>> >>
$outfile2
cat $outfile >> $outfile2
# ***** ,
/usr/ucb/mail #s "${SERVER}: update statistics cronjob complete"
psychoDBA@dbahost < $outfile2
exit

dbcc (dbcc_listof_dbs)
dbcc_listof_dbs dbcc
dbc checkdb, dbcc checkalloc db checkcatalog,
, . 
dbcc_listof_dbs
, dbcc.
#!/bin/sh
#
# Bourne,

www.books-shop.com

# dbcc # , .
# 9.9.96
#

if [ $# #lt 2 ]
then
echo $0: invalid format: $# argv parameters provided, at least 2 required
# 2
echo $0: required format: $0 '<SERVER> <database (s) . . . >'
exit 1
fi
#
#
#
# *****
# SYBASE PWD.
SYBASE=/export /home/sybase
SERVER=$1
PWD='cat /export/home/sybase/.kparm'
# ***** .
dumpdir=/export/home/dbdump
outfile=${dumpdir}/${SERVER}_dbcclog.out
outfile2=${dumpdir}/${SERVER}_dbcclog.out2
outfile3=${dumpdir}/${SERVER}_dbcclog.out3
outfile4=${dumpdir}/${SERVER}_dbcclog.out4
shift
dbs_to_dbcc="$*"
#
# .
#
echo "dbcc log:${SERVER}: started at 'date'." > $outfile
echo "dbcc log:${SERVER}: started at 'date'." > $outfile2
echo " " >> $outfile
echo " " >> $outfile2
#
#
#
for dbname in $dbs_to_dbcc
do
dmptime='date +%m%d%y_%H%M%S'
proc_name=dbcc_temp_sproc_${dmptime}
# ***** isql .
# SQL,
# ,
# .
# dbcc.
#
# isql SQL Server.
#
$SYBASE/bin/isql #Usa #S${SERVER} #P${PWD} #I$SYBASE/interfaces #e >
${outfile3} << finish_sql
create procedure $proc_name as
declare @status int
select getdate()
dbcc checkdb($dbname)
select getdate()
dbcc checkalloc($dbname)
select getdate()
dbcc checkcatalog($dbname)
go

%RRNVVKRS

piracy@books-shop.com

declare @return_status int


execute @return_status=$proc_name
drop procedure $proc_name
if @return_status = 0
begin
print **************************************************
print "Stored Procedure Execution Complete # no errors"
#print " "
end
else
begin
print
"!!!!!!!!!!!!!!!!!!!!!!!!!!!"
print "FAILURE of Stored Procedure"
#print " "
end

go
exit
finish_sql
#
# isql.
# #
# , #
# .
#
isql_status=$<
#
# dbcc
# . .
#
Msg_count='grep Msg ${outfile3} | wc #1'
grep Msg ${outfile3) > ${outfile4}
DBlib_COunt='grep DB#LIBRARY ${outfile3} | wc #l'
grep DB#LIBRARY ${outfile3) >> ${outfile4}
Error_count='expr $Msg_count + $DBlib_count'
echo $Error_count
#
# SQL#,
# .
#
sproc_status='tail #1 ${outfile3}'
#
# grep ,
# .
#
cat ${outfile3} >> ${outfile}
#
# isql :
#
if [ $isql_status #ne 0 ]
then
echo " " >> $outfile
echo dbcc log:${SERVER}: isql for dbcc of $dbname failed at 'date'
>> $outfile
echo " " >> $outfile
echo " " >> $outfile2
echo dbcc log:${SERVER}: database dbcc of $dbname failed at 'date'
>> $outfile2
echo " " >> $outfile2
# ***** .

www.books-shop.com

/usr/ucb/mail #s "${SERVER}: dbcc of $dbname failed"


psychoDBA@dbahost < $outfile
#
# isql
# .
#
else
#
# :
#
if [ "$sproc_status" = "Stored Procedure Execution Complete no
errors" ]
then
echo " " >> $outfile
echo dbcc log:${SERVER}: completed database dbcc of $dbname at
'date' >> $outfile
echo " ##############> total error count = ${Error_count} "
>> $outfile
echo " " >> $outfile2
echo dbcc log:${SERVER}: completed database dbcc of $dbname at
'date' >> $outfile2
echo " ##############> total error count = ${Error_count} "
>> $outfile2
#
# isql
# ,
# dbcc.
#
if [ "$Error_count" #ne "0" ]
then
cat ${outfile4} >> $outfile2
/usr/ucb/mail #s "${SERVER}: dbcc of $dbname failed"
psychoDBA@dbahost < $outfile4
#
fi
fi
#
# :
#
if [ "$sproc_status" = "FAILURE of Stored Procedure" ]
then
echo " " >> $outfile
echo dbcc log:${SERVER}: sproc for dbcc of $dbname failed at 'date'
>> $outfile
# ***** .
/usr/ucb/mail #s "${SERVER}: dbcc of $dbname failed"
psychoDBA@dbahost < $outfile
echo " " >> $outfile2
echo dbcc log:${SERVER}: sproc for dbcc of $dbname failed at 'date'
>> $outfile2
fi
fi
#
#
#
done
#
#
# .

www.books-shop.com

#
echo " " >> $outfile
echo "dbcc log:${SERVER}: exiting at 'date'." >> $outfile
echo " " >> $outfile
echo " " >> $outfile2
echo " " >> $outfile2
echo "dbcc log:${SERVER}: exiting at 'date'." >> $outfile2
echo " " >> $outfile2
echo " " >> $outfile2
echo "******************************************************"
>> $outfile2
cat $outfile >> $outfile2
# ***** ,
/usr/ucb/mail #s "${SERVER}: dbcc cronjob complete"
psychoDBA@dbahost < $outfile2
exit

SQL Server (scan_errorlog)
scan_errorlog
, , 
.
#!/bin/sh
#
# Bourne,
#
# .
#
# 25.11.96
#
if [ $# #lt 1 ]
then
echo $0: invalid format: $# argv parameters provided, 1 required
# 1
echo $0: required format: $0 '<SERVER>'
exit 1
fi
#
#
#
# ***** errorlog_filename
# .
# , rrorlog_<_>.
filea=/export/home/Sybase/install/errorlog_
SERVER=$1
errorlog_filename=${filea}${SERVER}
# ***** ,
outdir=/export/home/dbdump
outfile=${outdir}/${SERVER}_scan_errorlog.out
outfile2=${outdir}/${SERVER}_server_errors.out
outfile3=${outdir}/${SERVER}lserver_restarts.out
#
# .
#
echo "scan server errorlog:${SERVER}: started at 'date'." > $outfile
echo " " >> $outfile
#

www.books-shop.com

# .
#
Error_count='grep Error ${errorlog_filename} | wc #l'
grep Error ${errorlog_filename} > ${outfile2)
echo "server Errorlog Errors found = ${Error_count}" >> $outfile
#
# .
#
Restart_count='grep 'SQL Server/' ${errorlog_f ilename} I wc #l'
grep 'SQL Server/' ${errorlog_f ilename} > ${outfile3}
echo "server Errorlog Restarts found = ${Restart_count} " >> $outfile
#
# .
#
echo " " >> $outfile
echo "scan server errorlog:${SERVER}: exiting at 'date'." >> $outfile
echo " " >> $outfile
echo "************************* Errors ************************"
>> $outfile
cat $outfile2 >> $outfile
echo " " >> $outfile
echo "************************ Restarts ************************"
>> $outfile
cat $outfile3 >> $outfile
# ***** .
/usr/ucb/mail #s "${SERVER}: scan errorlog job complete"
psychoDBA@dbahost < $outfile
exit
(dump_server_config)
dump_server_conf ig
. , sp_configure.
,
, 
.
, dump_server_config
 . SQL Server System 11,
System 10 4.9.2 . , , 
dump_server_config,
(RUN_<_cepe"
>). dump_server_config,
. dump_server_config 
UNIX , 
dump_server_config .
#!/bin/sh
#
# Bourne,
# ,
#
# 02.12.96
#
if [ $# #lt l ]
then
echo $0: invalid format: $# argv parameters provided, at least 1 required

# 1
echo $0: required format: $0 '<SERVER>'
exit 1

www.books-shop.com

fi
#
#
#
# *****
# SYBASE PWD
SYBASE=/export/home/sybase
SERVER=$1
PWD='cat /export/home/sybase/.kparm'
# *****
#
dumpdir=/export/home/dbdump
outfil=${dumpdir}/${SERVER}_config_dump.out
outfile2=${dumpdir}/${SERVER}_config_dump.out2
tempfile=${dumpdir}/${SERVER}_config_dump.temp1
#
chmod 700 $outfile
chmod 700 $outfile2
#
#
#
echo "dump server config:${SERVER}: started at 'date'." > $outfile
echo "dump server config:${SERVER}: started at 'date'." > $outfile2
echo " " >> $outfile
echo " " >> $outfile2
#
#
#
$SYBASE/bin/isql #Usa #S${SERVER} #P${PWD} #I$SYBASE/interfaces
#e >> ${outfile} << finish_sqll
use master
go
select * from sysusages
go
select * from sysdevices

go
select * from sysdatabases
go
select * from sysservers
go
select * from sysremotelogins
go
select * from syslogins
go
sp_configure
go
sp_helpdevice
go
sp_helpdb
go
sp_helpcache
go
sp_cacheconfig
go
sybsystemprocs..p_mirror

go
sybsystemprocs..p_devspace

go
sybsystemprocs..p_servermap

www.books-shop.com

go
finish_sgll
#
#
#
$SYBASE/bin/isql #Usa #S${SERVER} #P${PWD) #I$SYBASE/interfaces
#e > ${tempfile} << finish_sg;2
use master
go
select name from sysdatabases order by name
go
finish_sql2
#
#
#
echo " >> $outfile
echo "@@@@@@@@@@@@@@@@@@@@@@>> >> $outfile
echo "all databases in server $SERVER...." >> $outfile
echo "@@@@@@@@@@@@@@@@@@@@@@@" >> $outfile
echo " " >> $outfile
cat ${tempfile} >> $outfile
echo " " >> $outfile
#
#
# ,
# dump_db_create
#
num_lines='wc #l ${tempfile} I cut #cl#9'
last_line='expr $num_lines # 4'
first_line='expr $last_line # 2'
databases_list='tail #$last_line ${tempfile} I head #$first_line'
rm #f ${tempfile}
#
#
for database_name in $databases_list
do
#
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" >> $outfile
echo "dumping configuration information for database $database_name
in $SERVER" >> $outfile
echo >>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@>> >> $outfile
echo " " >> $outfile
#
$SYBASE/bin/isql #Usa #S${SERVER} #P${PWD} #I$SYBASE/interfaces
#e >> ${outfile} << finish_sql2
use $database_name
go
sp_helpdb $database_name
go
sp_helpsegment
go
sybsystemprocs..p_dbcreate $database_name
go
sp_helpuser
go
select * from sysusers

go
select * from sysalternates
go

www.books-shop.com

finish_sql2
#
#
#
done
#
#
#
#
echo " " >> $outfile
echo "dump server config:${SERVER}: exiting at 'date'." >> $outfile
echo " " >> $outfile
echo "dump server config:${SERVER}: exiting at 'date'." >> $outfile2
echo " " >> $outfile2
echo " " >> $outfile2
echo "******************************************************" >> $outfile2
cat $outfile >> $outfile2
# *****
/usr/ucb/mail #s "${SERVER}: dump server config cronjob complete"
psychoDBA@dbahost < $outfile2
exit
(monitor.report)
monitor_report 
. monitor_report , 
,
, . 
monitor_report 
. ,
, monitor_re"
port 15 , , 
, ..
.
#!/bin/sh
#
# Bourne,
# ,
#
# 03.12.96
#
if [ $# #lt l ]
then
echo $0: invalid format: $# argv parameters provided, at least 1 required
# ' 1
echo $0: required format: $0 '<SERVER>'
exit 1
fi
#
#
#
# *****
# SYBASE PWD
SYBASE=/export/home/sybase
SERVER=$1

PWD='cat /export/home/sybase/.kparm'
# *****
dumpdir=/export/home/dbdump

www.books-shop.com

outfile=${dumpdir}/${SERVER}_monitor_report.out
outfile2=${dumpdir}/${SERVER}_monitor_report.out 2
#
#
#
echo "monitor report:${SERVER}: started at 'date'." > $outfile
echo "monitor report:${SERVER}: started at 'date'." > $outfile2
echo " " >> $outfile
echo " " >> $outfile2
#
$SYBASE/bin/isgl #Usa #S${SERVER} #P${PWD} #I$SYBASE/interfaces
#e >> ${outfile} << finish_sqll
use master
go
select @@servername, getdate()

go
sp_who
go
sp_lock
go
select * from sysprocesses
go
sp_monitor

go
finish_sql1
#
#
#
#
echo " " >> $outfile
echo "monitor report:${SERVER}: exiting at 'date'." >> $outfile
echo " " >> $outfile
echo " " >> $outfile2
echo "monitor report:${SERVER}: exiting at 'date'." >> $outfile2
echo " " >> $outfile2
echo " " >> $outfile2
echo "******************************************************"
>> $outfile2
cat $outfile >> $outfile2
# *****
/usr/ucb/mail #s "${SERVER}: monitor report cronjob complete"
psychoDBA@dbahost < $outfile2
exit
sp_sysmon (execute_sp_sysmon)
execute_sp_sysmon
sp_sysmon . sp_sys
mon SQL Server System 11,
execute_sp_sysmon .
, sp_sysmon 
, 
( monitor_report,
). sp_sysmon 
, crontab ( cron ),
sp_sysmon . sp_sysmon
, 
.

www.books-shop.com

#!/bin/sh
#
# Bourne,
# sp_sysmon ,
#
# 03.12.96
#
if [ $# #lt 1 ]
then
echo $0: invalid format: $# argv parameters provided, at least 1 required
# 1
echo $0: required format: $0 '<SERVER>'
exit 1
fi
#
#
#
#
# *****
# SYBASE PWD
SYBASE=/export/home/Sybase
SERVER=$1
PWD='cat /export/home/sybase/.kparm'
# *****
dumpdir=/export/home/dbdump
outfile=${dumpdir}/${SERVER}_monitor_report.out
outfile2=${dumpdir}/${SERVER}_monitor_report.out2
#
# sp_sysmon
#
echo "execute sp_sysmon:${SERVER}: started at 'date'." > $outfile
echo "execute sp_sysmon:${SERVER}: started at 'date'." > $outfile2
echo " " >> $outfile
echo " " >> $outfile2
#
$SYBASE/bin/isql #Usa #S${SERVER} #P${PWD} #I$SYBASE/interfaces
#e >> ${outfile} << finish_sqll
use master
go
select @@servername, getdate()

go

sp_sysmon 1
go
finish_sqll
#
#
#
#
echo " " >> $outfile
echo "execute sp_sysmon:${SERVER}: exiting at 'date'." >> $outfile
echo " " >> $outfile
echo " " >> $outfile2
echo "execute sp_sysmon:${SERVER}: exiting at 'date'." >> $outfile2
echo " " >> $outfile2
echo " " >> $outfile2
echo "******************************************************"
>> $outfile2
cat $outfile >> $outfile2
# *****

www.books-shop.com

/usr/ucb/mail #s "${SERVER}: execute sp_sysmon cronjob complete"


psychoDBA@dbahost < $outfile2
exit

SQL Server 
. /etc/rc3.d.
, 
. SQL Server,
Backup Server Sybase Replication Server.
5 (300 ), 
.
#!/bin/sh
#####################################################
# Sybase #
#####################################################
if [ #f /export/home/sybase/install/startserver ] ;then
su sybase #c "/bin/sh" << Here
SYBASE=/export/home/sybase; export SYBASE
/export/home/sybase/install/RUN_SPOTUS &
/export/home/sybase/install/RUN_SPOTUS_BCK &
sleep 300
/export/home/sybase/install/RUN_SPOTUSRS &
/export/home/sybase/install/RUN_SPOTUS_SPOTUSRS_RSSD_ltm &
/export/home/sybase/install/RUN_SPOTUS_spotdb_ltm &
/export/home/sybase/install/RUN_SPOTUK_spotdb_ltm &
Here
fi

crontab
crontab, 
SQL Server
System 11. 23:00 , 23:30
, 23:45
master sybsystemprocs (
, ).
, , (
/export /home/dbdump SPOTUS_*.dmp,
). dbcc , 3
, 4 
, , , 5
.
(monitor_report) 
9, 12 15 , ( 
execute_sp_sysmon) 12:30.
crontab, 
cron .
0 23 * * * /export/home/sybase/local/bin/dump_listof_dbs
SPOTUS spotdb SPOTUSRS_RSSD master sybsystemprocs
30 23 * * * /export/home/sybase/local/bin/logdump_listof_dbs
SPOTUS spotdb SPOTUSRS_RSSD
45 23 * * * /export/home/sybase/local/bin/trunclog_listof_dbs
SPOTUS master sybsystemprocs

%RRNVVKRS

piracy@books-shop.com

1 * * * /export/home/sybase/local/bin/remove_old_files
"/export/home/dbdump/SPOTUS_*.dmp" 2
0 2 * * * /export/home/sybase/local/bin/update_listof_dbs SPOTUS
spotdb SPOTUSRS_RSSD master sybsystemprocs
0 3 * * * /export/home/sybase/local/bin/dbcc_listof_dbs
SPOTUS spotdb
0 4 * * * /export/home/sybase/local/bin/scan_errorlog SPOTUS
0 5 * * * /export/home/sybase/local/bin/dump_server_config
SPOTUS
0 9,12,15 * * * /export/home/sybase/local/bin/monitor_report
SPOTUS
30 12 * * * /export/home/sybase/local/bin/execute_sp_sysmon
SPOTUS

www.books-shop.com

Anda mungkin juga menyukai