SlideShare a Scribd company logo
Oracle 9i is fully SQL:1999 join compliant.

CROSS JOIN (Cartesian Product).

SELECT
            E.ENAME, D.DNAME
     FROM
         EMP E CROSS JOIN DEPT D;

NATURAL JOIN (Equijoin on All Identically Named Columns).

SELECT
            E.ENAME, D.DNAME
     FROM
            EMP E NATURAL JOIN DEPT D;


USING clause (Similar to a Natural Join, but allows for the designation of which
column(s) to use in the equijoin).

SELECT
            E.ENAME, D.DNAME
     FROM
            EMP E JOIN DEPT D USING (DEPTNO);

ON clause (Used to define columns to join on)

SELECT
            E.ENAME, D.DNAME
     FROM
            EMP E JOIN DEPT D ON (E.DEPTNO = D.DEPTNO);


LEFT OUTER JOIN (All records from first table with matching rows from second)

SELECT
            E.ENAME, D.DNAME
     FROM
            EMP E LEFT OUTER JOIN DEPT D ON (E.DEPTNO = D.DEPTNO);


RIGHT OUTER JOIN (All records from second table with matching rows from first)

SELECT
            E.ENAME, D.DNAME
     FROM
            EMP E RIGHT OUTER JOIN DEPT D ON (E.DEPTNO = D.DEPTNO);


FULL OUTER JOIN (All records from both tables—Identical to a union of left outer
join and right outer join)

SELECT
            E.ENAME, D.DNAME
     FROM
            EMP E FULL OUTER JOIN DEPT D ON (E.DEPTNO = D.DEPTNO);

Keyword OUTER is optional with RIGHT,LEFT or FULL.

--------------------------------------------------------------------------------
--


Oracle 9i has also introduced several new functions:
NULLIF(expr1, expr2) —Returns NULL if the first argument is equal to the second,
otherwise returns the first argument.

COALESCE(expr1, expr2, expr3, ...) —Returns the first non-null argument.


CASE Statement

SELECT ENAME, EXTRACT(YEAR FROM HIREDATE) AS YEAR_OF_HIRE,
  (CASE EXTRACT(YEAR FROM HIREDATE)
      WHEN 2002 THEN 'NEW HIRE'
      WHEN 1997 THEN 'FIVE YEARS SERVICE'
      WHEN 1992 THEN 'TEN YEARS SERVICE'
      ELSE 'NO AWARD THIS YEAR'
   END ) AS AWARD
FROM EMP;

CASE Expression

SELECT ENAME, SAL,
         (CASE
              WHEN JOB = —DBA— THEN SAL * 1.5
              WHEN HIREDATE < SYSDATE - TO_YMINTERVAL(—05-00—) THEN SAL * 1.25
              WHEN DEPTNO IN (40,30,10) THEN SAL * 1.1
              ELSE SAL * .9
            END ) AS NEW_SAL
      FROM EMP;



Explicit Defaults —Oracle 9i now allows for the keyword DEFAULT to be used in
INSERT or UPDATE statements:

INSERT INTO EMP (EMPNO, ENAME, DEPTNO)
      VALUES (8000,—MIKE—,DEFAULT);

UPDATE EMP SET COMM = DEFAULT;


MERGE Statement. —This excellent feature also known as an UPSERT will either do
an insert or an update depending on the existence of the record in the target
table.

MERGE INTO T1
      USING T2 ON (T1.C9=T2.C9)
      WHEN MATCHED THEN UPDATE SET T1.C1=T2.C2, T1.C2=T2.C2 ...
      WHEN NOT MATCHED THEN INSERT (C1,C2, ...) VALUES (C1,C2, ...);



Multiple Table Inserts Statement. —Allows for insertion into multiple tables as
part of a single DML statement.

UNCONDITIONAL
INSERT ALL
INTO T1 (C1, C2, ...) VALUES (C1, C2, ...)
INTO T2 (C1, C2, ...) VALUES (C1, C2, ...)
...
SELECT C1, C2, ... FROM T9;

