Home > database >  Previous table appearing in new connection in Oracle database
Previous table appearing in new connection in Oracle database

Time:12-24

Every time I create a new connection under the same common user on the SQL Developer tool it automatically copies the table(s) of the previous connection. I am using Oracle Database 19c on the SQL developer tool. In the below picture, there is a table having 2 columns.
enter image description here

In the below image, I have created a new connection, but it already has the previous tables.
enter image description here

troubleshooting steps I have followed so far -:

  • disconnected the previous connection: not solved
  • deleted the previous tables & connection: not solved
  • restarted SQL developer tool: not solved
  • deleted user and created again: this works but can't do it every time.

I have created a table using steps on this website: sqlserverguides

Please Advise :-)

CodePudding user response:

The answer to your question here is that you are not doing what you think you are doing.

The objects newfirm and newtable are not tables, these are connections. A connection needs a username and a password, a hostname to connect to, a port number, and a service name (or SID). Once you are connected to a database server, all the "folders" you see under that connection are all related to the user used for the connection. If you want to look at other users (be it sys or service users, or "people"), then you need to go to the folder "other users" in the same tree.

The screenshots you are showing there in your question only show 2 distinct connections (we don't know if the same details such as username hostname were used) each with their own label/name (newfirm and newtable). You can't "disconnect" a table, you also can't delete it .. you can drop it however which is likely what you meant.

In your screenshots, what you are pointing at and calling columns are actually tables. Those things that you are pointing at and calling "previous table" and "new table" are not tables but connections (to a database server using a specific username).

You do not show any code you may be using, which would be useful.

If you want to drop a table (i.e. delete), you use the DROP command:

DROP TABLE user.tablename;

It is not possible for 2 tables with the same name to exist in the same schema (aka user).

  • Related