日期:2014-05-16 浏览次数:20424 次
如何建立SCOTT/TIGER模式
首先看下我的数据库版本
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
demobld.sql会创建5个表并为其填入数据。执行结束后,它会自动退出SQL*Plus,所以运行完这个脚本后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
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;