oracle 11g scott用户的加解锁方法以及修改密码

数据库默认安装时 scott用户是锁定的。

首先用超级管理员用户登录sqlplus

[oracle@dj ~]$ sqlplus / as sysdba 
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 4 10:44:28 2016
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> 

启动数据库

SQL> startup ;
ORACLE instance started.
Total System Global Area 1185853440 bytes
Fixed Size    2252664 bytes
Variable Size  754974856 bytes
Database Buffers  419430400 bytes
Redo Buffers    9195520 bytes
Database mounted.
Database opened.
SQL> 

解锁scott用户

SQL> alter user scott account unlock;
User altered.

连接scott用户 期间时会提示让你修改新密码 这里还是填写tiger默认密码

SQL> conn scott / tiger
ERROR:
ORA-28001: the password has expired
Changing password for scott
New password: 
Retype new password: 
Password changed
Connected.

SQL> 

查看scott用户  显示为已经是scott用户

SQL> show user ;
USER is "SCOTT"
SQL>

也可以修改用户的密码 例如

在sqlplus修改普通用户密码,其格式为:
aler user 用户名 identified by 密码
如:alter user scott identified by grace;

对用户的加锁及解锁 例如

SQL> alter user 用户名 account lock;(加锁)
SQL> alter user 用户名 account unlock;(解锁)

-------------------- THE END----------------------------




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值