oracle 11g 通过rlink重新编译二进制文件遇到的“agent nmhs”错误!
错误信息:
oracle relink 报错:
gcc -o /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmemso.so -Wl,--whole-archive -shared -L/home/oracle11gr3/oracle_11.2.0.3/lib/ -L/home/oracle11gr3/oracle_11.2.0.3/sysman/lib/ -L/home/oracle11gr3/oracle_11.2.0.3/lib/stubs/ -L/home/oracle11gr3/oracle_11.2.0.3/lib -L/home/oracle11gr3/oracle_11.2.0.3/sysman/lib/ -Wl,-rpath,/home/oracle11gr3/oracle_11.2.0.3/lib/:/home/oracle11gr3/oracle_11.2.0.3/sysman/lib/ /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmem.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmer.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmnl.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmnp.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmeu.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmeps.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmt.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnml.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmee.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmefmgr.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmevr.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmehu.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmehl.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmepm.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmecrmgr.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmedc.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmosudo.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmedt.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmedm.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmedr.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmeb.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmec.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmesched.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmectl.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmejc.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmej.a -L/opt/ora11/product/11.2/jdk/jre/lib/amd64/server -L/opt/ora11/product/11.2/jdk/jre/lib/amd64 -z lazyload -ljava -ljvm -lverify -z nolazyload -Wl,-rpath,/home/oracle11gr3/oracle_11.2.0.3/lib/:/home/oracle11gr3/oracle_11.2.0.3/sysman/lib/:/opt/ora11/product/11.2/jdk/jre/lib/amd64/server:/opt/ora11/product/11.2/jdk/jre/lib/amd64 /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmeclumgr.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmecluster.a /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmexml.a -Wl,--no-whole-archive -lclntsh -lxml11 -lcore11 -lnls11 -lunls11 -lnnz11 -lncrypt11 -ln11 -lpthread -lnsl -lm -ldl -Wl,-rpath,/home/oracle11gr3/oracle_11.2.0.3/lib `cat /home/oracle11gr3/oracle_11.2.0.3/lib/sysliblist` -ldl -lm
/usr/bin/ld: warning: -z lazyload ignored /usr/bin/ld: warning: -z nolazyload ignored /usr/bin/ld: cannot find -ljava /usr/bin/ld: cannot find -ljvm /usr/bin/ld: cannot find -lverify /usr/bin/ld: /home/oracle11gr3/oracle_11.2.0.3/lib//libnnz11.so: .dynsym local symbol at index 128 (>= sh_info of 15) /usr/bin/ld: /home/oracle11gr3/oracle_11.2.0.3/lib//libnnz11.so: .dynsym local symbol at index 846 (>= sh_info of 15) collect2: error: ld returned 1 exit status make[1]: *** [/home/oracle11gr3/oracle_11.2.0.3/sysman/lib/ins_emagent.mk:190: /home/oracle11gr3/oracle_11.2.0.3/sysman/lib/libnmemso.so] Error 1 make[1]: Leaving directory '/home/oracle11gr3/oracle_11.2.0.3/sysman/lib' make: *** [/home/oracle11gr3/oracle_11.2.0.3/sysman/lib/ins_emagent.mk:55: libnmemso] Error 2 Error in invoking target 'agent nmhs' of makefile '/home/oracle11gr3/oracle_11.2.0.3/sysman/lib/ins_emagent.mk'. See '/home/oracle11gr3/oracle_11.2.0.3/install/relinkActions2026-10-20_08-38-53-AM.log' for details.
几经折腾啊!
其实,关键信息就在报错上面的gcc输出记录中!!!
各位,仔细观察,发现各种库的路径是乱七八糟吧??!!
几经折腾后,你会发现gcc使用了系统中不存在的oracle安装路径!!!
而这,也不是gcc的问题,而是env_emagent.mk脚本的问题!
[oracle11gr3@kylinv10restore ~]$ find -name "*.mk" -exec grep -H ora11 {} \;
./oracle_11.2.0.3/sysman/lib/env_emagent.mk:JRE_LIB_DIR=/opt/ora11/product/11.2/jdk/jre/lib/amd64
Oracle 也是个草台班子!
浙公网安备 33010602011771号