Quantcast
Channel: Database Mirroring forum
Viewing all 1024 articles
Browse latest View live

AlwaysOn - Unable to connect to correct server with ApplicationIntent=READONLY

$
0
0

Having issues trying to get the READONLY intent to work on our AlwaysOn setup.

SETUP is

Azure VM

NIS-SQL01
NIS-SQL02

They run with a AlwaysOn High Availability, this works fine, the AGL also works fine from outside the Azure environment. However when we try and define the connection to be READONLY, we are still getting the Primary Server when connecting.

running

select		ar.replica_server_name
			, ar.endpoint_url
			, ar.replica_server_name
			, ar.availability_mode_desc
			, ar.failover_mode_desc
			, ar.session_timeout
			, ar.primary_role_allow_connections_desc
			, ar.secondary_role_allow_connections_desc
			, ar.backup_priority
			, ar2.read_only_routing_url

from sys.availability_replicas ar 
inner join sys.availability_read_only_routing_lists avr
on ar.replica_id = avr.replica_id
inner join sys.availability_replicas ar2
on avr.read_only_replica_id = ar2.replica_id

NIS-SQL02    TCP://NIS-SQL02.NISCLOUD.local:5022    NIS-SQL02    SYNCHRONOUS_COMMIT    AUTOMATIC    10    ALL    READ_ONLY    50   tcp://NIS-SQL01.NISCLOUD.local:1433
NIS-SQL01    TCP://NIS-SQL01.NISCLOUD.local:5022    NIS-SQL01    SYNCHRONOUS_COMMIT    AUTOMATIC    10    ALL    READ_ONLY    50   tcp://NIS-SQL02.NISCLOUD.local:1433

select dns_name,port,is_conformant,ip_configuration_string_from_cluster FROM sys.availability_group_listeners

AGL    50666    1    ('IP Address: CORRECT_IP')

select * from sys.availability_replicas

71284784-C2F6-4693-902A-8FD2108AAC96    1F9E1C25-7402-496F-99DA-808EBDBBFD83    65538    NIS-SQL01    0x010500000000000515000000F339C67C0A4FE3FAA41097E8E9030000    TCP://NIS-SQL01.NISCLOUD.local:5022   1    SYNCHRONOUS_COMMIT    0    AUTOMATIC    10    2    ALL    1    READ_ONLY    2014-07-08 11:05:59.727   2014-07-08 11:05:59.727    50    tcp://NIS-SQL01.NISCLOUD.local:1433
1309D653-0B34-4D61-9894-4A3C6061359D    1F9E1C25-7402-496F-99DA-808EBDBBFD83    NULL    NIS-SQL02    NULL    TCP://NIS-SQL02.NISCLOUD.local:5022    1    SYNCHRONOUS_COMMIT   0    AUTOMATIC    10    2    ALL    1    READ_ONLY    NULL    NULL    50    tcp://NIS-SQL02.NISCLOUD.local:1433

SELECT * FROM sys.availability_read_only_routing_lists

71284784-C2F6-4693-902A-8FD2108AAC96    1    1309D653-0B34-4D61-9894-4A3C6061359D
1309D653-0B34-4D61-9894-4A3C6061359D    1    71284784-C2F6-4693-902A-8FD2108AAC96

I can connect directly from one of the NIS-SQL servers to both of the read_only_routing_urls.

Made sure the Firewall settings allow for incomming connections on the specified ports.

I feel like i have tried almost everything that I could find through google, run through the MS Knowledge base step by step trying to find what might be wrong without any issues to the setup.

So hope that there might be some here who could shine some light or give som ideas on what I might be missing.

Regards,

Mike


SQL Database Reconnect after Compressing Log files

$
0
0
Hi, I had to pause my SQL Server 2008 R2,  Database to compress Log files. On an average the database creates 2GB of log files a week. I was successful with compressing the files and freeing up more disk space. I can't reconnect the databases of the log files that I compressed. The status "principal/disconnected. I've taking the databases offline and still can't reconnect. This is causing all my SharePoint Websites in my farm to unreachable. I've disabled mirroring on those databases, but still don't have an option to reconnect.

How to reset DBs at Partner Server showing (Restoring) State

$
0
0

Hello People,

