Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle SQL Developer Query Connect as Other User

Tags:

sql

oracle

I am designing a new database via a new sql file. I am using Oracle SQL Developer and logged in as sysdba.

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

connect scott/tiger;

Thank you in advance.

Edit

I am trying to create a foreign key on Schema A table referencing to Schema B table.

The error shown is

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

I therefore want to login as "Schema B", grant all permission to SYS user, login as sys again and create the relationship.

Hope I am clearer this time.

like image 384
Nick Binnet Avatar asked Feb 24 '23 22:02

Nick Binnet


1 Answers

I believe you need to break and re-establish the connection to the database/service in order to log in as a different user in SQL Developer.

However, if you simply want to be in the SCOTT user's name space (so that CREATE TABLE EMP... is executed as CREATE TABLE SCOTT.EMP ..., you can issue

alter session set current_schema = SCOTT;

like image 149
Adam Musch Avatar answered Feb 26 '23 11:02

Adam Musch