Showing posts with label environment. Show all posts
Showing posts with label environment. Show all posts

Thursday, March 29, 2012

Database Name Environment Variable

Is there any environment variable that tells me what database I'm in on SQL
2000?
TIA,
CJSELECT DB_NAME()
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:O%23n%234WSsEHA.2252@.TK2MSFTNGP11.phx.gbl...
> Is there any environment variable that tells me what database I'm in on
SQL
> 2000?
> TIA,
> CJ
>|||Much appreciated.
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:%23y%23S6fSsEHA.2632@.TK2MSFTNGP10.phx.gbl...
> SELECT DB_NAME()
>
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:O%23n%234WSsEHA.2252@.TK2MSFTNGP11.phx.gbl...
> > Is there any environment variable that tells me what database I'm in on
> SQL
> > 2000?
> >
> > TIA,
> > CJ
> >
> >
>|||Apologies for the multi post, realized after the fact it may be more of a
.programming question rather than a .server question.
Again, sorry.
-CJ
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:%23y%23S6fSsEHA.2632@.TK2MSFTNGP10.phx.gbl...
> SELECT DB_NAME()
>
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:O%23n%234WSsEHA.2252@.TK2MSFTNGP11.phx.gbl...
> > Is there any environment variable that tells me what database I'm in on
> SQL
> > 2000?
> >
> > TIA,
> > CJ
> >
> >
>

Database Name Environment Variable

Is there any environment variable that tells me what database I'm in on SQL
2000?
TIA,
CJ
SELECT DB_NAME()
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:O%23n%234WSsEHA.2252@.TK2MSFTNGP11.phx.gbl...
> Is there any environment variable that tells me what database I'm in on
SQL
> 2000?
> TIA,
> CJ
>
|||Much appreciated.
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:%23y%23S6fSsEHA.2632@.TK2MSFTNGP10.phx.gbl...
> SELECT DB_NAME()
>
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:O%23n%234WSsEHA.2252@.TK2MSFTNGP11.phx.gbl...
> SQL
>
|||Apologies for the multi post, realized after the fact it may be more of a
..programming question rather than a .server question.
Again, sorry.
-CJ
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:%23y%23S6fSsEHA.2632@.TK2MSFTNGP10.phx.gbl...
> SELECT DB_NAME()
>
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:O%23n%234WSsEHA.2252@.TK2MSFTNGP11.phx.gbl...
> SQL
>

Database Name Environment Variable

Is there any environment variable that tells me what database I'm in on SQL
2000?
TIA,
CJSELECT DB_NAME()
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:O%23n%234WSsEHA.2252@.TK2MSFTNGP11.phx.gbl...
> Is there any environment variable that tells me what database I'm in on
SQL
> 2000?
> TIA,
> CJ
>|||Much appreciated.
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:%23y%23S6fSsEHA.2632@.TK2MSFTNGP10.phx.gbl...
> SELECT DB_NAME()
>
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:O%23n%234WSsEHA.2252@.TK2MSFTNGP11.phx.gbl...
> SQL
>|||Apologies for the multi post, realized after the fact it may be more of a
.programming question rather than a .server question.
Again, sorry.
-CJ
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:%23y%23S6fSsEHA.2632@.TK2MSFTNGP10.phx.gbl...
> SELECT DB_NAME()
>
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:O%23n%234WSsEHA.2252@.TK2MSFTNGP11.phx.gbl...
> SQL
>sql

Thursday, March 22, 2012

database mirroring - between 2 production servers

we are having 2 prodction servers in our environment.

and we are planning to perform database mirroring between them.i want to mirror server 1 databases to server2 and server 2 databases to server 1.

is this possible?

if possible , can any one give me a link to document where i can find more info on this, or send me the steps what i need to done for this...

thanks

Haven't we discussed this on SSP forums ?

The process of setting up database mirroing is documented in Books online, have you looked there?

|||

hi sathya,

i am really confused with the concept in my scenario.that's why i am posting everywhere...

i can establish the mirroring between the 2 servers with the principal and the mirror script you posted to me. like creating the certificate,master key and dbmirrorendpoint for principal and the mirror server seperately...

now my scenario is different , i alredy mirrored the prodcution databases to server2, and failed over to server 2(which is now acting as principal m server).

now we want to mrror thoese databases to our new 64 bit server, in that server shall i need to run mirror script or principal script....

