Модераторы: Akina
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Подключение к MSSQL при запуске Windows 
:(
    Опции темы
Hypertonyc
Дата 22.5.2010, 10:09 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Шустрый
*


Профиль
Группа: Участник
Сообщений: 68
Регистрация: 19.10.2008

Репутация: нет
Всего: нет



Есть служба, которая при старте подключается к MSSQL. Когда служба стартует вместе с виндой это подключение обламывается с ошибкой:

Login failed for user 'NT AUTHORITY\SYSTEM'
Если тупо вставить перед подключением к БД задержку ~15сек, ошибка исчезает. Ну и естественно если тормозить/запускать службу руками — тоже все OK. 

Зависимость от SQLServer у службы есть. Служба запускается под LocalSystem. Строка подключения:

"Data Source=.\SQLEXPRESS;Initial Catalog=dbname;Integrated Security=True;"

Явно нужна зависимость еще от чего-то, вот только от чего?

PM MAIL   Вверх
Hypertonyc
Дата 23.5.2010, 11:01 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Шустрый
*


Профиль
Группа: Участник
Сообщений: 68
Регистрация: 19.10.2008

Репутация: нет
Всего: нет



Код

2010-05-22 10:20:17.76 Server      Microsoft SQL Server 2008 (SP1) - 10.0.2723.0 (Intel X86) 
    Jul 10 2009 01:41:08 
    Copyright (c) 1988-2008 Microsoft Corporation
    Enterprise Edition on Windows NT 5.2 <X86> (Build 3790: Service Pack 2)

2010-05-22 10:20:17.76 Server      (c) 2005 Microsoft Corporation.
2010-05-22 10:20:17.76 Server      All rights reserved.
2010-05-22 10:20:17.76 Server      Server process ID is 1192.
2010-05-22 10:20:17.76 Server      Authentication mode is WINDOWS-ONLY.
2010-05-22 10:20:17.76 Server      Logging SQL Server messages in file '^^blabla\MSSQL\Log\ERRORLOG'.
2010-05-22 10:20:17.76 Server      This instance of SQL Server last reported using a process ID of 1208 at 22.05.2010 10:18:18 (local) 22.05.2010 6:18:18 (UTC). This is an informational message only; no user action is required.
2010-05-22 10:20:17.76 Server      Registry startup parameters: 
     -d ^^blabla\MSSQL10.MSSQLSERVER\MSSQL\DATA\master.mdf
     -e ^^blabla\MSSQL10.MSSQLSERVER\MSSQL\Log\ERRORLOG
     -l ^^blabla\MSSQL10.MSSQLSERVER\MSSQL\DATA\mastlog.ldf
2010-05-22 10:20:17.78 Server      SQL Server is starting at high priority base (=13). This is an informational message only. No user action is required.
2010-05-22 10:20:17.78 Server      Detected 4 CPUs. This is an informational message; no user action is required.
2010-05-22 10:20:17.81 Server      Address Windowing Extensions is enabled. This is an informational message only; no user action is required.
2010-05-22 10:20:17.83 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
2010-05-22 10:20:17.91 Server      Node configuration: node 0: CPU mask: 0x0000000f Active CPU mask: 0x0000000f. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2010-05-22 10:20:17.93 spid7s      Starting up database 'master'.
2010-05-22 10:20:17.97 spid7s      Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2010-05-22 10:20:18.01 spid7s      Resource governor reconfiguration succeeded.
2010-05-22 10:20:18.01 spid7s      SQL Server Audit is starting the audits. This is an informational message. No user action is required.
2010-05-22 10:20:18.01 spid7s      SQL Server Audit has started the audits. This is an informational message. No user action is required.
2010-05-22 10:20:18.01 spid7s      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2010-05-22 10:20:18.02 spid7s      SQL Trace ID 1 was started by login "sa".
2010-05-22 10:20:18.02 spid7s      Starting up database 'mssqlsystemresource'.
2010-05-22 10:20:18.03 spid7s      The resource database build version is 10.00.2723. This is an informational message only. No user action is required.
2010-05-22 10:20:18.11 spid11s     Starting up database 'model'.
2010-05-22 10:20:18.11 spid7s      Server name is '^^blabla'. This is an informational message only. No user action is required.
2010-05-22 10:20:18.15 spid11s     Clearing tempdb database.
2010-05-22 10:20:18.19 spid11s     Starting up database 'tempdb'.
2010-05-22 10:20:18.20 spid14s     The Service Broker protocol transport is disabled or not configured.
2010-05-22 10:20:18.20 spid14s     The Database Mirroring protocol transport is disabled or not configured.
2010-05-22 10:20:18.21 spid14s     Service Broker manager has started.
2010-05-22 10:20:18.63 Server      A self-generated certificate was successfully loaded for encryption.
2010-05-22 10:20:18.63 Server      Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\MSSQLSERVER ].
2010-05-22 10:20:18.63 Server      Server local connection provider is ready to accept connection on [ \\.\pipe\sql\query ].
2010-05-22 10:20:18.63 Server      Server is listening on [ 127.0.0.1 <ipv4> 1434].
2010-05-22 10:20:18.64 Server      Dedicated admin connection support was established for listening locally on port 1434.
2010-05-22 10:20:18.64 Server      The SQL Server Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b, state: 3. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.
2010-05-22 10:20:20.76 Server      SQL Server is now ready for client connections. This is an informational message; no user action is required.
2010-05-22 10:20:21.11 Logon       Error: 18456, Severity: 14, State: 38.
2010-05-22 10:20:21.11 Logon       Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]
2010-05-22 10:20:21.12 Logon       Error: 18456, Severity: 14, State: 38.
2010-05-22 10:20:21.12 Logon       Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]
2010-05-22 10:20:21.13 Logon       Error: 18456, Severity: 14, State: 38.
2010-05-22 10:20:21.13 Logon       Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]
2010-05-22 10:20:23.73 Logon       Error: 18456, Severity: 14, State: 38.
2010-05-22 10:20:23.73 Logon       Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]
2010-05-22 10:20:25.09 Logon       Error: 18456, Severity: 14, State: 38.
2010-05-22 10:20:25.09 Logon       Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]
2010-05-22 10:20:29.00 Logon       Error: 18456, Severity: 14, State: 38.
2010-05-22 10:20:29.00 Logon       Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]
2010-05-22 10:20:32.79 spid19s     Starting up database '^^blablaDB'.
2010-05-22 10:20:32.79 spid13s     Starting up database 'msdb'.
2010-05-22 10:20:33.48 spid18s     Recovery is writing a checkpoint in database '^^blablaDB' (6). This is an informational message only. No user action is required.
2010-05-22 10:20:34.35 spid7s      Recovery is complete. This is an informational message only. No user action is required.
2010-05-22 10:30:44.81 spid53      Attempting to load library 'xpstar.dll' into memory. This is an informational message only. No user action is required.
2010-05-22 10:30:44.85 spid53      Using 'xpstar.dll' version '2007.100.1600' to execute extended stored procedure 'xp_instance_regread'. This is an informational message only; no user action is required.
2010-05-22 10:30:49.00 spid53      Attempting to load library 'xplog70.dll' into memory. This is an informational message only. No user action is required.
2010-05-22 10:30:49.01 spid53      Using 'xplog70.dll' version '2007.100.1600' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.



