gpt4 book ai didi

asp.net - aspnet_regsql 在mssql中创建 session 表的问题

转载 作者:行者123 更新时间:2023-12-02 14:17:05 29 4
gpt4 key购买 nike

我正在通过 MSSQL 服务器在 ASP.NET 中使用 session 状态处理:

sessionState mode="SQLServer"

在 web.config 中。在本地,我使用 aspnet_regsql 没有任何问题,但是当尝试在生产服务器上执行相同操作时,它向我抛出异常(* - 是屏蔽数据):

        C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regsql.exe -S somehostserver.com -U _admin -P _password -ssadd -sstype c -d mydb

Start adding session state.

.
An error occurred during the execution of the SQL file 'InstallSqlState.sql'. Th
e SQL error number is 229 and the SqlException message is: The EXECUTE permissio
n was denied on the object 'sp_delete_job', database 'msdb', schema 'dbo'.
If the job does not exist, an error from msdb.dbo.sp_delete_job is expected.
SQL Server: *
Database: [*]
SQL file loaded:
InstallSqlState.sql

Commands failed:

/* Drop all tables, startup procedures, stored procedures and types. */

/* Drop the DeleteExpiredSessions_Job */

DECLARE @jobname nvarchar(200)
SET @jobname = N'***' + '_Job_DeleteExpiredSessions'

-- Delete the [local] job
-- We expected to get an error if the job doesn't exist.
PRINT 'If the job does not exist, an error from msdb.dbo.sp_delete_job is expect
ed.'

EXECUTE msdb.dbo.sp_delete_job @job_name = @jobname

SQL Exception:
System.Data.SqlClient.SqlException (0x80131904): The EXECUTE permission was deni
ed on the object 'sp_delete_job', database 'msdb', schema 'dbo'.
If the job does not exist, an error from msdb.dbo.sp_delete_job is expected.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolea
n breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception
, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cm
dHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, Tds
ParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName,
Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult res
ult, 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 sessionSta
te, Boolean isInstall, SessionStateType sessionStatetype)

使用 SQL 脚本会导致类似的错误。我应该怎么办 ?!托管所有者建议“在您的计算机上进行备份并将其投入生产”,但这会导致另一个问题......有什么建议 !?或者我被迫手工制作表和过程的所有脚本?!

致以诚挚的问候

最佳答案

用户似乎在 Master 和 MSDB 系统数据库中缺少“RSExecRole”角色。 Reporting Services 使用名为“RSExecRole”的预定义数据库角色向报表服务器数据库授予报表服务器权限。

RSExecRole”角色是使用报表服务器数据库自动创建的。但是,当您将报表服务器数据库移动到新的或不同的 SQL Server 数据库引擎时,必须在 Master 和 MSDB 系统数据库中重新创建角色。

以下是有关如何创建“RSExecRole”的链接引用:

http://technet.microsoft.com/en-us/library/cc281308.aspx

关于asp.net - aspnet_regsql 在mssql中创建 session 表的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6720690/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com