because server 2 already having mirror script..

please help me out in this situation...

|||

Priya, from your question this is what i understood..........you have mirroring configured from server 1 to server 2 and you have failed over to server 2 so it has become the principal now..........then from server 2 you want to configure mirroring to someother server sql server .......it is possible.......i dunno abt the scripts you are talking abt......

|||

Yes this is possible ; For more information on configuring Database Mirroring refer Books Online.

HTH

Vishal

sql

Thursday, March 8, 2012

Database Maintenance Plan Bug

We have an environment where we utilize master-target topology. When we
create a maintenance plan, we are able to add as many servers as we want.
After the plan is created, we are unable to add additional servers on the
master server, and when we open a plan, all the servers are unchecked. Does
anyone know if this is a bug, and if there is a patch to it? Does anyone know
how to add additional servers after the plan is created?
There are several issues with the MP in that it is not quite capable of
doing everything you would expect. This is a one I haven't heard before but
it is somewhat consistent with other bugs that I have seen. The MP wizard
gets it's information from several sources when you open the wizard. One is
the MP system tables and another is that it parses the command strings in
the jobs it creates. It is very likely it has troubles parsing master -
target type jobs. It should be pretty easy to create your own to do the
same thing though.
Andrew J. Kelly SQL MVP
"MikeS" <MikeS@.discussions.microsoft.com> wrote in message
news:DA16B809-ED8C-412C-83BE-A328637CFA25@.microsoft.com...
> We have an environment where we utilize master-target topology. When we
> create a maintenance plan, we are able to add as many servers as we want.
> After the plan is created, we are unable to add additional servers on the
> master server, and when we open a plan, all the servers are unchecked.
> Does
> anyone know if this is a bug, and if there is a patch to it? Does anyone
> know
> how to add additional servers after the plan is created?
|||We have a very large sql shop, and I would like to have an automated way to
know on which servers I have the maintenance plan rolled out. Could you
please provide an example, of what you mean "easy to create your own " I can
create a string which will build a plan, but it means I will have to "rerun
it" every time I need to add a new server. Is there a sufficient way of
creating this?
thank you
"Andrew J. Kelly" wrote:

> There are several issues with the MP in that it is not quite capable of
> doing everything you would expect. This is a one I haven't heard before but
> it is somewhat consistent with other bugs that I have seen. The MP wizard
> gets it's information from several sources when you open the wizard. One is
> the MP system tables and another is that it parses the command strings in
> the jobs it creates. It is very likely it has troubles parsing master -
> target type jobs. It should be pretty easy to create your own to do the
> same thing though.
> --
> Andrew J. Kelly SQL MVP
>
> "MikeS" <MikeS@.discussions.microsoft.com> wrote in message
> news:DA16B809-ED8C-412C-83BE-A328637CFA25@.microsoft.com...
>
>
|||Mike,
What I meant was that it is fairly easy to create custom jobs to do things
such as Backup, Reindex etc. Once you have the scripts it is again pretty
easy to deploy them to any server. You can use DMO or even oSql to issue
the commands to any server you connect to. You can also use DMO or oSql to
check for the existence of any job by simply running the proper query or
sp_helpJob etc. If you have that many servers where it becomes hard to
manage I have two suggestions. One is that you might want to consider
consolidating several servers into a single larger one. This can save costs
on licenses and hardware over many smaller servers. They are also easier to
maintain. But I highly recommend you look at a 3rd party product from
http://www.sqlsentry.net/ that can help you to manage your jobs at a much
more efficient way.
Andrew J. Kelly SQL MVP
"MikeS" <MikeS@.discussions.microsoft.com> wrote in message
news:B46E86CA-F89E-4E79-A796-32BF781A601C@.microsoft.com...[vbcol=seagreen]
> We have a very large sql shop, and I would like to have an automated way
> to
> know on which servers I have the maintenance plan rolled out. Could you
> please provide an example, of what you mean "easy to create your own " I
> can
> create a string which will build a plan, but it means I will have to
> "rerun
> it" every time I need to add a new server. Is there a sufficient way of
> creating this?
> thank you
> "Andrew J. Kelly" wrote:

Database Maintenance Plan Bug