I tried to find the answer but somehow not exactly what I am looking for. So here is my scenario

  1. We had DB mirroring setup
  2. it is not longer required
  3. So we broke the mirror and Principal looks fine
  4. Now at the partner Server all the DBs show (Restoring) state.
  5. I don't need these database and just wan to keep them in the Folder but want to take them off-line or detach
  6. it is not letting me do that
  7. I ran a Drop Database script but it deleted the DB from that folder as well, which I don't want to do
  8. Is there any cleaner way of just taking those DBs off-line, detached or dropped without loosing them from the folders where these exist?

Please help and advise

site level failover

$
0
0

scenario:

2 datacenter with good connectivity. SQL 2012 principal and witness servers are placed in main site and mirroring server is place in DR site. high-safety mode with auto failover proposed.

customer is asking what about the main site down? can force mirroring server continue to support the application (RMS2012) in DR site?


Jason

Failover connection String not working

$
0
0

Hi,

We recently deployed mirroring on our sql server 2008R2 system. We made below changes to connection string on application

<add name="SampleContainer" connectionString="metadata=res://*/SampleModel.csdl|res://*/SampleModel.ssdl|res://*/SampleModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=PrimaryDB1;Failover Partner=SecondaryDB2;Initial Catalog=SampleDatabase;User ID=SCOTT;Password=*****;pooling=False;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient"/>

When our primary crashed, and was shutdown, databases failed over to secondary, but application was still trying to connect to primary, it never connected to secondary(now primary). When primary was backup up again now as mirror secondary, the applications started flowing to secondary(current primary due to earlier failover).

So it required failing primary to be available to transfer connections to secondary(current primary). I don't think it should work like this.  Please let me know if there is any problem with connection string.

Regards,

Sid

Mirror DB Stuck in (Mirror, Disconnected / In Recovery) state After Breaking the Mirror

$
0
0

After a network outage and a lot of processing our mirroring fell behind for one of our DBs.  It started to catch up, then just stopped shipping logs and on the restoring side it was running very slow.  It was clear that the mirrors were corrupt and needed to be rebuilt.

As I have run into this problem before, I first tried to break the mirroring on the Mirror DB's SQL Server, by issuing the following commands with the following results (we are using TDE encryption, so the commands are wrapped in commands needed for encryption):

OPEN MASTER KEY DECRYPTION BY PASSWORD = '<MasterKeyPwd>'
    ALTER DATABASE <DbName> SET PARTNER OFF
CLOSE MASTER KEY

Msg 1404, Level 16, State 5, Line 2
The command failed because the database mirror is busy. Reissue the command later.

OPEN MASTER KEY DECRYPTION BY PASSWORD = '<MasterKeyPwd>'
    ALTER DATABASE <DbName> SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS
CLOSE MASTER KEY

Msg 1404, Level 16, State 5, Line 2
The command failed because the database mirror is busy. Reissue the command later.

OPEN MASTER KEY DECRYPTION BY PASSWORD = '<MasterKeyPwd>'
    RESTORE DATABASE <DbName> WITH RECOVERY
CLOSE MASTER KEY

Msg 3101, Level 16, State 1, Line 2
Exclusive access could not be obtained because the database is in use.
Msg 3013, Level 16, State 1, Line 2
RESTORE DATABASE is terminating abnormally.

I tried these 3 commands in various orders with no luck, I believe this was because the mirroring was behind.  So I had to kill the mirroring from the Principal DB's SQL Server, which worked.  But the mirror DB was still stuck in the (Mirror, Disconnected / In Recovery) state.  This means you can't restore over the DB to rebuild the mirror.  I tried the 3 commands above again in various orders with no luck.

The only way I have found is to stop the mirror SQL Server instance, delete all the DATA and LOG files for the DB, and start it back up.  Then you can restore backups off the principal SQL Server instance to start rebuilding your mirror.

This is a real pain, and we have other DBs mirrored between the same instances, so we are forcing all of those to re-sync.  It is also dangerous in case you delete the wrong DATA / LOG files, it will create even more work for you.

I should mention we only use 'High performance (asynchronous)' mode on all our mirrors, but I assume that is quite standard.  We are also using TDE Encryption, which is becoming quite standard.

User permissions on schema automatically changed hence principal database is not accessible?

$
0
0

Hi All,

We have SQL Server 2012 on which a database if configured for mirroring and working fine but all of a sudden application couldn't connect to the principal database with an error (password did not match that for the login provided)

When it is analysed permission on schema is altered to some other schema hence the issue is occurred and resolved when it is set back.

Without any manually intervention how could it change the schema to default .dbo

Please share your views on this. Thank You

Regards,

Kalyan


Grateful to your time and support. Regards, Shiva

