Showing posts with label mirroring. Show all posts
Showing posts with label mirroring. Show all posts

Tuesday, February 21, 2012

Replication/mirroring on tables without a primary key

One of my clients is using an SQL Server 2000 database provided by a
third party. I attempted to setup transactional replication, but this
failed as a number of their tables do not have primary keys.
What they are really after is simply a mirrored database for reporting
purposes. So far, my position is that this cannot be done unless:-
(1) The vendor adds primary keys to the database
(2) The vendor upgrades to 2005 (and then I can use mirroring)
Notes:
A. I have discounted using snapshot replication due to the dynamic
nature of some of the tables that don't have a primary key
B. Although I can change the database schema myself to set the primary
keys, I do not want to do this as the vendor wont support the app, it
is risky and would involve a lot of work.
Are there any other solutions to this? eg third party products?
You could use log shipping in standby mode for this if you can control when
the reports are accessed. The main problem is that the restore of the logs
will drop all user connections, but in some cases this can be manageable.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Thanks Paul
I discounted log shipping as the interface is via the web and we
cant/dont want to drop user connections.
On Jan 24, 11:14 pm, "Paul Ibison" <Paul.Ibi...@.Pygmalion.Com> wrote:
> You could use log shipping in standby mode for this if you can control when
> the reports are accessed. The main problem is that the restore of the logs
> will drop all user connections, but in some cases this can be manageable.
> Cheers,
> Paul Ibison SQL Server MVP,www.replicationanswers.com.
|||In that case I'd upgrade to SQL Server 2005 and use mirroring/database
snapshots. Can't see another option as the requirements are incompatible
with current options
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||You mention manageable regarding the user connections, I see a couple
of options here:
(1) More frequent logs (eg 15 mins). This would minimise the risk of
getting disconnected as applying the transactions would be very quick
AND/OR (2) Build a level of fault tolerance into the s/w so that if
they get the message regarding disconnected because of the transaction
log being applied, the s/w retries.
Is this the sort of thing you were meaning?
On Jan 25, 5:22 pm, "Paul Ibison" <Paul.Ibi...@.Pygmalion.Com> wrote:
> In that case I'd upgrade to SQL Server 2005 and use mirroring/database
> snapshots. Can't see another option as the requirements are incompatible
> with current options
> Cheers,
> Paul Ibison SQL Server MVP,www.replicationanswers.com.
|||I was really thinking of latency. If you can allow say a day's latency, you
could ship the logs each evening during the out of hours time and this way
keep things going.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Thanks so much for your feedback Paul, I really appreciate it.
Unfortunately, the day's latency is unacceptable by the client. I did
try that initially but with no luck. They need data to be no more than
30mins late.
So given that log-shipping is the only possible alternative for SQL
Server 2000, I need to give the developers/query writers some guidance
on how they need to develop in this regime. So far, what I have been
thinking was:
(1) When developing SQL queries don't develop using the server that
uses log shipping as you will frequently lose your connection.
(2) In the application, do not keep keep connections open
unnecessarily. Open the connection,. perform the query and close the
connection as quick as possible. I am assuming 'pooled connections'
are still the best way to go.
(3) Try and build in fault tolerance into the application, ie if you
cannot open a connection, then retry within a set period. Also, if you
get an error when executing your query, close the connection (if you
can) and retry. Finally, if you cant close the connection, then just
ignore.
(4) Keep your queries short and snappy and avoid cursors.
Is there any white paper or guidance from Microsoft on this issue or
anyone with practical experience in running an app against a database
that uses 'log shipping'?
On Jan 25, 7:11 pm, "Paul Ibison" <Paul.Ibi...@.Pygmalion.Com> wrote:
> I was really thinking of latency. If you can allow say a day's latency, you
> could ship the logs each evening during the out of hours time and this way
> keep things going.
> Cheers,
> Paul Ibison SQL Server MVP,www.replicationanswers.com.
|||You could set the rowguid column that is used by replication as the
primary key - just don't make it clustered.
PromisedOyster wrote:
> One of my clients is using an SQL Server 2000 database provided by a
> third party. I attempted to setup transactional replication, but this
> failed as a number of their tables do not have primary keys.
> What they are really after is simply a mirrored database for reporting
> purposes. So far, my position is that this cannot be done unless:-
> (1) The vendor adds primary keys to the database
> (2) The vendor upgrades to 2005 (and then I can use mirroring)
> Notes:
> A. I have discounted using snapshot replication due to the dynamic
> nature of some of the tables that don't have a primary key
> B. Although I can change the database schema myself to set the primary
> keys, I do not want to do this as the vendor wont support the app, it
> is risky and would involve a lot of work.
> Are there any other solutions to this? eg third party products?
>
|||You could set the rowguid column that is used by replication as the
primary key - just don't make it clustered.
PromisedOyster wrote:
> One of my clients is using an SQL Server 2000 database provided by a
> third party. I attempted to setup transactional replication, but this
> failed as a number of their tables do not have primary keys.
> What they are really after is simply a mirrored database for reporting
> purposes. So far, my position is that this cannot be done unless:-
> (1) The vendor adds primary keys to the database
> (2) The vendor upgrades to 2005 (and then I can use mirroring)
> Notes:
> A. I have discounted using snapshot replication due to the dynamic
> nature of some of the tables that don't have a primary key
> B. Although I can change the database schema myself to set the primary
> keys, I do not want to do this as the vendor wont support the app, it
> is risky and would involve a lot of work.
> Are there any other solutions to this? eg third party products?
>
|||You could set the rowguid column that is used by replication as the
primary key - just don't make it clustered.
PromisedOyster wrote:
> One of my clients is using an SQL Server 2000 database provided by a
> third party. I attempted to setup transactional replication, but this
> failed as a number of their tables do not have primary keys.
> What they are really after is simply a mirrored database for reporting
> purposes. So far, my position is that this cannot be done unless:-
> (1) The vendor adds primary keys to the database
> (2) The vendor upgrades to 2005 (and then I can use mirroring)
> Notes:
> A. I have discounted using snapshot replication due to the dynamic
> nature of some of the tables that don't have a primary key
> B. Although I can change the database schema myself to set the primary
> keys, I do not want to do this as the vendor wont support the app, it
> is risky and would involve a lot of work.
> Are there any other solutions to this? eg third party products?
>

