Oracle – Default Schema Name Explained

oracleoracle-sql-developerschema

When you create an object in Oracle, and do not specify a schema (object prefix), is there a name for that default schema? I see in Oracle SQL Developer, that a newly created object shows up in the root object nodes when no prefix is specified, rather than the schema object nodes.

Creating table under schema X:

X.table_1

Creating table under default schema:

table_1

Best Answer

By default, it is the user you used to log in, and you can query it as below:

select sys_context('USERENV', 'CURRENT_SCHEMA') from dual;

You can change your current schema in your session however:

alter session set current_schema=USER2;

If you create a table after this, without specifying the schema, that table will be created in the USER2 schema regardless of what user you logged on with.