Showing posts with label installation. Show all posts
Showing posts with label installation. Show all posts

Wednesday, March 21, 2012

Delay between CREATE DATABASE and ability to connect to that database

I have an application that creates a new database during installation,
and I've noticed some strange behavior. Once I've created the
database, I am able to immediately create tables and populate lookup
data, provided I remain connected to the server. If, however, I
disconnect and attempt to reconnect immediately, I'll get an error
saying that my login is invalid for the new database.
I can get around this by having my code simply wait 5 seconds before
attempting to reconnect, but I'm curious to see if anybody here can
give an explaination for why this is happening. Here is a bit of
pseudo code to explain what I'm seeing:
open new connection
create database
create tables
populate tables
close connection
// open new connection /* can't do this yet, as it would break */
for (int a=0; a<5; a++)
{
Thread.Sleep(2000)
try
{
open new connection
break;
}
catch
{
Debug("still waiting...");
}
}
Running my version of this code, I'll see that "still waiting..."
message go past 2-3 times before SQL Server wakes up and realizes that
I'm allowed to connect to it. Anybody know why?
Thanks,
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/
This is probably for the simple reason that it takes a while to create the database.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<jasonkester@.gmail.com> wrote in message
news:1160181795.643203.219410@.h48g2000cwc.googlegr oups.com...
>I have an application that creates a new database during installation,
> and I've noticed some strange behavior. Once I've created the
> database, I am able to immediately create tables and populate lookup
> data, provided I remain connected to the server. If, however, I
> disconnect and attempt to reconnect immediately, I'll get an error
> saying that my login is invalid for the new database.
> I can get around this by having my code simply wait 5 seconds before
> attempting to reconnect, but I'm curious to see if anybody here can
> give an explaination for why this is happening. Here is a bit of
> pseudo code to explain what I'm seeing:
>
> open new connection
> create database
> create tables
> populate tables
> close connection
> // open new connection /* can't do this yet, as it would break */
> for (int a=0; a<5; a++)
> {
> Thread.Sleep(2000)
> try
> {
> open new connection
> break;
> }
> catch
> {
> Debug("still waiting...");
> }
> }
>
> Running my version of this code, I'll see that "still waiting..."
> message go past 2-3 times before SQL Server wakes up and realizes that
> I'm allowed to connect to it. Anybody know why?
> Thanks,
> Jason Kester
> Expat Software Consulting Services
> http://www.expatsoftware.com/
> --
> Get your own Travel Blog, with itinerary maps and photos!
> http://www.blogabond.com/
>
|||Tibor Karaszi wrote:
> This is probably for the simple reason that it takes a while to create the database.
>
Ah, but it's not that simple. I'm able to interact with the database
just fine from the moment the CREATE DATABASE command stops blocking.
It's just the user credentials that seem to take longer.
Really, I'm looking for a programatic way to check to see that the
database is really ready to use. The wait/try/waitsomemore/tryagain...
approach that I'm using at the moment just seems like a hack.
Thanks,
Jason
|||I think I understand. You execute the CREATE command, and are blocked. As soon as you aren't blocked
anymore, you try to open a new connection and that fails unless you wait a little while with opening
that new connection.
SQL Server 2005 has been more strict regarding state of a database. Google and you should find some
info, possibly also in Books Online. So it is possible that you can query sys.databases (state_desc
column) to see what state the database is in and based on that connect. Still a polling approach,
though.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<jasonkester@.gmail.com> wrote in message
news:1160250836.466398.194580@.m73g2000cwd.googlegr oups.com...
> Tibor Karaszi wrote:
> Ah, but it's not that simple. I'm able to interact with the database
> just fine from the moment the CREATE DATABASE command stops blocking.
> It's just the user credentials that seem to take longer.
> Really, I'm looking for a programatic way to check to see that the
> database is really ready to use. The wait/try/waitsomemore/tryagain...
> approach that I'm using at the moment just seems like a hack.
> Thanks,
> Jason
>
|||Tibor Karaszi wrote:
> SQL Server 2005 has been more strict regarding state of a database. Google and you should find some
> info, possibly also in Books Online. So it is possible that you can query sys.databases (state_desc
> column) to see what state the database is in and based on that connect. Still a polling approach,
> though.
Thanks for the suggestions. That sounds like it would at least
resemble polling. What I'm doing now is simply a hack!
Jason

