I have several store procedures, which analyze oracle logs using log miner. These procedures run on CDB user C##ADMIN which created for this manner.
Now I want to compare the logged values to the live values, so I need to be able to access each pdb from the CDB.
After several searches, I came across database link
which looks like a possible answer. but when I'm trying to create a database link it says ORA-02011: duplicate database link name
. and when I'm trying to drop it I'm getting ORA-65230: internal database link cannot be altered or dropped
.
I'm tried to run the following queries, but it failed: (even when connected as: / as sysdba
)
SELECT * FROM ALL_TABLES@testpdb;
ORA-12541: TNS:no listener
*Cause: The connection request could not be completed because the listener
is not running.
*Action: Ensure that the supplied destination address matches one of
the addresses used by the listener - compare the TNSNAMES.ORA entry with
the appropriate LISTENER.ORA file (or TNSNAV.ORA if the connection is to
go by way of an Interchange). Start the listener on the remote machine.
SELECT * FROM test.TABLE1@testpdb;
ORA-12541: TNS:no listener
*Cause: The connection request could not be completed because the listener
is not running.
*Action: Ensure that the supplied destination address matches one of
the addresses used by the listener - compare the TNSNAMES.ORA entry with
the appropriate LISTENER.ORA file (or TNSNAV.ORA if the connection is to
go by way of an Interchange). Start the listener on the remote machine.
So my questions are:
- Is using database links is it the correct way?
- If it is, how to configure it?
- How can I use it?
- Do I have any alternative to achieve my goal?
Best Answer
That error means your listener is not running. Start your listener.
This just works normally without doing anything:
An alternative is the CONTAINERS clause, but that has some serious limitations (queried object must exist in all containers).