Oracle problems with dbms_xmlgen package - oracle

I have a weird problem with dbms_xmlgen package in Oracle 10g.
Here's my situation:
Queries using this package usually work as expected, without issues.
I.E.:
SQL> select dbms_xmlgen.getXML('select 1 from dual') from dual;
DBMS_XMLGEN.GETXML('SELECT1FRO
--------------------------------------------------------------------------------
<?xml version="1.0"?>
<ROWSET>
<ROW>
<_x0031_>1</_x0031_>
</ROW>
</ROWSET>
However, yesterday afternoon, they (the queries using dbms_xmlgen package) stopped working at all with the following error:
ORA-06544: PL/SQL: internal error, arguments: [pef.c:pefpargs2()], [30], [], [], [], [], [], []
ORA-06553: PLS-801: internal error [pef.c:pefpargs2()]
ORA-06512: at "SYS.DBMS_XMLGEN", line 229
ORA-06512: at "SYS.DBMS_XMLGEN", line 175
Rebooting Oracle server fixed the issue.
The thing is, we are relying on this feature for a couple of integration features we are about to deploy, and I don't want to have unexpected problems when we're on production environment.
Any ideas/patches/experiences on the same issue?
Here's Oracle version we're using (select * from v$version):
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production

Have not found anything about that error. You can try to:
Ensure that server process have not been killed in the background by
checking alert_.log for more info on internal error, and in the trace files referenced there.
Less probable causes:
Check if you have special data like '<' or unicode chars that will be output.
Check your database and client character set.

Oracle "internal error" are internal errors..and as such can only be properly diagnosed by Oracle.
your best option is to contact Oracle support.

Related

How to call a procedure in Oracle from clojure

I want to be able to call a procedure in an Oracle database using Clojure.
I have a connection to an Oracle database and I can query the tables of the db using select queries with parameters.
E.g.: If I run "SELECT * FROM user_tables" I get the list of tables as the result. So the connection is working and I do have the correct credentials to make this connection.
I'm using the following dependencies:
[org.clojure/clojure "1.10.1"]
[org.clojure/java.jdbc "0.7.11"]
and as oracle driver I tried these
[oracle.jdbc/oracledriver "11.2.0.2"] (ojdbc6 driver I installed locally under this name)
[oracle.jdbc/ojdbc7 "12.1.0.2"]
[com.oracle/ojdbc8 "19.3.0.0"] or [oracle.jdbc/ojdbc8 "12.2.0.1"]
My java version is:
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)
Using the ojdbc6 driver results in:
Execution error (SQLException) at oracle.jdbc.driver.T4CTTIoer/processError (T4CTTIoer.java:440).
ORA-29481: Implicit results cannot be returned to client.
ORA-06512: at "SYS.DBMS_SQL", line 2785
ORA-06512: at "SYS.DBMS_SQL", line 2779
ORA-06512: at "<My procedure name>", line 157
ORA-06512: at line 1
Using the version 7 or 8 result in:
#:next.jdbc{:update-count -1}
Can anyone help me to solve this in such a way that I can see the same result set as in SQL-Developer?
Clojure code used to make the connection:
(defstate ^:dynamic *oracle*
"This variable has the database connection to the Oracle Database"
:start
(if-let [jdbc-url (:oracle (env :database-url))]
(conman/connect! {:jdbc-url jdbc-url})
(do
(log/warn "database connection URL was not found, please set :database-url for oracle in your config, e.g: dev-config.edn")
*oracle*))
:stop
(conman/disconnect! *oracle*))
(conman/bind-connection *oracle* "sql/queries-oracle.sql")
In resources/sql there is the file queries-oracle.sql which contains the procedure to be called. I tried several ways to call it:
EXEC schema_name.procedure_name :param1, :param2, :param3;
EXEC schema_name.procedure_name(:param1, :param2, :param3);
BEGIN EXEC schema_name.procedure_name :param1, :param2, :param3; END;
BEGIN schema_name.procedure_name :param1, :param2, :param3; END;
All these have a :name through which they are called. Which I'm now trying from a REPL.
The result of these tries is:
Invalid SQL-Statement
Invalid SQL-Statement
Encountered the symbol "schema_name" when expecting one of the follwing:...
#:next.jdbc{:update-count -1}

Datapump Import Fails With ORA-39006, ORA-39213: “Metadata processing is not available”

I am trying to import multiple dmp files using impdp command i got this error DataPump import (impdp) reports the errors:
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
ORA-39006: internal error
ORA-39213: Metadata processing is not available
Attempting to correct the error ORA-39213 via
dbms_metadata_util.load_stylesheets also reports errors similar to:
SQL> exec dbms_metadata_util.load_stylesheets;
BEGIN dbms_metadata_util.load_stylesheets; END;
* ERROR at line 1: ORA-22288: file or LOB operation FILEEXISTs failed
Permission denied
ORA-06512: at "SYS.DBMS_METADATA_UTIL", line 1807
ORA-06512: at line 1
login from sys and run below query worked for me oracle 11.2
exec dbms_metadata_util.load_stylesheets;

