linux运行DBCA出错(未解决)

UnsatisfiedLinkError exception loading native library: njni10
Exception in thread "main" java.lang.UnsatisfiedLinkError: get
        at oracle.net.common.NetGetEnv.get(Native Method)
        at oracle.net.config.Config.getNetDir(Unknown Source)
        at oracle.net.config.Config.initConfig(Unknown Source)
        at oracle.net.config.Config.<init>(Unknown Source)
        at oracle.sysman.assistants.util.NetworkUtils.<init>(NetworkUtils.java:222)
        at oracle.sysman.assistants.util.step.StepContext.<init>(StepContext.java:255)
        at oracle.sysman.assistants.dbca.backend.Host.<init>(Host.java:682)
        at oracle.sysman.assistants.dbca.ui.UIHost.<init>(UIHost.java:205)
        at oracle.sysman.assistants.dbca.ui.InteractiveHost.<init>(InteractiveHost.java:54)
        at oracle.sysman.assistants.dbca.Dbca.getHost(Dbca.java:160)
        at oracle.sysman.assistants.dbca.Dbca.execute(Dbca.java:94)
        at oracle.sysman.assistants.dbca.Dbca.main(Dbca.java:180


metalink上两个相关的帖子,其中之一:


Subject:  DBCA, NETCA and DBUA Fail With Error: "UnsatisfiedLinkError exception loading native library ..."
  Doc ID:  395891.1 Type:  PROBLEM
  Modified Date :  20-AUG-2008 Status:  MODERATED

In this Document
  Symptoms
  Cause
  Solution

 

--------------------------------------------------------------------------------


This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process, and therefore has not been subject to an independent technical review.

 

Applies to:
Net Configuration Assistant - NetCA - Version: 9.2.0.1.0 to 10.2.0.2.0
Oracle Database Configuration Assistant - Version: 9.2.0.1 to 10.2.0.2
HP-UX PA-RISC (64-bit)
Found in 10.2.0.1, but the problem can affect other Oracle versions
Symptoms
The Database Configuration Assistant (DBCA) and Network Configuration Assistant (NETCA) can fail with the following errors:

UnsatisfiedLinkError exception loading native library: njni10
Exception in thread "main" java.lang.UnsatisfiedLinkError: get
at oracle.net.common.NetGetEnv.get(Native Method)
at oracle.net.config.Config.getNetDir(Unknown Source)
at oracle.net.config.Config.initConfig(Unknown Source)
at oracle.net.config.Config.<init>(Unknown Source)
at oracle.sysman.assistants.util.NetworkUtils.<init>(NetworkUtils.java:222)
at oracle.sysman.assistants.util.step.StepContext.<init>(StepContext.java:255)
at oracle.sysman.assistants.dbca.backend.Host.<init>(Host.java:682)
at oracle.sysman.assistants.dbca.ui.UIHost.<init>(UIHost.java:205)
at oracle.sysman.assistants.dbca.ui.InteractiveHost.<init>(InteractiveHost.java:54)
at oracle.sysman.assistants.dbca.Dbca.getHost(Dbca.java:160)
at oracle.sysman.assistants.dbca.Dbca.execute(Dbca.java:94)
at oracle.sysman.assistants.dbca.Dbca.main(Dbca.java:180)

In this case DBCA and NETCA failed to load library libnjni10.sl

The generic error is:

UnsatisfiedLinkError exception loading native library: <library name>
Exception in thread "main" java.lang.UnsatisfiedLinkError: get
at oracle.net.common.NetGetEnv.get(Native Method)
at oracle.net.config.Config.getNetDir(Unknown Source)
at oracle.net.config.Config.initConfig(Unknown Source)
at oracle.net.config.Config.<init>(Unknown Source)
at oracle.sysman.assistants.util.NetworkUtils.<init>(NetworkUtils.java:222)
:


Cause
If you use truss or tusc to trace the DBCA or NETCA tools, the output can contain errors which indicate that the tools fail due to a lack of resources.  In the following example, the tools fail due to a lack of virtual memory:

:
[19963] stat("/oracle/product/10.2.0/lib32/libnjni10.sl", 0x77ff4440) ......................................................... = 0
[19963] open("/oracle/product/10.2.0/lib32/libnjni10.sl", O_RDONLY, 040230) ............................... = 76
:
[19963] read(76, "80\0\0\v\0\0\004\0\0\0\0", 12) .................................................................................... = 12
[19963] mmap(NULL, 20135936, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 76, 3629056)
................................................. ERR#12 ENOMEM
[19963] close(76) ................................................................................................................................... = 0
[19963] write(1, "U n s a t i s f i e d L i n k E ".., 61) ............................................................................... = 61
:

The ENOMEM error indicates that the tool failing when is trying to mmap (allocate memory for) the libnjni10.sl library.

From the mmap line we see that DBCA/NETCA fails to allocate 20 megabytes of virtual memory when loading the libnjni10.sl library.


Solution
To implement the solution, please execute the following steps:


1. Check if all kernel parameters are set correctly and all OS packages and Patches are installed (see Note 169706.1)

2. Verify if the environment is set correctly:

    #echo $PATH

    #echo $ORACLE_HOME

    #echo $LD_LIBRARY_PATH

    #echo $SHLIB_PATH

if the above env variables do not point to the correct Oracle Home, please change them according:

    # export ORACLE_HOME=<path to your Oracle Home directory>

    #export PATH=$ORACLE_HOME/bin:$PATH

    #export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

    #export SHLIB_PATH=$ORACLE_HOME/lib32:$SHLIB_PATH

 

3. Check whether any errors occur during a 'relink all' (and resolve them)

4. Collect truss or tusc output by running the following command (or similar):

           truss -faeio /tmp/dbca_output.log $ORACLE_HOME/bin/dbca

5. Check the truss/tusc output and, for the library reported in the UnsatisfiedLinkError exception, identify a line like the following:

[19963] stat("/oracle/product/10.2.0/lib32/libnjni10.sl", 0x77ff4440)................................................................ = 0
[19963] open("/oracle/product/10.2.0/lib32/libnjni10.sl", O_RDONLY, 040230)............................................ = 76
:
[19963] read(76, "80\0\0\v\0\0\004\0\0\0\0", 12)..................................................................................... = 12
[19963] mmap(NULL, 20135936, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 76, 3629056)................................................. ERR#12 ENOMEM
[19963] close(76).................................................................................................................... = 0
[19963] write(1, "U n s a t i s f i e d L i n k E ".., 61)........................................................................... = 61
:

According to the mmap line, the mmap system call fails to allocate 20135936 bytes of shared memory.

6. If this happens, try running DBCA/NETCA in a separate memory window (specifying how much memory the window requires, in megabytes):

          setmemwindow -i 20 ./dbca

@ the above command is only for HP-UX PA-RISC OS.

Keywords
DBCA ; DBUA ; DATABASE~CONFIGURATION~ASSISTANT ; UNSATISFIEDLINKERROR ; JAVA.LANG.UNSATISFIEDLINKERROR ; NETCA ; 
--------------------------------------------------------------------------------

Help us improve our service. Please email us your comments for this document. .



metalink上第二篇相关文章


Subject:  Unsatisfiedlinkerror Exception Loading Native Library: Njni10
  Doc ID:  557264.1 Type:  PROBLEM
  Modified Date :  02-JUL-2009 Status:  PUBLISHED

In this Document
  Symptoms
  Changes
  Cause
  Solution
  References

 

--------------------------------------------------------------------------------

 

Applies to:
Oracle Application Server 10g Enterprise Edition - Version: 10.1.2.0.0 to 10.1.2.3.0
IBM AIX Based Systems (64-bit)
Checked for relevance on 2-July-2009
Symptoms
During the installation of patchset 10.1.2.2.0, the Oracle Internet Directory Patch Configuration
Assistant fails with the following error:
UnsatisfiedLinkError exception loading native library: njni10
Exception in thread "main" java.lang.UnsatisfiedLinkError: get
at oracle.net.config.Config.getNetDir(Unknown Source)
Changes
The libnjni10 file did exist as expected in $ORACLE_HOME/lib and lib32.


The following notes describing the same error were reviewed and determined to not solve the issue:
Note 395891.1 - DBCA, NETCA and DBUA Fail With Error: "UnsatisfiedLinkError exception loading native library ..."
Cause
AIX caches the shared libraries at the OS level and in this case, it cached libraries specific to the Oracle installation.

Solution
1. Link prerequisite libraries
> ln -s $ORACLE_HOME/lib32/libnjni10.dylib $ORACLE_HOME/lib32/libnjni10
> ln -s $ORACLE_HOME/lib32/libclntsh.dylib $ORACLE_HOME/lib32/libclntsh.dylib.10.1
2. Clear the shared library cache by running the following command as root
> /usr/bin/slibclean

Be careful to switch back to the oracle user before running anything else

3. Set the LIBPATH to $ORACLE_HOME/lib32

4. Re-run the installation (failed configuration assistants can be completed by doing the following)
> export LD_LIBRARY_PATH=$ORACLE_HOME/lib32
> $ORACLE_HOME/cfgtoollogs/configToolCommands
References
Note 395891.1 - DBCA, NETCA and DBUA Fail With Error: "UnsatisfiedLinkError exception loading native library ..."
SR 6126571.993

Keywords
INSTALLATION~FAILS ; AIX ; SHARED~LIBRARY ; LIB32 ; UNSATISFIEDLINKERROR ; DURING~INSTALLATION ; JAVA.LANG.UNSATISFIEDLINKERROR ; 
--------------------------------------------------------------------------------

Help us improve our service. Please email us your comments for this document
 

 

 

 

 

 

<< Back
by: fcruz.


Are you one of those that has been suffering from this error: UnsatisfiedLinkError exception loading native library: njni10 , while installing oracle 10G client or oracle server on macosx ? , well , you wont beleive how simple the solution is ...

The complete error while loading the ./netca after making the installation is the following:

UnsatisfiedLinkError exception loading native library: njni10
Exception in thread "main" java.lang.UnsatisfiedLinkError: jniGetOracleHome
at oracle.net.common.NetGetEnv.jniGetOracleHome(Native Method)
at oracle.net.common.NetGetEnv.getOracleHome(Unknown Source)
at oracle.net.common.NetProperties.(Unknown Source)
at oracle.net.common.NetProperties.getInstance(Unknown Source)
at oracle.net.ca.CmdlineArgs.(Unknown Source)
at oracle.net.ca.InitialSetup.(Unknown Source)
at oracle.net.ca.NetCA.main(Unknown Source)

Ok , just follow the simple two steps ,

cd into $ORACLE_HOME/bin

then type: ln -s $ORACLE_HOME/lib/libnjni10.dylib $ORACLE_HOME/lib/libnjni10 , then ENTER

then type: ln -s $ORACLE_HOME/lib/libclntsh.dylib $ORACLE_HOME/lib/libclntsh.dylib.10.1

After that go into $ORACLE_HOME/bin and start ./netca

Problem solved, this simple solution came to me literally after hours of dealing with the situacion and very little help from ORACLE documentation on the issue.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值