How to create a new schema/new user in Oracle Database 11g?
For a new Oracle 11g schema/user, execute:
Here, new_schema
is the username you opt for and password
represents a secure password. Change them as per your requirements.
Step-by-step guide: Beyond the Basics
Grant 'em Privileges
A user with only CREATE SESSION
privilege is like a book without words. Here's how to make their life more interesting:
This endows the user with the power to create tables, views, and more!
Tablespaces: The custody of the schema!
In the world of Oracle, tablespaces are the eternal abodes of schema objects. Make sure to "house" your schema in the correct tablespace:
To create a new tablespace, chant:
The Art of Schema Creation: In-Depth
Securing the Fort
Security is paramount! Always choose a potent password for your user with IDENTIFIED BY
clause:
Playing Tablespaces
To befriend tablespaces and handle object and space management, grant RESOURCE
and UNLIMITED TABLESPACE
:
But remember, balance is the key.
The Oracle's Whisper: DBMS_METADATA
The DBMS_METADATA
package is your best friend for extracting schema objects. Especially useful when cloning and auditing:
SQL Plus or SQL Developer: Take Your Pick
Both SQL Plus and SQL Developer are your allies. SQL Plus is a classic, but SQL Developer offers a more intuitive interface, wizard guides, and GUI.
Road Test the User
Once the user is created, test the login:
Checks if the new schema is accessible and, most importantly, usable.
User Clean-Up
To remove a user (and its associated schema), use the DROP USER
command:
Proceed with caution. People have been known to press enter
a tad hastily!
Was this article helpful?