We have an environment where we utilize master-target topology. When we
create a maintenance plan, we are able to add as many servers as we want.
After the plan is created, we are unable to add additional servers on the
master server, and when we open a plan, all the servers are unchecked. Does
anyone know if this is a bug, and if there is a patch to it? Does anyone kno
w
how to add additional servers after the plan is created?There are several issues with the MP in that it is not quite capable of
doing everything you would expect. This is a one I haven't heard before but
it is somewhat consistent with other bugs that I have seen. The MP wizard
gets it's information from several sources when you open the wizard. One is
the MP system tables and another is that it parses the command strings in
the jobs it creates. It is very likely it has troubles parsing master -
target type jobs. It should be pretty easy to create your own to do the
same thing though.
Andrew J. Kelly SQL MVP
"MikeS" <MikeS@.discussions.microsoft.com> wrote in message
news:DA16B809-ED8C-412C-83BE-A328637CFA25@.microsoft.com...
> We have an environment where we utilize master-target topology. When we
> create a maintenance plan, we are able to add as many servers as we want.
> After the plan is created, we are unable to add additional servers on the
> master server, and when we open a plan, all the servers are unchecked.
> Does
> anyone know if this is a bug, and if there is a patch to it? Does anyone
> know
> how to add additional servers after the plan is created?|||We have a very large sql shop, and I would like to have an automated way to
know on which servers I have the maintenance plan rolled out. Could you
please provide an example, of what you mean "easy to create your own " I can
create a string which will build a plan, but it means I will have to "rerun
it" every time I need to add a new server. Is there a sufficient way of
creating this?
thank you
"Andrew J. Kelly" wrote:

> There are several issues with the MP in that it is not quite capable of
> doing everything you would expect. This is a one I haven't heard before b
ut
> it is somewhat consistent with other bugs that I have seen. The MP wizard
> gets it's information from several sources when you open the wizard. One
is
> the MP system tables and another is that it parses the command strings in
> the jobs it creates. It is very likely it has troubles parsing master -
> target type jobs. It should be pretty easy to create your own to do the
> same thing though.
> --
> Andrew J. Kelly SQL MVP
>
> "MikeS" <MikeS@.discussions.microsoft.com> wrote in message
> news:DA16B809-ED8C-412C-83BE-A328637CFA25@.microsoft.com...
>
>|||Mike,
What I meant was that it is fairly easy to create custom jobs to do things
such as Backup, Reindex etc. Once you have the scripts it is again pretty
easy to deploy them to any server. You can use DMO or even oSql to issue
the commands to any server you connect to. You can also use DMO or oSql to
check for the existence of any job by simply running the proper query or
sp_helpJob etc. If you have that many servers where it becomes hard to
manage I have two suggestions. One is that you might want to consider
consolidating several servers into a single larger one. This can save costs
on licenses and hardware over many smaller servers. They are also easier to
maintain. But I highly recommend you look at a 3rd party product from
http://www.sqlsentry.net/ that can help you to manage your jobs at a much
more efficient way.
Andrew J. Kelly SQL MVP
"MikeS" <MikeS@.discussions.microsoft.com> wrote in message
news:B46E86CA-F89E-4E79-A796-32BF781A601C@.microsoft.com...[vbcol=seagreen]
> We have a very large sql shop, and I would like to have an automated way
> to
> know on which servers I have the maintenance plan rolled out. Could you
> please provide an example, of what you mean "easy to create your own " I
> can
> create a string which will build a plan, but it means I will have to
> "rerun
> it" every time I need to add a new server. Is there a sufficient way of
> creating this?
> thank you
> "Andrew J. Kelly" wrote:
>

Database Maintenance Plan Bug

