Home > Enterprise >  Oracle SQL Developer - pre existing tables in new connection. Why?
Oracle SQL Developer - pre existing tables in new connection. Why?

Time:02-16

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

CodePudding user response:

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

  • Related