o1-手动创建scott(tiger) schema演示表
来源:互联网 发布:淘宝黑莓哪家好 编辑:程序博客网 时间:2024/06/05 20:01
DBA登陆数据库
[oracle@localhost ~]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.1.0 - Production on Tue May 8 14:02:38 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining options
创建scott用户并授予角色,至于connect和resource权限具体看这里
SQL> create user scott identified by tiger;User created.SQL> grant connect,resource to scott;Grant succeeded.
使用scott用户登陆
SQL> conn scott/tigerConnected.
执行demobld.sql脚本
SQL> @/home/oracle/Desktop/demobld.sqlBuilding demonstration tables. Please wait.Demonstration table build is complete.
这样创建的演示表中没有关联关系,没有引用完整性,其次可以执行以下脚本
SQL> alter table emp add constraint emp_pk primary key(empno);Table altered.SQL> alter table dept add constraint dept_pk primary key(deptno);Table altered.SQL> alter table emp add constraint emp_fk_dept foreign key(deptno) references dept;Table altered.SQL> alter table emp add constraint emp_fk_emp foreign key(mgr) references emp;Table altered.
这就完成了演示模式的安装。如果以后你整理系统时删除这个模式,只需执行[ORACLE_HOME]/sqlplus/demo/demodrop.sql(后面有附件)。这个脚本会删除5个演示表。
你也可以直接将此用户删除,语句为
drop user scott cascade;
这样写的特点是:
cascade将会删除scott所拥有的所有对象。
执行前要确保scott用户没有连接,否则报错。
你要谨慎,drop之前最好先执行一次导出。
- o1-手动创建scott(tiger) schema演示表
- oracle 10g 手动创建scott(tiger) schema
- oracle 10g 手动创建scott(tiger) schema
- oracle 10g 手动创建scott(tiger) schema
- oracle 10g 手动创建scott(tiger) schema
- oracle 10g 手动创建scott(tiger)
- SCOTT/TIGER demonstration schema (demobld.sql)
- 手动创建scott和表
- 手动建库 - scott 创建
- 创建Oracle的用户 create user scott identified by tiger;
- scott/tiger is locked 解决办法
- oracle 安装SCOTT/TIGER模式
- 解决oracle scott/tiger帐号被锁定
- oracle中scott/tiger、sys、SYSDBA、system
- Oracle数据库 scott/tiger账户经典查询
- 手动解锁scott用户
- oracle在scott用户创建表emp
- 创建scott的案例表代码
- Web Service调用方式的烦脑
- hibernate dao demo
- ubuntu QT开发环境
- android UI 库
- 第12周实验报告3
- o1-手动创建scott(tiger) schema演示表
- Android图片的内存优化
- 【软件测试自动化-QTP NOTE 13】 == 如何创建高效的Test-Data Dictionary 1st ==
- JAVA 环境变量设置
- Ajax发关Get和Post请求的方法
- 苹果或推$799Air 并非由于超极本威胁
- 16个桌面Linux用户必须要知道的Shell命令
- How to resolve java.lang.ClassNotFoundException in Java
- C# Winform 只打开Form窗体一次