Delay between CREATE DATABASE and ability to connect to that database

I have an application that creates a new database during installation,
and I've noticed some strange behavior. Once I've created the
database, I am able to immediately create tables and populate lookup
data, provided I remain connected to the server. If, however, I
disconnect and attempt to reconnect immediately, I'll get an error
saying that my login is invalid for the new database.
I can get around this by having my code simply wait 5 seconds before
attempting to reconnect, but I'm curious to see if anybody here can
give an explaination for why this is happening. Here is a bit of
pseudo code to explain what I'm seeing:
open new connection
create database
create tables
populate tables
close connection
// open new connection /* can't do this yet, as it would break */
for (int a=0; a<5; a++)
{
Thread.Sleep(2000)
try
{
open new connection
break;
}
catch
{
Debug("still waiting...");
}
}
Running my version of this code, I'll see that "still waiting..."
message go past 2-3 times before SQL Server wakes up and realizes that
I'm allowed to connect to it. Anybody know why?
Thanks,
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/This is probably for the simple reason that it takes a while to create the d
atabase.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<jasonkester@.gmail.com> wrote in message
news:1160181795.643203.219410@.h48g2000cwc.googlegroups.com...
>I have an application that creates a new database during installation,
> and I've noticed some strange behavior. Once I've created the
> database, I am able to immediately create tables and populate lookup
> data, provided I remain connected to the server. If, however, I
> disconnect and attempt to reconnect immediately, I'll get an error
> saying that my login is invalid for the new database.
> I can get around this by having my code simply wait 5 seconds before
> attempting to reconnect, but I'm curious to see if anybody here can
> give an explaination for why this is happening. Here is a bit of
> pseudo code to explain what I'm seeing:
>
> open new connection
> create database
> create tables
> populate tables
> close connection
> // open new connection /* can't do this yet, as it would break */
> for (int a=0; a<5; a++)
> {
> Thread.Sleep(2000)
> try
> {
> open new connection
> break;
> }
> catch
> {
> Debug("still waiting...");
> }
> }
>
> Running my version of this code, I'll see that "still waiting..."
> message go past 2-3 times before SQL Server wakes up and realizes that
> I'm allowed to connect to it. Anybody know why?
> Thanks,
> Jason Kester
> Expat Software Consulting Services
> http://www.expatsoftware.com/
> --
> Get your own Travel Blog, with itinerary maps and photos!
> http://www.blogabond.com/
>|||Tibor Karaszi wrote:
> This is probably for the simple reason that it takes a while to create the
database.
>
Ah, but it's not that simple. I'm able to interact with the database
just fine from the moment the CREATE DATABASE command stops blocking.
It's just the user credentials that seem to take longer.
Really, I'm looking for a programatic way to check to see that the
database is really ready to use. The wait/try/waitsomemore/tryagain...
approach that I'm using at the moment just seems like a hack.
Thanks,
Jason|||I think I understand. You execute the CREATE command, and are blocked. As so
on as you aren't blocked
anymore, you try to open a new connection and that fails unless you wait a l
ittle while with opening
that new connection.
SQL Server 2005 has been more strict regarding state of a database. Google a
nd you should find some
info, possibly also in Books Online. So it is possible that you can query sy
s.databases (state_desc
column) to see what state the database is in and based on that connect. Stil
l a polling approach,
though.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<jasonkester@.gmail.com> wrote in message
news:1160250836.466398.194580@.m73g2000cwd.googlegroups.com...
> Tibor Karaszi wrote:
> Ah, but it's not that simple. I'm able to interact with the database
> just fine from the moment the CREATE DATABASE command stops blocking.
> It's just the user credentials that seem to take longer.
> Really, I'm looking for a programatic way to check to see that the
> database is really ready to use. The wait/try/waitsomemore/tryagain...
> approach that I'm using at the moment just seems like a hack.
> Thanks,
> Jason
>|||Tibor Karaszi wrote:
> SQL Server 2005 has been more strict regarding state of a database. Google
and you should find some
> info, possibly also in Books Online. So it is possible that you can query
sys.databases (state_desc
> column) to see what state the database is in and based on that connect. St
ill a polling approach,
> though.
Thanks for the suggestions. That sounds like it would at least
resemble polling. What I'm doing now is simply a hack!
Jason

