Test: DML with NOLOGGING
NOLOGGING: Oracle will generate a minimal number of redo log entries in order to protect
the data dictionary, and the operation will probably run faster. Logging can be disabled at
the table level or the tablespace level.
The document provides an overview of the Oracle Database 11g product family, including the Standard Edition, Standard Edition One, and Enterprise Edition. It describes the key features included in each edition. It also outlines several optional features exclusively available for the Enterprise Edition, such as Oracle Active Data Guard, Oracle Advanced Security, Oracle Partitioning, Oracle Real Application Clusters, and various management packs. Finally, it briefly introduces some related Oracle products that can be used to extend the capabilities of the Oracle database, such as Oracle Exadata Storage Server, Oracle Audit Vault, and Oracle Secure Backup.
The document describes steps to identify and repair a block corruption in an Oracle database:
1. Use RMAN's Data Recovery Advisor to list, analyze, and repair the corruption. It identified a corrupted block in the USERS tablespace datafile and recommended restoring it from backup with block media recovery.
2. Verify the corruption using DBVERIFY and validate the tablespace with RMAN backup. Both tools confirmed the single corrupted block.
3. Restore the corrupted block using RMAN block recovery to fix the issue, and revalidate that the tablespace is no longer corrupted.
Basic - Oracle Edition Based Redefinition PresentationN/A
The document discusses Oracle Edition Based Redefinition, which allows upgrading an application while it is in use. Key points include: Edition Based Redefinition introduces editions, editioning views, and crossedition triggers to enable in-place application upgrades. Editions allow different versions of objects to coexist. Editioning views provide a transition between table structures. Crossedition triggers propagate transactions between editions to support concurrent usage of pre- and post-upgrade applications.
DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
DBA Commands and Concepts That Every Developer Should Know was presented by Alex Zaballa, an Oracle DBA with experience in Brazil and Angola. The presentation covered Oracle Flashback Query, Flashback Table, RMAN table recovery, pending statistics, explain plan, DBMS_APPLICATION_INFO, row-by-row vs bulk processing, Virtual Private Database, extended data types, SQL text expansion, identity columns, UTL_CALL_STACK, READ privileges vs SELECT privileges, and online table redefinition. The presentation included demonstrations of many of these concepts.
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
This document summarizes a presentation on DBA commands and concepts that every developer should know. The presentation covers topics such as parallel processing, explain plans, flashback queries, pending statistics, virtual columns, and online table redefinition. It demonstrates several commands and concepts to help developers better understand database administration tasks.
Oracle Database 12.1.0.2 introduced several new features including approximate count distinct, full database caching, pluggable database (PDB) improvements like cloning and state management, JSON support, data redaction, SQL query row limits and offsets, invisible columns, SQL text expansion, calling PL/SQL from SQL, session level sequences, and extended data types support.
Hello Everyone ! Hope everybody doing good in their work and with their busy life.
Today i am listing down some interesting ORA- errors which i found recently as a Beginner, My Good Luck i have solved those too. So, here i am Listing down the errors with solutions.
It happens when you work with oracle, you may face or might be facing.
So, guys ! Be fearless. Have a look over it. If you need any help, Please Please let me know..
Thankyou.
The document provides steps for cloning an Oracle EBS R12 environment from a source (PROD) system to a target (TEST) system. Key steps include:
1. Backing up files and databases from the source including applications files, database parameter files, and database backups.
2. Copying the backed up files to the target system and modifying configuration files to point to the target system.
3. Restoring and recovering the database on the target system using RMAN and modifying datafile names.
4. Running scripts to clone the application tier files and configure the applications.
5. Performing post-clone tasks like dropping and recreating temp tablespaces and cleaning up configuration.
Tony jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
There are several tools available for SQL tuning in Oracle, including those that generate explain plans, analyze trace files, and provide real-time SQL monitoring. The document discusses tuning methodology, generating explain plans with SQL*Plus and Autotrace, tracing using parameters and DBMS_MONITOR, and tools like DBMS_XPLAN, TRCA, SQLTXPLAIN, Oracle Active Report, and Toad. It provides examples of using many of these tools to analyze SQL performance.
The document describes migrating database files from the "+DATA01" disk group to the new "+DATA02" disk group. It involves creating the new disk group, identifying database file locations, copying files to the new disk group using RMAN backups, and switching the database to use the new disk group.
This document provides an overview of database administration tasks in Oracle including creating databases and tablespaces, managing users, granting and revoking privileges, managing passwords, and using roles. The key points covered are:
- How to create databases and tablespaces using the CREATE statements.
- How to create users with the CREATE USER statement and initialize passwords.
- The types of privileges (system and object) and how to grant privileges to users using the GRANT statement.
- How to change user passwords using the ALTER USER statement.
- How to group related privileges as roles and grant roles to users.
- How to revoke privileges from users using the REVOKE statement.
Step by Step Restore rman to different hostOsama Mustafa
1. Take a backup of the database and archived logs on the source system using RMAN.
2. Copy the backup files to the new target system using the same directory structure.
3. Restore the control file, SPFILE, and database files to the target system using RMAN, changing the data file locations and redo log file locations as needed.
4. Open the database with a resetlogs after restoring the database, control file, and archived redo logs from backup.
12c database migration from ASM storage to NON-ASM storageMonowar Mukul
1. The document describes the process of migrating a database from ASM to non-ASM storage. This involves taking backups, changing initialization parameters, creating new datafiles and redo logs in non-ASM locations, mounting and opening the database.
2. Key steps include taking an ASM backup, creating a pfile with new datafile and logfile locations, restoring the controlfile, copying datafiles to the new locations, renaming datafiles, and adding new redo logs.
3. After completing these steps, the database is successfully migrated from ASM to non-ASM storage, with the datafiles and redo logs now residing in normal filesystem locations instead of ASM.
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Alex Zaballa
Oracle Database 12c includes many new tuning features for developers and DBAs. Some key features include:
- Multitenant architecture allows multiple pluggable databases to consolidate workloads on a single database instance for improved utilization and administration.
- In-memory column store enables real-time analytics on frequently accessed data held entirely in memory for faster performance.
- New SQL syntax like FETCH FIRST for row limiting and offsetting provides more readable and intuitive replacements for previous techniques.
- Adaptive query optimization allows queries to utilize different execution plans like switching between nested loops and hash joins based on runtime statistics for improved performance.
Creating a physical standby database 11g on windowsRoo Wall
This document describes the steps to create a physical standby database including:
1. Configuring the primary and standby databases with the same Oracle version and opening the primary in archive log mode.
2. Setting up Oracle Net components and testing connectivity between the databases.
3. Enabling archive logging and log shipping on the primary and duplicating or copying the primary database to the standby.
4. Recovering the standby database and opening it in read-only mode to synchronize the data.
Install and upgrade Oracle grid infrastructure 12.1.0.2Biju Thomas
1) The document describes upgrading an Oracle Grid Infrastructure installation from 12.1.0.1 to 12.1.0.2. There were issues with the rootupgrade script, but moving the ASM SPFILE location resolved it.
2) Key steps included running the Grid Infrastructure 12.1.0.2 installation, applying the PSU patch 19791375, and verifying the services started up successfully from the new Oracle home.
3) Applying the latest OPatch version 12.1.0.1.5 prior to installing the PSU is also documented.
Testing Oracle 12c new features of Database Table rows Archiving. Better for quick recovery information than finding tape, load that and restore somewhere first.
Oracle11g introduces several new security, configuration, and administration features for databases. Security features include case sensitive passwords by default and additional auditing of actions. Configuration is simplified with new memory management parameters and automatic diagnostic repository. Administration enhancements provide options to make tables read-only, shrink temporary tablespaces, and add not null columns without updating existing rows.
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014Alex Zaballa
The document discusses Oracle Flex Cluster and Flex ASM configurations. A Flex Cluster allows running Oracle databases on hub and leaf nodes, where leaf nodes do not require direct access to storage. It also discusses converting existing clusters to Flex Clusters and Flex ASM. Key aspects covered include the use of Grid Naming Service for Flex Clusters, capabilities of hub and leaf nodes, and enhancements in Flex ASM such as larger LUN size support and password file storage in ASM.
The document describes the steps to move an Oracle 12c database from a non-ASM storage to ASM storage. It involves:
1. Checking the current database files and parameters.
2. Creating required directories in ASM for datafiles, controlfiles, online logs etc.
3. Configuring the fast recovery area.
4. Backing up the database files and control file, copying them to ASM, and switching to the copies.
5. Adding new online redo logs to ASM and dropping the old logs.
6. Adding a new tempfile to ASM and dropping the old tempfile.
7. Creating a new SPFILE in ASM.
Oracle applications 11i hot backup cloning with rapid cloneDeepti Singh
This document provides instructions for cloning an Oracle Applications 11i production system (PRODSERVER) to a test system (TESTSERVER) using Rapid Clone hot backup methodology. It outlines 7 stages: 1) prerequisites, 2) prepare source, 3) backup database, 4) copy apps files, 5) copy files to target, 6) configure target database, 7) configure target app tier. Key steps include applying patches, running preclone scripts, putting source database in backup mode, copying files, recovering database on target, and configuring target system.
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
This document contains a summary of an Oracle DBA presentation on DBA commands and concepts that every developer should know. The presentation covered topics such as parallel queries, row chaining, explain plans, flashback queries, pending statistics, bulk processing, virtual private databases, extended data types, identity columns, and online table redefinition. It provided examples and demonstrations of many of these commands and concepts.
Oracle applications 11i hot backup cloning with rapid cloneDeepti Singh
This document provides instructions for cloning an Oracle Applications 11i environment from a production system called PRODSERVER to a test system called TESTSERVER using Rapid Clone hot backup methodology. It involves 7 stages: 1) preparing the source system, 2) putting the database in backup mode and copying files, 3) copying application files, 4) copying files to the target, 5) configuring the target database, 6) configuring the target application tier, and 7) finishing tasks like updating profiles. Key steps include applying required patches, running preclone scripts, copying database and application files, recovering the database using the backup control file, and configuring the cloned application and database tiers.
This document provides instructions for setting up a physical standby database for an Oracle E-Business Suite Release 12.2 database using Oracle 11gR2. It describes configuring the primary database for archiving and adding standby redo logs. It also covers copying the Oracle home to the standby server, modifying initialization parameters, and using RMAN to duplicate the primary database and recover it as a physical standby. Key steps include enabling archive logging on the primary, setting the log archive destination, and starting redo transport services to ship archived logs to the standby.
The document discusses three common ways to improve performance of a MySQL database that is experiencing high load:
1. Upgrade hardware by adding more RAM, faster disks, or more powerful CPUs. This provides a temporary fix but can become exponentially more expensive and does not address underlying issues.
2. Change MySQL configuration settings like tmp_table_size or sort_buffer_size to optimize for specific bottlenecks shown in global status variables, but there are no "silver bullets" and misconfigurations must be addressed.
3. Improve indexing and tune queries by addressing issues like temporary tables on disk, full table scans, and lack of indexes causing full joins or sorting, which can have long term benefits over simply adding resources
The document provides an overview of SQL commands divided into DDL, DML, and DCL categories. DDL includes commands like CREATE, ALTER, and DROP for defining and modifying database schema. DML includes commands like SELECT, INSERT, UPDATE, and DELETE for manipulating data. DCL includes COMMIT, ROLLBACK, and SAVEPOINT for transaction control. Examples of each command are listed along with basic usage examples for DDL, DML, and DCL commands to practice creating tables, inserting, updating, deleting data, and managing transactions.
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
The document provides an overview of DBA commands and concepts that every developer should know. It includes sections on availability of Oracle Database 12c, parallel queries, row chaining and migration, explain plans, Oracle Flashback Query and Table, schema management, rollbacks, pending statistics, bulk processing vs row-by-row, Virtual Private Database, extended data types, SQL text expansion, identity columns, and virtual columns. The presentation aims to help developers better understand database administration tasks and functionality.
Tony jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
There are several tools available for SQL tuning in Oracle, including those that generate explain plans, analyze trace files, and provide real-time SQL monitoring. The document discusses tuning methodology, generating explain plans with SQL*Plus and Autotrace, tracing using parameters and DBMS_MONITOR, and tools like DBMS_XPLAN, TRCA, SQLTXPLAIN, Oracle Active Report, and Toad. It provides examples of using many of these tools to analyze SQL performance.
The document describes migrating database files from the "+DATA01" disk group to the new "+DATA02" disk group. It involves creating the new disk group, identifying database file locations, copying files to the new disk group using RMAN backups, and switching the database to use the new disk group.
This document provides an overview of database administration tasks in Oracle including creating databases and tablespaces, managing users, granting and revoking privileges, managing passwords, and using roles. The key points covered are:
- How to create databases and tablespaces using the CREATE statements.
- How to create users with the CREATE USER statement and initialize passwords.
- The types of privileges (system and object) and how to grant privileges to users using the GRANT statement.
- How to change user passwords using the ALTER USER statement.
- How to group related privileges as roles and grant roles to users.
- How to revoke privileges from users using the REVOKE statement.
Step by Step Restore rman to different hostOsama Mustafa
1. Take a backup of the database and archived logs on the source system using RMAN.
2. Copy the backup files to the new target system using the same directory structure.
3. Restore the control file, SPFILE, and database files to the target system using RMAN, changing the data file locations and redo log file locations as needed.
4. Open the database with a resetlogs after restoring the database, control file, and archived redo logs from backup.
12c database migration from ASM storage to NON-ASM storageMonowar Mukul
1. The document describes the process of migrating a database from ASM to non-ASM storage. This involves taking backups, changing initialization parameters, creating new datafiles and redo logs in non-ASM locations, mounting and opening the database.
2. Key steps include taking an ASM backup, creating a pfile with new datafile and logfile locations, restoring the controlfile, copying datafiles to the new locations, renaming datafiles, and adding new redo logs.
3. After completing these steps, the database is successfully migrated from ASM to non-ASM storage, with the datafiles and redo logs now residing in normal filesystem locations instead of ASM.
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Alex Zaballa
Oracle Database 12c includes many new tuning features for developers and DBAs. Some key features include:
- Multitenant architecture allows multiple pluggable databases to consolidate workloads on a single database instance for improved utilization and administration.
- In-memory column store enables real-time analytics on frequently accessed data held entirely in memory for faster performance.
- New SQL syntax like FETCH FIRST for row limiting and offsetting provides more readable and intuitive replacements for previous techniques.
- Adaptive query optimization allows queries to utilize different execution plans like switching between nested loops and hash joins based on runtime statistics for improved performance.
Creating a physical standby database 11g on windowsRoo Wall
This document describes the steps to create a physical standby database including:
1. Configuring the primary and standby databases with the same Oracle version and opening the primary in archive log mode.
2. Setting up Oracle Net components and testing connectivity between the databases.
3. Enabling archive logging and log shipping on the primary and duplicating or copying the primary database to the standby.
4. Recovering the standby database and opening it in read-only mode to synchronize the data.
Install and upgrade Oracle grid infrastructure 12.1.0.2Biju Thomas
1) The document describes upgrading an Oracle Grid Infrastructure installation from 12.1.0.1 to 12.1.0.2. There were issues with the rootupgrade script, but moving the ASM SPFILE location resolved it.
2) Key steps included running the Grid Infrastructure 12.1.0.2 installation, applying the PSU patch 19791375, and verifying the services started up successfully from the new Oracle home.
3) Applying the latest OPatch version 12.1.0.1.5 prior to installing the PSU is also documented.
Testing Oracle 12c new features of Database Table rows Archiving. Better for quick recovery information than finding tape, load that and restore somewhere first.
Oracle11g introduces several new security, configuration, and administration features for databases. Security features include case sensitive passwords by default and additional auditing of actions. Configuration is simplified with new memory management parameters and automatic diagnostic repository. Administration enhancements provide options to make tables read-only, shrink temporary tablespaces, and add not null columns without updating existing rows.
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014Alex Zaballa
The document discusses Oracle Flex Cluster and Flex ASM configurations. A Flex Cluster allows running Oracle databases on hub and leaf nodes, where leaf nodes do not require direct access to storage. It also discusses converting existing clusters to Flex Clusters and Flex ASM. Key aspects covered include the use of Grid Naming Service for Flex Clusters, capabilities of hub and leaf nodes, and enhancements in Flex ASM such as larger LUN size support and password file storage in ASM.
The document describes the steps to move an Oracle 12c database from a non-ASM storage to ASM storage. It involves:
1. Checking the current database files and parameters.
2. Creating required directories in ASM for datafiles, controlfiles, online logs etc.
3. Configuring the fast recovery area.
4. Backing up the database files and control file, copying them to ASM, and switching to the copies.
5. Adding new online redo logs to ASM and dropping the old logs.
6. Adding a new tempfile to ASM and dropping the old tempfile.
7. Creating a new SPFILE in ASM.
Oracle applications 11i hot backup cloning with rapid cloneDeepti Singh
This document provides instructions for cloning an Oracle Applications 11i production system (PRODSERVER) to a test system (TESTSERVER) using Rapid Clone hot backup methodology. It outlines 7 stages: 1) prerequisites, 2) prepare source, 3) backup database, 4) copy apps files, 5) copy files to target, 6) configure target database, 7) configure target app tier. Key steps include applying patches, running preclone scripts, putting source database in backup mode, copying files, recovering database on target, and configuring target system.
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
This document contains a summary of an Oracle DBA presentation on DBA commands and concepts that every developer should know. The presentation covered topics such as parallel queries, row chaining, explain plans, flashback queries, pending statistics, bulk processing, virtual private databases, extended data types, identity columns, and online table redefinition. It provided examples and demonstrations of many of these commands and concepts.
Oracle applications 11i hot backup cloning with rapid cloneDeepti Singh
This document provides instructions for cloning an Oracle Applications 11i environment from a production system called PRODSERVER to a test system called TESTSERVER using Rapid Clone hot backup methodology. It involves 7 stages: 1) preparing the source system, 2) putting the database in backup mode and copying files, 3) copying application files, 4) copying files to the target, 5) configuring the target database, 6) configuring the target application tier, and 7) finishing tasks like updating profiles. Key steps include applying required patches, running preclone scripts, copying database and application files, recovering the database using the backup control file, and configuring the cloned application and database tiers.
This document provides instructions for setting up a physical standby database for an Oracle E-Business Suite Release 12.2 database using Oracle 11gR2. It describes configuring the primary database for archiving and adding standby redo logs. It also covers copying the Oracle home to the standby server, modifying initialization parameters, and using RMAN to duplicate the primary database and recover it as a physical standby. Key steps include enabling archive logging on the primary, setting the log archive destination, and starting redo transport services to ship archived logs to the standby.
The document discusses three common ways to improve performance of a MySQL database that is experiencing high load:
1. Upgrade hardware by adding more RAM, faster disks, or more powerful CPUs. This provides a temporary fix but can become exponentially more expensive and does not address underlying issues.
2. Change MySQL configuration settings like tmp_table_size or sort_buffer_size to optimize for specific bottlenecks shown in global status variables, but there are no "silver bullets" and misconfigurations must be addressed.
3. Improve indexing and tune queries by addressing issues like temporary tables on disk, full table scans, and lack of indexes causing full joins or sorting, which can have long term benefits over simply adding resources
The document provides an overview of SQL commands divided into DDL, DML, and DCL categories. DDL includes commands like CREATE, ALTER, and DROP for defining and modifying database schema. DML includes commands like SELECT, INSERT, UPDATE, and DELETE for manipulating data. DCL includes COMMIT, ROLLBACK, and SAVEPOINT for transaction control. Examples of each command are listed along with basic usage examples for DDL, DML, and DCL commands to practice creating tables, inserting, updating, deleting data, and managing transactions.
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
The document provides an overview of DBA commands and concepts that every developer should know. It includes sections on availability of Oracle Database 12c, parallel queries, row chaining and migration, explain plans, Oracle Flashback Query and Table, schema management, rollbacks, pending statistics, bulk processing vs row-by-row, Virtual Private Database, extended data types, SQL text expansion, identity columns, and virtual columns. The presentation aims to help developers better understand database administration tasks and functionality.
After completing this lesson, you should be able to do the following:
Describe each DML statement
Insert rows into a table
Update rows in a table
Delete rows from a table
Control transactions
ER Publication,
IJETR, IJMCTR,
Journals,
International Journals,
High Impact Journals,
Monthly Journal,
Good quality Journals,
Research,
Research Papers,
Research Article,
Free Journals, Open access Journals,
erpublication.org,
Engineering Journal,
Science Journals,
1) Oracle 10g introduces flashback query which allows users to query past states of data within a specified time period by accessing the undo logs.
2) Flashback table allows users to recover accidentally dropped tables from the recycle bin.
3) Rollback monitoring provides estimated time to complete long running transactions such as rollbacks.
The document discusses data manipulation language (DML) statements in SQL. It describes how to insert rows into a table using INSERT, update rows using UPDATE, and delete rows from a table using DELETE. It also covers transaction control using COMMIT to save changes permanently and ROLLBACK to undo pending changes back to a savepoint.
This document discusses how to create and manage database tables in Oracle. It describes how to create tables with columns of different data types, alter table definitions by adding or modifying columns, drop and rename tables, and add comments to tables. The key database objects like tables, views, indexes and sequences are also introduced. Common SQL statements used for managing tables like CREATE TABLE, ALTER TABLE, DROP TABLE, COMMENT and more are explained with examples.
SQL is a language used to manage and manipulate databases. It allows users to create, update, and delete data from databases. The main components of SQL are the data query language (DQL) which is used to retrieve data, the data manipulation language (DML) which is used to insert, update and delete data, and the data definition language (DDL) which is used to define and manage database objects like tables and indexes. SQL also supports functions, joins, and other operations to help manage and analyze data in databases.
This document provides an overview of basic SQL statements and SQL*Plus commands. It describes how to select data from tables using the SELECT statement, perform calculations, and give columns aliases. It also summarizes how to describe table structures, edit SQL statements, and execute saved SQL files using SQL*Plus commands. The key capabilities of the SELECT statement are selection, projection, and joining data from multiple tables.
This document discusses data manipulation in Oracle databases. It describes how to insert new rows into tables using the INSERT statement, update existing rows using the UPDATE statement, and delete rows from tables using the DELETE statement. It also covers controlling transactions with commands like COMMIT, ROLLBACK, and SAVEPOINT to ensure data integrity when making multiple changes to a database.
This document provides an overview of basic SQL statements and SQL*Plus commands. It covers capabilities of SELECT statements, executing a basic SELECT statement, writing SQL statements, selecting specific columns, using arithmetic expressions and operators, defining aliases and literals, eliminating duplicate rows, and interacting with SQL*Plus through commands like editing, saving, and running SQL statements.
This document discusses various SQL concepts including data types, data definition language (DDL), data manipulation language (DML), constraints, and transactions. It provides examples of creating tables with different data types, inserting, updating, and deleting data, setting constraints, and using transactions like commit and rollback. Key points covered include creating a table with a timestamp column, using case expressions, cursor for loops, and nested procedures and exception handling.
This document provides examples of using various Oracle Database flashback features including:
1) Flashback at the table level to before a drop, to a specific System Change Number (SCN), and to a timestamp.
2) Creating restore points and flashing back a table to a specific restore point.
3) Flashing back the entire database to a timestamp or SCN using Flashback Database.
This document provides an introduction and overview of PostgreSQL, including its history, features, installation, usage and SQL capabilities. It describes how to create and manipulate databases, tables, views, and how to insert, query, update and delete data. It also covers transaction management, functions, constraints and other advanced topics.
After completing this lesson, you should be able to do the following:
Describe the main database objects
Create tables
Describe the datatypes that can be used when specifying column definition
Alter table definitions
Drop, rename, and truncate tables
The document provides an overview of basic SQL statements and capabilities. It discusses using SELECT statements to project columns, select rows, and join tables. It also covers arithmetic expressions, column aliases, concatenation, and eliminating duplicate rows. SQL statements are executed through the SQL*Plus environment, which allows editing, saving, and running SQL code and commands.
The document discusses various Transact-SQL functions and features including:
1) Sequence objects that generate unique numbers and can be used to automatically populate columns. String functions like CONCAT and FORMAT are demonstrated for concatenating and formatting strings.
2) Logical functions such as IIF and CHOOSE are shown. Date/time functions like DATEFROMPARTS and PARSE are used to extract dates from strings.
3) Paging results with OFFSET and FETCH is covered along with using sequences to generate unique IDs and row numbers when paging query results.
1. Test: DML with NOLOGGING
NOLOGGING: Oracle will generate a minimal number of redo log entries in order to protect
the data dictionary, and the operation will probably run faster. Logging can be disabled at
the table level or the tablespace level.
If it is done at the tablespace level then we create indexes or tables in this tablespace; they
will be in NOLOGGING mode.
A table or an index can be created with NOLOGGING mode or it can be altered using ALTER
TABLE/INDEX NOLOGGING.
NOLOGGING is active in the following situations and while running one of the following
commands but not after that.
- DIRECT LOAD (SQL*Loader)
- DIRECT LOAD INSERT (using APPEND hint)
- CREATE TABLE ... AS SELECT
- CREATE INDEX
- ALTER TABLE MOVE
- ALTER TABLE ... MOVE PARTITION
- ALTER TABLE ... SPLIT PARTITION
- ALTER TABLE ... ADD PARTITION (if HASH partition)
- ALTER TABLE ... MERGE PARTITION
- ALTER TABLE ... MODIFY PARTITION, ADD SUBPARTITON, COALESCE SUBPARTITON,
REBUILD UNUSABLE INDEXES
- ALTER INDEX ... SPLIT PARTITION
- ALTER INDEX ... REBUILD
- ALTER INDEX ... REBUILD PARTITION
Logging is stopped only while one of the commands above is running.
So if a user runs this:
ALTER INDEX new_index NOLOGGING.
The actual rebuild of the index does not generate redo (all data dictionary changes
associated with the rebuild will do) but after that any DML on the index will generate redo
this includes direct load insert on the table which the index belongs to.
All the following statements will generate redo despite the fact the table is in NOLOGGING
mode:
- INSERT INTO new_table_nolog_test ...,
- UPDATE new_table_nolog_test SET ...,
- DELETE FROM new_table_nolog_test ..
The following will not generate redo (except from dictionary changes and indexes):
- INSERT /*+APPEND+/ ...
- ALTER TABLE new_table_nolog_test MOVE ...
- ALTER TABLE new_table_nolog_test MOVE PARTITION ...
DML on table nologging, that will not generate redo, Really?
Example: NOLOGGING (11G Archive Mode) with DML
2. SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Script:
--new.sql
column OLD_VALUE new_value OLD_VALUE
select value OLD_VALUE
from v$mystat, v$statname
where v$mystat.statistic# = v$statname.statistic#
and v$statname.name = 'redo size';
--diff.sql
select (value - &OLD_VALUE) OLD_VALUE
from v$mystat, v$statname
where v$mystat.statistic# = v$statname.statistic#
and v$statname.name = 'redo size';
- Begin Testing -
- Create TABLE
SQL> @begin
OLD_VALUE
----------
0
SQL> create table T_NOLOG nologging as select * from all_objects;
Table created.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 0) OLD_VALUE
OLD_VALUE
----------
133120
REDO SIZE=133120
SQL> @begin
OLD_VALUE
----------
133120
SQL> create table T_LOG logging as select * from all_objects;
Table created.
3. SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 133120) OLD_VALUE
OLD_VALUE
----------
8748596
REDO SIZE=8748596
*** create table with nologging... not generate redo, just generate for data dictionary ***
- DML -
- DELETE
SQL> @begin
OLD_VALUE
----------
8881716
SQL> DELETE FROM T_NOLOG;
70999 rows deleted.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 8881716) OLD_VALUE
OLD_VALUE
----------
27076168
REDO SIZE=27076168
SQL> @begin
OLD_VALUE
----------
35958052
SQL> DELETE FROM T_LOG;
71000 rows deleted.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 35958052) OLD_VALUE
OLD_VALUE
5. OLD_VALUE
----------
80021684
SQL> UPDATE T_NOLOG SET OBJECT_ID=1;
71000 rows updated.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 80021684) OLD_VALUE
OLD_VALUE
----------
24671048
REDO SIZE=24671048
SQL> @begin
OLD_VALUE
----------
104692732
SQL> UPDATE T_LOG SET OBJECT_ID=1;
71000 rows updated.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 104692732) OLD_VALUE
OLD_VALUE
----------
20911424
REDO SIZE=20911424
*** On DML insert/update/delete redo size with nologging not difference... with logging.
***
- Show case "APPEND" hints
*** table NOLOGGING and not use APPEND hints ***
SQL> @begin
OLD_VALUE
----------
125604156
6. SQL> INSERT INTO T_NOLOG SELECT * FROM ALL_OBJECTS;
71000 rows created.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 125604156) OLD_VALUE
OLD_VALUE
----------
8586036
REDO SIZE=8586036
SQL> @begin
OLD_VALUE
----------
142830588
SQL> INSERT /*+ APPEND */ INTO T_NOLOG SELECT * FROM ALL_OBJECTS;
71000 rows created.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 142830588) OLD_VALUE
OLD_VALUE
----------
29448
REDO SIZE=29448
*** table LOGGING, and use APPEND hints ***
SQL> @begin
OLD_VALUE
----------
134190192
SQL> INSERT /*+ APPEND */ INTO T_LOG SELECT * FROM ALL_OBJECTS;
71000 rows created.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 134190192) OLD_VALUE
OLD_VALUE
7. ----------
8640396
REDO SIZE=8640396
*** make table logging to nologging ***
SQL> alter table t_log nologging ;
Table altered.
SQL> @begin
OLD_VALUE
----------
142874676
SQL> INSERT /*+ APPEND */ INTO T_LOG SELECT * FROM ALL_OBJECTS;
71000 rows created.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 142874676) OLD_VALUE
OLD_VALUE
----------
27956
REDO SIZE=27956
*** APPEND hints on table "logging" not difference (generate redo). ***
*** If "alter table nologging" before, and then insert (append)... it's work with nologging
(not generate redo, just redo for data dictionary). ***
Example: NOLOGGING (NO Archive Mode) with DML
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
- Create TABLE -
SQL> @begin
OLD_VALUE
----------
0
SQL> create table T_NOLOG nologging as select * from all_objects;
Table created.
8. SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 0) OLD_VALUE
OLD_VALUE
----------
109020
SQL> @begin
OLD_VALUE
----------
109020
SQL> create table T_LOG logging as select * from all_objects;
Table created.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 109020) OLD_VALUE
OLD_VALUE
----------
106360
*** When create table (noarchive mode) LOGGING table not different NOLOGGING table
***
- DML -
SQL> @begin
OLD_VALUE
----------
215380
SQL> DELETE FROM T_NOLOG;
49618 rows deleted.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 215380) OLD_VALUE
OLD_VALUE
----------
18318540
SQL> @begin
OLD_VALUE
----------
9. 18533920
SQL> DELETE FROM T_LOG;
49619 rows deleted.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 18533920) OLD_VALUE
OLD_VALUE
----------
18319920
SQL> @begin
OLD_VALUE
----------
36853840
SQL> INSERT INTO T_NOLOG SELECT * FROM ALL_OBJECTS;
49619 rows created.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 36853840) OLD_VALUE
OLD_VALUE
----------
5468288
SQL> @begin
OLD_VALUE
----------
42322128
SQL> INSERT INTO T_LOG SELECT * FROM ALL_OBJECTS;
49619 rows created.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 42322128) OLD_VALUE
OLD_VALUE
----------
5467828
SQL> @begin
10. OLD_VALUE
----------
93911152
SQL> UPDATE T_NOLOG SET OBJECT_ID=1;
49619 rows updated.
SQL> SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 93911152) OLD_VALUE
OLD_VALUE
----------
15555936
SQL> @begin
OLD_VALUE
----------
109467088
SQL> UPDATE T_LOG SET OBJECT_ID=1;
49619 rows updated.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 109467088) OLD_VALUE
OLD_VALUE
----------
16326484
*** On DML INSERT/UPDATE/DELETE not different between NOLOGGING and LOGGING ***
- INSERT /*+ APPEND */ -
SQL> @begin
OLD_VALUE
----------
125793740
SQL> INSERT INTO T_NOLOG SELECT * FROM ALL_OBJECTS;
49619 rows created.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
11. new 1: select (value - 125793740) OLD_VALUE
OLD_VALUE
----------
5823672
SQL> @begin
OLD_VALUE
----------
131617412
SQL> INSERT /*+ APPEND */ INTO T_NOLOG SELECT * FROM ALL_OBJECTS;
49619 rows created.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 131617412) OLD_VALUE
OLD_VALUE
----------
28484
SQL> @begin
OLD_VALUE
----------
131709848
SQL> INSERT INTO T_LOG SELECT * FROM ALL_OBJECTS;
49619 rows created.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
new 1: select (value - 131709848) OLD_VALUE
OLD_VALUE
----------
5823620
SQL> @begin
OLD_VALUE
----------
131645896
SQL> INSERT /*+ APPEND */ INTO T_LOG SELECT * FROM ALL_OBJECTS;
49619 rows created.
SQL> @diff
old 1: select (value - &OLD_VALUE) OLD_VALUE
12. new 1: select (value - 131645896) OLD_VALUE
OLD_VALUE
----------
26816
*** On NoArchive Mode, Don't mind tables be nologging/logging... just use /*+
APPEND */ ,that will not generate redo (just data dictionary) ***
*** On Archive Mode, TABLEs must be nologging... and use /*+ APPEND */, that
will not generate redo (just data dictionary) ***
by Surachart Opun