how to write oracle two instance information in single query? - oracle

i using oracle 10g database, i installed two instance in my machine(dev and dev10g), i using query "select instance_name,status from v$instance" this query return one instance information but i need two (dev and dev10g) instance information, how i write a query. it is possible without using dblink. pls help me.

No. Without a dblink, the two database instances do not communicate with each other. Also, not sure if you can dblink v$instance.
If you want to monitor several databases in one place, you will need to look at Oracle's management tools, I think. Or just query both databases separately.

You can see multiple instances if you use RAC but I don't think you are in this case. As mentioned above, each instance is separate - even with the same software. If you just want to know if the instance is alive, you can easily do this from the OS.
For example in linux:
ps -elf |grep pmon
This will check that the pmon process is running on the instance. If its not you're in trouble! The SID will be a part of the name - so if there are two instances running, you will see both.
In Windoz, you can check the services in a similar way.
Have you looked at Oracles Enterprice Manager Console?

Related

Identify oracle Container Databases (CDB) without connecting

We have a custom inventory system, for tracking all of our database, including Oracle v12 and v19 based databases. But as our DBA team has work with Container Databases (CDB), we need to identify, which one is a standalone or container, but we don't have any option to connection to the, due to our security policy.
Is there any way to Identify oracle Container Databases (CDB), without connecting to them?
As after reviewing Oracle official documentation: https://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN14174.
It seems that it's not possible, as the documented clearly mentioning, that first, it's necessary to connect to the database, and only then to run the following command: SELECT CDB FROM V$DATABASE;
And if the CDB column returns YES, the current database is a CDB. and NO, if the current database is a non-CDB.

Elixir/Phoenix - Connect to external database

I connected the main database in the dev.exs and it works fine. But in my project I plan to use several databases. I know that in the file dev.exs can connect multiple databases but this option doesn’t suit me. Databases connections will be stored in the main project database. I want to know: how can I connect to different databases using the elixir code without using a file dev.exs?
You can start multiple instances of your Repo with different connection options.
Then, use the Repo.put_dynamic_repo/1 function to tell the Repo which of the databases should be used for queries in the current process. (The documentation for this function also tells you how to start more of the same repo).
There's also a discussion document that goes more in-depth about this topic: https://hexdocs.pm/ecto/replicas-and-dynamic-repositories.html

Select listener when using DBCA on Oracle RAC

I have a 2 node oracle cluster (RAC). I created a listener and a database.
I want to create another listener and create a new database on the same cluster using the secondary listener for the new database.
In a single node mode where I define more than one listener on machine, when I use DBCA to create the database, a "Select Listener" page appears for me and I can choose the listener.
I created a new listener with the grid user for cluster-wide use, but when I use DBCA to create a database, the listener selection page does not appear.
Can any help me to choose secondary listener for new database?
Technically, it doesn't make sense to have two databases on the same set of RAC servers. Do not confuse between the terminolgy between database or database instances with logical schema(s). I have seen SQL Server developers confusing with schema and Oracle terminology of database.
Is it possible or not is a different scope altogether, but what you want to achieve is scalable and meaningful is my concern.
You could more explain about your requirement, what exactly makes you think to do so. I would be happy to guide you further. As of now, it doesn't make much sense.
update To Configure Multiple Listeners for Your Database Using DBCA, please read
http://docs.oracle.com/cd/E11882_01/install.112/e48195/undrstnd.htm#BEIDJJAG
You said, you have already created two listeners, but they were not listed in dbca. Please check the listener.ora if it has both the entries. If not, then create a new unique entry in listener.ora. Try again with dbca.

can't start oracle service in windows

