Delete Oracle Change Notifications - oracle

I'm trying to deregister change notifications in Oracle 12c by executing:
DBMS_CQ_NOTIFICATION.DEREGISTER(24906);
But this gives an error:
ORA-29970: Specified registration id does not exist
Although when I query the USER_CHANGE_NOTIFICATION_REGS view it does clearly state the correct regid.
Any one encountered this problem?

(Doc ID 971412.1)
How Can Database Change Notifications Not Created With PL/SQL Be Removed?
[ Last updated on JULY 05, 2017 ]
Applies to:
Oracle Database - Enterprise Edition - Version 10.2.0.1 to 11.2.0.2 [Release 10.2 to 11.2]
Oracle Data Provider for .NET - Version 10.2.0.1 to 11.2.0.1 [Release 10.2 to 11.2]
Information in this document applies to any platform.
Checked for relevance on 14th Dec 2016
Symptoms
You have an application that creates database change notifications via the OCI API or a higher level API that exposes this functionality such as ODP.Net. It does not create the notifications via PL/SQL, either through a stored procedure or PL/SQL block.
This application exits without cleaning up those notifications, typically via a fatal error as any controlled shutdown should remove any notifications. Or it may be that the application is still in development and the code to remove the notifications has a bug, or hasn't been added yet.
This leaves orphaned notifications in the database, which cannot be removed because they can only be removed within the same session in which they were created. Neither can they be removed with the PL/SQL function DBMS_CQ_NOTIFICATION.DEREGISTER(); this throws the error:
ORA-29970: Specified registration id does not exist.

Solution according to the MOS-Note:
Use patched Oracle version (bug fix included in 12.1 or later and the 11.2.0.4 Database and Client patchset)
enable following event to consume the fix: event "10865 trace name context forever, level 1".

Related

oracle 12c sqlplus login error subscriber

I am facing below error/warning when I login to oracle 12 using sqlplus client.
Details :
SQL*Plus: Release 12.1.0.2.0 Production on Fri Nov 8 05:38:11 2019
Copyright (c) 1982, 2014, Oracle. All rights reserved.
subscriber -1581956048 create failed: Last Successful login time: Fri
Nov 08 2019 05:36:31 -05:00
Connected to: Oracle Database 12c Enterprise Edition Release
12.1.0.2.0 - 64bit Production
Not sure what is subscriber -1581956048 create failed not getting much info on Google.
is anything need to worry about?
Regards
Laks
Issue caused by Fast Application Notification (FAN) for OCI client.
FAN uses Oracle Notification Services (ONS) to publish and subscribe
service for communicating information about all Fast Application Notification (FAN) events.
ONS uses port 6200 by default. If there is a firewall between the
client and the server and port 6200 port is closed then this behavior
is expected
You can use OCI to access Oracle TimesTen In-Memory Database and Oracle TimesTen Application-Tier Database Cache. OCI is an API that provides functions you can use to access the database and control SQL execution. OCI supports the data types, calling conventions, syntax, and semantics of the C and C++ programming languages.
TimesTen and TimesTen Cache support the Oracle Call Interface (OCI) for C or C++ programs.
Starting with Oracle Database Release 12c Release 1 (12.1), Oracle provides an oraaccess.xml file, a client-side configuration file. You can use the oraaccess.xml file to configure selected OCI parameters (some of which are accepted programatically in various OCI API calls), thereby allowing OCI behavior to be changed during deployment without modifying the source code that calls OCI.
Updates to the oraaccess.xml file will not affect already running clients. In order to pick up any updates to the oraaccess.xml file, already running clients need to be restarted.
The oraaccess.xml file is read from the directory specified by the TNS_ADMIN environment variable in regular and instant client installations.
This is the $ORACLE_HOME/network/admin directory on UNIX operating systems and the %ORACLE_HOME%\NETWORK\ADMIN directory on Microsoft Windows operating systems, if TNS_ADMIN is not set in regular client installations.
The oraaccess.xml file has a top-level node with the three elements. One of them is . the tag allows specifying default values for various OCI parameters. Some parameters can only be specified once and hence apply to all connections. These global parameters are described using by some tags. One of them is <events> tag.
Ref .
If you already have an oraaccess.xml file, then convert the part
<events>true</events> to <events>false</events>.
Otherwise create an oraaccess.xml file with the following information in the default_parameters section:
<?xml version="1.0" encoding="ASCII" ?>
<oraaccess xmlns="http://xmlns.oracle.com/oci/oraaccess"
xmlns:oci="http://xmlns.oracle.com/oci/oraaccess"
schemaLocation="http://xmlns.oracle.com/oci/oraaccess
http://xmlns.oracle.com/oci/oraaccess.xsd">
<default_parameters>
<events>false</events>
</default_parameters>
</oraaccess>
put this file under TNS_ADMIN directory, and then restart the SQL*Plus Client.

