Wednesday, August 28, 2013

Oracle SQLPlus and SQL Developer connection

In order to connect to Oracle DB from SQL Developer, a user must be created.
First, launch slqplus:
sqlplus /nolog



Second, connect to ORACLE_SID
connect $ORACLE_SID as sysdba



(when prompting for password, just hit Enter)

Third, create a user;
CREATE USER your_username IDENTIFIED BY your_password;


(if you try to connect with Oracle db at this point, you'll get an error since no session has been granted to this user yet)
Fourth, grant session to the newly-created user
grant create session your_username;



Now Oracle db is ready for connection from SQL Developer.

However, this user have read-only privilege. In order to get write privilge, e.g creating table. You need to grant this privilege to the user.
5. grant write prilivige to the user:
grant create table, create sequence, create database to your_username;
(you can add all other stuff in between: create view, create cluster, create synonym, etc.)
6. grant unlimited space:
grant create unlimited tablespace to your_username;


Note: you have to log in as oracle user in order to execute sqlplus commands.


No comments:

Post a Comment