replication/database mirroring

After reading about it, i'm still confused. Is replication and database mirroring the same? they seem to accomplish the same thing.No they are not the same. They are different technologies to attain high availability. While in Replication, the subscriber is available for querying and for reporting purposes, the mirrored DB is inaccessible. You can however create a snapshot of the mirror and use the snapshot Db which is in read only mode. Check out BOL for more differences.|||Additionally some flavors of Tran replication and Merge replication allow writes at subscribers and conflict detection/resolution.

replication, mirroring and log ship

dear all,

I have a case.

I have 1 production server and wanto to add 1 more server.

my production server is using sql 2000 stnd edition.

I want to have an indentical database from my production server.

the problem is my second server is using sql 2005 stnd edition.

I have try to use replication but because the my production database didn't have relationship on the database so I can't use transaction replication, I can't use mirroring and log ship too because the sql use the different version.

any idea or suggestion will be great....

regards,

-dedys

Transactional replication should work fine as it supports replicating between servers within two versions of each other.

Regards,

Matt Hollingsworth

SQL Server High Availability

|||

The only thing that would prevent you from using transactional replication is if you have tables that do not have primary keys.

As far as log shipping goes. You can configure log shipping from SQL Server 2000 to SQL Server 2005, because 2000 backups can be restored to 2005. You can not configure it the other way around.

|||

dear sir,

I already try to configure log ship on my server.

my primary server is on sql2000 and the secondary server is on sql 2005.

I find that on sql 2000 can't see the sql 2005.

do you have documentation regarding this. a web link ?

thanks

-dedys

|||You can't connect to and manage a 2005 instance from within Enterprise Manager. You can go the other way. Log shipping is nothing more than configuring jobs to backup the tran log, copy it to the secondary, and restore it on a recurring basis. From within Management Studio on 2005, you can point and click through the GUI and setup log shipping from 2000 to 2005. You can also just create three jobs manually and accomplish the same thing. I'm not sure what documentation you are looking for. The 2005 Books Online have step-by-step procedures for setting up log shipping.|||

hi,

I have tries to set log shipping from 2000 to 2005 but it seem can't be done.

example : Server A is 2005 and B is 2000

I'm using management studio from A and register B. but when I right click on the database B, I can't find log shipping.

so I can't configure log shipping from 2000 to 2005.

if you know how to set it. could you share it with me.

I also try to do it manually like you said. using 3 simple step.

step 1 and 2 is done. I have difficulties with step 3. that is restoring the transaction log.

do you know how to restore transaction log more that 2 files at the same time or the name is keep on changing ?

please advice

-dedys

|||You can't restore more than 1 tran log simultaneously. Just like you can't restore more than one of any backup at the same time to the same database. You have to restore 1 log and then the next and then the next etc.|||

hi mr michael,

I have tries but I still got problem.

the step that did,

restore fullbackup to other server.

then restore the transaction log one by one and at the last transaction log with recovery option.

that's part is ok.

but when I want add more transaction log, there is an error that said :

Msg 3117, Level 16, State 4, Line 1

The log or differential backup cannot be restored because no files are ready to rollforward.

Msg 3013, Level 16, State 1, Line 1

RESTORE LOG is terminating abnormally.

please advice

|||You have to restore all transaction logs using the NORECOVERY option. As soon as you recover the database, you can no longer restore tran logs.

replication, mirroring and log ship

dear all,

I have a case.

I have 1 production server and wanto to add 1 more server.

my production server is using sql 2000 stnd edition.

I want to have an indentical database from my production server.

the problem is my second server is using sql 2005 stnd edition.

I have try to use replication but because the my production database didn't have relationship on the database so I can't use transaction replication, I can't use mirroring and log ship too because the sql use the different version.

any idea or suggestion will be great....

regards,

-dedys

Transactional replication should work fine as it supports replicating between servers within two versions of each other.

Regards,

Matt Hollingsworth

