oracle学习笔记2
使用unrecoverable创建表
create table new_emp as select * from emp unrecoverable;
create table new_emp as select * from emp nologging;
推荐使用logging或者nologging.
将表移动到新的数据段或新的表空间
通过移动来实现存储参数的修改
alter table emp move storage(initial 1m next 512k mimextents 1maxextens 999 pctincrease 0 );
alter table emp2 set unuserd(comm);
创建主键
create table dept
(deptno number(2),
dname varchar2(20),
loc varchar2(20),
constraint pk_dept primary key (deptno)
);
修改增加主键
alter table park_revenue
add (park_rev_pk primary key (account_no));
create table dept
(deptno number(5) primary key,
dname varchar2(20),
loc varchar2(30))
disable primary key;
注:当主键被说明为 disable primary key 时,不能建立相应的外部键。一定先用:
alter table dept enable primary key 后方可使用:
deptno constraint fk_deptno References dept(deptno)
唯一索引和主键区别
唯一索引:唯一索引使用CREATE UNIQUE INDEX命令完成,能标识数据库表中一行的关键字。在数据字典中建立了唯一索引名字。
主 键:主键使用primary key来指定,能标识数据库表中一行的关键字。在数据字典中也建立了唯一索引名字。
差 别:被定义为唯一索引的列可以空,而被定义为主键的列不能空。
相关文档:
oracle 怎么来遍历一个树,相比较其他方法,oracle的connect语法更能很便利的解决问题。
语法格式:
select ...
from ...
start with...
connect by prior expr=expr
order siblings by ..
start with 的功能类似于where,指明从哪个分支开始便利;
connect by 指明父节点和子节点地连接方式,关键字prior放在父节 ......
在数据库的日常学习中,发现公司生产数据库的默认临时表空间temp使用情况达到了30G,使用率达到了100%;待调整为32G后,使用率还是为100%,导致磁盘空间使用紧张。根据临时表空间的主要是对临时数据进行排序和缓存临时数据等特性,待重启数据库后,temp会自动释放。于是想通过重启数据库的方式来缓解这种情况,但是重启数据 ......
2010年05月2号 |
23:59分类:Linux&Unix
, 管理维护
| 编辑
| 标签:11g
、grid
本文出自 “inthirties(男
人三十)
”博客,转载请务必注明作者和保留出处。
11g里出现了一个新角色。
Oracle Grid Infrastructure
http://downlo ......
现在的项目比较紧,加上自己也比较懒,实在是“没时间”写啊,呵呵,昨天看到一篇挺好的Oracle存储过程的例子,正好最近要用,转过来大家一起分享一下,谢谢(晨光映霞),原作地址:http://blog.csdn.net/xuyabao/archive/2008/03/20/2200205.aspx。
--------------------自定义函数开始-------------- ......
HOW TO SETUP ORACLE ON A RAW PARTITION
What is a Raw device and what is the advantage of having a Raw device?
A Raw device, or a Raw disk partition, is a hardware device that is
supported
by a character device driver. Raw devices are not buffered by the kernel;
the data is transferre ......