SQL 如何在 Oracle 11g 中激活 hr 模式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8784503/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to activate the hr schema in Oracle 11g
提问by BlaShadow
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.
我正在学习 PL/SQL 并且正在使用 SQL Developer,因为我使用 hr 架构创建了许多用户。但是当用户登录到 SQL Developer 时会出现类似用户无效的错误。但是当我使用系统用户时,它可以完美运行,但没有 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
采纳答案by Joachim Isaksson
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 herebut 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...)
您可以在此处找到可以帮助您正确设置用户的示例,但设置数据库权限有点依赖于您希望安全性的工作方式(即只读、存储过程、对某些表的访问受限。 ..)
回答by Mubazi Eric
ALTER USER hr IDENTIFIED BY hr ACCOUNT UNLOCK;
Then, enter this command
然后输入这个命令
CONNECT HR/HR
连接人力资源/人力资源
回答by Van Gogh
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;
ALTER USER hr IDENTIFIED BY hr ACCOUNT UNLOCK;
GRANT CONNECT, RESOURCE to hr;
更改由 OE 帐户解锁标识的用户 oe;
授予连接,资源给 OE;