Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to activate the hr schema in Oracle 11g

I am learning PL/SQL and am using SQL Developer cause I created many users with hr schema. But when a user logs in to SQL Developer give an error like the users is invalid. but When I use the system user, it works perfectly but without hr schema.

So:

  • How can I activate the hr schema in system user or
  • How can I make a user for use in SQL developer.

I am using Oracle 11g express

like image 923
BlaShadow Avatar asked Jan 09 '12 06:01

BlaShadow


3 Answers

ALTER USER hr IDENTIFIED BY hr ACCOUNT UNLOCK;

Then, enter this command

CONNECT HR/HR

like image 66
Mubazi Eric Avatar answered Nov 14 '22 07:11

Mubazi Eric


This may help

ALTER USER hr IDENTIFIED BY hr ACCOUNT UNLOCK;

GRANT CONNECT, RESOURCE to hr;

ALTER USER oe IDENTIFIED BY OE ACCOUNT UNLOCK;

GRANT CONNECT, RESOURCE to OE;

like image 41
Van Gogh Avatar answered Nov 14 '22 09:11

Van Gogh


Not sure this should even be an answer since the question is kind of light on concrete details, but you need to grant the appropriate privileges on the database to the new users for them to be usable.

For example you need to grant "create session" for the user to be able to connect and appropriate access to the tables the users should have access to.

Then the users have the correct privileges, you should be fine using SQL developer.

You can find a sample that may help you setting up a user correctly over here but setting up permissions on the database is a bit dependent on how you want the security to work (ie read-only, stored procedures, access to certain tables restricted...)

like image 38
Joachim Isaksson Avatar answered Nov 14 '22 07:11

Joachim Isaksson