oracle 9i does not support aq subscribers?

I'm trying to make oracle aq queue subscriber (Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production). Script
DECLARE
subs sys.aq$_agent;
BEGIN
subs := sys.aq$_agent('Subscriber_1', NULL, NULL);
DBMS_AQADM.ADD_SUBSCRIBER(
queue_name => 'queue1',
subscriber => subs);
END;
works well, but than I'm trying to see subscribers for this queue (in SQL developer), I see message:
Not currently available for this DB Version.
And than I'm trying to delete this user, I have message than such user is not subscribed to the corresponding queue.
How can I check if my Oracle 9 supports aq subscribers or enable this support?
UPDATE:
All works fine, just this version of SQL Developer does not support this feature for Oracle 9
Why not look at the documentation?
The object aq$_agent exists in 9i as does the package dbms_aqadm. The first link in the latter leads to the Oracle9i Application Developer's Guide - Advanced Queuing.
This is not a typical Oracle error message (Googling it returns only this question). How are you trying to see subscribers for this queue? Are you querying the actual tables or using an inbuilt SQL Developer implementation?

Microsoft Enterprise Logging Block with Entity Framework asks for WriteLog procedure

I have a WCF service that uses Microsoft Enterprise Library Logging to log some messages to the Event Log. That works just fine.
The problem is that i want to log some messages to a table in an Oracle database. I am using the Entity Framework to communicate with that Oracle database.
The next step is a right click on the 'web.config' and choose the option 'Edit Enterprise Configuration'. I get the 'Enterprise Library Configuration' editor. In there i am trying to set the Logging Settings so that it also logs to the database, but when i add a database trace listener it´s asking me to fill in a procedure name. Do i have to add a procedure name to fill the table in Oracle? The msdn tells me to run the script that create an MSSQL database 'Logging' and some tables. But i don't have an MSSQL server, i have an Oracle server. And i don't want to use a seperate logging database, but save the logs to a single table.
Can anybody help me with this?
Kind regards
The Enterprise Library Database Trace Listener uses 2 stored procedures to write to the database: Add Category Procedure and Write To Log Procedure.
There is a SQL Server script to create the tables and stored procedures. This would have to be ported to Oracle.
Unfortunately, it looks like this does not work as easily as you would hope. See the blog post, Enterprise Library Logging to Oracle Database (this is based on EntLib 3, I believe) and the work item Cannot log to oracle Database using logging blocks for a description of some of the issues as well as some downloads to help.

TNS,can not handle the service name when two different version installed together

In our server,we publish a asp.net application,which use the oracle11g as the database.
We just set the connection string in the web.config,it works.
However someone install the oracle8 in the same server since they need them in other client application.
But after that,our web applcation can not work,we get the error:
ora-12154 TNS an not handle the service name
Then I found that the path environment has been changed. The "C:/app/oracle81/bin" is added at first. But even I change the "D:/app/oracle11g/bin" first,it does not work also.
Any idea to make the both work?
You might investigate what drivers are being used within .NET ... Microsoft's deprecated Oracle provider or Oracle's own provider or some kind of ODBC provider sitting on top of several kinds of possible drivers in a DSN. Each might be remedied in a different way.
But it sounds like the Oracle 8 installation has stolen priority over the Oracle 11 installation in some way that is not just the "PATH" environment variable. My guess would be the registry.
In ascending order of inconvenience and effectiveness you could try:
1) Run the Oracle 11 installer and see if it knows about the Oracle 8 home. (Unlikely if it's 8.0). Set it as default or top of the list; exit; then go back and set Oracle 11 as the default/top of the list.
2) Configure the TNS entries in your Oracle 8 home to connect to your Oracle 11 database. Live with the fact you're using a very out of date client.
3) Uninstall and reinstall Oracle 11 to get it to steal back the priority.
By default the .net framework uses the FIRST oracle directory it comes to the in the path statement. There have been some discussions on how to get around this - but your best bet is to run one client per machine.

Is there a way to troubleshoot change notifications in Oracle?

I'm trying to use oracle change notifications (API from Dbms_Change_Notification package) to update complex materialized views. I install change notification for my table with my PL/SQL callback and I can see in USER_CHANGE_NOTIFICATION_REGS view that my change notification is installed properly. On development oracle servers with low load change notifications are called as expected just after commit to observed table. But on real servers with high load it looks like change notifications are never called.
Is there any way to troubleshoot why change notifications are not called, when they are going to be called, what kind of error happens when they are called and so on?
P.S. I am using oracle Version 10.2.0.3.0
On your production system, have you set the JOB_QUEUE_PROCESSES initialization parameter? It must be set to a non-zero value.
Has the user registering the queries been granted the right privileges on the production database (CHANGE NOTIFICATION and execute on DBMS_CHANGE_NOTIFICATION)?

Resources