Showing posts with label exe. Show all posts
Showing posts with label exe. Show all posts

Tuesday, March 27, 2012

Failed to launch 'osql'

I use one-way Transactional Replication on 38 servers with same configuration.
On one server I have problem with OSQL.EXE path.

On
Publication properties ->
snapshot ->
Additional scripts ->
Before applying the snapshot, execute this script:
Is set preinit script (C:\ReplData\ReplPreInit.sql).

On Distribution agent properties -> step "Run Agent"
I set additional command for log problem.
command= -Output C:\ReplOutFile.txt -Outputverboselevel 2

Here is part of ReplOutFile.txt:
--
The osql command is: "C:\Program Files\Microsoft SQL Server\80\Tool\Binn\osql.exe" -U"***" -P"***" -i "\\STROSBB\ReplData\unc\STROSBB_antikor_DataCDB\20060908104051\ReplPreInit_0.sql" -S "BTSVR" -d "AntikorCDB" -o "C:\WINNT\TEMP\ReplPreInit_0.sql_20060912150416.log" -b -X1
Launching osql to apply the script 'ReplPreInit_0.sql'
[9/12/2006 3:04:16 PM]STROSBB.distributionAntikor: {call sp_MSadd_distribution_history(1, 3, ?, ?, 0, 0, 0.00, 0x00, 1, ?, 0, 0x01, 0x00)}
Agent message code 20130. Failed to launch 'osql'
[9/12/2006 3:04:16 PM]STROSBB.distributionAntikor: {call sp_MSadd_distribution_history(1, 6, ?, ?, 0, 0, 0.00, 0x01, 1, ?, 4, 0x01, 0x01)}
Adding alert to msdb..sysreplicationalerts: ErrorId = 1233,
Transaction Seqno = 00000491000618f4007000000001, Command ID = 4
Message: Replication-Replication Distribution Subsystem: agent STROSBB-antikor-BTSVR-1 failed. Failed to launch 'osql'[9/12/2006 3:04:16 PM]STROSBB.distributionAntikor: {call sp_MSadd_repl_alert(3, 1, 1233, 14151, ?, 4, N'STROSBB', N'antikor', N'BTSVR', N'AntikorCDB', ?)}
ErrorId = 1233, SourceTypeId = 3
ErrorCode = '3'
ErrorText = 'The system cannot find the path specified.
--

Problem is that the path to osql command in log ReplOutFile.txt is
C:\Program Files\Microsoft SQL Server\80\Tool\Binn\
but SQL is installed on path
C:\Program Files\Microsoft SQL Server\80\Tools\Binn\

Diferences is between Tool vs. Tools

I think that when server create OSQL command for preinit sql script he use STATIC path to osql.exe and there is my problem.

Where is this path stored and can I change it?

Hi Marco, the osql path was constructed based on the value of HKLM\Software\Microsoft\Microsoft SQL Server\80\ClientSetup\SQLPath (+"\Binn\osql.exe") so you may want to check whether the registry value correctly reflects how SQL Server is set up on the machine where the distribution agent is running.

-Raymond

|||

In my server was registry path:

HKLM\Software\Microsoft\Microsoft SQL Server\80\Tools\ClientSetup\SQLPath

Many Thanks.

Friday, March 23, 2012

Failed to create Application Services Database for SQL Server

I have sql 2005 express installed with VS2005. I tried to install the service database using Aspnet_regsql.exe but always ended up with the same error:

Code Snippet

Setup failed.

Exception:
An error occurred during the execution of the SQL file 'InstallMembership.sql'. The SQL error number is -2 and the SqlException message is: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

-
Details of failure
-

SQL Server:
Database: [aspnetdb]
SQL file loaded:
InstallMembership.sql

Commands failed:

EXEC sp_addrolemember N'aspnet_Membership_BasicAccess', N'aspnet_Membership_FullAccess'
EXEC sp_addrolemember N'aspnet_Membership_ReportingAccess', N'aspnet_Membership_FullAccess'

SQL Exception:
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32 bytesExpected)
at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
at System.Data.SqlClient.TdsParserStateObject.ReadByte()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at System.Web.Management.SqlServices.ExecuteFile(String file, String server, String database, String dbFileName, SqlConnection connection, Boolean sessionState, Boolean isInstall, SessionStateType sessionStatetype)


The database aspnetdb was always created with just 4 tables and 3 views.

Please can someone help me on this, thanks very much!

If the database still exists, the script might wait for the last database connection to close to be able to drop the database. Is there any DROp statement in the sql file ?

Jens K. Suessmeyer

http://www.sqlserver2005.de