今日做veridata软件的测试,需要先配置一个用goldengate同步数据的环境,在目标端配置goldengate的复制进程时,使用dblogin userid ogg,password 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 ogg,password ogg
- ERROR: Failed to open data source for user OGG.
- GGSCI (WIN-RDG14W8R3AD) 3> dblogin userid ogg,password ogg
- ERROR: Failed to open data source for user OGG.
- GGSCI (WIN-RDG14W8R3AD) 4> dblogin userid ogg@localhost:1521/gc,password ogg
- ERROR: Failed to open data source for user OGG@LOCALHOST:1521/GC.
于是,开始排查对于权限,已给goldengate用户授予connect,resouce,dba角色,所以在权限上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 ogg,password ogg
- ERROR: Failed to open data source for user OGG.
- GGSCI (WIN-RDG14W8R3AD) 8> dblogin userid ogg@gc,password ogg
- ERROR: Failed to open data source for user OGG@GC.
- GGSCI (WIN-RDG14W8R3AD) 9> dblogin userid ogg@localhost:1521/gc,password ogg
- Successfully logged into database.
看到没,这次进去了。。。。。
------------------------------------------实验遇错排错记录。中间有重新建用户重配一样没解决问题。最后发现还是监听引起的问题。
转载于:https://blog.51cto.com/2874575/1139629