Это лог. Насколько я понял служба пытается подключиться к базе SQLсервера(^^blablaDB) до того как это база "2010-05-22 10:20:32.79 spid19s Starting up database '^^blablaDB'."...можно ли эту базу заставить стартовать раньше? вместе с master...ну или чтонибудь подобное...?
P.S. надеюсь понятно что ^^blabla это вымышленная строка...так...для конспирации smile
PM MAIL   Вверх
kobra
Дата 23.5.2010, 11:06 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 730
Регистрация: 15.6.2005
Где: Грузия, Тбилиси

Репутация: 5
Всего: 9



при старте упомянутая служба запускается ранше службы SQLServer, со всеми вытекающими.
варианты решения:
службе включить повторные запуски в случае останоки.
проверять запущен ли SQLServer.
PM MAIL   Вверх
Hypertonyc
Дата 23.5.2010, 11:16 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Шустрый
*


Профиль
Группа: Участник
Сообщений: 68
Регистрация: 19.10.2008

Репутация: нет
Всего: нет



Цитата(kobra @  23.5.2010,  11:06 Найти цитируемый пост)
проверять запущен ли SQLServer. 

я ж писал 
Цитата(Hypertonyc @  22.5.2010,  10:09 Найти цитируемый пост)
Зависимость от SQLServer у службы есть.

тоесть поидее служба ждет когда SQL загрузится...вот только я так понял MSSQL дает знать, что он готов еще до того как загрузит все свои БД. Как это избежать? только перезапуском службы в случае остановки?
PM MAIL   Вверх
kobra
Дата 23.5.2010, 11:30 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Опытный
**


Профиль
Группа: Участник
Сообщений: 730
Регистрация: 15.6.2005
Где: Грузия, Тбилиси

Репутация: 5
Всего: 9



Цитата(Hypertonyc @  23.5.2010,  11:16 Найти цитируемый пост)
Как это избежать? только перезапуском службы в случае остановки?

перезапуск нужно включить в любом случае, служба может грохнутся и по другим причинам.
Цитата(Hypertonyc @  22.5.2010,  10:09 Найти цитируемый пост)
Зависимость от SQLServer у службы есть
смысл этой фразы я истолкавал иначе. подобные службы я всегда деляю цикличними, т.е. если контакт не удалос установить, то включается задежка, и попытка повтарается. 


Это сообщение отредактировал(а) kobra - 23.5.2010, 11:30
PM MAIL   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Правила форума "MS SQL"
Akina

Akina

Запрещается!

Публиковать ссылки и обсуждать взлом чего бы то ни было.

  • Действия модераторов можно обсудить здесь
  • С просьбами о написании курсовой, реферата и т.п. обращаться сюда
  • Вопросы составления неспецифических запросов рассматриваются здесь
  • Используйте теги [code=sql][/code] для подсветки кода. Используйтe чекбокс "транслит" (возле кнопок кодов) если у Вас нет русских шрифтов.

Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Zloxa, Akina.

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | MS SQL Server | Следующая тема »


 




[ Время генерации скрипта: 0.0806 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.