博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  数据库学习

摘要:查看当前用户的缺省表空间select username,default_tablespace from user_users;查看当前用户的角色select * from user_role_privs;查看当前用户的系统权限和表级权限select * from user_sys_privs;select * from user_tab_privs; 查看用户下所有的表select * from user_tables;显示用户信息(所属表空间)select default_tablespace,temporary_tablespace from dba_users where usernam 阅读全文

posted @ 2011-03-31 14:46 lynstone 阅读(321) 评论(0) 推荐(0)

摘要:索引表索引表(index-by tables)有点类似数据库表,它由两列组成(key和value)。它的Key值类型是binary_integer,value类型就是在定义中指定的类型。和数据库表不同的是它是保存在内存中的表。定义索引表:Type type_name is table of element_type [not null]index by binary_integer;type_na... 阅读全文

posted @ 2009-09-20 09:58 lynstone 阅读(192) 评论(0) 推荐(0)

摘要:DDL is Data Definition Language statements. Some examples: CREATE - to create objects in the databaseALTER - alters the structure of the databaseDROP - delete objects from the databaseTRUNCATE - remov... 阅读全文

posted @ 2009-09-17 15:27 lynstone 阅读(193) 评论(0) 推荐(0)

摘要:如果想知道某个用户模式(如dmsuser)下的模式对象是什么时候创建的以及其他一些创建模式对象时的信息,就要用到一个DDL触发器来实现。实现方法分两步:1>创建一个表来保存创建表时的各类信息create table OBJECT_CREATED( OWNER VARCHAR2(30), NAME VARCHAR2(30), TYPE VARCHAR2(30), CREATE_USER VAR... 阅读全文

posted @ 2009-09-16 11:02 lynstone 阅读(176) 评论(0) 推荐(0)

摘要:1.为表创建唯一索引,索引字段为emp_idcreate unique index ibx_emp on employee(emp_id)2.创建用户,赋管理员权限create user user1 identified by user1;grant resource ,connect to user1;3.授权操作grant all on employee to user1;revoke del... 阅读全文

posted @ 2009-09-13 20:20 lynstone 阅读(163) 评论(0) 推荐(0)

摘要:第一章1.登陆命令: sqlplus dmsuser/123456@gis 或 sqlplus /nolog connect dmsuser/123456@gis2.退出命令:exit3.使用DBMS_OUTPUT包中的PUT_LINE过程输出:SET SERVEROUTPUT ON命令告诉SQL*PLUS显示这一结果。eg <1>: declarestr varchar2(30);b... 阅读全文

posted @ 2009-09-12 22:28 lynstone 阅读(301) 评论(0) 推荐(0)