如何设置的sessionState与亚马逊RDS SQL Server模式 [英] How to setup sessionState with SQL Server mode on Amazon RDS

查看:469
本文介绍了如何设置的sessionState与亚马逊RDS SQL Server模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有asp.net应用程序,我要我的会话存储在SQL Server中。我使用的是亚马逊RDS(Microsoft SQL Server的防爆preSS版)。我使用本地数据库进行测试和它的作品以及在那里。

I have asp.net app and I'm going to store my session in SQL Server. I'm using Amazon RDS (Microsoft SQL Server Express Edition). I am using local db for testing and its works well there.

所以我试图创建下一行会议分贝

So I've tried to create session db with next line

aspnet_regsql.exe -ssadd -sstype p -S mydb.rds.amazonaws.com -U myuser-P mypass

所以当我的意思是它为当地的分贝。但是,亚马逊RDS我收到一个异常:

So as I meant it works for local db. But for Amazon RDS I've received next exception:

开始添加会话状态。

.. SQL文件的执行过程中发生错误
  InstallSqlState.sql。前作SQL错误号为229和
  SQLEXCEPTION信息是:EXECUTE permissio n为否定的
  对象sp_delete_job',数据库'MSDB,架构DBO。如果作业
  不存在,从msdb.dbo.sp_delete_job错误的预期。 SQL
  服务器:数据库mydb.rds.amazonaws.com:ASPNETDB SQL文件加载:
  InstallSqlState.sql

.. 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: mydb.rds.amazonaws.com Database: aspnetdb SQL file loaded: InstallSqlState.sql

命令失败:

/ *删除所有的表,启动过程,存储过程和类型。
  * /

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

/ *删除该DeleteExpiredSessions_Job * /

/* Drop the DeleteExpiredSessions_Job */

DECLARE @jobname为nvarchar(200)设置@jobname = N'ASPState'+
  _Job_DeleteExpiredSessions

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

- 删除[本地]工作
   - 我们预计,如果作业不存在能获得一个错误。 PRINT如果作业不存在,从msdb.dbo.sp_delete_job一个错误预期
  ED。

-- 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.'

执行msdb.dbo.sp_delete_job @job_name = @jobname

EXECUTE msdb.dbo.sp_delete_job @job_name = @jobname

SQL异常信息:System.Data.SqlClient.SqlException(0x80131904):该
  EXECUTE权限是在对象上sp_delete_job杰尼版,数据库
  MSDB,架构DBO。如果作业不存在,从错误
  msdb.dbo.sp_delete_job预期。在
  System.Data.SqlClient.SqlConnection.OnError(SqlException异常,
  BooleañbreakConnection)在
  System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()在
  System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
  的SqlCommand厘米dHandler,SqlDataReader的数据流,
  BulkCopySimpleResultSet bulkCopyHandler,TDS ParserStateObject
  stateObj)在
  System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(字符串
  方法名,布尔异步)在
  System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
  资源ULT,字符串methodName中,布尔sendToPipe)在
  System.Data.SqlClient.SqlCommand.ExecuteNonQuery()在
  System.Web.Management.SqlServices.ExecuteFile(字符串文件,字符串
  服务器,数据库字符串,字符串dbFileName,SqlConnection的连接,
  布尔sessionSta德,布尔isInstall,SessionStateType
  sessionStatetype)

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.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)

有谁知道一个方法来解决呢?这就产生了一个数据库,但它是不完全的。

Does anybody know a way to solve this? This creates a database, but it is incomplete.

推荐答案

看起来是不可能在Amazon RDS创建会话分贝。而且没有人让我回答的。

Looks like it isn't possible to create session db on Amazon RDS. Moreover nobody gets me answer there.

我已经解决了在其他的方式我的问题。我对我的EC2服务和设置会话DB安装有MS SQL服务器。

I've solved my issue in other way. I installed MS SQL Server on my EC2 service and set session DB there.

这篇关于如何设置的sessionState与亚马逊RDS SQL Server模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