I'm taking DB prog. class and we are required to use Oracle+ Oracle sql dev. I so far I got 3 DB in oracle each with a connection from Oracle sql dev.
In windows services I only have one service called OracleDBConsole"MY1stDB name" there's no similiar services for the other DBs I created.
When I try to start this service I receive error as the picture
I can connect through the connections in Oracle sql dev. to the other DB I created except the 1st one
Does anybody have an idea on this issue
As one of affected people, I finally found solution:
If this appears, run lsnrctl start as an administrator to start the listener.
Most probably your listener.ova and tnsnames.ova are improperly set.
OK you installed 3 instances on same machine. There are two possibilities.
They are all set up to use default ports so when one is started no other can start due to port conflict. In that case you need to reconfigure ports following documentation
Second possibility is you already have different ports for your instances. In that case please check your connection definitions if they use proper ports. First will probably need default 1521 but others needs other ports. You may try 1522 as when during instalation 1521 was used it could took next free. But generally you should go to NETWORK/ADMIN/listener.ora edit file and check what port is used. Then properly define connection in client tool.
But as said in comments. Installing 3 instances make no sense unless you're trying to do some study with DBlinks simulations.
Mentioned service relates to oracle enterprise manager service.you have this because it configured for your database. but to troubleshoot it please check its logs in %ORACLE_HOME%**HOSTNAME_DBNAME**\sysman\log*. check there logs and send to investigate.
regards,
Mohsen
There is insufficient detail about the error to know what the problem is, however my guess is that subsequent instances are attempting to use the same resource as the already started instance, most likely the port.
Nevertheless, your problem can be solved by not creating multiple instances of Oracle, but rather creating multiple databases in the one Oracle instance.
It is a virtual certainty that your teacher did not intend you to start multiple instances of Oracle.

How do I browse databases on an Oracle Server?

So I'm coming from a position as a SQL Server developer who has written a little bit of PL/SQL way back in the mists of time but effectively knows nothing.
I've got a laptop, it's running Oracle. There is a database on the laptop which I need to have a look at and neither I, nor anyone else I can speak to, knows what it's called.
I have a couple of logins including one which alleges to be an Admin login.
What's the easiest way to browse the databases on the server and then connect to one?
I suspect that my assumptions about relationships between servers, users and databases from SQL Server are leading me astray but right now I can't get past idea that the client tools Oracle ships are someone's idea of a joke but I'm really not finding it that funny.
I'm pretty sure that it's version 9.2 that's running.
Happy to provide more information but right now I don't know where to start.
If this is windows look in the services. Each database will have a separate service. By default these are named OracleServiceDATABASENAME.
You may be able to connect with just this information on the default port 1521.
If that does not work open the properties of that service you can find the location of the oracle home. The default place to keep your connection information in the ORACLEHOME\network\admin\tnsnames.ora . Using the database name you can find your connect information in this file.
If this is linux/unix look in the /etc/oratab file. This should have the database name and oracle home listed. The default location of the tnsnames.ora file is the same as on windows.
Once you have this information you can use any of the tools mentioned above to connect to the database.
I don't know what qualifies as "easiest" in your book. I'm moderately fond of Aqua Data Studio (www.aquafold.com); it's nice & visual & pretty & all. It's also Not Cheap, but might be worth a 2-week evaluation to see if it does anything helpful for you. I'm not an expert on this, and I joined an Oracle-based group from a SQL Server background; that's the tool they were using at the time, and I've found it extremely usable. But that's just me. Good luck.
Check out Oracle SQL Developer. (It's free)
I'm not a SQL Server expert, but there are differences in terminology.
An Oracle "Instance" is a single entity of the Oracle software. A database is the actual logical data that the instance serves. You may have multiple instances of the Oracle database software running against one database (This is considered a RAC setup); or just one instance running against one database.
I'm assuming what you mean by database here is actually the different schemas/users/tablespaces/procedures etc. that you have within an Oracle database. In that case, Oracle SQL Developer should do the job nicely.
If you are able to utilize Enterprise Manager (this is a licensed option), it provides this functionality as well, though it is more cumbersome than SQL Developer IMHO. EM does provide many other tools for providing a general overview of your Oracle instance health, alerts, and many things used to help tune the performance of your Oracle instance.
In Windows, the following command lists running database services:
net start | findstr -i ora
In Unix/Linux, grepping for the Oracle SMON process will give you the names of running databases:
ps -ef | grep smon

Resources