默认的scott用户是被锁定的,先解锁就能登陆使用 数据库了。
使用下面的语句解锁scott:
alter user scott account unlock;
解锁之后可能会要求你该密码:
alter user scott identified by tiger;
再登陆:
sqlplus scott/tiger
之后 就可以登陆了。
注意:
用命令行启用帐户 先解锁后 一定要设密码 不然还是无法登陆 最后要进行提交。
补全给出示范操作吧:
使用system 用户 登录Oracle 数据库, 输入命令: show user; 该条命令执行结果为: 显示当前登录的用户。
SQL*Plus: Release 10.2.0.1.0 - Production on 星期日3月4 13:54:32 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> show user;
USER 为"SYSTEM"
SQL>
使用sys 用户登录Oracle 数据库, 输入命令:conn as sysdba; 该条命令执行后提示:输入用户名,之后提示输入密码, 系统核对正确后,便可以连接了。
请输入用户名: sys
输入口令: ****
已连接。
SQL> show user;
USER 为"SYS"
使用show user; 命令查看当前登录的用户。
SQL> show user;
USER 为"SYS"
使用sys 启用Scott用户: 输入命令:
SQL> alter user scott account unlock;
用户已更改。
SQL> alter user scott identified by tiger;
用户已更改。
SQL> conn scott;
输入口令: *****
已连接。
SQL> show user;
USER 为"SCOTT"
SQL>
使用Oracle 命令 查看当前数据库中已存在的 所有用户 命令如下:
select username from dba_users;
Over!!!
作者 SongYanJun2011