How To Do The Database Transcation Replica ?

Feb 5, 2008

Hi,

I am new to SQL server.

I have two databases lets call them A & B, they reside in two PCs, each pC has its own C/C++ program
working with A or B, Two PCs are linked by PPP (for example), but the link is not permonent available,
the link is only available at certain time period, for example, at midnight.and the link is only last
certain period, during this period, A & B will do the transcation replica( just heard about that!) to
make them identical, A=B.

Now are my questions.

(1) Can database use dial up modem itself ? For PC program it is not the problem, but I am not sure whether
MS SQL server database can be configured to do such job automatically ?

(2) Can database have awareness of whether the link is available or not ? For example A is dialing modem, and
B realize that there is a incoming call.

(3) Once link is established, how two databases start to do the transcation replica ? Does SQL server has such ability to do this automatically ?

(4) Can database notice PC program that changes has occured ? so PC program can process it, see display new data.

Thanks

nick

View 1 Replies


ADVERTISEMENT

SQL 2012 :: Backup On Primary Replica In Case Of Secondary Replica Is Down

Jun 9, 2014

I have 2 SQL Server replicas configured on SQL Server 2012 AlwaysOn. e.g. SQL1 & SQL2.

I have configured backup job on both SQL Server with the following statement. and the job occurs every 10 minutes.

•declare @DBNAME sysname,@sqlstr varchar(500)
set @DBNAME = 'dba'
IF (sys.fn_hadr_backup_is_preferred_replica(@DBNAME)=0)
BEGIN
--Select 'This is not the preferred replica, exiting with success';

[Code] ...

I turned off SQL2 for Windows maintenance. So there is only SQL1 is online. Afterwards. I checked the backup folder and didn't see any new backup files was created after SQL2 was offline. I rerun the job. It still doesn't backup database on the Primary Replica. Then I searched on SQL Server Book online. It says

Prefer Secondary

Specifies that backups should occur on a secondary replica except when the primary replica is the only replica online. In that case, the backup should occur on the primary replica. This is the default option.

According to what it says, it should backup on the Primary Replica.

View 2 Replies View Related

SQL 2012 :: Existing Replica MDF File Size Increased In Size Than New Replica Install

Apr 14, 2015

Here are my scenarios:

We have an application with replicated environment setup on sql server 2012 . Users will have a replica on their machines and they will replicate to the master database. It has 3 subscriptions subscribed to the publications on the master db.

1) We set up a replica(which uses sql server 2012) on a machine with no sql server on it. After the initial synchronization(used replmerge tool) the mdf file has grown to 33gigs and ldf has grown to 41 gigs. I went to sql server management studion . Right click and checked the properties of the local database. over all size is around 84 gb with little empty free space available.

2) We set up a replica(which uses sql server 2012) on a machine with sql server 2008 on it. After the initial synchronization(used replmerge tool) the mdf file has grown to 49 gigs and ldf has grown to 41 gigs. I went to sql server management studio , Right click and checked the properties of the local database. over all size is around 90 gb with 16 gb free space available.

3) We set up a replica(which uses sql server 2012) on a machine with sql server 2012 on it. We have dropped the local database and recreated the local db and did the initial synchronization using replmerge tool. The mdf file has grown to 49 gigs and ldf has grown to 41 gigs. I went to sql server management studio , Right click and checked the properties of the local database. over all size is around 90 gb with 16 gb free space available.

Why it is allocating the space differently? This is effecting our initial replica set up times.

View 0 Replies View Related

Creating A Replica Of A SQL Database.

Jan 18, 2008

Hi i want to create a test environment for a system, therefore i need an exact replica of the database that is currently standing, how can i go about doing this, i am using SQL enterprise manager 2000, thank you.

View 2 Replies View Related

Can I Have Exec(...) Statements Within A Transcation ?

Sep 17, 2004

Is the following T-SQL correct, in which I am trying to make sure that th effect of 3 stored procedures gets reversed in case of an error ? I know if in place of stored procedures I had action queries like 'ActionQry1', 'ActionQry2' and 'ActionQry3' then the transaction logic would work. But will it work even if exec(....) statements are there in the transaction ? Each stored procedure is made up of an action query.

begin tran
exec("storeprocedure1('2')")
if @@error=0
begin
exec("storeprocedure2")
if @@error=0
begin
exec("storeprocedure3(122)")
if @error=0
commit tran
else
rollback tran
end
else
rollback tran
end
else
rollback tran