Delay between CREATE DATABASE and ability to connect to that database

I have an application that creates a new database during installation,
and I've noticed some strange behavior. Once I've created the
database, I am able to immediately create tables and populate lookup
data, provided I remain connected to the server. If, however, I
disconnect and attempt to reconnect immediately, I'll get an error
saying that my login is invalid for the new database.
I can get around this by having my code simply wait 5 seconds before
attempting to reconnect, but I'm curious to see if anybody here can
give an explaination for why this is happening. Here is a bit of
pseudo code to explain what I'm seeing:
open new connection
create database
create tables
populate tables
close connection
// open new connection /* can't do this yet, as it would break */
for (int a=0; a<5; a++)
{
Thread.Sleep(2000)
try
{
open new connection
break;
}
catch
{
Debug("still waiting...");
}
}
Running my version of this code, I'll see that "still waiting..."
message go past 2-3 times before SQL Server wakes up and realizes that
I'm allowed to connect to it. Anybody know why?
Thanks,
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
--
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/This is probably for the simple reason that it takes a while to create the database.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<jasonkester@.gmail.com> wrote in message
news:1160181795.643203.219410@.h48g2000cwc.googlegroups.com...
>I have an application that creates a new database during installation,
> and I've noticed some strange behavior. Once I've created the
> database, I am able to immediately create tables and populate lookup
> data, provided I remain connected to the server. If, however, I
> disconnect and attempt to reconnect immediately, I'll get an error
> saying that my login is invalid for the new database.
> I can get around this by having my code simply wait 5 seconds before
> attempting to reconnect, but I'm curious to see if anybody here can
> give an explaination for why this is happening. Here is a bit of
> pseudo code to explain what I'm seeing:
>
> open new connection
> create database
> create tables
> populate tables
> close connection
> // open new connection /* can't do this yet, as it would break */
> for (int a=0; a<5; a++)
> {
> Thread.Sleep(2000)
> try
> {
> open new connection
> break;
> }
> catch
> {
> Debug("still waiting...");
> }
> }
>
> Running my version of this code, I'll see that "still waiting..."
> message go past 2-3 times before SQL Server wakes up and realizes that
> I'm allowed to connect to it. Anybody know why?
> Thanks,
> Jason Kester
> Expat Software Consulting Services
> http://www.expatsoftware.com/
> --
> Get your own Travel Blog, with itinerary maps and photos!
> http://www.blogabond.com/
>|||Tibor Karaszi wrote:
> This is probably for the simple reason that it takes a while to create the database.
>
Ah, but it's not that simple. I'm able to interact with the database
just fine from the moment the CREATE DATABASE command stops blocking.
It's just the user credentials that seem to take longer.
Really, I'm looking for a programatic way to check to see that the
database is really ready to use. The wait/try/waitsomemore/tryagain...
approach that I'm using at the moment just seems like a hack.
Thanks,
Jason|||I think I understand. You execute the CREATE command, and are blocked. As soon as you aren't blocked
anymore, you try to open a new connection and that fails unless you wait a little while with opening
that new connection.
SQL Server 2005 has been more strict regarding state of a database. Google and you should find some
info, possibly also in Books Online. So it is possible that you can query sys.databases (state_desc
column) to see what state the database is in and based on that connect. Still a polling approach,
though.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<jasonkester@.gmail.com> wrote in message
news:1160250836.466398.194580@.m73g2000cwd.googlegroups.com...
> Tibor Karaszi wrote:
>> This is probably for the simple reason that it takes a while to create the database.
> Ah, but it's not that simple. I'm able to interact with the database
> just fine from the moment the CREATE DATABASE command stops blocking.
> It's just the user credentials that seem to take longer.
> Really, I'm looking for a programatic way to check to see that the
> database is really ready to use. The wait/try/waitsomemore/tryagain...
> approach that I'm using at the moment just seems like a hack.
> Thanks,
> Jason
>|||Tibor Karaszi wrote:
> SQL Server 2005 has been more strict regarding state of a database. Google and you should find some
> info, possibly also in Books Online. So it is possible that you can query sys.databases (state_desc
> column) to see what state the database is in and based on that connect. Still a polling approach,
> though.
Thanks for the suggestions. That sounds like it would at least
resemble polling. What I'm doing now is simply a hack!
Jason

