sqlplus / as sysdba
登录数据库以最高权限登录
SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 11 09:00:05 2019
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> show user;
产看当前登录用户
USER is "SYS"
SQL> startup
启动数据库
ORACLE instance started.
Total System Global Area 784998400 bytes
Fixed Size 2217464 bytes
Variable Size 482347528 bytes
Database Buffers 293601280 bytes
Redo Buffers 6832128 bytes
Database mounted.
Database opened.
SQL> select username, account_status from dba_users order by username;
查看OracleDBA_USER视图
DBA_USERS视图中ACCOUNT_STATUS记录的用户的当前状态,一般情况下在使用的正常用户均处于OPEN状态。
例如我们查看sec用户的当前状态,此时该用户处于OPEN状态,可以正常使用。
USERNAME | ACCOUNT_STATUS | 状态 |
---|---|---|
ANONYMOUS | EXPIRED & LOCKED | 此时状态为过期并且锁住 |
APEX_030200 | EXPIRED & LOCKED | |
APEX_PUBLIC_USER | EXPIRED & LOCKED | |
APPQOSSYS | EXPIRED & LOCKED | |
BI | EXPIRED & LOCKED | |
CTXSYS | EXPIRED & LOCKED | |
DBSNMP | OPEN | 开放的 |
DIP | EXPIRED & LOCKED | |
EXFSYS | EXPIRED & LOCKED | |
FLOWS_FILES | EXPIRED & LOCKED | |
HR | EXPIRED | 过期的 |
IX | EXPIRED & LOCKED | |
MDDATA | EXPIRED & LOCKED | |
MDSYS | EXPIRED & LOCKED | |
MGMT_VIEW | OPEN | |
OE | EXPIRED & LOCKED | |
OLAPSYS | EXPIRED & LOCKED | |
ORACLE_OCM | EXPIRED & LOCKED | |
ORDDATA | EXPIRED & LOCKED | |
ORDPLUGINS | EXPIRED & LOCKED | |
ORDSYS | EXPIRED & LOCKED | |
OUTLN | EXPIRED & LOCKED | |
OWBSYS | EXPIRED & LOCKED | |
OWBSYS_AUDIT | EXPIRED & LOCKED | |
PM | EXPIRED & LOCKED | |
SCOTT | OPEN | |
SH | EXPIRED & LOCKED | |
SI_INFORMTN_SCHEMA | EXPIRED & LOCKED | |
SPATIAL_CSW_ADMIN_USR | EXPIRED & LOCKED | |
SPATIAL_WFS_ADMIN_USR | EXPIRED & LOCKED | |
SYS | OPEN | |
SYSMAN | OPEN | |
SYSTEM | OPEN | |
WMSYS | EXPIRED & LOCKED | |
XDB | EXPIRED & LOCKED | |
XS$NULL | EXPIRED & LOCKED |
SQL> alter user hr account unlock;
更改用户hr帐户为未锁
SQL> alter user hr identified by hr;
更改用户hr密码为hr
SQL> conn hr /hr
切换用为hr/密码为hr
Connected.
SQL> show user
查看当前登录账号
USER is "HR"
SQL>
原文地址:https://blog.51cto.com/13660858/2403685