问题描述
- goldengate配置目标库接收进程
- GGSCI (gc2) 8> DBLOGIN USERID ogg PASSWORD ogg在目标库操作这一步出错ERROR: Failed to open data source for user OGG.有哪些原因导致,权限有,监听也正
解决方案
可参考以下内容
[oracle@ora10gr2 11.1]$ sqlplus ""/as sysdba""
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jan 1 20:52:22 2013
Copyright (c) 1982 2005 Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning OLAP and Data Mining options
SQL> grant dba to ogg;
Grant succeeded.
SQL> conn ogg/ogg
Connected.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning OLAP and Data Mining options
[oracle@ora10gr2 11.1]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
Linux x86 32bit (optimized) Oracle 10g on Oct 4 2011 23:54:04
Copyright (C) 1995 2011 Oracle and/or its affiliates. All rights reserved.
GGSCI (ora10gr2) 1> dblogin userid oggpassword ogg;
ERROR: Failed to open data source for user OGG.
GGSCI (ora10gr2) 2> DBLOGIN USERID oggPASSWORD ogg;
ERROR: Failed to open data source for user OGG.
--解决方案
[oracle@ora10gr2 11.1]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
Linux x86 32bit (optimized) Oracle 10g on Oct 4 2011 23:54:04
Copyright (C) 1995 2011 Oracle and/or its affiliates. All rights reserved.
GGSCI (ora10gr2) 1> DBLOGIN USERID oggPASSWORD ogg;
ERROR: Failed to open data source for user OGG.
GGSCI (ora10gr2) 2> DBLOGIN USERID ogg
Password:
Successfully logged into database.
GGSCI (ora10gr2) 3>
其实,在密码后边不加分号 ‘;’ 就可以
解决方案二:
或者这个
今日做veridata软件的测试,需要先配置一个用goldengate同步数据的环境,在目标端配置goldengate的复制进程时,使用dblogin userid oggpassword ogg命令出现错误
ERROR: Failed to open data source for user OGG,纠结了一两天了,都不知道是什么问题,好在现如今终于得到解决。配置goldengate环境是win 2008操作系统,数据库为11g。
在目标端安装完goldengate启动了mgr进程,globals文件也配置好,执行如下命令报错:
GGSCI (WIN-RDG14W8R3AD) 1> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
GGSCI (WIN-RDG14W8R3AD) 2> dblogin userid oggpassword ogg
ERROR: Failed to open data source for user OGG.
GGSCI (WIN-RDG14W8R3AD) 3> dblogin userid oggpassword ogg
ERROR: Failed to open data source for user OGG.
GGSCI (WIN-RDG14W8R3AD) 4> dblogin userid ogg@localhost:1521/gcpassword ogg
ERROR: Failed to open data source for user OGG@LOCALHOST:1521/GC.
于是,开始排查对于权限,已给goldengate用户授予connectresoucedba角色,所以在权限上ogg用户是没有问题的;是不是监听的问题呢?
查看监听没问题,但是如果用sqlplus ogg/ogg@localhost:1521/gc 和 sqlplus ogg/ogg@127.0.0.1:1521/gc 都连接不进去,而使用sqlplus ogg/ogg@192.168.88.18:1521/gc
可以连接进去,监听文件内容如下:
sqlnet.ora内容:
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES EZCONNECT)
listener.ora内容:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.18)(PORT = 1521))
)
)
tnsnames.ora内容:
GC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.88.18)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = gc)
)
)
查看host文件内容:
127.0.0.1 localhost
::1 localhost
192.168.88.18 WIN-RDG14W8R3AD
准备重新配置监听,将listener.ora 和tnsnames.ora里面的host值 改成主机名,然后监听重启,接着用
sqlplus ogg/ogg@localhost:1521/gc 和 sqlplus ogg/ogg@127.0.0.1:1521/gc
sqlplus ogg/ogg@192.168.88.18:1521/gc和 sqlplus ogg/ogg@WIN-RDG14W8R3AD:1521/gc 四种方式都可以连接进去。
下面再次使用dblogin命令,
GGSCI (WIN-RDG14W8R3AD) 6> info all
Program Status Group Lag Time Since Chkpt
MANAGER STOPPED
GGSCI (WIN-RDG14W8R3AD) 7> dblogin userid oggpassword ogg
ERROR: Failed to open data source for user OGG.
GGSCI (WIN-RDG14W8R3AD) 8> dblogin userid ogg@gcpassword ogg
ERROR: Failed to open data source for user OGG@GC.
GGSCI (WIN-RDG14W8R3AD) 9> dblogin userid ogg@localhost:1521/gcpassword ogg
Successfully logged into database.
看到没,这次进去了。。。。。
------------------------------------------实验遇错排错记录。中间有重新建用户重配一样没解决问题。最后发现还是监听引起的问题。