I'm totaly new in oracle, so sorry for my probably stupid question... I have two instances on oracle server, when I'm connecting to the server via sqlplus in default opens connection to instance X but I need to change instance to Y. How can I do that?
Assuming that you already went through the steps of connecting to your Oracle DB using SQL*PLUS, here is how to switch from one database to another within your instance:
ALTER SESSION SET CONTAINER = myDB;
The best way (in my opinion) to connect to an specific database would be to specify the DB your are connecting to in the connection string.