premise: There are multiple instances on the same server and have been started.
If you do not specify a connection string at logon, the environment variable ORACLE_SID is generally used, and thedefault Oracle_sid value for Windows system is the last installed instance .
1. View the instance name and Oracle_sid
In Unix/linux environment can echo $ORACLE _sid view the value of Oracle_sid;
In the Windows environment You can (take my own Machine for example):
(1) Start-to-run (input regedit) with Oracle_sid key value (system default) in Hkey_local_machine\software\oracle\key_oradb10g_home1, as shown in:
(2) Log in to the database and view it through the SQL statement (view the instance name for the currently used database):
Sql>show parameter instance;
Sql>show parameter instance_name;
Sql>select * from V$instance;
2. Switching instances
under the cmd window, first modify the value of the Oracle_sid (set oracle_sid=xxxx, which is only valid for the current CMD window), and then access the database with the same CMD window.
View window under Default Oracle_sid