'How do i connect to different oracle databases that are installed in a same Linux server
There are multiple databases installed in the server and i am trying list them
There is an Oracle Linux server where multiple oracle databases are installed, i connected through sqlplus as sysdba , and i found a container with 3 pluggable database.
then there are another 2 databases installed in the same server. how do connect to the other 2 databases to perform some queries,
there are multiple databases installed in the the server and i am trying list them
Solution 1:[1]
If you use a oracle container database, you can login to the database using the steps that are below:
- login db via sqlplus
- show pdbs;
- alter session set container=container_db_name;
Solution 2:[2]
Re: "the two other databases" (ie, not the container and 2 pdbs previously mentioned). you can find out what they are at the OS command line:
[oracle@vbol83-01 ~]$ ps -ef | grep pmon | grep -v grep
oracle 1673 1 0 Feb14 ? 00:00:07 ora_pmon_orcl
[oracle@vbol83-01 ~]$
This shows that I have one pmon process, and the sid name is 'orcl'. I can then set my environment for that sid, and connect with sqlplus:
[oracle@vbol83-01 ~]$ source oraenv
ORACLE_SID = [orcl] ? orcl
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@vbol83-01 ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Feb 15 09:42:26 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
orcl
SQL>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | carr |
| Solution 2 | EdStevens |
