database 在 Oracle 11g R2 中解锁帐户

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11942410/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 08:40:12  来源:igfitidea点击:

Unlocking account in Oracle 11g R2

databaseoracleoracle11g

提问by arsenal

I know this question has been asked many times, but this problem is confusing me a lot. I just installed Oracle 11g R2. And I was trying to unlock Scott/Tiger accountso that I can use them to make a SQL Developer connection. I was trying to do something like below- And I always get user SCOTTdoes not exist? Why is it so? Is there anything wrong I am doing?

我知道这个问题已经被问过很多次了,但是这个问题让我很困惑。我刚安装Oracle 11g R2。我试图解锁Scott/Tiger account以便我可以使用它们制作 SQL Developer connection. 我试图做类似下面的事情 - 我总是让用户SCOTT不存在?为什么会这样?我做错了什么吗?

SQL> conn system/abcdef1234
Connected.
SQL> alter user scott account unlock;
alter user scott account unlock
           *
ERROR at line 1:
ORA-01918: user 'SCOTT' does not exist

Any thoughts will be appreciated.

任何想法将不胜感激。

Updates:-

更新:-

SQL> select username,account_status from dba_users where username='SCOTT'; 
no rows selected

回答by Justin Cave

During the installation process, one of the questions that is asked is whether you want to install the sample schemas (SCOTT, HR, etc.). If the SCOTTuser doesn't exist, it would appear that you chose not to install the sample schemas.

在安装过程中,被问的一个问题是,你是否要安装示例模式(SCOTTHR,等)。如果SCOTT用户不存在,您似乎选择不安装示例模式。

You can create a new user, grant appropriate privileges to that user, and then build tables to work with. For example

您可以创建一个新用户,向该用户授予适当的权限,然后构建要使用的表。例如

CREATE USER rjchar 
  IDENTIFIED BY rjchar
  DEFAULT TABLESPACE users
  TEMPORARY TABLESPACE temp;

GRANT create session,
      create table,
      create view,
      create procedure,
      create trigger
   TO rjchar;

You can then log in as the user rjcharfrom SQL Developer and can start building your schema. Alternately, you can manually install the sample schemasusing the scripts that were installed on your server.

然后,您可以rjchar从 SQL Developer以用户身份登录并开始构建您的架构。或者,您可以使用服务器上安装的脚本手动安装示例模式

回答by Avi

In SQL DEVELOPER

在 SQL 开发人员中

Default connection for oracle 11g

oracle 11g 的默认连接

go to connection>New Connection

转到连接>新建连接

Connection Name = HR or Use any name

连接名称 = HR 或使用任何名称

User name = hr

用户名 = hr

Password = Your Password (This is the password that you selected during the installation of the of Oracle 11g)

Password = Your Password(这是您在安装Oracle 11g时选择的密码)

Check the "Save" option

勾选“保存”选项

role: default

角色:默认

port 1521

端口 1521

SID : orcl

SID : orcl

If you want to create the SYSDBA Account ( Administrator account)

如果要创建 SYSDBA 帐户(管理员帐户)

Connection Name = admin ORCL or Use any name

连接名称 = admin ORCL 或使用任何名称

User name = sys

用户名 = sys

Password = Your Password (This is the password that you selected during the installation of the of Oracle 11g)

Password = Your Password(这是您在安装Oracle 11g时选择的密码)

role: sysdba( from the drop down)

角色:sysdba(从下拉菜单)

port 1521

端口 1521

SID : orcl

SID : orcl

TEST and Save Connect

测试和保存连接

Just in case if your HR account is locked because you have connected multiple number of times than you can fix this by logging into your SYS DBA account

以防万一您的 HR 帐户因连接多次而被锁定,您可以通过登录到您的 SYS DBA 帐户来解决此问题

In the objects list on your list go to the OTHER USERS and

在列表中的对象列表中,转到其他用户并

GO to HR Account > RT Click

转到 HR 帐户 > RT 单击

EDIT USER

编辑用户

Choose the password youlike

选择你喜欢的密码

and UN CHECK The account locked and Uncheck the Password Expired options if they are checked in

和 UN CHECK The account locked 和 Uncheck the Password Expired 选项,如果他们被签入

回答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;

回答by Todd Pierce

Does it exist? Try

它存在吗?尝试

select username,account_status from dba_users where username='SCOTT';