CONDITIONAL —FIRST will only insert into the first statement that returns true,
ALL will insert into each statement that returns true.
INSERT [ALL|FIRST]
WHEN c1 = 1 THEN INTO T1 (C1, C2, ...) VALUES (C1, C2, ...)
WHEN c1 = 2 THEN INTO T2 (C1, C2, ...) VALUES (C1, C2, ...)
WHEN c2 = 3 THEN INTO T3 (C1, C2, ...) VALUES (C1, C2, ...)
...
SELECT C1, C2, ... FROM T9;



We also have several new conversion functions:

TO_TIMESTAMP —From String to Timestamp.
TO_TIMESTAMP_TZ —From String to Timestamp with Time Zone.

TO_DSINTERVAL —From String to Interval Day to Second.
TO_YMINTERVAL —From String to Interval Year to Month

TO_CHAR —Extended to accept the new format characters.

EXTRACT —Returns the requested value (as a number) from a datetime or interval
datatype. Options are Year, Month, Day, Hour, Minute, Second, Timezone_Hour,
Timezone_Minute, Timezone_Region, or Timezone_ABBR.
SELECT EXTRACT(YEAR FROM SYSDATE) FROM DUAL;



DBMS_METADATA is a package that allows for object DDL to be retrieved from the
database.
This package will work for tables, indexes, views, packages, functions,
procedures, triggers, synonyms, and types.

DBMS_METADATA has functions for casual use:
DBMS_METADATA.GET_DDL(object_type, name, schema)
DBMS_METADATA.GET_XML(object_type, name, schema)

--

