Sie sind auf Seite 1von 2

11 g New features for Developers

Read Only Tables: In Oracle 11g, a table can be set READ ONLY mode to restrict
write operations on the table. A table can be altered to toggle over READ ONLY and
READ WRITE modes.
create table ptest
(id number(5),name varchar2(20),age number(3));

insert into ptest


values(1003,'devanand',27);

commit;

alter table ptest read only;

insert into ptest


values(1004,'anand',25);

ORA-12081: update operation not allowed on table "SCOTT"."PTEST"

alter table ptest read write;

insert into ptest


values(1004,'anand',25);

commit;

select * from ptest;

Invisible Indexes: An invisible index is ignored by the optimizer unless you


explicitly set the OPTIMIZER_USE_INVISIBLE_INDEXES initialization parameter to TRUE
or using INDEX hint. Making an index invisible is an alternative to making it
unusable. It can be converted to VISIBLE mode for auto consideration by the
optimizer.
Usage of Invisible Indexes
One can use invisible index for testing the impact of removing an index. Instead of
dropping the index we can make it invisible and its effect.
One can speed up operations by creating invisible indexes for infrequent scenarios.
Invisible index will make sure that the overall performance of the application is
not affected.
Gives you the flexibility to have both b-tree (to guarantee unique PK) as well as
bitmap indexes (on FK columns) in a data warehouse application.

CREATE INDEX index_name ON table_name (column_name) INVISIBLE;

ALTER INDEX index_name INVISIBLE;


ALTER INDEX index_name VISIBLE;

Pivot and Unpivot: The PIVOT operator takes data in separate rows, aggregates it
and converts it into columns. The UNPIVOT operator converts column-based data into
separate rows.
(Note: UNPIVOT is not the reverse of a PIVOT operation as it cannot undo
aggregations made by PIVOT.)
PIVOT:
SELECT *
FROM (SELECT job, deptno, sum(sal) sal FROM emp GROUP BY job, deptno)
PIVOT ( sum(sal) FOR deptno IN (10, 20, 30, 40) );
Listagg function in 11g release 2: LISTAGG is a built-in function that enables us
to perform string aggregation natively.
The LISTAGG function has the following syntax structure:
LISTAGG ([,]) WITHIN GROUP (ORDER BY) [OVER (PARTITION BY)]

Das könnte Ihnen auch gefallen