关于Scott用户

本文介绍如何解锁Oracle数据库中的默认Scott用户,并提供了在未找到该用户时的创建方法。通过SQL命令进行解锁操作,并使用Oracle自带脚本创建Scott用户。

一:典型安装的情况下包括Scott用户 ,默认情况下是锁定的状态,可以通过命令行来进行解锁;

-:SQL> alter user scott account unlock identefied bu tiger;
alter user scott account unlock identefied bu tiger
                                *
ERROR at line 1:
ORA-00922: missing or invalid option


SQL>

_:缺失或者无效的选择

然后进行查找看看有没有这个Scott

SQL> select username from dba_users where username='scott';

no rows selected

 

二:如果环境中没有Scott用户,那么可以利用Oracle自带的脚本来进行创建

SQL>
SQL> @?/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@localhost ~]$
[oracle@localhost ~]$
[oracle@localhost ~]$ sqlplus scott/tiger

SQL*Plus: Release 11.2.0.4.0 Production on Sun Sep 25 20:27:44 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> select * from tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
BONUS                          TABLE
DEPT                           TABLE
EMP                            TABLE
SALGRADE                       TABLE

SQL>

SQL> select tname from tab;

TNAME
------------------------------
BONUS
DEPT
EMP
SALGRADE

SQL>

(*?是指操作系统中环境变量$ORACLE_HOME)

 

转载于:https://www.cnblogs.com/material/p/5906812.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值