We have an environment where we utilize master-target topology. When we
create a maintenance plan, we are able to add as many servers as we want.
After the plan is created, we are unable to add additional servers on the
master server, and when we open a plan, all the servers are unchecked. Does
anyone know if this is a bug, and if there is a patch to it? Does anyone know
how to add additional servers after the plan is created?There are several issues with the MP in that it is not quite capable of
doing everything you would expect. This is a one I haven't heard before but
it is somewhat consistent with other bugs that I have seen. The MP wizard
gets it's information from several sources when you open the wizard. One is
the MP system tables and another is that it parses the command strings in
the jobs it creates. It is very likely it has troubles parsing master -
target type jobs. It should be pretty easy to create your own to do the
same thing though.
--
Andrew J. Kelly SQL MVP
"MikeS" <MikeS@.discussions.microsoft.com> wrote in message
news:DA16B809-ED8C-412C-83BE-A328637CFA25@.microsoft.com...
> We have an environment where we utilize master-target topology. When we
> create a maintenance plan, we are able to add as many servers as we want.
> After the plan is created, we are unable to add additional servers on the
> master server, and when we open a plan, all the servers are unchecked.
> Does
> anyone know if this is a bug, and if there is a patch to it? Does anyone
> know
> how to add additional servers after the plan is created?|||We have a very large sql shop, and I would like to have an automated way to
know on which servers I have the maintenance plan rolled out. Could you
please provide an example, of what you mean "easy to create your own " I can
create a string which will build a plan, but it means I will have to "rerun
it" every time I need to add a new server. Is there a sufficient way of
creating this?
thank you
"Andrew J. Kelly" wrote:
> There are several issues with the MP in that it is not quite capable of
> doing everything you would expect. This is a one I haven't heard before but
> it is somewhat consistent with other bugs that I have seen. The MP wizard
> gets it's information from several sources when you open the wizard. One is
> the MP system tables and another is that it parses the command strings in
> the jobs it creates. It is very likely it has troubles parsing master -
> target type jobs. It should be pretty easy to create your own to do the
> same thing though.
> --
> Andrew J. Kelly SQL MVP
>
> "MikeS" <MikeS@.discussions.microsoft.com> wrote in message
> news:DA16B809-ED8C-412C-83BE-A328637CFA25@.microsoft.com...
> > We have an environment where we utilize master-target topology. When we
> > create a maintenance plan, we are able to add as many servers as we want.
> > After the plan is created, we are unable to add additional servers on the
> > master server, and when we open a plan, all the servers are unchecked.
> > Does
> > anyone know if this is a bug, and if there is a patch to it? Does anyone
> > know
> > how to add additional servers after the plan is created?
>
>|||Mike,
What I meant was that it is fairly easy to create custom jobs to do things
such as Backup, Reindex etc. Once you have the scripts it is again pretty
easy to deploy them to any server. You can use DMO or even oSql to issue
the commands to any server you connect to. You can also use DMO or oSql to
check for the existence of any job by simply running the proper query or
sp_helpJob etc. If you have that many servers where it becomes hard to
manage I have two suggestions. One is that you might want to consider
consolidating several servers into a single larger one. This can save costs
on licenses and hardware over many smaller servers. They are also easier to
maintain. But I highly recommend you look at a 3rd party product from
http://www.sqlsentry.net/ that can help you to manage your jobs at a much
more efficient way.
--
Andrew J. Kelly SQL MVP
"MikeS" <MikeS@.discussions.microsoft.com> wrote in message
news:B46E86CA-F89E-4E79-A796-32BF781A601C@.microsoft.com...
> We have a very large sql shop, and I would like to have an automated way
> to
> know on which servers I have the maintenance plan rolled out. Could you
> please provide an example, of what you mean "easy to create your own " I
> can
> create a string which will build a plan, but it means I will have to
> "rerun
> it" every time I need to add a new server. Is there a sufficient way of
> creating this?
> thank you
> "Andrew J. Kelly" wrote:
>> There are several issues with the MP in that it is not quite capable of
>> doing everything you would expect. This is a one I haven't heard before
>> but
>> it is somewhat consistent with other bugs that I have seen. The MP
>> wizard
>> gets it's information from several sources when you open the wizard. One
>> is
>> the MP system tables and another is that it parses the command strings in
>> the jobs it creates. It is very likely it has troubles parsing master -
>> target type jobs. It should be pretty easy to create your own to do the
>> same thing though.
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "MikeS" <MikeS@.discussions.microsoft.com> wrote in message
>> news:DA16B809-ED8C-412C-83BE-A328637CFA25@.microsoft.com...
>> > We have an environment where we utilize master-target topology. When we
>> > create a maintenance plan, we are able to add as many servers as we
>> > want.
>> > After the plan is created, we are unable to add additional servers on
>> > the
>> > master server, and when we open a plan, all the servers are unchecked.
>> > Does
>> > anyone know if this is a bug, and if there is a patch to it? Does
>> > anyone
>> > know
>> > how to add additional servers after the plan is created?
>>