CentOS Linux release 7.4.1708 (Core) +oracle11.2.0.4+sde10.0
好久没搞了,提示报错:
SQL> select sde.ST_AsText(SDE.ST_Geometry('POINT (10 10)', 0)) from dual;
ERROR:
ORA-28595: Extproc agent : Invalid DLL Path
ORA-06512: at "SDE.ST_GEOMETRY_SHAPELIB_PKG", line 12
ORA-06512: at "SDE.ST_GEOMETRY", line 55
no rows selected
解决办法:
1.修改$ORACLE_HOME/hs/admin/extproc.ora添加ANY
2.确认ST_SHAPELIB 的文件/home/oracle/libst_shapelib.so存在有效
3.需要重启监听和数据库
4.再执行SQL确认即可。
SQL> !
[oracle@db ~]$ cd $ORACLE_HOME/hs/admin
[oracle@db admin]$ ls
extproc.ora initdg4odbc.ora listener.ora.sample tnsnames.ora.sample
[oracle@db admin]$ ll
total 16
-rw-r--r-- 1 oracle oracle 1109 Aug 24 2013 extproc.ora
-rw-r--r-- 1 oracle oracle 489 Aug 24 2013 initdg4odbc.ora
-rw-r--r-- 1 oracle oracle 407 Jul 9 20:22 listener.ora.sample
-rw-r--r-- 1 oracle oracle 244 Jul 9 20:22 tnsnames.ora.sample
[oracle@db admin]$ vi extproc.ora
#
# extproc.ora is used by extproc in the default Oracle configuration.
#
# This is a sample extproc init file that contains a name-value(s) pair which
# is same as the value of ENVS parameter in listener.ora file.
#
# Syntax: SET name=value (environment variable name and value)
#
# When specifying the EXTPROC_DLLS environment variable to restrict the DLLs
# that extproc is allowed to load, you may set EXTPROC_DLLS to one of the
# following values:
#
# * ONLY (maximum security)
#
# When EXTPROC_DLLS=ONLY:DLL[:DLL], only the specified DLL(s) can be loaded.
#
# Syntax: SET EXTPROC_DLLS=ONLY:DLL[:DLL]
#
# * NULL (the default value)
#
# When EXTPROC_DLLS=, only the DLL(s) in $ORACLE_HOME/bin and ORACLE_HOME/lib
# can be loaded.
#
# Syntax: SET EXTPROC_DLLS=
#
# * Colon-seperated list of the DLLs
#
# When EXTPROC_DLLS=DLL[:DLL], the specified DLL(s) and the DLLs in
# $ORACLE_HOME/bin and ORACLE_HOME/lib can be loaded.
#
# Syntax: SET EXTPROC_DLLS=DLL:DLL
#
# * ANY
# When EXTPROC_DLLS=ANY, DLL checking is disabled.
#
# Syntax: SET EXTPROC_DLLS=ANY
#
SET EXTPROC_DLLS=ANY
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"extproc.ora" 38L, 1112C written
[oracle@db admin]$ cat extproc.ora
#
# extproc.ora is used by extproc in the default Oracle configuration.
#
# This is a sample extproc init file that contains a name-value(s) pair which
# is same as the value of ENVS parameter in listener.ora file.
#
# Syntax: SET name=value (environment variable name and value)
#
# When specifying the EXTPROC_DLLS environment variable to restrict the DLLs
# that extproc is allowed to load, you may set EXTPROC_DLLS to one of the
# following values:
#
# * ONLY (maximum security)
#
# When EXTPROC_DLLS=ONLY:DLL[:DLL], only the specified DLL(s) can be loaded.
#
# Syntax: SET EXTPROC_DLLS=ONLY:DLL[:DLL]
#
# * NULL (the default value)
#
# When EXTPROC_DLLS=, only the DLL(s) in $ORACLE_HOME/bin and ORACLE_HOME/lib
# can be loaded.
#
# Syntax: SET EXTPROC_DLLS=
#
# * Colon-seperated list of the DLLs
#
# When EXTPROC_DLLS=DLL[:DLL], the specified DLL(s) and the DLLs in
# $ORACLE_HOME/bin and ORACLE_HOME/lib can be loaded.
#
# Syntax: SET EXTPROC_DLLS=DLL:DLL
#
# * ANY
# When EXTPROC_DLLS=ANY, DLL checking is disabled.
#
# Syntax: SET EXTPROC_DLLS=ANY
#
SET EXTPROC_DLLS=ANY
[oracle@db admin]$ pwd
/app/oracle/product/11.2.0/dbhome_1/hs/admin
[oracle@db admin]$ exit
exit
SQL> SELECT object_name FROM user_objects WHERE status = 'INVALID';
no rows selected
SQL> select sde.ST_AsText(SDE.ST_Geometry('POINT (10 10)', 0)) from dual;
ERROR:
ORA-28595: Extproc agent : Invalid DLL Path
ORA-06512: at "SDE.ST_GEOMETRY_SHAPELIB_PKG", line 12
ORA-06512: at "SDE.ST_GEOMETRY", line 55
no rows selected
SQL> !
[oracle@db ~]$ pwd
/home/oracle
[oracle@db ~]$ pwd
/home/oracle
[oracle@db ~]$ ll
total 5536
-rw-rw-r-- 1 oracle oracle 2886 Jan 2 2020 arcgis-2038.ecp
-rw-rw-r-- 1 oracle oracle 5652930 Oct 10 2018 libst_shapelib.so
-rw-r--r-- 1 oracle oracle 1108 Jul 9 20:32 tbs.sql
-rw-r--r-- 1 oracle oracle 494 Jul 10 09:27 t.txt
[oracle@db ~]$ ls -lt
total 5536
-rw-r--r-- 1 oracle oracle 494 Jul 10 09:27 t.txt
-rw-r--r-- 1 oracle oracle 1108 Jul 9 20:32 tbs.sql
-rw-rw-r-- 1 oracle oracle 2886 Jan 2 2020 arcgis-2038.ecp
-rw-rw-r-- 1 oracle oracle 5652930 Oct 10 2018 libst_shapelib.so
[oracle@db ~]$ exit
exit
SQL> !pwd
/home/oracle
SQL> create or replace library ST_SHAPELIB as '/home/oracle/libst_shapelib.so';
2 /
Library created.
SQL> select * from user_libraries;
rows will be truncated
rows will be truncated
LIBRARY_NAME FILE_SPEC
------------------------------ -----------------------------------------------------------------------------------------------------
ST_SHAPELIB /home/oracle/libst_shapelib.so
SQL> select sde.ST_AsText(SDE.ST_Geometry('POINT (10 10)', 0)) from dual;
ERROR:
ORA-04068: existing state of packages has been discarded
ORA-04061: existing state of package body "SDE.ST_GEOM_UTIL" has been invalidated
ORA-04065: not executed, altered or dropped package body "SDE.ST_GEOM_UTIL"
ORA-06508: PL/SQL: could not find program unit being called: "SDE.ST_GEOM_UTIL"
ORA-06512: at "SDE.ST_GEOMETRY", line 19
no rows selected
SQL> !
[oracle@db ~]$ lsnrctl stop
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 17-JUL-2020 15:37:16
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully
[oracle@db ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 17-JUL-2020 15:37:21
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Starting /app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /app/oracle/diag/tnslsnr/db/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 17-JUL-2020 15:37:21
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /app/oracle/diag/tnslsnr/db/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@db ~]$ exit
exit
SQL> alter system registry;
alter system registry
*
ERROR at line 1:
ORA-02065: illegal option for ALTER SYSTEM
SQL> alter system register;
System altered.
SQL> !lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 17-JUL-2020 15:37:46
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 17-JUL-2020 15:37:21
Uptime 0 days 0 hr. 0 min. 25 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /app/oracle/diag/tnslsnr/db/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db)(PORT=1521)))
Services Summary...
Service "ydgc" has 1 instance(s).
Instance "ydgc", status READY, has 1 handler(s) for this service...
Service "ydgcXDB" has 1 instance(s).
Instance "ydgc", status READY, has 1 handler(s) for this service...
The command completed successfully
SQL> select sde.ST_AsText(SDE.ST_Geometry('POINT (10 10)', 0)) from dual;
ERROR:
ORA-28595: Extproc agent : Invalid DLL Path
ORA-06512: at "SDE.ST_GEOMETRY_SHAPELIB_PKG", line 12
ORA-06512: at "SDE.ST_GEOMETRY", line 55
no rows selected
SQL> select sde.st_pointfromtext('point(490190.408397 323452.438997)', 5) from dual;
select sde.st_pointfromtext('point(490190.408397 323452.438997)', 5) from dual
*
ERROR at line 1:
ORA-20005: SRID 5 does not exist in ST_SPATIAL_REFERENCES table.
ORA-06512: at "SDE.ST_POINTFROMTEXT", line 35
SQL> select sde.st_pointfromtext('point(490190.408397 323452.438997)',1) from dual;
select sde.st_pointfromtext('point(490190.408397 323452.438997)',1) from dual
*
ERROR at line 1:
ORA-20005: SRID 1 does not exist in ST_SPATIAL_REFERENCES table.
ORA-06512: at "SDE.ST_POINTFROMTEXT", line 35
SQL> select sde.st_pointfromtext('point(490190.408397 323452.438997)',0) from dual;
select sde.st_pointfromtext('point(490190.408397 323452.438997)',0) from dual
*
ERROR at line 1:
ORA-28595: Extproc agent : Invalid DLL Path
ORA-06512: at "SDE.ST_GEOMETRY_SHAPELIB_PKG", line 12
ORA-06512: at "SDE.ST_POINTFROMTEXT", line 58
SQL> conn /as sysdba
Connected.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 2.1379E+10 bytes
Fixed Size 2262656 bytes
Variable Size 3422554496 bytes
Database Buffers 1.7918E+10 bytes
Redo Buffers 36073472 bytes
Database mounted.
Database opened.
SQL> select sde.st_pointfromtext('point(490190.408397 323452.438997)',0) from dual;
SDE.ST_POINTFROMTEXT('POINT(490190.408397323452.438997)',0)(ENTITY, NUMPTS, MINX, MINY, MAXX, MAXY, MINZ, MAXZ, MINM, MAXM, AREA, LE
------------------------------------------------------------------------------------------------------------------------------------
ST_POINTFROMTEXT(1, 1, 490190.408, 323452.439, 490190.408, 323452.439, NULL, NULL, NULL, NULL, 0, 0, 0, '100000000100000088C3AEB08F8
SQL>
SQL> select sde.ST_AsText(SDE.ST_Geometry('POINT (10 10)', 0)) from dual;
SDE.ST_ASTEXT(SDE.ST_GEOMETRY('POINT(1010)',0))
--------------------------------------------------------------------------------
POINT ( 10.00000000 10.00000000)