简体   繁体   English

如何在 Oracle 11g 中激活 hr 模式

[英]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.我正在学习 PL/SQL 并且正在使用 SQL Developer,因为我使用 hr 架构创建了许多用户。 But when a user logs in to SQL Developer give an error like the users is invalid.但是当用户登录到 SQL Developer 时会出现类似用户无效的错误。 but When I use the system user, it works perfectly but without hr schema.但是当我使用系统用户时,它可以完美运行,但没有 hr 架构。

So:所以:

  • How can I activate the hr schema in system user or如何在系统用户
  • How can I make a user for use in SQL developer.如何让用户在 SQL 开发人员中使用。

I am using Oracle 11g express我正在使用 Oracle 11g express

ALTER USER hr IDENTIFIED BY hr ACCOUNT UNLOCK;

Then, enter this command然后输入这个命令

CONNECT HR/HR连接人力资源/人力资源

This may help这可能有帮助

ALTER USER hr IDENTIFIED BY hr ACCOUNT UNLOCK; ALTER USER hr IDENTIFIED BY hr ACCOUNT UNLOCK;

GRANT CONNECT, RESOURCE to hr; GRANT CONNECT, RESOURCE to hr;

ALTER USER oe IDENTIFIED BY OE ACCOUNT UNLOCK;更改由 OE 帐户解锁标识的用户 oe;

GRANT CONNECT, RESOURCE to OE;授予连接,资源给 OE;

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.然后用户拥有正确的权限,您应该可以使用 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...)您可以在此处找到可以帮助您正确设置用户的示例,但设置数据库权限有点依赖于您希望安全性的工作方式(即只读、存储过程、对某些表的访问受限。 ..)

ALTER USER hr IDENTIFIED BY hr ACCOUNT UNLOCK;
GRANT CONNECT, RESOURCE to hr;
CONNECT HR/hr;
Password : hr

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM