Oracle Database 12c is the latest version of Oracle Corporations flagship database and has added many new features. In this presentation I am capturing.

Slides:



Advertisements
Similar presentations
CHAPTER 4 Tablespaces and Datafiles. Introduction After installing the binaries, creating a database, and configuring your environment, the next logical.
Advertisements

ITEC474 INTRODUCTION.
5 Copyright © 2005, Oracle. All rights reserved. Managing Database Storage Structures.
Overview of Database Administrator (DBA) Tools
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 2 Overview of Database Administrator (DBA) Tools.
Page Footer Keed Education Oracle Database Administration Basic Copyright 2009 Keed Education BV Version Concept.
System Administration Accounts privileges, users and roles
Harvard University Oracle Database Administration Session 2 System Level.
Harvard University Oracle Database Administration Session 5 Data Storage.
10 Copyright © 2009, Oracle. All rights reserved. Managing Undo Data.
Backup and Recovery Part 1.
Chapter 5 Configuring the RMAN Environment. Objectives Show command to see existing settings Configure command to change settings Backing up the controlfile.
9 Copyright © Oracle Corporation, All rights reserved. Oracle Recovery Manager Overview and Configuration.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
CHAPTER 11 Large Objects. Need for Large Objects Data type to store objects that contain large amount of text, log, image, video, or audio data. Most.
Bordoloi and Bock CURSORS. Bordoloi and Bock CURSOR MANIPULATION To process an SQL statement, ORACLE needs to create an area of memory known as the context.
Database Administration TableSpace & Data File Management
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Chapter 6 Additional Database Objects
Basic Oracle Architecture
By Lecturer / Aisha Dawood 1.  Administering Users  Create and manage database user accounts.  Create and manage roles.  Grant and revoke privileges.
5 Copyright © 2004, Oracle. All rights reserved. Using Recovery Manager.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
Database Technical Session By: Prof. Adarsh Patel.
1 Oracle Database 11g – Flashback Data Archive. 2 Data History and Retention Data retention and change control requirements are growing Regulatory oversight.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
Architecture Rajesh. Components of Database Engine.
Introduction to SEQUEL. What is SEQUEL? Acronym for Structural English Query Language Acronym for Structural English Query Language Standard language.
Database Systems Slide 1 Database Systems Lecture 5 Overview of Oracle Database Architecture - Concept Manual : Chapters 1,8 Lecturer : Dr Bela Stantic.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing.
Copyright © Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
An Oracle server:  Is a database management system that provides an open, comprehensive, integrated approach to information management.  Consists.
Triggers A Quick Reference and Summary BIT 275. Triggers SQL code permits you to access only one table for an INSERT, UPDATE, or DELETE statement. The.
9 Copyright © Oracle Corporation, All rights reserved. Creating and Managing Tables.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Introduction to Oracle. Oracle History 1979 Oracle Release client/server relational database 1989 Oracle Oracle 8 (object relational) 1999.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
7 Copyright © 2005, Oracle. All rights reserved. Managing Undo Data.
Database structure and space Management. Segments The level of logical database storage above an extent is called a segment. A segment is a set of extents.
1 © 2010 Julian Dyke Edition-Based Redefinition Julian Dyke Independent Consultant juliandyke.com Web Version.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Objectives Database triggers and syntax
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 9 Database Triggers.
IT Database Administration Section 09. Backup and Recovery Backup: The available options Full Consistent (cold) Backup Database shutdown, all files.
D Copyright © Oracle Corporation, All rights reserved. Loading Data into a Database.
PL/SQLPL/SQL Oracle11g: PL/SQL Programming Chapter 9 Database Triggers.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 9 Database Triggers.
3 Copyright © 2006, Oracle. All rights reserved. Using Recovery Manager.
Altering Tables and Constraints Database Systems Objectives Add and modify columns. Add, enable, disable, or remove constraints. Drop a table. Remove.
12 Copyright © Oracle Corporation, All rights reserved. User-Managed Complete Recovery.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
Intro To Oracle :part 1 1.Save your Memory Usage & Performance. 2.Oracle Login ways. 3.Adding Database to DB Trees. 4.How to Create your own user(schema).
1 11g NEW FEATURES ByVIJAY. 2 AGENDA  RESULT CACHE  INVISIBLE INDEXES  READ ONLY TABLES  DDL WAIT OPTION  ADDING COLUMN TO A TABLE WITH DEFAULT VALUE.
1 Database Fundamentals Introduction to SQL. 2 SQL Overview Structured Query Language The standard for relational database management systems (RDBMS)
SQL Triggers, Functions & Stored Procedures Programming Operations.
 CONACT UC:  Magnific training   