Deadlock when updating different rows on a single table with one clustered index

$
0
0

Deadlock when updating different rows on a single table with one clustered index. Can anyone explain why?

<event name="xml_deadlock_report" package="sqlserver" timestamp="2014-07-30T06:12:17.839Z">
  <data name="xml_report">
    <value>
      <deadlock>
        <victim-list>
          <victimProcess id="process1209f498" />
        </victim-list>
        <process-list>
          <process id="process1209f498" taskpriority="0" logused="1260" waitresource="KEY: 8:72057654588604416 (8ceb12026762)" waittime="1396" ownerId="1145783115" transactionname="implicit_transaction" lasttranstarted="2014-07-30T02:12:16.430" XDES="0x3a2daa538" lockMode="X" schedulerid="46" kpid="7868" status="suspended" spid="262" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2014-07-30T02:12:16.440" lastbatchcompleted="2014-07-30T02:12:16.437" lastattention="1900-01-01T00:00:00.437" clientapp="Internet Information Services" hostname="CHTWEB-CH2-11P" hostpid="12776" loginname="chatuser" isolationlevel="read uncommitted (1)" xactid="1145783115" currentdb="8" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
           <inputbuf>
UPDATE analyst_monitor SET cam_status = N'4', cam_event_data = N'sales1', cam_event_time = current_timestamp , cam_modified_time = current_timestamp , cam_room = '' WHERE cam_analyst_name=N'ABCD' AND cam_window= 2   </inputbuf>
          </process>
          <process id="process9cba188" taskpriority="0" logused="2084" waitresource="KEY: 8:72057654588604416 (2280b457674a)" waittime="1397" ownerId="1145783104" transactionname="implicit_transaction" lasttranstarted="2014-07-30T02:12:16.427" XDES="0x909616d28" lockMode="X" schedulerid="23" kpid="8704" status="suspended" spid="155" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2014-07-30T02:12:16.440" lastbatchcompleted="2014-07-30T02:12:16.437" lastattention="1900-01-01T00:00:00.437" clientapp="Internet Information Services" hostname="CHTWEB-CH2-11P" hostpid="12776" loginname="chatuser" isolationlevel="read uncommitted (1)" xactid="1145783104" currentdb="8" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
            <inputbuf>
UPDATE analyst_monitor SET cam_status = N'4', cam_event_data = N'sales2', cam_event_time = current_timestamp , cam_modified_time = current_timestamp , cam_room = '' WHERE cam_analyst_name=N'12345' AND cam_window= 1   </inputbuf>
          </process>
        </process-list>
        <resource-list>
          <keylock hobtid="72057654588604416" dbid="8" objectname="CHAT.dbo.analyst_monitor" indexname="IX_Clust_scam_an_name_window" id="lock4befe1100" mode="X" associatedObjectId="72057654588604416">
            <owner-list>
              <owner id="process9cba188" mode="X" />
            </owner-list>
            <waiter-list>
              <waiter id="process1209f498" mode="X" requestType="wait" />
            </waiter-list>
          </keylock>
          <keylock hobtid="72057654588604416" dbid="8" objectname="CHAT.dbo.analyst_monitor" indexname="IX_Clust_scam_an_name_window" id="lock18ee1ab00" mode="X" associatedObjectId="72057654588604416">
            <owner-list>
              <owner id="process1209f498" mode="X" />
            </owner-list>
            <waiter-list>
              <waiter id="process9cba188" mode="X" requestType="wait" />
            </waiter-list>
          </keylock>
        </resource-list>
      </deadlock>
    </value>
  </data>
</event>


Database mirroring Enpoints Error

$
0
0

Hi,

I am getting below error while i configuring mirroring in my laptop (Local System).

Please help me.

SQL Server 2005 High availability

$
0
0

Hi

 

I would like to know, Is Logshipping is supported on SQL 2005 clustering?

 

Thanks in Advance

shan

Disabling and Re-enabling mirroring after shutdown

$
0
0

Hi all,

I have a customer who is planning on physically moving two servers to a new location. The two servers are running SQL Server 2008 with mirroring, so one is the principle and one is the mirror (High safety without automatic failover), there's no witness.Since they're physically moving them they will be powering down both servers during the move. When they power them back on the servers will be configured with new IP addresses, but otherwise shouldn't change.<o:p></o:p>

I'm looking for some best-practice guidance for doing this. Is it recommended to pause the mirroring, and then shut down the servers, or can we simply shut them down? Are there any problems I should expect when we boot them back up?<o:p></o:p>



