转自:http://cnhtm.itpub.net/post/39970/496967
oracle 9i/10g中,如果数据库实例中没有scott模式,可以手工创建,方法如下:
登录数据库
ora_test@oracle[/home/oracle]> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 24 09:21:26 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: |
创建scott用户
sys@CNHTM> create user scott identified by tiger;
User created. |
为scott用户分配权限
sys@CNHTM> grant connect,resource to scott;
Grant succeeded. |
用scott用户登录
sys@CNHTM> conn scott/tiger Connected. |
执行demobld.sql脚本
scott@CNHTM> @?/sqlplus/demo/demobld.sql Building demonstration tables. Please wait. Demonstration table build is complete. Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options |
附件:demobld.sql 脚本内容
----------------------demobld.sql begin----------------------- -- -- Copyright (c) Oracle Corporation 1988, 2000. All Rights Reserved. -- -- NAME -- demobld.sql -- -- DESCRIPTION -- This script. creates the SQL*Plus demonstration tables in the -- current schema. It should be STARTed by each user wishing to -- access the tables. To remove the tables use the demodrop.sql -- script. -- -- USAGE -- From within SQL*Plus, enter: -- START demobld.sql SET TERMOUT ON DROP TABLE EMP; CREATE TABLE EMP INSERT INTO EMP VALUES CREATE TABLE DEPT INSERT INTO DEPT VALUES (10, 'ACCOUNTING', 'NEW YORK'); CREATE TABLE BONUS CREATE TABLE SALGRADE INSERT INTO SALGRADE VALUES (1, 700, 1200); CREATE TABLE DUMMY INSERT INTO DUMMY VALUES (0); COMMIT; SET TERMOUT ON EXIT |
--end--