Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Linked server with mirrored database 2

 
   Database Forums (Home) -> Setup RSS
Next:  The differences between Access 2003 and 2007  
Author Message
Martin M

External


Since: Dec 05, 2008
Posts: 7



(Msg. 1) Posted: Thu Dec 11, 2008 10:09 am
Post subject: Linked server with mirrored database 2
Archived from groups: microsoft>public>sqlserver>setup (more info?)

As recommended by Mark Han, I am opening a new post for this issue. I am
trying to setup a linked server that works with both integrated logins and
sql logins and includes the information necessary to connect to a mirrored
database.

I have created a linked server that includes a database mirror using the
following statements:

EXEC master.dbo.sp_addlinkedserver @server = N'LinkedServerName2',
@srvproduct=N'.', @provider=N'SQLNCLI', @datasrc=N'Server\Instance',
@catalog=N'Database'
EXEC master.dbo.sp_addlinkedsrvlogin
@rmtsrvname=N'LinkedServerName2',@useself=N'True',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL


This linked server only works with integrated logins. When it is used by a
SQL login, the following error is returned:

Msg 7416, Level 16, State 2, Line 1
Access to the remote server is denied because no login-mapping exists.


I have verified that the problem is not in the permissions of the sql login
by creating a linked server that connects to the same instance, but using
more basic parameters that do not include mirroring information. This linked
server works for the same sql login, but does not have the needed mirroring
information:

EXEC master.dbo.sp_addlinkedserver @server = N'LinkedServerName2',
@srvproduct=N'.', @provider=N'SQLNCLI', @datasrc=N'Server\Instance',
@catalog=N'Database'
EXEC master.dbo.sp_addlinkedsrvlogin
@rmtsrvname=N'LinkedServerName2',@useself=N'True',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL

This is an example of a simple select that works with the second linked
server (no mirroring) but not the first (mirroring):

select * from LinkedServerName.Database.dbo.tableName
select * from LinkedServerName2.Database.dbo.tableName

Both of the above work if an integrated login is used.

How do I create a linked server that includes mirroring and works with both
integrated and sql logins?

Thanks,
Martin

 >> Stay informed about: Linked server with mirrored database 2 
Back to top
Login to vote
Mark Han[MSFT]

External


Since: Aug 29, 2008
Posts: 20



(Msg. 2) Posted: Fri Dec 12, 2008 4:26 am
Post subject: RE: Linked server with mirrored database 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

HI Martin,

This is Mark, agian. I am glad to work with you on this issue.

Based on the current information, I would like to sum up the situation for
you,
1 we have created 2 linked server pointing to a same instance. One linked
server(named A) with mirroring database and another(named B)

2 scenario B works with SQL Authentication and Windows Authenticattion but
scenario can only works with Windows Authenticattion

in order to address your concern, I would like to explain the following
1 at first, the scenario A doesn't work with SQL Authentication and Windows
Authenticattion. Based on my suggestion, now the scenario A works with
Windows Authenticattion.

2 For your convenience, I make a sample here.
For example, to explicitly connect using TCP/IP to the AdventureWorks
database on either Partner_A or Partner_B, a client application could
supply the following connection string
"Server=Partner_A; Failover Partner=Partner_B; Database=AdventureWorks;
Network=dbmssocn"

3 Based on the error message, please take the following.
1 confirm if the SQL Authentication is accepted by the mirroring server
instance.(ServerB\Instance)
2 verify if we can use the SQl login to connect to the mirroring server
instance.(ServerB\Instance)

Besides, there is an article to share with you:
http://msdn.microsoft.com/en-us/library/ms366348(SQL.90).aspx

If there is anything unclear, please do not hesitate to let me know.

Best regards,
Mark Han
Microsoft Online Community Support
===========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg.DeleteThis@microsoft.com.
===========================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or
a Microsoft Support Engineer within 2 business day is acceptable. Please
note that each follow up response may take approximately
2 business days as the support professional working with you may need
further investigation to reach the most efficient resolution.
The offering is not appropriate for situations that require urgent,
real-time or phone-based interactions. Issues of this nature are
best handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx

============================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================

 >> Stay informed about: Linked server with mirrored database 2 
Back to top
Login to vote
Martin M

External


Since: Dec 05, 2008
Posts: 7



(Msg. 3) Posted: Fri Dec 12, 2008 7:57 am
Post subject: RE: Linked server with mirrored database 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Mark,