execute dbms_connection_pool.start_pool(); not able to execute

I am not able to execute this command, Even I am in system user. I tried with both that is in command prompt even in Oracle SQL developer tool.
When i am executing the below command in System user
execute dbms_connection_pool.start_pool();
I am getting error as
Error starting at line : 1 in command -
EXECUTE DBMS_CONNECTION_POOL.START_POOL()
Error report -
ORA-06550: line 1, column 7:
PLS-00201: identifier 'DBMS_CONNECTION_POOL.START_POOL' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
For your information I am user oracle express 12c
The database resident connection pool (DRCP) reduces the resource requirements of applications that currently don't support connection pooling, either because it is not supported by the application infrastructure, or it has not been implemented. DRCP is only supported for database connections using the OCI driver. The pool is managed using the dbms_connection_pool package. And the operation is started by start_pool procedure.
You can call this procedure in these two ways :
SQL> exec dbms_connection_pool.start_pool( pool_name => 'my_connection_pool');
or
SQL> exec dbms_connection_pool.start_pool;
but not like in the below way :
SQL> exec dbms_connection_pool.start_pool();
I had the same issue
conn / as sysdba
and
exec dbms_connection_pool.start_pool;
worked for me
and
SELECT connection_pool, maxsize
FROM dba_cpool_info;
to get the info about pool

JDBC and Oracle 11g connection reset on ubuntu

