Oracle SQL Developer Query Connect as another user

I am creating a new database through a new sql file. I am using Oracle SQL Developer and registered as sysdba.

I would like to know if SQL developer supports or has equivalent command for

connect scott/tiger;

Thanks in advance.

Edit

I am trying to create a foreign key in a schema. A table that references the table of Schema B.

Error shown

[Err] ORA-00942: table or view does not exist

So I want to log in as “Schema B”, grant all permissions to the SYS user, log in again as sys and create a relationship.

I hope I am clearer this time.

+3
source share
3 answers

SYS, , , :

ALTR TABLE foo.t1 ADD FOREIGN KEY (col) REFERENCES bar.t2(ID);

, REFERENCES foo, :

GRANT REFERENCES ON bar.t2 TO foo;

SYS . , .

+2

, /, SQL Developer.

, SCOTT ( CREATE TABLE EMP... CREATE TABLE SCOTT.EMP ...,

alter session set current_schema = SCOTT;

+4

, FK , :

, SCHEMA_A:

ALTER TABLE SCHEMA_A.TABLE_A
add CONSTRAINT fk_TABLE_B
  FOREIGN KEY (COLUMN_A)
  REFERENCES SCHEMA_B.TABLE_B(COLUMN_B);

You mention using the SYS user - I hope you are not logging into SYS for normal development ...

+1
source

All Articles