Your description of the current situation is correct.

In response to your points:

1. Scenario A has always worked with Windows Authentication. Based on your
suggestion, I corrected a problem that would have prevented the SQL login
from accessing the database if the linked server were working. However, the
error message did not change, so I am assuming that the connection is failing
before it even tries to connect.

2. The only difference in this string versus the one I was using is the
attribute "Network=dbmssocn". I added the attribute to my linked server with
no effect.

3. The mirroring server instance does accept SQL logins. The login I am
testing can connect to the mirroring server instance.

I reviewed the linked article, but not did not find anything that suggested
how to fix the issue.

Thanks,
Martin
 >> Stay informed about: Linked server with mirrored database 2 
Back to top
Login to vote
Mark Han[MSFT]

External


Since: Aug 29, 2008
Posts: 20



(Msg. 4) Posted: Tue Dec 16, 2008 2:25 am
Post subject: RE: Linked server with mirrored database 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Martin,

Thank you for the update.

Based on the current information, please try the following
Use Enterprise Manager and go to the properties of the Linked Server. On
the security tab, select the radio button "be made using this security
context". For the remote login information, specify the SA account and its
password. Nothing has to be listed in the top section for local logins.

Besides, I share you the article is to make the linked servere much easier
understandable for you.

Hope the above helpful.

Best regards,
Mark Han
Microsoft Online Community Support
=========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg.RemoveThis@microsoft.com.
=========================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
 >> Stay informed about: Linked server with mirrored database 2 
Back to top
Login to vote
Martin M

External


Since: Dec 05, 2008
Posts: 7



(Msg. 5) Posted: Tue Dec 16, 2008 8:10 am
Post subject: RE: Linked server with mirrored database 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Mark,

Changing that setting made no difference. The integrated login still works,
and the sql login still returns the same error message. To make sure I was
changing the correct linked server and wasn't missing any other conflicting
settings, I dropped it and recreated it using the following script:
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N'LinkedServer',
@locallogin = NULL , @useself = N'True', @rmtuser = N''
GO
exec master.dbo.sp_dropserver 'LinkedServer'
go
EXEC master.dbo.sp_addlinkedserver @server = N'LinkedServer',
@srvproduct=N'.', @provider=N'SQLNCLI',
@provstr=N'Server=Server1\Instance;Partner=Server2\Instace;Network=dbmssocn',
@catalog=N'DbName'
EXEC master.dbo.sp_addlinkedsrvlogin
@rmtsrvname=N'LinkedServer',@useself=N'False',@locallogin=NULL,@rmtuser=N'sa',@rmtpassword='########'

Thanks,
Martin
 >> Stay informed about: Linked server with mirrored database 2 
Back to top
Login to vote
Mark Han[MSFT]

External


Since: Aug 29, 2008
Posts: 20



(Msg. 6) Posted: Thu Dec 18, 2008 6:25 am
Post subject: RE: Linked server with mirrored database 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Martin,

Thank you for the update and patience with me.

In order to address your concern, I would like to explain the following.
1 the cause of the issue seems to be the
@provstr=N'Server=Server1\Instance;Partner=Server2\Instace;Network=dbmssocn.
In the provstr, we don't use key word PWD and UID. So SQL Server consider
the connection use window authentication as by default. It is the root
cause of the issue. There is an artilce to share with
you:http://msdn.microsoft.com/en-us/library/ms130822(SQL.90).aspx

2 if you would like to SQL authentication, and the UID and PWD keywords
must be specified.

Hope the above helpful.

Best regards,
Charles Wang
Microsoft Online Community Support
=========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg RemoveThis @microsoft.com.
=========================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
 >> Stay informed about: Linked server with mirrored database 2 
Back to top
Login to vote
Martin M

External


Since: Dec 05, 2008
Posts: 7



(Msg. 7) Posted: Thu Dec 18, 2008 8:27 am
Post subject: RE: Linked server with mirrored database 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Mark,

OK, that answers part of my question. There is no way to create a linked
server using @provstr that works with both integrated and sql logins.

The other part remains. Is there any way to create the linked server so
that it allows mirroring to be configured and both integrated and sql logins
to be used?

Thanks,
Martin
 >> Stay informed about: Linked server with mirrored database 2 
Back to top
Login to vote
Mark Han[MSFT]

External


Since: Aug 29, 2008
Posts: 20



(Msg. 8) Posted: Thu Dec 18, 2008 10:25 pm
Post subject: RE: Linked server with mirrored database 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Martin,

Thank you for the reply and patience with me.

It seems to be a by-design issue. In the connection string, it is allowed
to definate only one authentication. To better assist you with the issue,
could you please tell me the reason for using both windows authentication
and SQl authentication in the scenario?

To make the issue easier understandable, I would like to explain the
following.
1 there are 3 servers involved in the scenario. one the linked server(B),
another is mirrored database server(C), the other is primary server(A)

2 in the scenario, we can consider the Server A as the client. The
connection string
@provstr=N'Server=Server1\Instance;Partner=Server2\Instace;Network=dbmssoc
is used by the client to connect to the server B with mirrored database
server(C)

3 To ensure our connection security, it is allowed to definate only one
authentication in one connection string.

Hope the above helpful. Thanks.

Best regards,
Mark Han

Microsoft Online Community Support
Get Secure! - www.microsoft.com/security
====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
====================================================
 >> Stay informed about: Linked server with mirrored database 2 
Back to top
Login to vote
Martin M

External


Since: Dec 05, 2008
Posts: 7



(Msg. 9) Posted: Fri Dec 19, 2008 7:53 am
Post subject: RE: Linked server with mirrored database 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hello Mark,

The client server (A) is our primary reporting instance and is used by both
reporting applications and end users. Not all of our applications can
connect using Windows authentication, and we want some of them to connect
with consistent permissions regardless of the users running them. End users
that develop their own reports connect using Windows authentication. A lot
of reports pull information from other servers; for various reasons, we often
create views on this server that reference tables in other instances. Some
of these views are used by both applications and end users.

This has never been a problem before; the basic linked servers we usually
set up handle this without issue, but we recently added a mirrored database
to our set of sources. I am trying to create a linked server that will work
for everybody regardless of which side of the mirror is active.

I got close using a linked server with a DSN, but it had problems with
binary fields.

Thanks,
Martin
 >> Stay informed about: Linked server with mirrored database 2 
Back to top
Login to vote
Mark Han[MSFT]

External


Since: Aug 29, 2008
Posts: 20



(Msg. 10) Posted: Mon Dec 22, 2008 1:25 am
Post subject: RE: Linked server with mirrored database 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hello Martin,

Thank you for the reply.

in order to address your concern, i would like to explain the following.
1 to connect to a mirrored database scenario, we must define one
authentication in the connection string.

2 based on the current situation, we might need to do the following to work
around the issue.
a) change all application/user to connect to SQL by SQL Authentication.
b) remove the mirrored database.

Hope the above helpful.

Best regards,
Mark Han

Microsoft Online Community Support
Get Secure! - www.microsoft.com/security
====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
====================================================
 >> Stay informed about: Linked server with mirrored database 2 
Back to top
Login to vote
Martin M

External


Since: Dec 05, 2008
Posts: 7



(Msg. 11) Posted: Mon Dec 22, 2008 7:48 am
Post subject: RE: Linked server with mirrored database 2 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Mark,

OK, that answers my question. Thanks for your assistance.

Thanks,
Martin
 >> Stay informed about: Linked server with mirrored database 2 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Linked Server through DMZ - Does anyone have any reference material on what ports need opened, and configuration settings set to allow a linked server to work through a DMZ to an internal SQL Server Box?

Linked server to Interbase - Hi everybody Need to know how i can create a linked server from a SQL Server 2000 server to an interbase database. I believe it is of version6 and later. Can anyone help me here. Can't seem to find an answer elsewhere. Does microsoft have an OLEDB..

Linked server setup - I have to setup the link server.the Remote server is alrady registered in my enterprise mangaer using Client Network utility. When i setup the Linked server,error message says:- the server does not exist or access denied. Can you help me the General...

Script-Out Linked Server? - SQL Server 2000. There is a linked server and I want to replicate, in TSQL only, the code that I could execute on another server to re-gen it. It doesn't seem to be created if I "script all SQL objects" from Enterprise Manager or SQL Workbench....

Linked Server Autentication - Help - Login Failed - Hi there. I've been trying to get linked servers set up on two servers. Here is what i have done in my test environment. I've got two servers. Test1 and Test2. They are Standard 2005 installs. I've got two user accounts set as local admin on both..
   Database Forums (Home) -> Setup All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]