20 Copyright © 2006, Oracle. All rights reserved. Best Practices and Operational Considerations.
Views / Session 3/ 1 of 40 Session 3 Module 5: Implementing Views Module 6: Managing Views.
23 Copyright © 2004, Oracle. All rights reserved. Preferring the Past: Flashback.
10 Copyright © 2007, Oracle. All rights reserved. Managing Undo Data.
Fundamentals of DBMS Notes-1.
Table spaces.
How To Pass Oracle 1z0-060 Exam In First Attempt?
Using Data Dictionary and Dynamic Performance Views
Physical Database Structure .
Prof. Arfaoui. COM390 Chapter 9
Presentation transcript:

Oracle Database 12c is the latest version of Oracle Corporations flagship database and has added many new features. In this presentation I am capturing the few important new additions and enhancements introduced in the area of Database Administration, and for developers.

 Invisible column  Multiple indexes on the same column  Limiting ROWS for Top-N query results  Miscellaneous SQL*Plus enhancements  Session level sequences  WITH clause improvements  Extended data types  How to truncate a master table while child tables contain data

 Online migration of an active data file  DDL logging  Temporary undo in- and- outs  New backup user privilege  How to execute SQL statement in RMAN  Table level recovery in RMAN  Restricting PGA size  Online table partition or sub-partition migration

 Table partition maintenance enhancements  Database upgrade improvements  Restore/Recover data file over the network  Data Pump enhancements  Real-time ADDM  Concurrent statistics gathering

 Invisible columns  Oracle introduced invisible indexes in 11g. In Oracle 12c it introduced invisible column concept  Characteristics: ◦ When a column is defined as invisible, the column will never appear in generic queries, for example, select * from employee; unless the column is explicitly referred to in the SQL statement or condition, or DESCRIBED in the table definition. ◦ Easy to add or modify a column to be invisible and vice versa