Delay between CREATE DATABASE and ability to connect to that database

I have an application that creates a new database during installation,
and I've noticed some strange behavior. Once I've created the
database, I am able to immediately create tables and populate lookup
data, provided I remain connected to the server. If, however, I
disconnect and attempt to reconnect immediately, I'll get an error
saying that my login is invalid for the new database.

I can get around this by having my code simply wait 5 seconds before
attempting to reconnect, but I'm curious to see if anybody here can
give an explaination for why this is happening. Here is a bit of
pseudo code to explain what I'm seeing:

open new connection
create database
create tables
populate tables
close connection

// open new connection /* can't do this yet, as it would break */

for (int a=0; a<5; a++)
{
Thread.Sleep(2000)
try
{
open new connection
break;
}
catch
{
Debug("still waiting...");
}
}

Running my version of this code, I'll see that "still waiting..."
message go past 2-3 times before SQL Server wakes up and realizes that
I'm allowed to connect to it. Anybody know why?

Thanks,

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
--
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/On 6 Oct 2006 17:36:01 -0700, Jason Kester wrote:

(snip)

Hi Jason,

You posted the same question and youy already received some answers
there.

In the future, please post to a single group only. It prevents people
wasting time on a problm that has already been solved.

--
Hugo Kornelis, SQL Server MVP

Deinstall SQL 2000 instance?

Plaese help:
How to remove SQL 2000 server instance from the server?
SQL Installation CD does not give Remove option.
Should it be manual remove from Windows services, Programm
Files,Registry?
Thanks in advance,
Nick
Just like any other Windows application. Control Panel -> Add/Remove
Programs.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"nick" <nikolay.brodsky@.phs.com> wrote in message
news:1135284807.063825.230020@.g14g2000cwa.googlegr oups.com...
> Plaese help:
> How to remove SQL 2000 server instance from the server?
> SQL Installation CD does not give Remove option.
> Should it be manual remove from Windows services, Programm
> Files,Registry?
> Thanks in advance,
> Nick
>
|||What if SQL does not appear on the Windows Programm list?
Thanks a lot for your quick response.
Nick
|||What if SQL does not appear on the Windows Programm list?
Thanks a lot for your quick response.
Nick
|||Then there is the hard way.
How to manually remove SQL Server 2000 default, named, or virtual instance
http://support.microsoft.com/kb/290991/en-us
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"nick" <nikolay.brodsky@.phs.com> wrote in message
news:1135286483.591103.324700@.o13g2000cwo.googlegr oups.com...
> What if SQL does not appear on the Windows Programm list?
> Thanks a lot for your quick response.
> Nick
>
|||Thanks again that helps a lot.
Have a nice Hollydays.
Nick

Deinstall SQL 2000 instance?

Plaese help:
How to remove SQL 2000 server instance from the server?
SQL Installation CD does not give Remove option.
Should it be manual remove from Windows services, Programm
Files,Registry?
Thanks in advance,
NickJust like any other Windows application. Control Panel -> Add/Remove
Programs.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"nick" <nikolay.brodsky@.phs.com> wrote in message
news:1135284807.063825.230020@.g14g2000cwa.googlegroups.com...
> Plaese help:
> How to remove SQL 2000 server instance from the server?
> SQL Installation CD does not give Remove option.
> Should it be manual remove from Windows services, Programm
> Files,Registry?
> Thanks in advance,
> Nick
>|||What if SQL does not appear on the Windows Programm list?
Thanks a lot for your quick response.
Nick|||What if SQL does not appear on the Windows Programm list?
Thanks a lot for your quick response.
Nick|||Then there is the hard way.
How to manually remove SQL Server 2000 default, named, or virtual instance
http://support.microsoft.com/kb/290991/en-us
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"nick" <nikolay.brodsky@.phs.com> wrote in message
news:1135286483.591103.324700@.o13g2000cwo.googlegroups.com...
> What if SQL does not appear on the Windows Programm list?
> Thanks a lot for your quick response.
> Nick
>|||Thanks again that helps a lot.
Have a nice Hollydays.
Nick