View 1 Replies View Related

SQL Server Admin 2014 :: AlwaysOn Replica Database For Reporting

Feb 1, 2015

We have a 2 node clustered instance(SQL 2014) with 26 databases and we would like to enable alwayson for one of the databases for reporting (only one secondary and do not need high availability setup). I'm thinking if the reporting application/queries can explicitly connect to the secondary database(Instance namedatabase name) without using a listener and setup the secondary in asynchronous commit mode. Read about the REDO thread blocking due to reporting workload. How does this affect if I implement the secondary in this way.

View 3 Replies View Related

Inser A Table From A View In A Transcation

Nov 30, 2005

Hello, everyone:

I have to post this problem again because I didn't get the correct way.

I have SQL Server 2000 on client (Windows XP) and server (Windows 2003). DTC is running on both side. There is a transcation like,

BEGIN TRAN
INSERT MyTable SELECT * FROM MyView
COMMIT

MyView get data by:

SELECT * FROM OPENDATASOURCE ('SQLOLEDB', 'Data Source=PROD;UserID=DBDev;Password=WORLDWID').PRODD ata.dbo.CService

PROD is the production server.

When I run this query, there is the error message,

Server: Msg 8501, Level 16, State 1, Line 2
MSDTC on server 'PROD' is unavailable.
Server: Msg 7391, Level 16, State 1, Line 2
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.
OLE DB error trace [OLE/DB Provider 'SQLOLEDB' ITransactionJoin::JoinTransaction returned 0x8004d01c].

Any idea is appreciated.

Thanks

ZYT

View 2 Replies View Related

Visibility Into Active Transcation Using LINQ To SQL And SQL Server Compact 3.5

Jan 6, 2008



I am talking to SQL Server CE through LINQ to SQL in Visual Studio 2008. I have a table that uses location information as the primary key. The state associated with the location may change so sometimes I add new records and sometimes I update existing records. Before adding records to the table I verify that no existing record exists with the same primary key.

When I query against SQL Server Compact 3.5, I don't pick up records in the active transaction. I thought that the previous version of SQL Server CE did pick up records in the active transaction.

View 3 Replies View Related

SQL Server Admin 2014 :: How To Exit From Initializing / Recovery Pending Database In Secondary Replica

Sep 12, 2015

We have 2 switch between primary and secondary this morning.

after that one database in secondary went to "initializing / recovery pending".

How can i exit from this situation ?

View 3 Replies View Related

Need Emergency Help For Replica

May 9, 2006

Dear All,

We have a big concern in our Database system. We have 2000 transactions daily in our database. We need to replicate some how the database for our fail over setup. I tried transactional replication at midnight but our all systems locked and we had a lot of complaints from the customers and It was taking a lot of time to snapshot part and I had to abort it because of these reasons.
I need an advice how I can create a replication or is there any other way to replicate or is there any way to do this process without bothering the system? Please give me some advice and help..

View 1 Replies View Related

SQL 2012 :: Secondary Replica In AG

May 27, 2015

in my secondary server the database which is in restoring state , when i checked in always on dash board "This secondary database is not joined to the availability group" ,

View 3 Replies View Related

How Many Databases Can Add In AlwaysOn Replica

May 14, 2015

is there any limition in AlwayOn to add database in secondary replica?

View 2 Replies View Related

Recovery :: Replica Server Not Available

Aug 11, 2015

I'm new to Sql Server and want to install SQL server alwayson clustering on my test environment. I followed the steps by this site: [URL] ....

On each node I can connect to SQL Server but why my 2nd node is not available so that I can add it as my 2ndary Replica?

According to this site, till "Always-On Availability Group Configuration" everything was successful.

View 6 Replies View Related

Recreate Index On Replica

Jan 30, 2006

I have a slow query. It is indexed and I was wondering if there were any issues with using 'dbcc dbreindex' on each of the 12 replicas, to maybe make it run more efficiently? And is this something I could/should do nightly?

View 1 Replies View Related

SQL 2012 :: Permissions For Read Only Replica?

Jul 2, 2014

