TimesTen 数据库复制学习:9. 更改Active Standby Pair
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了TimesTen 数据库复制学习:9. 更改Active Standby Pair,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含5511字,纯文字阅读大概需要8分钟。
内容图文
![TimesTen 数据库复制学习:9. 更改Active Standby Pair](/upload/InfoBanner/zyjiaocheng/467/0ef018d4b6dd4b25a35d29513405fdd5.jpg)
先不复制一个表,后续又将其加入到复制计划中
cachedb2> drop table a2;
cachedb2> ALTER SESSION SET ddl_replication_action=‘exclude‘;
Session altered.
cachedb2> create table a2(a int not null);
cachedb1> select * from a2;
cachedb2> ALTER ACTIVE STANDBY PAIR INCLUDE TABLE a2;
8000: No primary or unique index on non-nullable column found for replicated table TTHR.A2
cachedb2> CREATE UNIQUE INDEX ixnewtab ON a2(a);
cachedb2> ALTER ACTIVE STANDBY PAIR INCLUDE TABLE a2;
下面例子说明了,如果一个表最初不在复制计划中,然后又加入复制计划,此表必须为空
cachedb2> ALTER SESSION SET ddl_replication_action=‘exclude‘;
Session altered.
cachedb2> create table a2(a int, primary key(a));
cachedb2> insert into a2 values(1);
cachedb2> insert into a2 values(2);
cachedb2> ALTER ACTIVE STANDBY PAIR INCLUDE TABLE a2;
17059: Replicated INCLUDE TABLE failed for (TTHR.A2) because the table is not empty
cachedb2> delete from a2;
cachedb2> ALTER ACTIVE STANDBY PAIR INCLUDE TABLE a2;
可以自动复制的对象
以下的对象在DDLReplicationLevel = 2或3时可以自动复制
* Create, alter, or drop a user with the CREATE USER, ALTER USER, or DROP USER statements.
* Grant or revoke privileges from a user with the GRANT or REVOKE statements.
* Alter a table to add or drop a column with the ALTER TABLE … ADD COLUMN or ALTER TABLE … DROP COLUMN statements. These are the only ALTER TABLE clauses that are replicated. However, when DDLReplicationLevel=2, you cannot alter a table to add a NOT NULL column to a table that is part of a replication scheme with the ALTER TABLE … ADD COLUMN NOT NULL DEFAULT statement. You can execute this statement if DDLReplicationLevel=3.
* Create or drop a table, including global temporary tables with the CREATE TABLE or DROP TABLE statements. The new table is also included in the active standby pair.
* Create or drop a synonym with the CREATE SYNONYM or DROP SYNONYM statements.
* Create or drop an index with the CREATE INDEX or DROP INDEX statements.
以下的对象仅在 DDLReplicationLevel = 3时可以自动复制
* 视图
* 序列(sequence)
* ttCacheUidPwdSet 操作
以上的复制操作均不需要停止复制代理。
对于物化视图的操作,更改autorefresh mode,PL/SQL都不会复制
如果需要创建PL/SQL函数,需要在所有的数据库中执行create语句并赋权
只有在空表创建的索引才会被复制,如果需要复制索引,可以将DDLReplicationLevel设为1,然后在所有数据库上手工建立
对于active standby pair的其它更改操作
以下的操作必须先停止复制代理:
* Include or exclude a cache group.
* Add or drop a subscriber.
* Change values in the STORE clause.
* Change network operations (ADD ROUTE or DROP ROUTE clause).
以上操作的过程如下:
1. 在active上停rep agent
2. 如果ASP包含缓存组,在active上停cache agent
3. 使用ALTER ACTIVE STANDBY PAIR修改复制schema
4. 在active上启动rep agent
5. 如果ASP包含缓存组,在active上启动cache agent
6. destroy所有的standby和subscriber
7. 使用ttRepAdmin 克隆standby
8. 启动standby上的rep agent
9. 等待standby的状态自动变为STANDBY(ttRepStateGet )
10. 如果ASP包含缓存组,在standby上启动cache agent
11. 通过standby克隆subsc
12. 启动subscriber上的复制代理
TimesTen 数据库复制学习:9. 更改Active Standby Pair
标签:
本文系统来源:http://blog.csdn.net/stevensxiao/article/details/51775055
内容总结
以上是互联网集市为您收集整理的TimesTen 数据库复制学习:9. 更改Active Standby Pair全部内容,希望文章能够帮你解决TimesTen 数据库复制学习:9. 更改Active Standby Pair所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。