0

I am using Oracle SQL developer as part of course I am taking. Every time I create a new connection it keeps adding these tables on its own. I want to create a clean connection to create tables and import DB later from excel. Oracle is really frustrating as compared to SSMS and PostgreSQL. enter image description here

6
  • it is not creating any tables. it is just showing existing tables in the schema/user you logged in as. Those tables already exist in the database. You can verify that by executing "select * from user_tables" in a sql window Commented Feb 15, 2022 at 18:30
  • Are you connected to the same username each time? Those tables already exist in the database schema you have connected to. They are not created by SQL*Developer. Commented Feb 15, 2022 at 18:31
  • Thanks, is there a way around it. When i create new connection it only allows me to connect using the same username that I used for other connections. I tried cant find any tutorials on this online. Commented Feb 15, 2022 at 18:35
  • I'm not quite sure what you're asking. If this is your database and you have privileges, you could create a new user in the database, grant that user create session privileges to be able to log in, grant whatever other privileges you want that user to have, and then connect to the database as that new user in SQL Developer. You'd then be connected to an empty schema. If this is a database your university is providing, however, I'd expect that you wouldn't have permission to create new users. Commented Feb 15, 2022 at 18:41
  • What if i want to create a brand new DB from scratch. How do I do that? Is there a way in SQL Developer? Or does it only support one DB at a time? I want to be able to work on 2 different DBs. Lets say one is current one in Developer for company xyz and i want to create a new one for company abc. Right now when I create a new connection i see tables from xyz. Commented Feb 15, 2022 at 18:55

1 Answer 1

2

As you're establishing connection to user which already contains some objects, that's what you see. Now, you said that you'd like to create a new - empty - user. OK, no problem - as long as you can connect as a privileged user (such as SYS) which is capable of creating other users.

I'm using Oracle database 11gXE; this is SQL*Plus session output which shows how to create a new user. You can do the same in SQL Developer, no difference at all.

SQL> connect sys as sysdba
Enter password:
Connected.
SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP             --> this will be TEMPORARY tablespace
USERS            --> this will be DEFAULT   tablespace

SQL> create user yash identified by tuesday
  2  default tablespace users
  3  temporary tablespace temp
  4  quota unlimited on users;

User created.

SQL> grant create session, create table to yash;

Grant succeeded.

SQL>

Screenshot shows

  1. my "previous" connection (as user scott, who already has some tables)
  2. new connection (that's the green "plus" sign in the upper left corner of your SQL Developer)
  3. yash doesn't have any tables; that's what you wanted, right? An empty schema. Privilege I granted (create table) lets you create new tables. If/when you'll need other privileges, connect as SYS and grant them (e.g. grant create view to yash, etc.)

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Awesome, worked thanks so much.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.