创建scott用户及对象

首先查看数据库版本
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
1.利用脚本创建scott用户
要创建SCOTT演示表,步骤很简单。
10g版本:  
(1)cd $ORACLE_HOME/sqlplus/demo
(2)以任意用户身份连接后运行demobld.sql
    下载地址: http://blog.itpub.net/29439655/viewspace-1369226/
demobld.sql会创建5个表并为其填入数据。执行结束后,它会自动退出SQL*Plus。
11g版本
(1)cd &ORACLE_HOME/rdbms/admin
(2)以任意用户身份连接后运行utlsampl.sql
[oracle@elvis admin]$ pwd
/u01/oracle/product/11.2.0/dbhome_1/rdbms/admin
[oracle@elvis admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Oct 13 10:41:21 2012
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> @utlsampl.sql
---如果报TNS错误,最好把脚本中的Scott/tigher后面加上服务名, 以保证连接Scott用户不出错。

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@elvis admin]$
SQL> col username format a15;
SQL> set linesize 100;
SQL> select username,user_id,account_status from dba_users;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29439655/viewspace-1085662/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29439655/viewspace-1085662/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值