I am having this strange issue connection JDBC to Oracle 11g. It started happening suddenly this Monday without any settings changes that either me or the team were aware of. Reading in Stackoverflow and Oracle forums (see links at the bottom) I've learned that there has been an issue with the generation of random bytes on linux 64bit machines. It led my to try several things, which unfortunately didn't work. Here is a summary of all information I'm aware of.
The weird thing is that I can connect over the terminal using sqlplus, but not using JDBC.
Thank you for any ideas or help,
Amit
My Setup:
OS: Ubuntu 12.04
Java: Both 7 and 6_45 (Issue is the same)
JDBC: Downloaded from the Oracle official site (see further description down)
Connection behind a Cisco VPN
JDBC-MANIFESTS:
odbc7.jar:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 20.12-b01 (Sun Microsystems Inc.)
Implementation-Vendor: Oracle Corporation
Implementation-Title: JDBC
Implementation-Version: 12.1.0.1.0
Repository-Id: JAVAVM_12.1.0.1.0_LINUX.X64_130403
Specification-Vendor: Sun Microsystems Inc.
Specification-Title: JDBC
Specification-Version: 4.0
Main-Class: oracle.jdbc.OracleDriver
sealed: true
Name: oracle/sql/converter/
Sealed: false
Name: oracle/sql/
Sealed: false
Name: oracle/sql/converter_xcharset/
Sealed: false
odbc6.jar:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 20.12-b01 (Sun Microsystems Inc.)
Implementation-Vendor: Oracle Corporation
Implementation-Title: JDBC
Implementation-Version: 12.1.0.1.0
Repository-Id: JAVAVM_12.1.0.1.0_LINUX.X64_130403
Specification-Vendor: Sun Microsystems Inc.
Specification-Title: JDBC
Specification-Version: 4.0
Main-Class: oracle.jdbc.OracleDriver
sealed: true
Name: oracle/sql/converter/
Sealed: false
Name: oracle/sql/
Sealed: false
Name: oracle/sql/converter_xcharset/
Sealed: false
On Friday everything was still working:
I could start my application and have a Java connection to the Oracle DB.
Since Monday I'm having this issue
My old computer (Ubuntu 12.04) as well, I hadn't touched for almost a week started having this issue too, even though I left it in a working state.
Terminal connection using SQLPLUS is working:
amit#mymachine:/usr/lib/oracle$ sqlplus /#DB_HOST_IP:1521/DB_NAME
SQL*Plus: Release 12.1.0.1.0 Production on Tue Apr 22 11:35:58 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Release 11.2.0.3.0 - 64bit Production
SQL>
But connection with JDBC is failing:
DriverManager.getConnection(
"jdbc:oracle:thin:#//DB_HOST_IP:1521/DB_NAME", username,
password);
Hangs for about 20 seconds and throws:
ava.sql.SQLRecoverableException: IO Error: Connection reset
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:682)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:711)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:385)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:30)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:558)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at OracleJDBC.main(OracleJDBC.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at oracle.net.ns.Packet.receive(Packet.java:311)
at oracle.net.ns.DataPacket.receive(DataPacket.java:105)
at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:305)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:249)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:171)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:89)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:123)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:79)
at oracle.jdbc.driver.T4CMAREngineStream.unmarshalUB1(T4CMAREngineStream.java:426)
at oracle.jdbc.driver.T4C8TTIdty.receive(T4C8TTIdty.java:688)
at oracle.jdbc.driver.T4C8TTIdty.doRPC(T4C8TTIdty.java:595)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1439)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:486)
... 12 more
From the server's log:
Fatal NI connect error 12170.
VERSION INFORMATION:
TNS for Linux: Version 11.2.0.3.0 - Production
Oracle Bequeath NT Protocol Adapter for Linux: Version
11.2.0.3.0 - Production
TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production
Time: 22-APR-2014 09:57:45
Tracing not turned on.
Tns error struct:
ns main err code: 12535
TNS-12535: TNS:operation timed out
ns secondary err code: 12606
nt main err code: 0
nt secondary err code: 0
nt OS err code: 0
Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=<my.ip.address>)(PORT=42738))
From the Oracle documentation on both server errors:
ORA-12535: TNS:operation timed out
Cause: The requested operation could not be completed within the time out period.
Action: Look at the documentation on the secondary errors for possible remedy. See SQLNET.LOG to find secondary error if not provided explicitly. Turn on tracing to gather more information.
ORA-12606: TNS: Application timeout occurred
Cause: A network session did not reach an application-defined stage within the allowed time interval.
Action: This is an error which does not normally appear at the high level. The action to take is application specific, and is detailed in the higher level error description.
Solutions I've tried:
Adding the following system property -Djava.security.egd=file:///dev/urandom as suggested in the Stackoverflow discussion below.
Set up rng-tools to 'help' the entropy generator of the OS. (see links)
Following code runs without a problem producing random byte arrays (regardless of the parameter -Djava.security.egd:
int a = 10000;
while (a-- > 0){
byte[] array = new byte[2048];
new SecureRandom().nextBytes(array);
System.out.println(a);
}
None of the above seem to have changed the error (time-out).
EDIT: new attemps:
Running my application I could recognize the exact query that causes me the live problem. This is when reading a CLOG column of 1-2kb in size.
SQL> select secure_params from session_token where id=11065073; <- query is stuck.
Restart the client,
increasingly updating this field in this specific row I could still read the field if it was 429 charactes in size, but then when I've increased this to 587 chars it got stuck again.
SQL> select length( secure_params) from session_token where id=11065073;
LENGTH(SECURE_PARAMS)
---------------------
587
SQL> select secure_params from session_token where id=11065073; <- query again stuck.
Attemps number 4 brings me to the thought that there might be an additional issue here, since the application is able to create an initial connection and get some short data from the DB, but only then fails when the results-set gets a bit fat.
END OF EDIT
Links:
Stackoverflow: Oracle JDBC intermittent Connection Issue
Rng entropy generator: http://www.howtoforge.com/helping-the-random-number-generator-to-gain-enough-entropy-with-rng-tools-debian-lenny
ORA-12170 indicates that the TCP connection to the database listener failed.
If this is an error that happens all the time, then check firewalls and network ACLs. Possibly something intermediary has changed?
Alternatively, it could be some other artifact impacting TCP connectivity, such as a IP address clash. I've recently had this problem myself, and have blogged about it at http://distracted-it.blogspot.co.nz/2014/04/ora-12170-tnsconnect-timeout-resolved.html
Hope it helps.

Oracle DB Providers installation scripts errors

After installing Oracle XE DB and ODP.NET, i tried to run included scripts to establish tables for .NET providers. When i try to run for example InstallOracleMembership.sql, the operation fails with folowing errors:
IF ( ora_aspnet_TableExists('ORA_ASPNET_MEMBERSHIP') = 0) THEN
*
ERROR at line 2:
ORA-06550: line 2, column 11:
PLS-00201: identifier 'ORA_ASPNET_TABLEEXISTS' must be declared
ORA-06550: line 2, column 6:
PL/SQL: Statement ignored
Then comes some warnings -> Warning: Function created with compilation errors.
And the more errors:
GRANT SELECT ON ora_vw_aspnet_Applications TO ora_aspnet_Mem_ReportAccess
*
ERROR at line 1:
ORA-00942: table or view does not exist
.
.
.
GRANT ora_aspnet_Mem_BasicAccess TO ora_aspnet_Mem_FullAccess
*
ERROR at line 1:
ORA-01917: user or role 'ORA_ASPNET_MEM_FULLACCESS' does not exist
For this purpose i created user and added him privileges like create role, view, table according to this tutorial Oracle tutorial
I am using ODAC 11.2 Release 4 (11.2.0.3.0) 32bit, Oracle 11g R2 XE DB, Win7 Professional 64bit and VS2010.
Am i something missing? What i am doing wrong? Thanks for help.
The manual says you need to run $ORACLE_HOME\ASP.NET\sql\InstallOracleASPNETCommon.sql install script before any other install scripts.
http://docs.oracle.com/cd/E11882_01/appdev.112/e10767/installation.htm

Resources