Shaun

programming

$
0
0
How to  become a good programmer? plz Reply  refernce ebooks 

SQL SERVER 2012

$
0
0

SQl Server 2014 benefits and features


"Bypassing recovery for database 'XXXX' because it is marked as an inaccessible database mirroring database. A problem exists with the mirroring session.

$
0
0
SQL Server info SQL Server Std edition SP3 on both Principal and Mirror X64.  SQL Server Express edition Sp3 on witness x64 WOW.
OS Info Server 2003 X64 Std Edition SP2

Succesfully setup mirroring using certificates on database X.  Mirror monitor indicated asll communication green and in sync.  SQL Server X on Host X where database X was principal we restarted.  Database X failed over to SQL Server Y on Host Y.  All in sync and all communication green per Mirror Monitor.
Database X failed back to SQL Server X using Alter database 'X' set partner failover.  Database never comes out of recovery.
"Bypassing recovery for database 'X because it is marked as an inaccessible database mirroring database. A problem exists with the mirroring session. The session either lacks a quorum or the communications links are broken because of problems with links, endpoint configuration, or permissions (for the server account or security certificate). To gain access to the database, figure out what has changed in the session configuration and undo the change.
To my knowledge noithign was changed (of course). But I verified existence of logins and users, logins permissions on endpoints, endpoints existed and started.  Could ping between all hosts.    Ended up having to break the mirror from SQL Server Y.  Could not break mirror from SQL Server X.  Could not failback from SQL Server X or Y.  Ran DBCC checkdb and no errrors.  
Looking for any information on this error or any ideas of addtional troubleshooting that could be done. 
TIA,

SQL SERVER 2012 R

$
0
0
What is threading, Replication and Denormalization?

Log shipping - Deleting particular record on primary database doesn't reflect on secondary database

$
0
0

Hi, 

     I am new to log shipping, i successfully set up a log shipping. But when i tried to test, i deleted  the records on primary database but it doesn't reflect on the secondary database. When checking the history of the jobs it doesn't show me an error.

    What can i do to reflect on the secondary database? 

Thanks for your Help!

Logshipping: Skipping Log back up file since load delay period has not Expired

$
0
0

Skipping Log back up file since load delay period has not Expired

What does it mean?

Thanks.

License

$
0
0
In My WEB application all users are using same user id and password to log int to the DB data. So it's also need to BUY a cal's ?
Because my WEB application is host in IIS server. 

Data Redundency

$
0
0
TeamWorks Inc. is one of the leading corporate training companies in Asia. The company is
primarily involved in imparting corporate training to its offshore clients located in London, Australia,
and China. Today, under the chairmanship of Lewis Lee, the company has spread across the
world.
The company maintains the details of its employees and clients in the Employee and Client files,
respectively. In addition, the company maintains the details of various projects undertaken in the
Project file. The details stored in the Employee file consist of employee ID, employee name,
gender, phone number, department ID, department name, project ID, and project name. However,
the details stored in the Client file consist of client ID, client name, project ID, and project name. In
addition, the Project file consists of project ID, project name, employee ID, employee name,
department ID, department name, project start date, project end date, and project cost.
Due to the high quality of services it offers, the company has noticed a tremendous increase in the
number of its offshore projects. Consequently, it has become very difficult for the company to
manually maintain the details of various projects undertaken. Therefore, the company has decides
to use an automated project management system. For this, the company approaches SoftTech
Inc. to develop the automated project management system.
At SoftTech Inc., a team of developers have been assigned the task to create the required
application. Harry Butler, being the team leader, analyzes the application and identifies the various
components required to create the application. Being the database developer in the team, you
have been assigned the task to analyze the application and create the required database and
tables.
You need to analyze the various files in the given scenario and perform the following tasks:
1. Identify the various entities that may cause data redundancy. Justify your answer. [5 Marks]
2. Identify the various problems that may arise due to data redundancy. Justify your answer. [5
Marks]

Hw the transactions are transfered

$
0
0

Hi,

Can some one help me with the following in sql  mirroring?

As per

http://msdn.microsoft.com/en-IN/library/ms189852.aspx

Unlike replication, which works at the logical level, database mirroring works at the level of the physical log record.

How the transaction is actually moved to Mirror instance and commited at both Mirror and Pricipal Server(In High Safety Mode) . What is role of trasaction log file here? Is it read some where like log shipping.

Thanks

Aslam

Viewing all 1024 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>