oracle练习1-删除scott用户,并重建
来源:互联网 发布:淘宝女装折扣店 编辑:程序博客网 时间:2024/06/05 22:38
一,概述
scott用户是oracle自带的测试用户,当删除后,可手动建立。如果没有 scott 用户也不要紧,数据库内含了建立该用户的脚本
表了一定的典型数据库的应用。
Sql> @%oracle_home%\rdbms\admin\scott.sql scott.sql 脚本也可以建立 scott 用户, 有的平台没有这个脚本, 只有 utlsampl.sql 脚本。
这两个脚本有点差别,但不大。一个含有自动退出,一个保留会话。
二,操作步骤
(1) oracle版本查看
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
(2)执行@%oracle_home%\rdbms\admin\utlsampl.sql
SQL> conn /as sysdba;
已连接。
SQL> drop user scott;
drop user scott
*
第 1 行出现错误:
ORA-01922: 必须指定 CASCADE 以删除 'SCOTT'
###drop user ; 仅仅是删除用户,drop user ×× cascade ;会删除此用户名下的所有表和视图。###
SQL> drop user scott cascade;
用户已删除。
SQL> conn scott/tiger;
ERROR:
ORA-01017: invalid username/password; logon denied
警告: 您不再连接到 ORACLE。
SQL> conn /as sysdba;
已连接。
SQL> @%oracle_home%\rdbms\admin\utlsampl.sql
从 Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options 断开
C:\Documents and Settings\Administrator>sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.3.0 - Production on 星期二 12月 10 15:12:08 2013
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> conn scott/tiger;
已连接。
SQL>
(3)执行@%oracle_home%\rdbms\admin\scott.sql
SQL> conn /as sysdba;
已连接。
SQL> drop user scott cascade;
用户已删除。
SQL> @%oracle_home%\rdbms\admin\scott.sql
SQL> conn scott/tiger;
已连接。
SQL>
scott用户是oracle自带的测试用户,当删除后,可手动建立。如果没有 scott 用户也不要紧,数据库内含了建立该用户的脚本
SQL> @%oracle_home%\rdbms\admin\utlsampl.sql 建立完成以后会自动退出 sqlplus,请重新登录既可。
SCOTT 用户可以随时被删除和建立,该用户存在的目的就是为了实验用的,表很少,但又代表了一定的典型数据库的应用。
Sql> @%oracle_home%\rdbms\admin\scott.sql scott.sql 脚本也可以建立 scott 用户, 有的平台没有这个脚本, 只有 utlsampl.sql 脚本。
这两个脚本有点差别,但不大。一个含有自动退出,一个保留会话。
二,操作步骤
(1) oracle版本查看
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
(2)执行@%oracle_home%\rdbms\admin\utlsampl.sql
SQL> conn /as sysdba;
已连接。
SQL> drop user scott;
drop user scott
*
第 1 行出现错误:
ORA-01922: 必须指定 CASCADE 以删除 'SCOTT'
###drop user ; 仅仅是删除用户,drop user ×× cascade ;会删除此用户名下的所有表和视图。###
SQL> drop user scott cascade;
用户已删除。
SQL> conn scott/tiger;
ERROR:
ORA-01017: invalid username/password; logon denied
警告: 您不再连接到 ORACLE。
SQL> conn /as sysdba;
已连接。
SQL> @%oracle_home%\rdbms\admin\utlsampl.sql
从 Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options 断开
C:\Documents and Settings\Administrator>sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.3.0 - Production on 星期二 12月 10 15:12:08 2013
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> conn scott/tiger;
已连接。
SQL>
(3)执行@%oracle_home%\rdbms\admin\scott.sql
SQL> conn /as sysdba;
已连接。
SQL> drop user scott cascade;
用户已删除。
SQL> @%oracle_home%\rdbms\admin\scott.sql
SQL> conn scott/tiger;
已连接。
SQL>
0 0
- oracle练习1-删除scott用户,并重建
- Oracle练习:有关Oracle用户scott的sql练习
- oracle 重建scott的方法
- Linux下删除并重建Oracle实例
- oracle scott 用户解锁
- Oracle Scott用户
- oracle解锁scott用户
- oracle添加scott用户
- oracle启用scott用户
- Oracle scott用户解锁
- oracle解锁scott用户
- oracle scott 用户锁定
- oracle解锁scott用户
- oracle scott用户解锁
- oracle解锁scott用户
- Oracle添加SCOTT用户
- Oracle解锁scott用户
- Oracle启用scott用户
- (转)cocos2d-x学习笔记(五)仿真树叶飘落效果的实现(精灵旋转、翻转、钟摆运动等综合运用)
- Android APK测试总结
- 基于visual Studio2013解决C语言竞赛题之1093连接链表
- 冒泡排序(改良)
- cocos2dx 碰撞
- oracle练习1-删除scott用户,并重建
- iOS7中改变导航栏的标题
- 查询当前设备的总空间 剩余空间 用户占用空间
- java.sql.SQLException: Io 异常:The Network Adapter could not establish the connect
- 相似图片搜索的原理
- 解决OutOfMemorError(内存不足)的方法
- TOJ 1005
- 设计模式(九)外观模式Facade(结构型)
- JXNUOJ_1925:特殊排序