When inserting value in invisible column, you must explicitly refer to the invisible column name with the INSERT statement. A virtual column or partition column can be defined as invisible too. Temporary tables, external tables and cluster tables will not support invisible columns.  Benefits: ◦ hide important data –columns from being displayed in the generic queries– we used to create a view hiding the required information or apply some sort of security conditions.

 How to add column: ◦ CREATE TABLE employee ◦ (eno number(6), ◦ ename name varchar2(40), ◦ sal number(9) INVISIBLE);  How to make column visible: ◦ SQL> ALTER TABLE emp MODIFY (sal visible);

 In Oracle 11g, you cannot create multiple indexes on the same column or set of columns. For instance, if you have an index on column A, you cannot create another index on the same column.  In 12c, you can have multiple indexes on the same column as long as the index type is different.  Only one type of index is usable/visible at a given time.  In order to test the invisible indexes, you need to set the optimizer_use_use_invisible_indexes=true.

 Following is an example:  SQL> CREATE INDEX emp_ind1 ON EMPLOYEE (ENO);  SQL> CREATE BITMAP INDEX emp_ind2 ON EMP(ENO) INVISIBLE;

 In the previous releases, there wasn’t a direct option provided to truncate a master table while it is referred to by the child tables and child records exist.  The TRUNCATE TABLE with CASCADE option in 12c truncates the records in the master table and automatically initiates recursive truncate on child tables too  subject to foreign key reference as DELETE ON CASCADE.  There is no CAP on the number of recursive levels as it will apply on all child, grand child and great grandchild etc.

 This enhancement gets rid of the prerequisite to truncate all child records before truncating a master table.  The new CASCADE clause can also be applied on table partitions and sub-partitions etc.  SQL> TRUNCATE TABLE CASCADE;   SQL> TRUNCATE TABLE PARTITION CASCADE;  An ORA error will be thrown if no ON DELETE CASCADE option is defined with the foreign keys of the child tables.

 There are various indirect approaches/methods exist to fetch Top-N query results for top/bottom rows in the previous releases.  In 12c, retrieving Top-N query results for top/bottom rows simplified and become straight forward with the new FETCH FIRST|NEXT|PERCENT clauses.  In order to retrieve top 10 salaries from EMP table, use the following new SQL statement: ◦ SQL> SELECT eno,ename,sal FROM emp ORDER BY SAL DESC FETCH FIRST 10 ROWS ONLY;

 The following example fetches all similar records of Nth row. For example, if the 10th row has salary of 5000 value, and there are other employees whose salary matches with the Nth value, they will also be fetched upon mentioning WITH TIES clause  SQL> SELECT eno,ename,sal FROM emp ORDER BY SAL DESC FETCH FIRST 10 ROWS ONLY WITH TIES;

 The following example limits the fetch to 10 per cent from the top salaries in the EMP table:  SQL> SELECT eno,ename,sal FROM emp ORDER BY SAL DESC FETCH FIRST 10 PERCENT ROWS ONLY;  The following example offsets the first 5 rows and will display the next 5 rows from the table:  SQL> SELECT eno,ename,sal FROM emp ORDER BY SAL DESC OFFSET 5 ROWS FETCH NEXT 5 ROWS ONLY;  All these limits can be very well used within the PL/SQL block too.  BEGIN SELECT sal BULK COLLECT INTO sal_v FROM EMP FETCH FIRST 100 ROWS ONLY; END;

 Implicit Results on SQL*Plus:  SQL*Plus in 12c returns results from an implicit cursor of a PL/SQL block without actually binding it to a RefCursor.  The new dbms_sql.return_result procedure will return and formats the results of SELECT statement query specified within PL/SQL block.  The following code descries the usage: ◦ SQL> CREATE PROCEDURE mp1 as res1 sys_refcursor; BEGIN open res1 for SELECT eno,ename,sal FROM emp; dbms_sql.return_result(res1); END; SQL> execute mp1; When the procedure is executed, it return the formatted rows on the SQL*Plus.

 Display invisible columns:  Previously, I have explained and demonstrated about invisible columns new feature. When the columns are defined as invisible, they won’t be displayed when you describe the table structure. However, you can display the information about the invisible columns by setting the following on the SQL*Plus prompt:  SQL> SET COLINVISIBLE ON|OFF  The above setting is only valid for DESCRIBE command. It has not effect on the SELECT statement results on the invisible columns.

 A new SESSION level database sequence can be created now in 12c to support the session level sequence values. These types of sequences are most useful and suitable on global temporary tables that have session level existence.  Session level sequences produce a unique range of values that are limited within the session, not across the sessions. Once the session ends, the state of the session sequences also goes away.

 The following example explains creating a session level sequence: SQL> CREATE SEQUENCE my_seq START WITH 1 INCREMENT BY 1 SESSION; SQL> ALTER SEQUENCE my_seq GLOBAL|SESSION; The CACHE, NOCACHE, ORDER or NOORDER clauses are ignored for SESSION level sequences.

 Extended data types  In 12c, the data type VARCHAR2, NAVARCHAR2, and RAW size will support up to 32,767 bytes in contrast to 4,000 and 2,000 in the earlier releases. The extended character size will reduce the use of going for LOB data types, whenever possible. In order to enable the extended character size, you will have to set theMAX_STRING_SIZE initialization database parameter to EXTENDED.  The following procedure need to run to use the extended data types:  Shutdown the database  Restart the database in UPGRADE mode  Modify the parameter: ALTER SYSTEM SET MAX_STRING_SIZE=EXTENDED;  Execute utl32k.sql as sysdba :  Shutdown the database  Restart the database in READ WRITE mode

 Online rename and relocation of an active data file  Unlike in the previous releases, a data file migration or renaming in Oracle database 12c R1 no longer requires a number of steps i.e. putting the tablespace in READ ONLY mode, followed by data file offline action. In 12c R1, a data file can be renamed or moved online simply using the ALTER DATABASE MOVE DATAFILE SQL statement. While the data file is being transferred, the end user can perform queries, DML and DDL tasks. Additionally, data files can be migrated between storages e.g. from non-ASM to ASM and vice versa.  Rename a data file:  SQL> ALTER DATABASE MOVE DATAFILE '/u00/data/users01.dbf' TO '/u00/data/users_01.dbf';Migrate a data file from non-ASM to ASM:  SQL> ALTER DATABASE MOVE DATAFILE '/u00/data/users_01.dbf' TO '+DG_DATA';Migrate a data file from one ASM disk group to another:  SQL> ALTER DATABASE MOVE DATAFILE '+DG_DATA/DBNAME/DATAFILE/users_01.dbf ' TO '+DG_DATA_02';Overwrite the data file with the same name, if it exists at the new location:  SQL> ALTER DATABASE MOVE DATAFILE '/u00/data/users_01.dbf' TO '/u00/data_new/users_01.dbf' REUSE;Copy the file to a new location whilst retaining the old copy in the old location:  SQL> ALTER DATABASE MOVE DATAFILE '/u00/data/users_01.dbf' TO '/u00/data_new/users_01.dbf' KEEP;You can monitor the progress while a data file being moved by querying the v$session_longops dynamic view. Additionally, you can also refer the alert.log of the database where Oracle writes the details about action being taken place.

 DDL logging  There was no direction option available to log the DDL action in the previous releases. In 12cR1, you can now log the DDL action into xml and log files. This will be very useful to know when the drop or create command was executed and by who. The ENABLE_DDL_LOGGING initiation parameter must be configured in order to turn on this feature. The parameter can be set at the database or session levels. When this parameter is enabled, all DDL commands are logged in an xml and a log file under the $ORACLE_BASE/diag/rdbms/DBNAME/log|ddl location. An xml file contains information, such as DDL command, IP address, timestamp etc. This helps to identify when a user or table dropped or when a DDL statement is triggered.  To enable DDL logging  SQL> ALTER SYSTEM|SESSION SET ENABLE_DDL_LOGGING=TRUE;The following DDL statements are likely to be recorded in the xml/log file:  CREATE|ALTER|DROP|TRUNCATE TABLE  DROP USER  CREATE|ALTER|DROP PACKAGE|FUNCTION|VIEW|SYNONYM|SEQUENCE

 Temporary Undo  Each Oracle database contains a set of system related tablespaces, such as, SYSTEM, SYSAUX, UNDO & TEMP, and each are used for different purposes within the Oracle database. Pre Oracle 12c R1, undo records generated by the temporary tables used to be stored in undo tablespace, much similar to a general/persistent table undo records. However, with the temporary undo feature in 12c R1, the temporary undo records can now be stored in a temporary table instead of stored in undo tablespace. The prime benefits of temporary undo includes: reduction in undo tablespace and less redo data generation as the information won’t be logged in redo logs. You have the flexibility to enable the temporary undo option either at session level or database level.  Enabling temporary undo  To be able to use the new feature, the following needs to be set:  Compatibility parameter must be set to or higher  Enable TEMP_UNDO_ENABLED initialization parameter  Since the temporary undo records now stored in a temp tablespace, you need to create the temporary tablespace with sufficient space  For session level, you can use: ALTER SESSION SET TEMP_UNDO_ENABLE=TRUE;

 How to execute SQL statement in RMAN  In 12c, you can now execute any SQL and PL/SQL commands in RMAN without the need of a SQL prefix: you can execute any SQL and PLS/SQL commands directly from RMAN. How you can execute SQL statements in RMAN:  RMAN> SELECT username,machine FROM v$session; RMAN> ALTER TABLESPACE users ADD DATAFILE SIZE 121m;

 Restricting PGA size  Pre Oracle 12c R1, there was no option to limit and control the PGA size. Although, you set a certain size toPGA_AGGREGATE_TARGET initialization parameter, Oracle could increase/reduce the size of the PGA dynamically based on the workload and requirements. In 12c, you can set a hard limit on PGA by enabling the automatic PGA management, which requires PGA_AGGREGATE_LIMIT parameter settings. Therefore, you can now set the hard limit on PGA by setting the new parameter to avoid excessive PGA usage.  SQL> ALTER SYSTEM SET PGA_AGGREGATE_LIMIT=2G; SQL> ALTER SYSTEM SET PGA_AGGREGATE_LIMIT=0; --disables the hard limit  Important notes:  When the current PGA limits exceeds, Oracle will automatically terminates/abort the session/process that holds the most untenable PGA memory.