处理数据块损坏
今天在测试环境做测试的时候,遇到如下错误:SQL> select count(*) from test1;select count(*) from test1 &n...
循序渐进hints--full
1.不加hints的情况下,由于在object_id列上创建了唯一索引,执行计划走的是索引。SQL> set autot on explainSQL> select count(*) from test where object_id=100; COUNT(*)---------- &nbs...
用explain plan查看执行计划
1.创建PLAN_TABLE表SQL> conn b2c20/b2c20Connected.SQL> @?/rdbms/admin/utlxplan.sql Table created.2.运行EXPLAIN PLANSQL> explain plan for 2 select count(*) from bc_customer; Ex...
分区表的truncate
Truncating Table Partitions Containing Data and Global IndexesIf the partition contains data and global indexes, use one of the following methods to truncate the table partition.方法1 。先truncate,...
去除空格的函数trim
有2个表,test1、test2,结构如下:SQL> desc test1; Name &n...
巧用rman修改数据文件名
在添加一个数据文件时,由于终端的原因,导致数据文件名中包含了隐含字符,在操作系统和数据库里均无法以数据文件名定位数据文件,用rman对该数据文件进行重命名:1.获得该文件的file_idselect file_id from dba_d...
读书笔记之-索引压缩
1. 创建一个索引组织表,但不压缩sys@TEST>create table iot  ...
读书笔记之-堆表与索引组织表
1.创建父表sys@TEST>create table p as select object_id empno, 2 object_name ename, 3 created hiredate, 4 owner job from all_objects;&n...
学习系统包-DBMS_TTS
包DBMS_TTS用于检查表空间集合是否是自包含的,并在执行了检查之后,将违反自包含规则的信息写入到临时表TRANSPORT_SET_VIOLATIONS中。 在表空间传输的中...
学习系统包-DBMS_SPACE
1. unused_space 该过程用于返回对象(表、索引等)的未用空间。举例如下:编辑space.sql,内容如下:declaretotal_blocks number;total_bytes number;unused_blocks number;unused_bytes numb...
学习oracle系统包-DBMS_ROWID
包DBMS_ROWID用于再PL/SQL程序和SQL语句中取得行标识符的信息并建立rowid。1.取得特定rowid所对应的数据库。SQL> select dbms_rowid.rowid_block_number(rowid) from t; DBMS_ROWID.ROWID_BLOCK...
学习oracle系统包-DBMS_JOB
1.创建job。SQL> conn scott/tigerConnected.SQL> var jobno numberSQL> begin 2 dbms_job.submit(:jobno, 3 'dbms_ddl.analyze_object(''TABLE'', 4 ''SCOTT'',''EMP'',''COM...
初试RDA
1.RDA简介RDA is a set of command line diagnostic scripts that are executed by an enginewritten in the Perl programming language. RDA is used to gather detailedinformation about an Oracle environment;...
分区表管理
1. 分区的好处。Reduce the possibility of data corruption in multiple partitions Back up and recover each partition independently Control the mapping of partitions to disk drives (important for bal...
循序渐进---hints-Hints for Optimization Approaches and Goals
ALL_ROWS FIRST_ROWS(n) CHOOSE RULE 1. ALL_ROWSSQL> SELECT /*+ ALL_ROWS */ count(*) from t; COUNT(*)---------- 500 Elapsed: 00:00:00.09&n...
一个查找引起latch free的脚本
select to_char(sysdate,'yyyymmdd hh24:mi:ss') from dual;set echo onset pagesize 100 set linesize 100 COLUMN EVENT FORMAT A26 select event,sid,p1,p2,p3, SECONDS_IN_WAIT from v$session_wait where event ...
学习使用logminer
1.启用SUPPLEMENTAL LOG DATASQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA2. Extracting the Dictionary to a Flat File(1)添加字典文件存放路径,将以下参数添加到初始化参数文件里UTL_FILE_DIR = /oracle/da...
linux下升级oracle到9208
1.去metalink下载相应的升级包及cpu patch9208升级包:p4547809_92080_LINUX.zipcpu patch: p6646842_92080_LINUX.zip\opatch: p2617419_10102_GENERIC.zip2.执行升级过程整个升级过程与hp下升级oracle 9208基...
模拟行链接
1.创建测试表T,该表每一行长度8000个字节,由于block大小为8192字节,考虑到pct_free默认设置为10,则每个block将容纳不下每一行数据。 SQL> create table t (a char(2000),b char(2000),c char(2000),d char...
学习笔记二-nologging对move和rebuild操作的影响
1。测试nologging对move操作影响。(1)创建2个同样的表test1和test2,分别为logging和nologgingSQL> create table test logging as select * from sys.dba_objects; Table created. SQL> insert into t...