一、故障说明
配置好OGG的抽取进程后,启动时报错(如下),根据下面红色报错信息得知不能打开redo log /u01/app/oracle/product/11.2.0/db/dbs/arch1_12_896804745.dbf文件,此时大家应该能反映出两种可能,要不文件不存在,要不文件存在却无法访问。通过查询,发现文件确定存在,应该是无法访问导致。此时可以确认是权限问题。让我们去处理问题吧。
错误日志:
2015-11-27 15:25:40 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (ogg): start eora.
2015-11-27 15:25:40 INFO OGG-00963 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host test2 (START EXTRACT EORA ).
2015-11-27 15:25:40 INFO OGG-00975 Oracle GoldenGate Manager for Oracle, mgr.prm: EXTRACT EORA starting.
2015-11-27 15:25:40 INFO OGG-00992 Oracle GoldenGate Capture for Oracle, eora.prm: EXTRACT EORA starting.
2015-11-27 15:25:40 INFO OGG-03035 Oracle GoldenGate Capture for Oracle, eora.prm: Operating system character set identified as UTF-8. Locale: en_US, LC_ALL:.
2015-11-27 15:25:40 INFO OGG-03500 Oracle GoldenGate Capture for Oracle, eora.prm: WARNING: NLS_LANG environment variable does not match database character set, or not set. Using database character set value of ZHS16GBK.
2015-11-27 15:25:40 INFO OGG-01635 Oracle GoldenGate Capture for Oracle, eora.prm: BOUNDED RECOVERY: reset to initial or altered checkpoint.
2015-11-27 15:25:40 INFO OGG-01815 Oracle GoldenGate Capture for Oracle, eora.prm: Virtual Memory Facilities for: BR
anon alloc: mmap(MAP_ANON) anon free: munmap
file alloc: mmap(MAP_SHARED) file free: munmap
target directories:
/home/ogg/BR/EORA.
2015-11-27 15:25:40 INFO OGG-01815 Oracle GoldenGate Capture for Oracle, eora.prm: Virtual Memory Facilities for: COM
anon alloc: mmap(MAP_ANON) anon free: munmap
file alloc: mmap(MAP_SHARED) file free: munmap
target directories:
/home/ogg/dirtmp.
2015-11-27 15:25:41 INFO OGG-01515 Oracle GoldenGate Capture for Oracle, eora.prm: Positioning to begin time Nov 27, 2015 3:07:04 PM.
2015-11-27 15:26:01 ERROR OGG-00446 Oracle GoldenGate Capture for Oracle, eora.prm: error 13 (Permission denied) opening redo log /u01/app/oracle/product/11.2.0/db/dbs/arch1_12_896804745.dbf for sequence 12Not able to establish initial position for begin time 2015-11-27 15:07:04.
2015-11-27 15:26:01 ERROR OGG-01668 Oracle GoldenGate Capture for Oracle, eora.prm: PROCESS ABENDING.
二、故障处理:
- 检查redo日志文件与archivelog文件权限,用户/属组 oracle/oinstall
[oracle@test2 TESTDB]$ ls -l redo*
-rw-r-----. 1 oracle oinstall 524288512 Nov 27 14:44 redo04.log
-rw-r-----. 1 oracle oinstall 524288512 Nov 27 15:39 redo05.log
-rw-r-----. 1 oracle oinstall 524288512 Nov 27 14:44 redo06.log
[oracle@test2 dbs]$ ls -l arch*
-rw-r-----. 1 oracle oinstall 44121600 Nov 27 15:05 arch1_11_896804745.dbf
-rw-r-----. 1 oracle oinstall 3210240 Nov 27 15:16 arch1_12_896804745.dbf
-rw-r-----. 1 oracle oinstall 1024 Nov 27 15:16 arch1_13_896804745.dbf
-rw-r-----. 1 oracle oinstall 7168 Nov 27 15:16 arch1_14_896804745.dbf
- 将ogg用户改变为oinstall组,使得可以读取redo日志文件与archivelog文件
[root@test2 ~]# usermod -g oinstall ogg
[root@test2 ~]# id ogg
uid=503(ogg) gid=501(oinstall) groups=501(oinstall),502(dba),601(ogg)
- 重启动ogg管理进程(这步是必须的,很多时间会忘记它)
GGSCI (test2) 5> stop mgr
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)? y
Sending STOP request to MANAGER ...
Request processed.
Manager stopped.
GGSCI (test2) 6> start mgr
Manager started.
GGSCI (test2) 7> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED EORA 00:00:00 00:25:22
EXTRACT STOPPED PORA 00:00:00 00:58:49
- 启动抽取进程并验证
GGSCI (test2) 8> start eora
Sending START request to MANAGER ...
EXTRACT EORA starting
GGSCI (test2) 9> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EORA 00:25:34 00:00:00
EXTRACT STOPPED PORA 00:00:00 00:59:01
GGSCI (test2) 10> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EORA 00:00:00 00:00:06
EXTRACT STOPPED PORA 00:00:00 01:07:21
[ogg@test2 dirdat]$ ls -l
total 4
-rw-rw-rw-. 1 ogg oinstall 1007 Nov 27 15:32 et000000
- 正常日志如下:
2015-11-27 15:32:37 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (ogg): start eora.
2015-11-27 15:32:37 INFO OGG-00963 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host test2 (START EXTRACT EORA ).
2015-11-27 15:32:37 INFO OGG-00975 Oracle GoldenGate Manager for Oracle, mgr.prm: EXTRACT EORA starting.
2015-11-27 15:32:38 INFO OGG-00992 Oracle GoldenGate Capture for Oracle, eora.prm: EXTRACT EORA starting.
2015-11-27 15:32:38 INFO OGG-03035 Oracle GoldenGate Capture for Oracle, eora.prm: Operating system character set identified as UTF-8. Locale: en_US, LC_ALL:.
2015-11-27 15:32:38 INFO OGG-03500 Oracle GoldenGate Capture for Oracle, eora.prm: WARNING: NLS_LANG environment variable does not match database character set, or not set. Using database character set value of ZHS16GBK.
2015-11-27 15:32:38 INFO OGG-01635 Oracle GoldenGate Capture for Oracle, eora.prm: BOUNDED RECOVERY: reset to initial or altered checkpoint.
2015-11-27 15:32:38 INFO OGG-01815 Oracle GoldenGate Capture for Oracle, eora.prm: Virtual Memory Facilities for: BR
anon alloc: mmap(MAP_ANON) anon free: munmap
file alloc: mmap(MAP_SHARED) file free: munmap
target directories:
/home/ogg/BR/EORA.
2015-11-27 15:32:38 INFO OGG-01815 Oracle GoldenGate Capture for Oracle, eora.prm: Virtual Memory Facilities for: COM
anon alloc: mmap(MAP_ANON) anon free: munmap
file alloc: mmap(MAP_SHARED) file free: munmap
target directories:
/home/ogg/dirtmp.
2015-11-27 15:32:38 INFO OGG-01515 Oracle GoldenGate Capture for Oracle, eora.prm: Positioning to begin time Nov 27, 2015 3:07:04 PM.
2015-11-27 15:32:38 INFO OGG-01516 Oracle GoldenGate Capture for Oracle, eora.prm: Positioned to Sequence 12, RBA 1453568, SCN 0.0, Nov 27, 2015 3:07:04 PM.
2015-11-27 15:32:38 INFO OGG-00993 Oracle GoldenGate Capture for Oracle, eora.prm: EXTRACT EORA started.
2015-11-27 15:32:38 INFO OGG-01052 Oracle GoldenGate Capture for Oracle, eora.prm: No recovery is required for target file ./dirdat/et000000, at RBA 0 (file not opened).
2015-11-27 15:32:38 INFO OGG-01478 Oracle GoldenGate Capture for Oracle, eora.prm: Output file ./dirdat/et is using format RELEASE 11.2.
2015-11-27 15:32:38 INFO OGG-01517 Oracle GoldenGate Capture for Oracle, eora.prm: Position of first record processed Sequence 12, RBA 1453584, SCN 0.1100123, Nov 27, 2015 3:07:06 PM.
三、总结
此次故障对于细心的朋友们是不会出现的,还是因为在建立ogg用户后没有即时分配对应权限导致。相信在这里摔过跟头的朋友们都会长个大经验。
Where there’s a will, there ’s a way.