[英]Unlocking account in Oracle 11g R2
I know this question has been asked many times, but this problem is confusing me a lot. 我知道这个问题已被多次询问,但这个问题让我很困惑。 I just installed
Oracle 11g R2
. 我刚刚安装了
Oracle 11g R2
。 And I was trying to unlock Scott/Tiger account
so that I can use them to make a SQL Developer connection
. 我试图解锁
Scott/Tiger account
以便我可以使用它们建立SQL Developer connection
。 I was trying to do something like below- And I always get user SCOTT
does not exist? 我试图做下面的事情 - 我总是让用户
SCOTT
不存在? Why is it so? 为什么会这样? Is there anything wrong I am doing?
我在做什么问题?
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
During the installation process, one of the questions that is asked is whether you want to install the sample schemas ( SCOTT
, HR
, etc.). 在安装过程中,询问的一个问题是您是否要安装示例模式(
SCOTT
, HR
等)。 If the SCOTT
user doesn't exist, it would appear that you chose not to install the sample schemas. 如果
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 rjchar
from SQL Developer and can start building your schema. 然后,您可以从SQL Developer以用户
rjchar
身份登录,并可以开始构建架构。 Alternately, you can manually install the sample schemas using the scripts that were installed on your server. 或者,您可以使用服务器上安装的脚本手动安装示例模式 。
In SQL DEVELOPER 在SQL DEVELOPER中
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) 密码=您的密码(这是您在安装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) 密码=您的密码(这是您在安装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 转到人力资源帐户> 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帐户已锁定,如果已签入,则取消选中密码已过期选项
-- This may help - 这可能会有所帮助
ALTER USER hr IDENTIFIED BY hr ACCOUNT UNLOCK;
通过hr帐户解锁来识别ALTER USER hr;
GRANT CONNECT, RESOURCE to hr;
GRANT CONNECT,RESOURCE to hr;
ALTER USER oe IDENTIFIED BY OE ACCOUNT UNLOCK;
更改用户,由OE帐户解锁;
GRANT CONNECT, RESOURCE to OE;
GRANT CONNECT,RESOURCE to OE;
Does it exist? 它存在吗? Try
尝试
select username,account_status from dba_users where username='SCOTT';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.