Pergunta

I know this has been a topic that has been discussed in AWS forums before

and SO How to setup sessionState with SQL Server mode on Amazon RDS

As mentioned on the above thread and on a couple of stack overflow articles it would seem like there is a way to get a SQL session using AWS RDS. I used the above stackoverflow as guidance to try and set up my ASPState database. Using the pastebin script in the above stackoverflow article for a "jobless" InstallSqlState.sql still caused me issues as it tries to use "tempdb" and "master". I don't have access to these databases neither can I grant myself permissions to do so.

However had a working site that used the sessions table on an EC2 server. As per the above stackoverflow article I used the SQL import/export tool.

The database seemed to copy over okay, tables and stored procedures all seem to be present and correct.

In my web.config I have:

<sessionState mode="SQLServer" allowCustomSqlDatabase="true" cookieless="false" timeout="45" sqlConnectionString="data source=RDSIP;initial catalog=ASPState;user id=myuser;password=mypassword" />

However when I run my site I get the error:

Invalid object name 'tempdb.dbo.ASPStateTempApplications'.

Is there anyone who has managed to achieve a session state using SQL on AWS RDS or can point me to a resource that can explain the steps I need to take?

Foi útil?

Solução

After some digging around I realised that the stored procedures being generated by the pastebin script are still making reference to the tempdb. By doing a simple find replace of [tempdb] to [ASPState] and then re-running the script recreated SP with the correct DB name.

I also changed the "USE" statements to databases I had permissions for.

Outras dicas

I've solved my issue create session db on Amazon RDS.

1 Step:- Create ASPState DB on AWS RDS and database and schema migration using Following Tool SQLAzureMW v5.15.6 Release Binary for SQL Server 2014.

2 Step:- change DB Name on sessionState mode="SQLServer" allowCustomSqlDatabase="true" sqlConnectionString="data source=amazon-server-name;initial catalog=ASPState;persist security info=True;user id=userid;password=password" cookieless="false" timeout="100">

please feel free to contact us about any of your queries

Thanks

Amit Verma

I solved the issue by generating scripts for the whole schema (Tasks -> Generate Scripts) from a locally create session database, and then running the same on the RDS instance on a newly created session database. For the job, I created it manually by copying the exact steps from my local instance.

The setup is running fine till now.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top