Deinstall SQL 2000 instance?

Plaese help:
How to remove SQL 2000 server instance from the server?
SQL Installation CD does not give Remove option.
Should it be manual remove from Windows services, Programm
Files,Registry?
Thanks in advance,
NickJust like any other Windows application. Control Panel -> Add/Remove
Programs.
--
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"nick" <nikolay.brodsky@.phs.com> wrote in message
news:1135284807.063825.230020@.g14g2000cwa.googlegroups.com...
> Plaese help:
> How to remove SQL 2000 server instance from the server?
> SQL Installation CD does not give Remove option.
> Should it be manual remove from Windows services, Programm
> Files,Registry?
> Thanks in advance,
> Nick
>|||What if SQL does not appear on the Windows Programm list?
Thanks a lot for your quick response.
Nick|||What if SQL does not appear on the Windows Programm list?
Thanks a lot for your quick response.
Nick|||Then there is the hard way.
How to manually remove SQL Server 2000 default, named, or virtual instance
http://support.microsoft.com/kb/290991/en-us
--
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"nick" <nikolay.brodsky@.phs.com> wrote in message
news:1135286483.591103.324700@.o13g2000cwo.googlegroups.com...
> What if SQL does not appear on the Windows Programm list?
> Thanks a lot for your quick response.
> Nick
>|||Thanks again that helps a lot.
Have a nice Hollydays.
Nick

Saturday, February 25, 2012

Default web site not listening on port 80

Hello,
For various reasons our default web site is not listening on port 80, but
81. The installation of Reporting Services went OK and I can do all
administration from the browser. Ie., everything seems OK with the
installation.
However, Visual Studio does not manage to connect to the reportserver for
deployment of reports.
How can I make VS connect?
Is there any other way to deploy reports?
Best regards,
VemundHello again,
Found the answer myself after some research.
Visual Studio doesn't manage to connect to the webserver when the
TargetServerURL is written with an IP address, eg.
http://10.0.0.1:81/ReportServer.
The solution to this was to add an entry in the hosts file as '10.0.0.1
OurReportServer'. Then the TargetServerURL in VS was entered as
http://OurReportServer:81/ReportServer and the deployment went without a
hitch.
Instead of using the hosts file, this should of course be entered into the
local DNS.
Best regards,
Vemund
"Vemund Haga" <vemund.haga@.nospam.nospam> wrote in message
news:%23ZYGIH%23kEHA.1644@.tk2msftngp13.phx.gbl...
> Hello,
> For various reasons our default web site is not listening on port 80, but
> 81. The installation of Reporting Services went OK and I can do all
> administration from the browser. Ie., everything seems OK with the
> installation.
> However, Visual Studio does not manage to connect to the reportserver for
> deployment of reports.
> How can I make VS connect?
> Is there any other way to deploy reports?
> Best regards,
> Vemund
>

Default vs Named instances

I have a server computer named 'X' and I would like to install 2 instances of SQL Server 2005

1. SQLTEST

2. SQLDEV

During installation. if I select Default instance then it will name my sql server instance X . I don't want that. I want to have essentially 2 named instances to make it clear to the users that they are using a test and dev sql server. Whats the best way to do this? I am open to suggestions if there is a different way to do this.

Is it required to have a default instance? Can I have 2 named instances X\SQLDEV and X\SQLTEST?

Also, on the SQLTEST I will be installing reporting services. By not having a default instance will it cause issues for the SSRS installation.

Please help!

Thanks.

You certainly do not need a default instance on your machine. You are fine installing two named instances side-by-side. Essentially, the default instance is merely a named instance that we call "MSSQLSERVER" by default. As for specific RS questions, you may want to search/post in their forum for side-by-side recommendations.

Thanks,
Sam Lester (MSFT)