SQL Server High Availability

|||

The only thing that would prevent you from using transactional replication is if you have tables that do not have primary keys.

As far as log shipping goes. You can configure log shipping from SQL Server 2000 to SQL Server 2005, because 2000 backups can be restored to 2005. You can not configure it the other way around.

|||

dear sir,

I already try to configure log ship on my server.

my primary server is on sql2000 and the secondary server is on sql 2005.

I find that on sql 2000 can't see the sql 2005.

do you have documentation regarding this. a web link ?

thanks

-dedys

|||You can't connect to and manage a 2005 instance from within Enterprise Manager. You can go the other way. Log shipping is nothing more than configuring jobs to backup the tran log, copy it to the secondary, and restore it on a recurring basis. From within Management Studio on 2005, you can point and click through the GUI and setup log shipping from 2000 to 2005. You can also just create three jobs manually and accomplish the same thing. I'm not sure what documentation you are looking for. The 2005 Books Online have step-by-step procedures for setting up log shipping.|||

hi,

I have tries to set log shipping from 2000 to 2005 but it seem can't be done.

example : Server A is 2005 and B is 2000

I'm using management studio from A and register B. but when I right click on the database B, I can't find log shipping.

so I can't configure log shipping from 2000 to 2005.

if you know how to set it. could you share it with me.

I also try to do it manually like you said. using 3 simple step.

step 1 and 2 is done. I have difficulties with step 3. that is restoring the transaction log.

do you know how to restore transaction log more that 2 files at the same time or the name is keep on changing ?

please advice

-dedys

|||You can't restore more than 1 tran log simultaneously. Just like you can't restore more than one of any backup at the same time to the same database. You have to restore 1 log and then the next and then the next etc.|||

hi mr michael,

I have tries but I still got problem.

the step that did,

restore fullbackup to other server.

then restore the transaction log one by one and at the last transaction log with recovery option.

that's part is ok.

but when I want add more transaction log, there is an error that said :

Msg 3117, Level 16, State 4, Line 1

The log or differential backup cannot be restored because no files are ready to rollforward.

Msg 3013, Level 16, State 1, Line 1

RESTORE LOG is terminating abnormally.

please advice

|||You have to restore all transaction logs using the NORECOVERY option. As soon as you recover the database, you can no longer restore tran logs.

replication, mirroring and log ship

dear all,

I have a case.

I have 1 production server and wanto to add 1 more server.

my production server is using sql 2000 stnd edition.

I want to have an indentical database from my production server.

the problem is my second server is using sql 2005 stnd edition.

I have try to use replication but because the my production database didn't have relationship on the database so I can't use transaction replication, I can't use mirroring and log ship too because the sql use the different version.

any idea or suggestion will be great....

regards,

-dedys

Transactional replication should work fine as it supports replicating between servers within two versions of each other.

Regards,

Matt Hollingsworth

SQL Server High Availability

|||

The only thing that would prevent you from using transactional replication is if you have tables that do not have primary keys.

As far as log shipping goes. You can configure log shipping from SQL Server 2000 to SQL Server 2005, because 2000 backups can be restored to 2005. You can not configure it the other way around.

|||

dear sir,

I already try to configure log ship on my server.

my primary server is on sql2000 and the secondary server is on sql 2005.

I find that on sql 2000 can't see the sql 2005.

do you have documentation regarding this. a web link ?

thanks

-dedys

|||You can't connect to and manage a 2005 instance from within Enterprise Manager. You can go the other way. Log shipping is nothing more than configuring jobs to backup the tran log, copy it to the secondary, and restore it on a recurring basis. From within Management Studio on 2005, you can point and click through the GUI and setup log shipping from 2000 to 2005. You can also just create three jobs manually and accomplish the same thing. I'm not sure what documentation you are looking for. The 2005 Books Online have step-by-step procedures for setting up log shipping.|||

hi,

I have tries to set log shipping from 2000 to 2005 but it seem can't be done.

example : Server A is 2005 and B is 2000

I'm using management studio from A and register B. but when I right click on the database B, I can't find log shipping.

so I can't configure log shipping from 2000 to 2005.

if you know how to set it. could you share it with me.

I also try to do it manually like you said. using 3 simple step.

step 1 and 2 is done. I have difficulties with step 3. that is restoring the transaction log.

do you know how to restore transaction log more that 2 files at the same time or the name is keep on changing ?

please advice

-dedys

|||You can't restore more than 1 tran log simultaneously. Just like you can't restore more than one of any backup at the same time to the same database. You have to restore 1 log and then the next and then the next etc.|||

hi mr michael,

I have tries but I still got problem.

the step that did,

restore fullbackup to other server.

then restore the transaction log one by one and at the last transaction log with recovery option.

that's part is ok.

but when I want add more transaction log, there is an error that said :

Msg 3117, Level 16, State 4, Line 1

The log or differential backup cannot be restored because no files are ready to rollforward.

Msg 3013, Level 16, State 1, Line 1

RESTORE LOG is terminating abnormally.

please advice

|||You have to restore all transaction logs using the NORECOVERY option. As soon as you recover the database, you can no longer restore tran logs.