重建 scott 用户

Oracle用户状态查看、解锁与重建操作
本文介绍了Oracle数据库相关操作,包括查看用户状态的SQL语句,可查看用户名、密码、账户状态和过期日期;还给出了解锁hr用户的命令;同时详细说明了在11G和12CR2版本中重建scott用户的步骤及完成标志。

查看用户状态:
col username for a30
col password for a20
col account_status for a30
select username,password,account_status,expiry_date from dba_users;

解锁 hr 用户
alter user hr identified by hr;
alter user hr account unlock;
alter user hr identified by hr account unlock;


重建 scott 用户:
https://blog.51cto.com/3474247/1876399
11G 重建:
SYS@PROD> @?/rdbms/admin/utlsampl.sql
?  表示 $ORACLE_HOME

SYS@PROD> @?/rdbms/admin/utlsampl.sql
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options    --表示重建完成,直接登录即可
[oracle@oracle ~]$ sqlplus scott/tiger

SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 18 00:38:44 2019

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

SCOTT@PROD> 


12CR2 重建:
SYS@PROD> @?/rdbms/admin/utlsampl.sql
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production    --表示重建完成
[oracle@ora12c ~]$ sqlplus scott/tiger

SQL*Plus: Release 12.2.0.1.0 Production on Thu May 2 10:04:54 2019

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Last Successful login time: Thu May 02 2019 10:00:54 +08:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SCOTT@PROD> 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值