使用 DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTTVE DATABASE NOFILENAMECHECK 命令创建物理备用数据库(Physical Standby Database) 时,主库数据量越大,创建所需要的时间越多,如果放前台运行该命令的话,容易中断,因此可以考虑将其放在后台
下面进行举例说明
1.创建hup.txt文件(或者hup.rcv文件,名字随便取)
run
{
allocate channel primy1 device type disk;
allocate channel primy2 device type disk ;
allocate channel primy3 device type disk ;
allocate channel primy4 device type disk ;
allocate auxiliary channel aux1 device type disk ;
allocate auxiliary channel aux2 device type disk ;
allocate auxiliary channel aux3 device type disk ;
allocate auxiliary channel aux4 device type disk ;
duplicate target database for standby from active database nofilenamecheck;
}
但是主备库是互相通信的,能够简易连接以及别名连接,查看网上思路: https://blog.csdn.net/tianlesoftware/article/details/9358807,说是没在脚本设置通道(修改通道数量)(原先脚本 dup.txt 是:"duplicate target database for standby from active database nofilenamecheck;",没有分配通道),但后续直接在主库运行,并修改成上述案例脚本后便可正常同步,因此尚未证明是否有效;同时作者给出了另外一个解决方法就是分别在两个节点创建另一个节点的口令文件,这两个方法都值得一试