89493

89493



Replication with Morę Columns on Master or Slave

You can replicate a table from the master to the slave such that the master and slave copies of the

table have differing numbers of columns, subject to the following conditions:

•    Columns common to both versions of the table must be defined in the same order on the master and

the slave.

(This is true even if both tables have the same number of columns.)

•    Columns common to both versions of the table must be defined before any additional columns.

This means that executing an ALTER TABLE statement on the slave where a new column is inserted

into the table within the rangę of columns common to both tables causes replication

to fail, as shown

in the following example:

Suppose that a table t, existing on the master and the slave, is defined by the following CREATE TABLE statement:

CREATE TABLE t (

Cl INT, c2 INT, c3 INT );

Suppose that the ALTER TABLE statement shown here is executed on the slave:

ALTER TABLE t ADD COLUMN cnewl INT AFTER c3;

The previous ALTER TABLE is permitted on the slave because the columns cl, c2, and c3 that are

common to both versions of table t remain grouped together in both versions of the table, before any columns that differ.

However, the following ALTER TABLE statement cannot be executed on the slave without causing replication to break:

ALTER TABLE t ADD COLUMN cnevr2 INT AFTER c2;

Replication fails after execution on the slave of the ALTER TABLE statement just shown, because

the new column cnew2 comes between columns common to both versions of t.

•    Each "extra” column in the version of the table having morę columns must have a default value.

A column's default value is determined by a number of factors, including its type, whether it is defined

with a DEFAULT option, whether it is declared as NULL, and the server SQL modę in effect at the

time of its creation; for morę information, see Section 11.5, “Data Type Default Values”).

In addition, when the slave's copy of the table has morę columns than the master’s copy, each column

common to the tables must use the same data type in both tables.



Wyszukiwarka

Podobne podstrony:
Computer or paper Your IELTS, your choice Whether you take IELTS on paper or Computer, you can be co
start. 6.    Configure the slave with the replication coordinates from the master. Th
Using Replication for Backups To use replication as a backup solution, replicate data from the maste
Zdj?cie0185 She saw a tabłe with three bowls on it She was very hungry so she tasied the p
One clap, two clap, three clap, forty? By clapping morę or less, you can signal to us which stories
* rr yiO How many" or "how mucn" can be expressed through the use of guantifiers WHAT
Effect Of Dividends On Stock Prices 13 5. Results And Discussions Table 5.1 shows the descriptive st
m75( §111 Turkish zardiyyat with piąte reinforcement, secured by brass hooks. This example dat es fr
qualitative information can be obtained from the mu-tual interaction of the strength and weakness fa
1349254044 sting 0 Sting -Englishman in New York I don t drink (1)_I take (2)_my dear I like my (3)_
project 2 Make notes about another environmental disaster. You can choose one from book, or another
Replication of Columns Having Different Data Types Corresponding columns on the master s and the sla
Replication with Differing Table Definitions on Master and Slave Source and target tables for replic
Replication and Master or Slave Shutdowns It is safe to shut down a master server and restart it lat
Using different storage engines on master and slave. It is possible to replicate transactional table
help 04 WpToFacobook Activa*> I Edit l Doleto Choose contonts to snów in one or morę tabs on a Fa
newfederalbudget New Federal Budget Place an Action token on any one Govemment group, or on two or m

więcej podobnych podstron