SELECT DBMS_METADATA.GET_DDL(—TABLE—, —EMP—, —SCOTT—) from dual;
  CREATE TABLE "SCOTT"."EMP"
   (    "EMPNO" NUMBER(4,0),
        "ENAME" VARCHAR2(10),
        "JOB" VARCHAR2(9),
        "MGR" NUMBER(4,0),
        "HIREDATE" DATE,
        "SAL" NUMBER(7,2),
        "COMM" NUMBER(7,2),
        "DEPTNO" NUMBER(2,0),
         CONSTRAINT "PK_EMP" PRIMARY KEY ("EMPNO")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0
  FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS"   ENABLE,
         CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO")
  REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE NOVALIDATE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0
  FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS"

--

External tables are flat files stored outside of the database that Oracle treats
as a table.
The data is read-only and no indexes can be created.

Object rights are controlled through —SELECT TABLE— and —READ DIRECTORY—
privileges.

UTL_FILE_DIR must be set appropriately.



CREATE DIRECTORY external_tables AS —c:oracleoradataexternal—;

CREATE TABLE EMP_EXT (EMPNO NUMBER(4,0), ENAME VARCHAR2(10), JOB VARCHAR2(9),
MGR NUMBER(4,0), HIREDATE DATE, SAL NUMBER(7,2), COMM NUMBER(7,2), DEPTNO
NUMBER(2,0))
   ORGANIZATION EXTERNAL
   (TYPE oracle_loader
   DEFAULT DIRECTORY external_tables
   ACCESS PARAMETERS
     (RECORDS DELIMITED BY NEWLINE
      BADFILE external_tables:—bad_emp_ext.txt—
      LOGFILE external_tables:—log_emp_ext.txt—
      FIELDS TERMINATED BY —,—
      MISSING FIELD VALUES ARE NULL)
      LOCATION (—emp.txt—))
   REJECT LIMIT UNLIMITED

     --

Once the table metadata has been created (as in the previous slide) , then this
table can be queried just like any other table. This includes functions, joins,
etc.


Two new views help in the administration of these external tables:
DBA_EXTERNAL_TABLES lists the attributes of each external table in the database.
DBA_EXTERNAL_LOCATIONS lists the specific flat files and their associated
directories.

--

Flashback Query allows users to see a consistent view of the database at a point
in time in the past.

This view of the data is read-only.

This view of the data is re-created by undo and is only available if the undo
blocks are still available.

PL/SQL cursors opened in flashback mode are available for DML after flashback
mode is disabled.

Flashback Query is also supported by EXP.

--

EXEC DBMS_FLASHBACK.ENABLE_AT_TIME(
    TO_DATE(—03-20-2002 14:00:00—,—MM-DD-YYYY HH24:MI:SS—));

Oracle uses a new table, SMON_SCN_TIME to translate timestamps to SCNs.
Documentation states that it only tracks the last five days and is only in five
minute increments.

SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;
This is a excellent new feature for capturing the current SCN.

EXEC DBMS_FLASHBACK.DISABLE;

--

Automatic Undo Management

UNDO_MANAGEMENT (MANUAL or AUTO)
Specifies whether or not to use AUM.   Default = MANUAL

UNDO_TABLESPACE (valid tablespace)
Specifies which undo tablespace to use.

UNDO_RETENTION (in seconds default=30)
Specifies how long to keep committed undo.

UNDO_SUPPRESS_ERRORS (TRUE or FALSE)
Specifies whether or not to return an exception when —SET TRANSACTION USE
ROLLBACK SEGMENT— is issued. Default = TRUE

--

DBA_ROLLBACK_SEGS, V$TRANSACTION, V$ROLLSTAT, are V$ROLLNAME are still
available.


DBA_UNDO_EXTENTS shows when each extent in the undo tablespace was committed.
#
V$UNDOSTAT shows the undo usage for the last 24 hours. Each row records a ten
minute interval defined by START_TIME and END_TIME. The key field is
UNDO_BLOCKS.

--

Things You Can Do With Online Redefinition

Move a table or index to a new tablespace
Change a table—s organization (partitioning, index-organized, etc.)
Add, remove, or rename columns in a table
Change the data type of a column in a table
Add new indexes to a table
Change constraint definitions on a table

--

The dbms_redefinition Package

Use the five procedures in this package to redefine an object online.
CAN_REDEF_TABLE
START_REDEF_TABLE
FINISH_REDEF_TABLE
ABORT_REDEF_TABLE
SYNC_INTERIM_TABLE

--

Other Enhancements

Index Monitoring Usage.
ALTER INDEX INDEX_NAME MONOITORING USAGE;
V$OBJECT_USAGE
Skip Scanning of Indexes.
Real Application Clusters (RAC).
Cache Fusion Block Transfer.
Oracle Managed Files (OMF)
DROP TABLESPACE TBS_01 INCLUDING CONTENTS AND DATAFILES;
Default temporary tablespace.
ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP;
Constraints on Views.
Log Miner Enhancements.
CURSOR_SHARING=SIMILAR

--

More Enhancements

EXP TABLESPACES=()
DBMS_STATS.GATHER_SYSTEM_STATS.
RMAN Enhancements.
Data Guard (formerly Standby Database).
Log Transport Services.
 LOG_ARCHIVE_DEST_n where n = 1-10.
 ARCHIVE_LAG_TARGET
Workspace Manager.
Data versioning.
SVRMGR is Deprecated.
CONNECT INTERNAL

--

More Related Content

PPT
Les10[1]Creating and Managing Tables
PPT
Oracle training in hyderabad
DOC
ORACLE NOTES
PPT
Les10
PPT
Les05[1]Aggregating Data Using Group Functions
PPT
Les12[1]Creating Views
PDF
Data Definition Language (DDL)
Les10[1]Creating and Managing Tables
Oracle training in hyderabad
ORACLE NOTES
Les10
Les05[1]Aggregating Data Using Group Functions
Les12[1]Creating Views
Data Definition Language (DDL)

What's hot (20)

PPT
Les03[1] Single-Row Functions
PPT
Les12
PPT
Les09[1]Manipulating Data
ODP
Mysqlppt
 
PPT
Les09
PPT
Les11
PDF
SQL Macros - Game Changing Feature for SQL Developers?
PPTX
Oracle: DML
DOC
SQLQueries
PPT
Les22[1]Advanced Explicit Cursor Concepts
PDF
MERGE SQL Statement: Lesser Known Facets
PPT
Les03
PPT
Les13[1]Other Database Objects
PPT
Les01
PDF
Database Oracle Basic
PPT
Les07[1]Multiple-Column Subqueries
ODP
Les03[1] Single-Row Functions
Les12
Les09[1]Manipulating Data
Mysqlppt
 
Les09
Les11
SQL Macros - Game Changing Feature for SQL Developers?
Oracle: DML
SQLQueries
Les22[1]Advanced Explicit Cursor Concepts
MERGE SQL Statement: Lesser Known Facets
Les03
Les13[1]Other Database Objects
Les01
Database Oracle Basic
Les07[1]Multiple-Column Subqueries
Ad

Similar to Oracle 9i notes([email protected]) (20)

PPT
Sql dml & tcl 2
PPTX
unit 3.pptx notes very important prepare
PPT
Oracle tips and tricks
PPTX
My SQL.pptx
PDF
SQL learning notes and all code.pdf
PDF
1670595076250.pdf
PDF
Cheat sheet SQL commands with examples and easy understanding
PDF
SQL 🌟🌟🔥.pdf
PPTX
SQL Server Select Topics
PPTX
ADVANCE ITT BY PRASAD
DOC
Most useful queries
DOC
Sql Queries
DOC
Oracle
ODP
Mysql1
PPTX
SQl data base management and design
PPSX
Oracle Training in Kochi | Trivandrum |Thrissur
PPTX
Introduction to sql new
DOC
SQL
DOC
Oracle SQL AND PL/SQL
PPT
Mysql
Sql dml & tcl 2
unit 3.pptx notes very important prepare
Oracle tips and tricks
My SQL.pptx
SQL learning notes and all code.pdf
1670595076250.pdf
Cheat sheet SQL commands with examples and easy understanding
SQL 🌟🌟🔥.pdf
SQL Server Select Topics
ADVANCE ITT BY PRASAD
Most useful queries
Sql Queries
Oracle
Mysql1
SQl data base management and design
Oracle Training in Kochi | Trivandrum |Thrissur
Introduction to sql new
SQL
Oracle SQL AND PL/SQL
Mysql
Ad

Recently uploaded (20)

PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
Updated Idioms and Phrasal Verbs in English subject
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Complications of Minimal Access Surgery at WLH
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Cell Structure & Organelles in detailed.
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
master seminar digital applications in india
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Lesson notes of climatology university.
Paper A Mock Exam 9_ Attempt review.pdf.
A systematic review of self-coping strategies used by university students to ...
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Updated Idioms and Phrasal Verbs in English subject
LDMMIA Reiki Yoga Finals Review Spring Summer
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Complications of Minimal Access Surgery at WLH
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Final Presentation General Medicine 03-08-2024.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Microbial disease of the cardiovascular and lymphatic systems
Cell Structure & Organelles in detailed.
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
What if we spent less time fighting change, and more time building what’s rig...
Chinmaya Tiranga quiz Grand Finale.pdf
master seminar digital applications in india
Microbial diseases, their pathogenesis and prophylaxis
Orientation - ARALprogram of Deped to the Parents.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Lesson notes of climatology university.

Oracle 9i notes([email protected])

  • 1. Oracle 9i is fully SQL:1999 join compliant. CROSS JOIN (Cartesian Product). SELECT E.ENAME, D.DNAME FROM EMP E CROSS JOIN DEPT D; NATURAL JOIN (Equijoin on All Identically Named Columns). SELECT E.ENAME, D.DNAME FROM EMP E NATURAL JOIN DEPT D; USING clause (Similar to a Natural Join, but allows for the designation of which column(s) to use in the equijoin). SELECT E.ENAME, D.DNAME FROM EMP E JOIN DEPT D USING (DEPTNO); ON clause (Used to define columns to join on) SELECT E.ENAME, D.DNAME FROM EMP E JOIN DEPT D ON (E.DEPTNO = D.DEPTNO); LEFT OUTER JOIN (All records from first table with matching rows from second) SELECT E.ENAME, D.DNAME FROM EMP E LEFT OUTER JOIN DEPT D ON (E.DEPTNO = D.DEPTNO); RIGHT OUTER JOIN (All records from second table with matching rows from first) SELECT E.ENAME, D.DNAME FROM EMP E RIGHT OUTER JOIN DEPT D ON (E.DEPTNO = D.DEPTNO); FULL OUTER JOIN (All records from both tables—Identical to a union of left outer join and right outer join) SELECT E.ENAME, D.DNAME FROM EMP E FULL OUTER JOIN DEPT D ON (E.DEPTNO = D.DEPTNO); Keyword OUTER is optional with RIGHT,LEFT or FULL. -------------------------------------------------------------------------------- -- Oracle 9i has also introduced several new functions:
  • 2. NULLIF(expr1, expr2) —Returns NULL if the first argument is equal to the second, otherwise returns the first argument. COALESCE(expr1, expr2, expr3, ...) —Returns the first non-null argument. CASE Statement SELECT ENAME, EXTRACT(YEAR FROM HIREDATE) AS YEAR_OF_HIRE, (CASE EXTRACT(YEAR FROM HIREDATE) WHEN 2002 THEN 'NEW HIRE' WHEN 1997 THEN 'FIVE YEARS SERVICE' WHEN 1992 THEN 'TEN YEARS SERVICE' ELSE 'NO AWARD THIS YEAR' END ) AS AWARD FROM EMP; CASE Expression SELECT ENAME, SAL, (CASE WHEN JOB = —DBA— THEN SAL * 1.5 WHEN HIREDATE < SYSDATE - TO_YMINTERVAL(—05-00—) THEN SAL * 1.25 WHEN DEPTNO IN (40,30,10) THEN SAL * 1.1 ELSE SAL * .9 END ) AS NEW_SAL FROM EMP; Explicit Defaults —Oracle 9i now allows for the keyword DEFAULT to be used in INSERT or UPDATE statements: INSERT INTO EMP (EMPNO, ENAME, DEPTNO) VALUES (8000,—MIKE—,DEFAULT); UPDATE EMP SET COMM = DEFAULT; MERGE Statement. —This excellent feature also known as an UPSERT will either do an insert or an update depending on the existence of the record in the target table. MERGE INTO T1 USING T2 ON (T1.C9=T2.C9) WHEN MATCHED THEN UPDATE SET T1.C1=T2.C2, T1.C2=T2.C2 ... WHEN NOT MATCHED THEN INSERT (C1,C2, ...) VALUES (C1,C2, ...); Multiple Table Inserts Statement. —Allows for insertion into multiple tables as part of a single DML statement. UNCONDITIONAL INSERT ALL INTO T1 (C1, C2, ...) VALUES (C1, C2, ...) INTO T2 (C1, C2, ...) VALUES (C1, C2, ...) ... SELECT C1, C2, ... FROM T9; CONDITIONAL —FIRST will only insert into the first statement that returns true, ALL will insert into each statement that returns true.
  • 3. INSERT [ALL|FIRST] WHEN c1 = 1 THEN INTO T1 (C1, C2, ...) VALUES (C1, C2, ...) WHEN c1 = 2 THEN INTO T2 (C1, C2, ...) VALUES (C1, C2, ...) WHEN c2 = 3 THEN INTO T3 (C1, C2, ...) VALUES (C1, C2, ...) ... SELECT C1, C2, ... FROM T9; We also have several new conversion functions: TO_TIMESTAMP —From String to Timestamp. TO_TIMESTAMP_TZ —From String to Timestamp with Time Zone. TO_DSINTERVAL —From String to Interval Day to Second. TO_YMINTERVAL —From String to Interval Year to Month TO_CHAR —Extended to accept the new format characters. EXTRACT —Returns the requested value (as a number) from a datetime or interval datatype. Options are Year, Month, Day, Hour, Minute, Second, Timezone_Hour, Timezone_Minute, Timezone_Region, or Timezone_ABBR. SELECT EXTRACT(YEAR FROM SYSDATE) FROM DUAL; DBMS_METADATA is a package that allows for object DDL to be retrieved from the database. This package will work for tables, indexes, views, packages, functions, procedures, triggers, synonyms, and types. DBMS_METADATA has functions for casual use: DBMS_METADATA.GET_DDL(object_type, name, schema) DBMS_METADATA.GET_XML(object_type, name, schema) -- SELECT DBMS_METADATA.GET_DDL(—TABLE—, —EMP—, —SCOTT—) from dual; CREATE TABLE "SCOTT"."EMP" ( "EMPNO" NUMBER(4,0), "ENAME" VARCHAR2(10), "JOB" VARCHAR2(9), "MGR" NUMBER(4,0), "HIREDATE" DATE, "SAL" NUMBER(7,2), "COMM" NUMBER(7,2), "DEPTNO" NUMBER(2,0), CONSTRAINT "PK_EMP" PRIMARY KEY ("EMPNO") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" ENABLE, CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO") REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE NOVALIDATE ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" -- External tables are flat files stored outside of the database that Oracle treats as a table.
  • 4. The data is read-only and no indexes can be created. Object rights are controlled through —SELECT TABLE— and —READ DIRECTORY— privileges. UTL_FILE_DIR must be set appropriately. CREATE DIRECTORY external_tables AS —c:oracleoradataexternal—; CREATE TABLE EMP_EXT (EMPNO NUMBER(4,0), ENAME VARCHAR2(10), JOB VARCHAR2(9), MGR NUMBER(4,0), HIREDATE DATE, SAL NUMBER(7,2), COMM NUMBER(7,2), DEPTNO NUMBER(2,0)) ORGANIZATION EXTERNAL (TYPE oracle_loader DEFAULT DIRECTORY external_tables ACCESS PARAMETERS (RECORDS DELIMITED BY NEWLINE BADFILE external_tables:—bad_emp_ext.txt— LOGFILE external_tables:—log_emp_ext.txt— FIELDS TERMINATED BY —,— MISSING FIELD VALUES ARE NULL) LOCATION (—emp.txt—)) REJECT LIMIT UNLIMITED -- Once the table metadata has been created (as in the previous slide) , then this table can be queried just like any other table. This includes functions, joins, etc. Two new views help in the administration of these external tables: DBA_EXTERNAL_TABLES lists the attributes of each external table in the database. DBA_EXTERNAL_LOCATIONS lists the specific flat files and their associated directories. -- Flashback Query allows users to see a consistent view of the database at a point in time in the past. This view of the data is read-only. This view of the data is re-created by undo and is only available if the undo blocks are still available. PL/SQL cursors opened in flashback mode are available for DML after flashback mode is disabled. Flashback Query is also supported by EXP. -- EXEC DBMS_FLASHBACK.ENABLE_AT_TIME( TO_DATE(—03-20-2002 14:00:00—,—MM-DD-YYYY HH24:MI:SS—)); Oracle uses a new table, SMON_SCN_TIME to translate timestamps to SCNs. Documentation states that it only tracks the last five days and is only in five minute increments. SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;
  • 5. This is a excellent new feature for capturing the current SCN. EXEC DBMS_FLASHBACK.DISABLE; -- Automatic Undo Management UNDO_MANAGEMENT (MANUAL or AUTO) Specifies whether or not to use AUM. Default = MANUAL UNDO_TABLESPACE (valid tablespace) Specifies which undo tablespace to use. UNDO_RETENTION (in seconds default=30) Specifies how long to keep committed undo. UNDO_SUPPRESS_ERRORS (TRUE or FALSE) Specifies whether or not to return an exception when —SET TRANSACTION USE ROLLBACK SEGMENT— is issued. Default = TRUE -- DBA_ROLLBACK_SEGS, V$TRANSACTION, V$ROLLSTAT, are V$ROLLNAME are still available. DBA_UNDO_EXTENTS shows when each extent in the undo tablespace was committed. # V$UNDOSTAT shows the undo usage for the last 24 hours. Each row records a ten minute interval defined by START_TIME and END_TIME. The key field is UNDO_BLOCKS. -- Things You Can Do With Online Redefinition Move a table or index to a new tablespace Change a table—s organization (partitioning, index-organized, etc.) Add, remove, or rename columns in a table Change the data type of a column in a table Add new indexes to a table Change constraint definitions on a table -- The dbms_redefinition Package Use the five procedures in this package to redefine an object online. CAN_REDEF_TABLE START_REDEF_TABLE FINISH_REDEF_TABLE ABORT_REDEF_TABLE SYNC_INTERIM_TABLE -- Other Enhancements Index Monitoring Usage. ALTER INDEX INDEX_NAME MONOITORING USAGE; V$OBJECT_USAGE Skip Scanning of Indexes. Real Application Clusters (RAC).
  • 6. Cache Fusion Block Transfer. Oracle Managed Files (OMF) DROP TABLESPACE TBS_01 INCLUDING CONTENTS AND DATAFILES; Default temporary tablespace. ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP; Constraints on Views. Log Miner Enhancements. CURSOR_SHARING=SIMILAR -- More Enhancements EXP TABLESPACES=() DBMS_STATS.GATHER_SYSTEM_STATS. RMAN Enhancements. Data Guard (formerly Standby Database). Log Transport Services. LOG_ARCHIVE_DEST_n where n = 1-10. ARCHIVE_LAG_TARGET Workspace Manager. Data versioning. SVRMGR is Deprecated. CONNECT INTERNAL --