I have an availability group with read only replicas, readable secondary set to yes and allow all incoming connections. I have also configured the read only routing (at least I'm pretty sure this is correct).

If I login to SSMS with a user in the sysadmin role I can view the objects in the read only replica database. If I login with a user in the public role I'm unable to get past the obvious error:

"The database databaseA is not accessbile. (ObjectExplorer)"

I've also tried adding the "ApplicationIntent=ReadOnly" option.

View 4 Replies View Related

Query Replica Directly Via SSMS?

Apr 3, 2015

I know it is possible to use the secondary replica to pull data (application intent) etc..

But is there some way to query the replica directly via SSMS?

View 2 Replies View Related

SSIS CDC Components On Asynchronous Secondary Replica

Jan 15, 2015

MSDN states the following on: Readable Secondary Replicas (AlwaysOn Availability Groups) for SQL Server 2014:

Limitations and Restrictions:

Change tracking and change data capture are not supported on secondary databases that belong to a readable secondary replica:

Change tracking is explicitly disabled on secondary databases.
Change data capture can be enabled on a secondary database, but this is not supported.

This confuses me: You can not track the changes. However you can enable CDC?

The scenario I am trying to achieve is to use SSIS CDC components on an asynchronous secondary replica. Is this possible? If not what would be other viable approaches?

View 0 Replies View Related

SQL 2012 :: Dump Every 1 Minute In Secondary Replica?

Jun 9, 2015

SQL is generating dump every 1 min with error

EXCEPTION_ACCESS_VIOLATION reading address 0000000000000020 at

Server is running SP2 CU2.

View 1 Replies View Related

SQL 2012 :: Setup Replica For Databases For Reporting?

Jun 17, 2015

I would like to setup replica for one of the databases for reporting. The current environment is a 2 node cluster(active/passive). I would like to add a 3rd node that can server as a secondary replica. The secondary replica will be on asynchronous commit mode.

The database that needs to have alwayson setup has column level encryption enabled.

* Do I need to backup and restore the service master key on secondary server in order to have the column level encryption to work on secondary server?

* What would be preferred Quorum settings?

* What is the setting for 'readable secondary' for primary and replica db?

* What should be the setting for 'Connections in Primary Role' for primary and replica db?

* We are trying to setup without a Listner. Do I need to setup AG Listner? Can the application exclusively use the [secondary instance name].[replica DB name] without a listner?

View 2 Replies View Related

Replication :: Remove Secondary Available Replica From 2012?

Oct 14, 2015

Environment:-

Windows 2012 R2,
SQL 2012 (Primary Replica)
SQL 2012 (Seondary Replica)
SQL 2012 (Secondary Replica over WAN site)

There are database replicating on three SQL servers. WAN line is having performance issue because of limited bandwidth I have to remove SQL secondary replica over WAN site temporarily and add it again later when the WAN line is upgraded with between bandwidth What is the best practice to remove secondary replica and replicating database and add later from SQL management studio without interruptions on databases?

View 6 Replies View Related

Recovery :: Active Second Replica Shared DB Not Accessible

Apr 27, 2015

I have Active Active Cluster with 2 nodes , on the first node I can execute the queries, but when I trying to execute query or just open a DB to see the tables I getting error:"The Database XX is not accessible. (ObjectExplorer)".

View 5 Replies View Related

SQL 2012 :: AlwaysOn Secondary Replica - Resolving State

May 21, 2013

I have an AlwaysOn Availability group configured between 2 nodes (Synchronous)

Automatic failover was working fine until recently

I can failover between the nodes manually but automatic failover doesn't seem to be working. In my earlier test, I would shut down the SQL Service on the primary and within seconds, the secondary replica would take over. Recently I have performed the same test and the secondary replica enters the resolving state and the DB in unavailable.

I have tried everything here: [URL] ....

The only change I made was changing the availability mode from Synchronous to Asynchronous - Could that be the cause?

View 3 Replies View Related

SQL 2012 :: Clustering AlwaysOn - Primary And Secondary Replica

Apr 11, 2014

Looking for info on ole/requirement of primary and secondary replica under SQL Server 2012 AlwaysOn.

View 4 Replies View Related

SQL Server Admin 2014 :: Read Only On Secondary Replica

May 5, 2014

Assume if i have a connection(Application intent readonly) starts with reading, writing and again reading data for a report. how it will works in SQL 2014 Always availability on?

View 3 Replies View Related

SQL 2012 :: How To Change Backup Replica In AlwaysOn Cluster

May 6, 2014

How can we change the backup replica in Always on Cluster. I am not able to take backup because of this.

View 7 Replies View Related

SQL 2012 :: AlwaysOn Async Replica Back To Sync

Aug 19, 2014

After failing over to the DR replica. All databases are out of sync. DR replicas were setup as async the other 2 are set up as sync. Is this by design. No data has been updated to any of these as they are test dbs. So all dbs should be the same, no data loss.

View 0 Replies View Related

Application With AlwaysOn Read Only Replica In Synchronous Commit

Mar 8, 2015

I am trying to implement a read only replica to move much of the data read for an application to the secondary replica. Initially I had the the primary and secondary set to asynchronous commit. QA brought up an issue with creating entities from the application because after the creation of an entity the application turns around and repopulates the entire aggregate object. Well it seems that the application was reading the secondary replica before the data had been committed. Although I understand the issues that synchronous commits can cause, I went ahead and made the change as I expected it to fix the issue. After changing the primary replica to synchronous we still had the error, so I also changed the secondary although that makes no since, but the issue remains.

View 5 Replies View Related

SQL Server Admin 2014 :: Set Up AlwaysOn Replica For Reporting

Jun 17, 2015

I would like to setup replica for one of the databases for reporting. The current environment is a 2 node cluster(active/passive). I would like to add a 3rd node that can server as a secondary replica. The secondary replica will be on asynchronous commit mode.

The database that needs to have alwayson setup has column level encryption enabled.

Other Questions,

* Do I need to backup and restore the service master key on secondary server in order to have the column level encryption to work on secondary server?
* What would be preferred Quorum settings?
* What is the setting for 'readable secondary' for primary and replica db?
* What should be the setting for 'Connections in Primary Role' for primary and replica db?
* We are trying to setup without a Listner. Do I need to setup AG Listener? Can the application exclusively use the [secondary instance name].[replica DB name] without a listener?

View 4 Replies View Related

SQL Server Admin 2014 :: Cannot Failover AG To Secondary Replica

Aug 11, 2015

We are not able to failover the AG to secondary replica. The process gets timed out and AG goes to resolving mode. Had to reboot the box in order to switch the AG back to primary node. We even rebuilt the whole AG from scratch but the issue remains.

Failed to bring availability group 'xxxx' online. The operation timed out. Verify that the local Windows Server Failover Clustering (WSFC) node is online. Then verify that the availability group resource exists in the WSFC cluster. If the problem persists, you might need to drop the availability group and create it again. [SQLSTATE 42000] (Error 41131). The step failed.

Not much information is available in the logs.

Version : sql server 2014 sp1

View 6 Replies View Related

DB Engine :: Table Triggers On Read-only Secondary Replica?

Jun 30, 2015

I was hoping for some information regarding table triggers. We have databases that are part of an AlwaysOn availability group on SQL Server 2012. Some of the tables have table triggers defined. There are both types of triggers, INSTEAD OF and AFTER INSERT, etc.

From my understanding of how secondary read-only replicas work, I am assuming that these triggers have no impact at all when the database is a read-only secondary replica and they only fire when the database is the primary read-write database.

However, after doing a search on the internet, I have not been able to find a definitive source of information.

View 3 Replies View Related

Recovery :: Set Synchronization Time From Primary To Secondary Replica

Sep 28, 2015

As per our client requirement we want to set synchronization time from primary replica to secondary replica after 20 minutes. Is it possible in MSSQL AlwaysOn Availability Groups in SQL Server 2012?

View 6 Replies View Related

Recovery :: Which Replica Becomes Primary When Availability Group Fails Over

Jul 16, 2015

I have 3 synchronous AlwaysON replicas: A, B and C. A is primary, B and C are secondary and both are set to Automatic recovery. How can I understand, which of them (B or C) will become primary when A goes offline? Well, Actually my final DB system should support following configuration:

1) Normally - A is primary B and C are sync secondary.
2) if A fails, B automatically becomes primary, C remains Sync secondary.
3) if A goes online, it becomes primary again 
4) C becomes primary only after A and B fail (and there still should be cluster quorum!)

As I understood, first of all i should configure quorum the following way: A-0, B-1, C-1, folder-witness-1.

The problem, again, is: I cannot understand how to configure which replica becomes primary when AG fails over.

View 3 Replies View Related

Recovery :: Adding Second Replica To 2012 AG / Cannot Click Next Button

Oct 21, 2015

Trying to add a second replica to my SQL 2012 AG. for some reason i cant click the next button.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved