Availability Groups -- Cannot connect to both instances

We have created a two node availability group using SQL 2012. Installation went fine and we thought everything was working. We installed our application and everything also was working fine till we failed the databases over to the second node. Once their
the application can no longer see the databases. We have set the same permissions to the databases on both servers. The SQL service is running under the same Windows Service account for both nodes and both nodes are on the same subnet. I am pretty sure it
is not a listener problem because if I reset the permission to the databases on the second node the app can now only see the databases when on the second node. We are trying to use an internal SQL account for application access and the account password is
synced between both nodes. Any ideas or comments would be most appreciated.

Hello,
We are trying to use an internal SQL account for application access and the account password is synced between both nodes. Any ideas or comments would be most appreciated.
There's the problem. You're using SQL Auth and while the password may be the same, the SID for the login is not. Thus your database has an orphaned user and your problem presents itself. The problem has nothing to do with Availability Groups but with how
SQL Authentication internally works. BTW this would not be a problem with Windows Auth.
When you create the login on the other node, use the SID option to specify the same SID for the original login (or the one that has permissions currently) which can be found in sys.sql_logins. Once the SIDs are the same you will no longer have this issue.
Sean Gallardy | Blog |
Twitter

Similar Messages

  • Weird - can connect to both instances - but not to main SID

    As a newbie to RAC I got stuck...
    after installation of grid, db SW and a sample DB "QRC" with dbca I can connect to both instances QRC1 and QRC2,
    but not to QRC - here sqlplus tells me "connected to an idle instance"
    What did I mix up??
    rac11a ~ RDBMS > srvctl start database -d QRC -o open
    PRCR-1004 : Resource ora.qrc.db is already running
    rac11a ~ RDBMS >
    [root@rac11a ~]# crsctl status res -t
    NAME TARGET STATE SERVER STATE_DETAILS
    Local Resources
    ora.LISTENER.lsnr
    ONLINE ONLINE rac11a
    ONLINE ONLINE rac11b
    ora.asm
    OFFLINE OFFLINE rac11a
    OFFLINE OFFLINE rac11b
    ora.eons
    ONLINE ONLINE rac11a
    ONLINE ONLINE rac11b
    ora.gsd
    OFFLINE OFFLINE rac11a
    OFFLINE OFFLINE rac11b
    ora.net1.network
    ONLINE ONLINE rac11a
    ONLINE ONLINE rac11b
    ora.ons
    ONLINE ONLINE rac11a
    ONLINE ONLINE rac11b
    Cluster Resources
    ora.LISTENER_SCAN1.lsnr
    1 ONLINE ONLINE rac11b
    ora.LISTENER_SCAN2.lsnr
    1 ONLINE ONLINE rac11a
    ora.LISTENER_SCAN3.lsnr
    1 ONLINE ONLINE rac11a
    ora.oc4j
    1 OFFLINE OFFLINE
    ora.qrc.db
    1 ONLINE ONLINE rac11a Open
    2 ONLINE ONLINE rac11b Open
    ora.rac11a.vip
    1 ONLINE ONLINE rac11a
    ora.rac11b.vip
    1 ONLINE ONLINE rac11b
    ora.scan1.vip
    1 ONLINE ONLINE rac11b
    ora.scan2.vip
    1 ONLINE ONLINE rac11a
    ora.scan3.vip
    1 ONLINE ONLINE rac11a
    [root@rac11a ~]#
    rac11a ~ RDBMS > tnsping qrc
    TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 02-FEB-2012 09:20:54
    Copyright (c) 1997, 2009, Oracle. All rights reserved.
    Used parameter files:
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = qrcscan.ddnett.de)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = QRC.ditanett)))
    OK (40 msec)
    rac11a ~ RDBMS > env | grep ORA
    dbms_type=ORA
    ORACLE_SID=QRC
    ORACLE_BASE=/oracle/QRC
    ORACLE_HOME=/oracle/QRC/11202
    rac11a ~ RDBMS >
    rac11a ~ RDBMS > sqlplus " / as sysdba"
    SQL*Plus: Release 11.2.0.1.0 Production on Thu Feb 2 09:21:04 2012
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    Connected to an idle instance.
    SQL>
    rac11a ~ RDBMS > lsnrctl status
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
    Start Date 02-FEB-2012 08:23:25
    Uptime 0 days 1 hr. 16 min. 21 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File /oracle/LOCAL/GRID/11202/network/admin/listener.ora
    Listener Log File /oracle/LOCAL/BASE/diag/tnslsnr/rac11a/listener/alert/log.xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.141)(PORT=1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.241)(PORT=1521)))
    Services Summary...
    Service "QRC.ditanett" has 1 instance(s).
    Instance "QRC1", status READY, has 1 handler(s) for this service...
    Service "QRCXDB.ditanett" has 1 instance(s).
    Instance "QRC1", status READY, has 1 handler(s) for this service...
    The command completed successfully
    rac11a ~ RDBMS >
    rac11b ~ RDBMS > lsnrctl status
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
    Start Date 02-FEB-2012 08:24:02
    Uptime 0 days 1 hr. 17 min. 12 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File /oracle/LOCAL/GRID/11202/network/admin/listener.ora
    Listener Log File /oracle/LOCAL/BASE/diag/tnslsnr/rac11b/listener/alert/log.xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.142)(PORT=1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.242)(PORT=1521)))
    Services Summary...
    Service "QRC.ditanett" has 1 instance(s).
    Instance "QRC2", status READY, has 1 handler(s) for this service...
    Service "QRCXDB.ditanett" has 1 instance(s).
    Instance "QRC2", status READY, has 1 handler(s) for this service...
    The command completed successfully
    rac11b ~ RDBMS >

    Hi,
    after installation of grid, db SW and a sample DB "QRC" with dbca I can connect to both instances QRC1 and QRC2,
    rac11a $ env | grep ORA
    dbms_type=ORA
    ORACLE_SID=QRC
    ORACLE_BASE=/oracle/QRC
    ORACLE_HOME=/oracle/QRC/11202
    rac11a ~ RDBMS >
    rac11a $ sqlplus " / as sysdba"
    SQL*Plus: Release 11.2.0.1.0 Production on Thu Feb 2 09:21:04 2012
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    Connected to an idle instance.
    SQL>
    The Oracle System ID (SID) is used to uniquely identify a particular database on a system. For this reason, one cannot have more than one database with the same SID on a host.
    When using RAC, all instances belonging to the same database must have unique SID's even using different hosts.
    So, you must set ORACLE_SID to QRC1 where Instance 1 is running or QRC2 where Instance 2 is running.
    To know where instance number is running you can get this info following steps below:
    $GRID_HOME/bin/olsnodes -n
    lnxora01        1
    lnxora02        2In example above all instance created by DBCA on lnxora01 will have prefix 1 (e.g db QRC will have QRC1) and on lnxora02 will have prefix 2. (it's not a rule, because I can set manually the number of instance as I wish)
    Or exists another way to find it: (on local node)
    ps -ef |grep pmon
    ora_pmon_QRC1 So, to connect just set right ORACLE_SID
    eg:
    export ORACLE_SID=QRC1
    sqlplus / as sysdbaRegards,
    Levi Pereira

  • Cannot connect to RAC-Instance as another user

    Hi,
    I have two unix user, called oracle and bb, belongs to the group osdba in a RAC environment.
    As user "oracle" I can connect to the instance with sqlplus "/ as sysdba".
    As user "bb" I get the message: "connected to an idle instance."
    Does anyone has any idea why this can happen ?
    In both cases I set ORACLE_SID and LD_LIBRARY_PATH and PATH identical.
    What's wrong ?
    PS: In a single database environment this will work.
    thanks for any help,
    Rainer

    If you have to connect to oracle RAC (Real Application Cluster) using JDBC with thin driver, the classic url:
    jdbc:oracle:thin:@<HOST>:1521:<SID>
    doesn�t work and you get the error ORA � 12505.
    Instead, you must use this url:
    jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)
    (ADDRESS=(PROTOCOL=TCP)(HOST=host1) (PORT=1521))
    (ADDRESS=(PROTOCOL=TCP)(HOST=host2) (PORT=1521))
    (CONNECT_DATA=(SERVICE_NAME=service)))
    Check the tsnames.ora for the correct values of SERVICE_NAME and host.

  • DI Server - Cannot connect to named instance SQL server database

    Hi,
    I have developed a small DI server application and want to migrate it to a production server. I keep on getting the Cannot connect to SBOCommon error on login though. I have verified all user names and passwords and the only real difference is that the production environment uses a named instance SQL server eg server\instance setup.
    The production DI server will however connect perfectly to the test database (which is NOT a named instance) .
    Anyone using DI server against a named instance SQL server or have some other ideas what might cause this?
    I use B1WS 1.0 and the version of SBO is 8.00.181..
    Jaco

    I may have solved the problem, at least partially.
    I created a test user with full rights on my test database server and it would also not connect, even though my test database is not a an instance setup.
    Then I found this thread  [Re: DI Server Always Uses SA to log into MS SQL database even if SOAP packet]
    It seems that at my current patch level the user 'sa' is hard coded into the DI server as sql username! I don't have the production server's 'sa' user credentials at present but will test it on Monday. Will also test against 8.8 soon ..

  • Thread: Cannot connect to auxiliary instance posted by William Wong

    I am experiencing the same issue and I am able to get the suggestion to work connecting to both the target and auxiliary databases on the auxiliary server, but I don't know where to go from there. Do I go back to the target server and continue from there?
    This is on 2 identical linux boxes running Oracle 10.2.0.6.

    Your problem I think is that the listener on the auxiliary server is likely to have the status of this service (shown with lsnrctl servcies) as BLOCKED.
    What you need to do is, on that server, edit the listener.ora and add a static SID_LIST section to the file, so that the listener will report that service as status UNKNOWN. That is, there will be two statuses listed for the same service, one BLOCKED because that's coming from dynamic registration and one UNKNOWN because that's what the SID_LIST says.
    An example listener.ora would look like:
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = PLPC358)(PORT = 1521))
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (GLOBAL_DBNAME = TESTDB)
          (ORACLE_HOME = c:\oracle\10g\db_1)
          (SID_NAME = TESTDB)
      )You will have to make sure that on the server where you're running RMAN (effectively, the client for this occasion), the auxiliary instance is listed in the tnsnames.ora with a SID=TESTDB sort of line, rather than a SERVICE=TESTDB. If you try to connect via 'service=' aliases, you'll be trying to connect via the BLOCKED "socket" on the auxialiary instance. If you connect via a "sid=" alias, you'll be connecting via the UNKNOWN socket, and that's what you want.
    Message was edited by:
    Catfive Lander
    I should have read your earlier post more carefully. I see you already have the UNKNOWN instance listed on the auxialiary server, so I think you're half-way there. I think you just need to make sure the tnsnames.ora used by your RMAN machine refers to SID= not SERVICE=

  • Cannot connect to the Instance

    Hi there, I'm a newbie to Oracle. I downloaded Oracle 9i Database. After installation, when I try to connect to the Instance using command prompt, I get the following error message:
    SQL> CONNECT SYS/change_on_install AS SYSDBA
    ERROR:
    ORA-12560: TNS:protocol adapter error
    Could anyone please show me how to resolve the above problem. Thanks. :)

    DB_DOMAIN is not a mandatory parameter.
    The DB_NAME parameter is the value of the database and is the name used when creating the database. It is specified within the INIT.ORA parameter file or in the CREATE DATABASE command. This is one of those parameters that is optional but is always best to set it.
    DB_DOMAIN is the value of the domain to which the database belongs. It is the location of the database within the network hierarchy. Even if the database you are creating is not going to be a part of any network or distributed system, I would suggest that you set this parameter just for the sake of going through the thought process and understanding how things connect when networked.

  • Agent cannot connect to DB Instance after listener restart

    I am using 10gR2. I am running EM dbconsole on my machine. It runs fine as long as listener is also running. But when I stop the listener and restart the listener, the dbconsole shows the agent to be unreachable. I tried "emctl reload agent". Still it does not work.
    But when i restart dbconsole, it works fine. Is there anyway I can correct this problem without restarting dbconsole? Please let me know.

    Hi.
    Thanks for your reply. The reason I am asking this
    question is because is:
    1) If the listener cannot go down at all while
    dbconsole is running (because dbconsole needs
    listener), then why did they provide the option to
    stop/start the listener in the dbconsole web
    interface.You can Stop and Start the Listener successully from DB Console if you did not logout of DB Console after the Stop. Once you disconnected from DB Console after Stop, you will get an error. E.g "Io exception: The Network Adapter could not establish the connection". You can restart the listener manually, then reconnect.
    >
    2) If the listener fails due to some reason, then
    there should be some way by which, upon manual
    restart of listener, the dbconsole should be able to
    recognize that the listener is now up.When the listener fails (or you manually Stop it) while the DB Console is open, it should be able to reconnect when you manually restart the listener. You just have to ensure that your Agent is pinging the correct listener. I have not had a problem with this.

  • Cannot connect to 10g instance from 11g client (ORA-12638)

    Hi,
    I don't know why I have problems when I connect from a 11g client to a 10g server. I get the error ORA-12638.
    However, it works fine doing the same with a 10g client.
    Can anybody tell me how to avoid this problem without having to install the 10g client ?
    Thanks in advance.
    Regards.

    Hi, user7409638,
    To understand the problem, I advice you to enable tracing and have a look at it.
    As you may know, ORA-12638 is the problem with the authentication service.
    It was just unable to get your credentials.
    If you want me finally get the solution, please report it at my system http://1dayotn.blogspot.de/p/question-me_7.html
    If you have any questions, ask.
    Kirill Babeyev

  • Cannot connect to newly created SQL 2008 R2 instance. Login failed for user...

    I'm not a SQL guy, just figuring my way around here...
    I just created a new instance on an existing SQL server. The original instance works fine. On
    Database Engine Configuration > Account Provisioning
    I selected Windows authentication mode and added several users, myself among them.
    Tried to log in with one my account and getting:
    TITLE: Connect to Server
    Cannot connect to SERVERNAME\INSTANCE.
    ADDITIONAL INFORMATION:
    Login failed for user 'domain\myusername'. (Microsoft SQL Server, Error: 18456)
    Guidance/suggestions?
    Thanks,
    Scott

    http://sqlserver-help.com/2014/07/08/help-how-to-find-cause-of-login-failed-for-user-error/
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • Always on Availability groups using static SQL Tcp Port

    Hi,  I have 2 SQL 2012 servers in my DMZ and I have assigned SQL to run on a static TCP Port.  I would like to setup Always On availability groups on the servers but I cannot get the failover to work with the static TCP port.  It works fine
    with dynamic ports.
    When the failover is initiated it attempts to connect to the secondary replica with out using the static port,  can someone tell me how to setup the availability group using static tcp ports.
    Thanks,

    When I setup the secondary replica I added the port number, but it doesn't appear to use it for failover.  I add the secondary replica w/o errors.
    I am not sure how to add the port number to the primary.
    Dave
    Hi Dave,
    Based on your description, could you please post the error message when getting failover to the secondary replica?
    In addition, If you use the default port of 1433 for availability group listener VNNs, you will still need to ensure that no other services on the cluster node are using this port; otherwise this would cause a port conflict.
    If one of the instances of SQL Server is already listening on TCP port 1433 via the instance listener and there are no other services (including additional instances of SQL Server) on the computer listening on port 1433, this will not cause a port conflict
    with the availability group listener. However multiple instances of SQL Server (side-by-side)should not be configured to listen on the same port.
    For more details, please review this article:
    Availability Group Listeners, Client Connectivity, and Application Failover (SQL Server).
    Thanks,
    Lydia Zhang

  • Cannot connect to Analysis server

    Gooday ,
    I am trying to log in to our analysis server using my windows authentications,for some reason i am not able to and i get this error
    "Cannot Connect to "ServerName\Instance"
    "The Execute element at line 6, column 60 (namespace urn:schemas-microsoft-com:xml-analysis) cannot appear under Envelope/Body. (Microsoft SQL Server 2008 R2 Analysis Services)"
    I(and the team) are really confused as to whats happening here,
    Could someone please assist by guiding us as to where to start in resolving this issue.
    Kind Regards

    Hi Smacoba,
    First to ensure that you have the corresponding permission to access this database, you can refer to the link below to see the details.
    Granting User Access
    Do you connect to local server or remote server? If you connect to a remote server, you need to unblock ports in a firewall to allow access to Analysis Services, please refer to the link below to see the detail information.
    Configure Windows Firewall for Analysis Services Access
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Finds headset but cannot connect

    Trying a Plantronics 220 headset with my 6220 classic, the phone finds the headset but says it cannot connect. Both are Bluetooth 2.9. Any idea what's wrong?

    Have you paired them correctly? It typically involves a PIN# of 0000 to be entered into the phone during the pairing process.

  • Cannot connect to SQL SERVER with Always on availability group listener name

    Hi everyone,
    I have setup always an availability group listener for sql server on port 1433, have opened the port in  firewall , remote connections are enabled in the sql server, but still I am not able to connect to the sqlserver instance with the help
    of the availability group listener name.
    I get the following error.
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.(provider:
    TCP Provider, error: 0 - The wait operation timed out.)"} System.Exception {System.Data.SqlClient.SqlException
    Have gone through several blogs for the solution but none of them helped.
    Please let me know if anyone has fixed the issue.
    Regards,
    Divya

    Prior to making SS connection, can you establish the connection with a networking tool?
    SS connectiviy trouble shooting:
    http://technet.microsoft.com/en-us/library/ms378845.aspx
    http://stackoverflow.com/questions/5919524/not-able-to-telnet-sql-port-1433-locally-or-remotely
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/227f431a-4274-4d95-b605-67541d78ef03/test-sql-connection-with-telnet?forum=sqldataaccess
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Unable to connect to primary replica VM of the SQLSERVER availability group

    Hi,
    I have configured an always-on availability group on 2 SQLSERVER nodes and one WSFC node. All reside within the same cluster.
    I also configured Always-on Availability Group Listener. Have given the Load balanced endpoint for the 3 VM's as 1433 with direct server return enabled and have added rules for both the listener port and probe port 59999 in all the VM'S firewall. After
    I create the Listener in primary replica and bring it online I lose the connection to the VM. Have gone through all the Links referred in various blogs but I still have the issue and not able to connect through the Listener. I am not able to
    connect to the primary replica VM.
    Please provide some suggestions to resolve this error.
    Thanks and Regards,
    Divya 

    Hi Edwin,
    Thanks for your reply.
    My main issue is that once I create a Availability group listener and run the powershell script for configuring the cluster network with the IP address of the Cloud service hosting all the sqlserver VM's and the get the listener online. The moment I bring
    the listener online, I lose connection to that primary replica VM. Have not yet set the dependency for the Availability group.
    Then through the secondary replica's sqlserver's instance I connected to my primary replica's instance , added resource dependency to availability group and set the port in the listener.
    When I ping the listener through the primary and secondary replica it shows the correct IP of the listener but later give Request Time out error.
    I am not able to ping the listener through the domain controller machine.
    Regards,
    Divya

  • I have windows 7 64 bit, Core i5, I have tried every option identified in the discussion groups but still cannot connect to the iTunes Store, any ideas?

    I have a brand new Core i5 Windows 64bit laptop, but cannot connect to the iTunes Sore.  I have tried every solution suggested in the discussion groups but I still cannot connect.  This includes completely removing all security and firewalls, and I still cannot connect.  I have re-load the software in different combinations again to no avail.  Any ideas anyone?

    Could you walk us through what happens (when you try to connect to the Store) in some more detail, please?

Maybe you are looking for

  • Problem with 3rd Gen Ipod Nano being recognized by Itunes

    I have a third generation Ipod Nano that was only used once. It takes a full charge and appears to be working fine. Problem is when I plug it into a computer it is not recognized by Itunes. The computer recognizes it but not Itunes. I have tried it o

  • How to force traffic though a chosen interface in Windows 8.1?

    Windows 8.1 seems to be able to detect dead routes and picks up the default gateway or next best route for routing. I have a requirement where I want traffic for specific destinations to "always" go through the Interface that I pick and if that inter

  • Today's Bridge CC update killed InDesign!

    After installing an update to Bridge CC this morning, InDesign suddenly became a MESS. I know it was the Bridge update that caused this- I was using InDesign before and after the update and all this happened immediately after the update. I can no lon

  • Calling Non SOAP based Web Service

    Can I call a web service that is not SOAP based through Data Services natively? I have an API I need to hit that's XML based, but it's not SOAP. Edited by: jmbsquared on Sep 20, 2011 7:25 PM

  • EREC - Read Canditate resume

    Hi All, I am currently working in EREC candidate registration. My requirement is when ever a candidate applies...the resume should me send to manager through mail as attachment,.....so i have to read the resume from IT5134...i used the class CL_HRRCF