powered by simpleCommunicator - 2.0.50     © 2025 Programmizd 02
Форумы / Sybase ASA, ASE, IQ [игнор отключен] [закрыт для гостей] / Как на sybsecurity взвести single user?
3 сообщений из 3, страница 1 из 1
Как на sybsecurity взвести single user?
    #37784160
blzz
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Есть сервер ASE 12.5/15.5 у которого в sybsecurity повреждена таблица syslogs, из-за чего sp_helpsegment 'logsegment' показывает неверные значения. По идее это надо чинить в пом. dbcc tablealloc(syslogs,full,fix), переведя базу в 'single user' (аудит выключен).
Вот только sybsecurity - это особенная база, которую нельзя в 'single user'.
Код: sql
1.
2.
3.
4.
5.
6.
7.
8.
1> use master
2> go
1> exec sp_dboption sybsecurity,'single user',true
2> go
Msg 17435, Level 16, State 1:
Server 'SRVNAME', Procedure 'sp_dboption', Line 573:
The 'single user' option is not valid for the 'sybsecurity' database.
(return status = 1)


Запуск всего сервера с ключем -m, тоже успеха не принес:

Код: sql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
1> use sybsecurity
2> go
1> dbcc tablealloc(syslogs,full,fix)
2> go
Server Message:  Number  12947, Severity  16
Server 'SRVNAME', Line 1:
Syslogs free space is currently 1763862 pages but DBCC counted 130552 pages. This descrepancy may be spurious if this count was done in multi-user mode. Please run DBCC TABLEALLOC(syslogs, full, fix) to correct it. 
Table Corrupt: Extent id 842176 on allocation pg# 841984 has objid 8, indid 0, and used bit on, but reference bit off. 
The 'fix' option has been ignored for this command. To use the 'fix' option with system tables, run the command from the database where the table is located. The database must be in single user mode. 
*************************************************************** 
TABLE: syslogs OBJID = 8 
PARTITION ID=8 FIRST=830267 ROOT=830267 SORT=0 
Data level: indid 0, partition 8. 1 Data pages allocated and 1 Extents allocated. 
TOTAL # of extents = 1 
Alloc page 830208 (# of extent=1 used pages=5 ref pages=2314885530279477249) 
Alloc page 841984 (# of extent=1 used pages=1 ref pages=2314885530279477248) 
Total (# of extent=2 used pages=6 ref pages=1) in this database 

 Statistical information for this run follows: 
Total # of pages read = 1  
Total # of pages found cache = 1  
Total # of physical reads = 0  
Total # of saved I/O = 0  
Size of I/O used = 8 pages 
DBCC execution completed. If DBCC printed error messages, contact a user with System Administrator (SA) role. 


Вот такой замкнутый круг. Что можно сделать?
...
Рейтинг: 0 / 0
Как на sybsecurity взвести single user?
    #37784251
Компостеров
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
To put the sybsecurity database into single user mode, issue the following manual steps:



1 - Allow updates to system tables:



sp_configure "allow updates to system tables", 1

go



2 - Note current value for sysdatabases.status for sybsecurity:



select status from master..sysdatabases where name = "sybsecurity"

go



3 - Update status of sybsecurity to 'single user mode'



begin tran

update sysdatabases set status = 4096

go



if 1 row affected, issue

commit

go



else issue

rollback

go

resubmit the transaction



4 - Recycle server - this is necessary for change in status to be recognized by the server.



5 - Run checkalloc or tablealloc with fix option.



6 - Change sysdatabase.status for sybsecurity back to original value returned from query in #2 above:



begin tran

update sysdatabases set status = <original_value>

go



if 1 row affected, issue

commit

go



else issue

rollback

go

resubmit the transaction



7 - Recycle server - a recycle is still required to clear the single user mode status.
...
Рейтинг: 0 / 0
Как на sybsecurity взвести single user?
    #37784551
Фотография MasterZiv
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
blzz,

Легче всего сделать дамп баз с данными, стереть сервер, поставить с нуля, создать базы и загрузить их из дампа.
...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / Sybase ASA, ASE, IQ [игнор отключен] [закрыт для гостей] / Как на sybsecurity взвести single user?
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]