我目前正在尝试在主机(Win10x64)主机上的数据库AR421和客户机(Win7x86虚拟机)上的数据库STUD421之间的Oracle Database 11g中进行多主复制,但是我无法使它们进行通信。 / p>
我关闭了防火墙;我将虚拟机配置为使用来宾权限和2个网络适配器:1个NAT和另一个具有静态IP的仅限主机的主机(这样我就可以从主机ping到来宾,反之亦然);我从控制面板启动了所有与Oracle相关的服务,并将它们设置为自动。
在Oracle SQLDeveloper中,我为每个数据库创建了一个架构/用户,两个数据库都命名为ARip,并且都具有一个名为STUDENT的表,该表具有1个相同的行(内部没有数据)。
以下代码已用SQLPlus编写:
*主机和来宾:
CREATE USER REPMM IDENTIFIED BY REPMM DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
EXEC DBMS_REPCAT_ADMIN.GRANT_ADMIN_ANY_SCHEMA('REPMM');
EXEC DBMS_DEFER_SYS.REGISTER_PROPAGATOR('REPMM');
EXEC DBMS_REPCAT_ADMIN.REGISTER_USER_REPGROUP (USERNAME => 'REPMM', PRIVILEGE_TYPE => 'RECEIVER', LIST_OF_GNAMES => NULL);
*主机:
CREATE PUBLIC DATABASE LINK STUD421 USING 'STUD';
CONN REPMM/REPMM
CREATE DATABASE LINK STUD421 CONNECT TO REPMM IDENTIFIED BY REPMM USING 'STUD';
*客人:
CREATE PUBLIC DATABASE LINK AR421 USING 'AR';
CONN REPMM/REPMM
CREATE DATABASE LINK AR421 CONNECT TO REPMM IDENTIFIED BY REPMM USING 'AR';
*主机:
EXEC DBMS_REPCAT.CREATE_MASTER_REPGROUP('REPLICATION');
EXEC DBMS_REPCAT.CREATE_MASTER_REPOBJECT('ARip', 'STUDENT', 'TABLE', -
- GNAME=>'REPLICATION');
EXEC DBMS_REPCAT.ADD_MASTER_DATABASE (GNAME=> 'REPLICATION', MASTER=>'STUD421', USE_EXISTING_OBJECTS => TRUE,COPY_ROWS=> FALSE, PROPAGATION_MODE=> 'ASYNCHRONOUS');
在代码的最后一行,我遇到以下错误:
ERROR at line 1:
ORA-04052: error occurred when looking up remote object REPMM.SYS@STUD421
ORA-00604: error occurred at recursive SQL level 2
ORA-12154: TNS:could not resolve the connect identifier specified
ORA-06512: at "SYS.DBMS_REPCAT_UTL", line 4280
ORA-06512: at "SYS.DBMS_REPCAT_MAS", line 2158
ORA-06512: at "SYS.DBMS_REPCAT", line 146
ORA-06512: at line 1
连接标识符存在于名为tnsnames.ora的文件中。我的文件(在主机上)具有以下内容:
LISTENER_AR421 = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))
ORACLR_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522)) ) (CONNECT_DATA = (SID = CLRExtProc) (PRESENTATION = RO) ) )
AR421 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = AR421) ) )