OCI-21700: object does not exist or is marked for delete (a quick reminder)

While many reasons can cause the OCI-21700: object does not exist or is marked for delete message, many times the OCI-21700 is caused by difficulty to access resources that are checked only at runtime.

The most common reason for this error is granting execute privileges on a function without granting privileges on referenced object like types for example.

Giving the same grants to the referenced objects will solve the problem.

Update: it appears that this error message can be raised when using Weblogic Data Source to run a function as well.
Sometimes, mostly after a network failure/database restart/DB schema changes, the “OCI-21700: object does not exist or is marked for delete” will be raised. The weird thing is that the same function will fail when running it with Weblogic but it can run without a problem when you run it from the sql console using the same credentials.
It appears that some Data Base actions like importing or droping objects or even unexpected network failure can “corrupt the DataSource”. If this is the case, all you have to do to solve the problem is restarting the Data Source.

Update 2: Apparently, there is a bug in Oracle 10 that raises the OCI-21700 error regardless of providing the required permission. A unexplained workaround, if all else fails, is creating the function with the same name in the schema you are connected to and retry. Even weirder, if this solves the problem, it will still work even if you drop the newly created function. Sound like Oracle voodoo but hey, if it solve the problem …

3 thoughts on “OCI-21700: object does not exist or is marked for delete (a quick reminder)

  1. Eberhard Altenpohl

    Hello,

    thank you very much for the tipp having the OCI-21700 Error:

    “The most common reason for this error is granting execute privileges on a function without granting privileges on referenced object like types for example. ”

    Its the only site, I found the right solution.

    Eberhard

  2. Fahad Mahmood

    Hi,
    Thanks. Issue Resolved.
    “The most common reason for this error is granting execute privileges on a function without granting privileges on referenced object like types for example. ”

Leave a Reply

Your email address will not be published. Required fields are marked *