首先查看数据库版本
要创建SCOTT演示表,步骤很简单。
---如果报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;
SQL> select * from v$version;1.利用脚本创建scott用户
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
要创建SCOTT演示表,步骤很简单。
10g版本:[oracle@elvis admin]$ pwd
(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
/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 2012SQL> @utlsampl.sql
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
---如果报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/