哈希分区表
哈希分区表中的数据,oracle会尽量让其均匀分布到所有分区上,当向分区表添加新的分区时,数据会自动重新分布,现在通过添加新分区前后数据行rowid的变化来验证这一点--创建测试表,并插入10000条记录A>create table t_hash(id int) 2 partition by hash(id) 3 ( 4 ...
参数文件中的process
oracle有两种模式:专用服务器和共享服务器专用模式下,一个会话对应一个server process,控制server process的参数为Process,于是想到做实验看看Process不够用时,oracle会怎么样,想连上来的用户又会怎么样。--现在process=150A>show parameter processNAME &...
ORA-12162: TNS:net service name is incorrectly specified
SID就是实例名,你用sqlplus连的也是实例,所以当你未设置ORACLE_SID环境变量时,Oracle就不知道你要连什么,所以报错[oracle@win7 ~]$ unset ORACLE_SID[oracle@win7 ~]$ set|grep SID_=ORACLE_SID[oracle@win7 ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Tue May 27 13:29:54 2014...
Instance_name和db_name
--设置SID就是设置实例名,这里为了演示特意将实例命名为abc,数据库命名为cba[oracle@win7 ~]$ export ORACLE_SID=abc[oracle@win7 ~]$ ls $ORACLE_HOME/dbs/[oracle@win7 ~]$ echo db_name=cba >$ORACLE_HOME/dbs/initabc.ora[oracle@win7 ~]$ cat $ORACLE_HOME/dbs/initabc.oradb_name=cba[oracle@win7 ~]$ set...
ORA-06553: PLS-213: package STANDARD not accessible
看tom说简单地create database就可以创建数据库,于是小试了一把SYS>create database;ERROR:ORA-06553: PLS-213: package STANDARD not accessible Database created.--查询视图发现数据文件、日志文件和控制文件都创建好了SYS>select NAME,bytes/1024/1024 from v$datafile;NAME &nb...
Clustoring Factor(二)
A>create table t 2 as 3 select rownum id1,dbms_random.random id2,rpad('*',200,'*') data 4 from all_objects;Table created.A>create index organized on t(id1);Index created.A>create index disorganized on t(id2);Index created.A>select inde...
Clustoring Factor
A>create table t as select * from all_objects;Table created.A>create index t_owner on t(OWNER);Index created.A>create index t_objnm on t(OBJECT_NAME);Index created.A>create index t_objid on t(OBJECT_ID);Index created.A>select INDEX_NAME as "index",LEAF_BLOCKS as "l...
只读表空间
--执行完检查点后,创建两个表空间,分记录下创建时的SCNA>alter system checkpoint;System altered.A>select NAME,FILE#,CHECKPOINT_CHANGE# from v$datafile;NAME &nb...
show_space
美中不足的是包DBMS_SPACE不能用在ASSM上,只能用在MSSM上A>!oerr ora 1061810618, 00000, "Operation not allowed on this segment"// *Cause: This DBMS_SPACE operation is not permitted on segments in// tablespaces with AUTO SEGMENT SPACE MANAG...
压缩
--相同的表结构和数据,压缩比不压缩好A>create table t_comp compress as select object_id,object_name from all_objects;Table created.A>create table t_nocomp as select object_id,object_name from all_objects;Table created.A>select SEGMENT_NAME,sum(BYTES) as "size",sum(BLOCKS) as "block...
分区表及其索引的压缩属性
一.分区表部分二.分区上索引部分一.分区表部分A>create table t_part(id int) 2 partition by range(id) 3 ( 4 partition p1 values less than(100), 5 partition p2 values less than(200), 6 partition p3 values less than(300) 7 ...
Interpreting Raw SQL_TRACE output [ID 39817.1]
修改时间 04-MAR-2012 类型 REFERENCE 状态 PUBLISHEDApplies to: Oracle Server - Standard Edition - Version: 8.0.3.0 to 11.2.0.3 - Release: 8.0.3 to 11.2Oracle Server - Personal Edition - Version: 8....
当BBED遇见ASM,FILENAME怎么写?
参考:http://hi.baidu.com/binsil/item/8997454861194414896d1091bbed不能直接操作封装在ASM里面的数据文件,所以需要将对应的数据文件转存出来。建立目录路径SQL> create directory sd as '+NDG1/devdb_rac/datafile';Directory created.SQL> create directory dd as '/u01/backupfile';Directo...
DROP和TRUNCATE的区别
drop table t purge is not the same as truncate. the purge just allows for the space to be immediately reused, it is not in the recycle bin truncate changes the tables data object id, points it to new space, changes the TABLE entirely. they are different commands.
OBJECT_ID和DATA_OBJECT_ID关系
参考:https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:23417970272903A>create table d as select * from a;Table created.-- 刚开始表D的OBJECT_ID和DATA_OBJECT_ID是一样的A>select OBJECT_ID,DATA_OBJECT_ID from dba_objects where OBJECT_NAME='D'; OBJECT_ID DATA_OBJ...
非分区表=>分区表(三)
前面已经写了两篇了,今天一高兴在网上又学到一招,其实很简单,就是利用CTAS大概步骤1.原表A2.创建分区表A_NEW(CTAS)3.将T重命名为A_OLD4.将A_NEW重命名为A--表A原来有一条记录A>select * from a; ID---------- &n...
非分区表=>分区表(二)
在asktom上又学了一招,使用dbms_redefinition包来完成这一工作不多说了,上实验--分别创建非分区表A,分区表BA>create table a(id int);Table created.A>create table b(id int) 2 partition by range(id) 3 (partition p1 values less than(100), 4 partiti...
非分区表=>分区表(一)
大概步骤:1.创建原始表SRC及索引2.插入数据3.创建目标表DST及索引(要求和原表结构一模一样,多一个列也不行)4.交换分区(第3步创建分区表DST时只指定一个分区)5.将DST按规则再一分为三个小分区(有点像装操作系统时给硬盘分区)6.验证结果1.创建原始表SRC及索引A>create table src(id int);Table create...
ASMCMD中的CP命令
在做表空间传输实验时,想把ASM中的数据文件拷贝到操作系统上,于是想到用CP,help cp后,本以为很简单,敲了两次命令都报错了(其实那帮助写得不咋地)--这是报错的场景ASMCMD [+fra/ORCL/DATAFILE] > cp TEST.261.848058223 /home/oracle/test.dbf copying +fra/ORCL/DATAFILE/TEST.261.848058223 ...
分区中的exchange
参考:http://www.orafaq.com/node/2570网上说,分区交换比常规插入速度要快,照着做了一遍,确实比较快,但快的原因没搞清楚,说是交换时只是交换了定义,所以快——这个先放着以下是实验内容A>set timing on--创建测试表A>create table t as select object_id id,object_name from all_objects;Table...