This site is intend to Share & Exchange ORACLE Core & APPS Knowledge across Global Expertise
Thursday, November 6, 2008
11g ASM New Features
■ ASM Fast Mirror Resync
A new SQL statement, ALTER DISKGROUP ... DISK ONLINE, can be executed
after a failed disk has been repaired. The command first brings the disk online for
writes so that no new writes are missed. Subsequently, it initiates a copy of all extents
marked as stale on a disk from their redundant copies.
This feature significantly reduces the time it takes to repair a failed diskgroup,
potentially from hours to minutes. The repair time is proportional to the number of
extents that have been written to or modified since the failure.
■ ASM Manageability Enhancements
The new storage administration features for ASM manageability include the following:
■ New attributes for disk group compatibility
To enable some of the new ASM features, you can use two new disk group
compatibility attributes, compatible.rdbms and compatible.asm. These
attributes specify the minimum software version that is required to use disk
groups for the database and for ASM, respectively. This feature enables
heterogeneous environments with disk groups from both Oracle Database 10g and
Oracle Database 11g. By default, both attributes are set to 10.1. You must advance
these attributes to take advantage of the new features.
■ New ASM command-line utility (ASMCMD) commands and options
ASMCMD allows ASM disk identification, disk bad block repair, and backup and
restore operations in your ASM environment for faster recovery.
■ ASM fast rebalance
Rebalance operations that occur while a disk group is in RESTRICTED mode
eliminate the lock and unlock extent map messaging between ASM instances in
Oracle RAC environments, thus improving overall rebalance throughput.
This collection of ASM management features simplifies and automates storage
management for Oracle databases.
■ ASM Preferred Mirror Read
When ASM failure groups are defined, ASM can now read from the extent that is
closest to it, rather than always reading the primary copy. A new initialization
parameter, ASM_PREFERRED_READ_FAILURE_GROUPS, lets the ASM administrator
specify a list of failure group names that contain the preferred read disks for each node
in a cluster.
In an extended cluster configuration, reading from a local copy provides a great
performance advantage. Every node can read from its local diskgroup (failure group),
resulting in higher efficiency and performance and reduced network traffic.
■ ASM Rolling Upgrade
Rolling upgrade is the ability of clustered software to function when one or more of
the nodes in the cluster are at different software versions. The various versions of the
software can still communicate with each other and provide a single system image.
The rolling upgrade capability will be available when upgrading from Oracle
Database 11g Release 1 (11.1).
This feature allows independent nodes of an ASM cluster to be migrated or patched
without affecting the availability of the database. Rolling upgrade provides higher
uptime and graceful migration to new releases.
■ ASM Scalability and Performance Enhancements
This feature increases the maximum data file size that Oracle can support to 128 TB.
ASM supports file sizes greater than 128 TB in any redundancy mode. This provides
near unlimited capacity for future growth. The ASM file size limits are:
■ External redundancy - 140 PB
■ Normal redundancy - 42 PB
■ High redundancy - 15 PB
Customers can also increase the allocation unit size for a disk group in powers of 2 up
to 64 MB.
■ Convert Single-Instance ASM to Clustered ASM
This feature provides support within Enterprise Manager to convert a non-clustered
ASM database to a clustered ASM database by implicitly configuring ASM on all
nodes. It also extends the single-instance to Oracle RAC conversion utility to support
standby databases.
Simplifying the conversion makes it easier for customers to migrate their databases
and achieve the benefits of scalability and high availability provided by Oracle RAC.
■ New SYSASM Privilege for ASM Administration
This feature introduces the new SYSASM privilege to allow for separation of database
management and storage management responsibilities.
The SYSASM privilege allows an administrator to manage the disk groups that can be
shared by multiple databases. The SYSASM privilege provides a clear separation of
duties from the SYSDBA privilege.
For complete list of 11g ASM New Feature, You can refer the following
Note 551205.1 11g ASM New Features Technical White Paper
http://www.oracle.com/technology/pub/articles/oracle-database-11g-top-features/11g-asm.html
Tuesday, November 4, 2008
How to Start the CSS Process ,ASM & DB Instances Services On Windows using Command Prompt.
C:\> net start oraclecsservice
C:\> net start OracleASMService+ASM
C:\> net start OracleServiceDBAASMW
2.
Check whether above services are running using following command :C:\> net start
Example as shows:
C:\> net start
These Windows services are started: OracleASMService+ASM
OracleCSService
OracleServiceDBAASMW
3. To stop the above services
C:\> net stop OracleServiceDBAASMW
C:\> net stop OracleASMService+ASM
C:\> net stop oraclecsservice
Oracle Database 11g Top New Features : Summary
Oracle Database 11g Top New Features : Summary
1) Automatic Diagnostic Repository [ADR]
2) Database Replay
3) Automatic Memory Tuning
4) Case sensitive password
5) Virtual columns and indexes
6) Interval Partition and System Partition
7) The Result Cache
8) ADDM RAC Enhancements
9) SQL Plan Management and SQL Plan Baselines
10) SQL Access Advisor & Partition Advisor
11) SQL Query Repair Advisor
12) SQL Performance Analyzer (SPA) New
13) DBMS_STATS Enhancements
14) The Result Cache
15) Total Recall (Flashback Data Archive)
Note: The above are only top new features, there are other features as well introduced in 11g which will be included subsequently
Oracle 11g Database DBA New Features with brief explanation
==========================================
# Database Capture/replay database workloads :
This allows the total database workload to be captured, transferred to a test database
create from a backup or standby database, then replayed to test the affects of an upgrade or
system change. Currently, these are working to a capture performance overhead of 5%,
so this will capture real production workloads
# Automatic Memory Tuning:
Automatic PGA tuning was introduced in Oracle 9i. Automatic SGA tuning was already
introduced in Oracle 10g. But In 11g, all memory can be tuned automatically by setting one
parameter. We can literally tell Oracle how much memory it has and it determines how
much to use for PGA, SGA and OS Processes. Maximum and minimum thresholds can be set
# Interval partitioning for tables :
Interval partitions are extensions to range partitioning. These provide automation for
equi-sized range partitions. Partitions are created as metadata and only the start partition is
made persistent. The additional segments are allocated as the data arrives. The additional
partitions and local indexes are automatically created.
# Feature Based Patching:
All one-off patches will be classified as to which feature they affect. This allows you to easily
identify which patches are necessary for the features you are using. EM will allow you to
subscribe to a feature based patching service, so EM automatically scans for available
patches for the features you are using
# RMAN UNDO bypass :
Rman backup can bypass undo. Undo tablespaces are getting huge, but contain lots of
useless information. Now rman can bypass those types of tablespace. Great for exporting a
tablespace from backup.
# Virtual columns/indexes :
User can create Virtual index on table. This Virtual index is not visible to optimizer, so it will
not affect performance, Developer can user HINT and see is Index is useful or not.Invisible
Indexesprevent premature use of newly created indexes
# New default audit settings :
Oracle database where general database auditing was "off" by default, logging is intended
to be enabled by default with the Oracle Database 11g beta secure configuration. Notable
performance improvements are planned to be introduced to reduce the performance
degradation typically associated with auditing.
# Case sensitive password :
Passwords are expected to also become case sensitive This and other changes should result
in better protection against password guessing scenarios. For
example, in addition to limiting the number of failed login attempts to 10 (default
configuration in 10gR2), Oracle 11g beta’s planned default settings should expire
passwords every 180 days, and limit to seven the number of times a user can login with an
expired password before disabling access.
# Faster DML triggers : Create a disabled trigger; specify trigger firing order
# Fine grained access control for Utl_TCP:
in 10g all port are available, now it is controlled.
# Data Guard supports "Flashback Standby"
# New Trigger features
# Partitioning by logical object and automated partition creation.
# LOB's - New high-performance LOB features.
# New Oracle11g Advisors
# Enhanced Read only tables
# Table trigger firing order
# Enhanced Index rebuild online : - Online index build with NO pause to DML.
# No recompilation of dependent objects:- When
A) Columns added to tables
B) Procedures added to packages
# Improved optimizer statistics collection speed
# Online index build with NO pause to DML
# Read only table :-
alter table t read only
alter table t read write
Oracle 11g Database SQL/PL-SQL New Features
----------------------------------------------
> Fine Grained Dependency Tracking:
In 11g we track dependencies at the level of element within unit. so that these changes have
no consequence
• Transparent performance improvement
•Unnecessary recompilation certainly consumes CPU
create table t(a number)
create view v as select a from t
alter table t add(Unheard_Of number)
select status from User_Objectswhere Object_Name = 'V'
- -----
VALID
No recompilation of dependent objects when Columns added to tables OR Procedures
added to packages
> Named and Mixed Notation from SQL:
select fun(P4=>10) from DUAL
In 10g not possible to call function in select statment by passing 4th parameter,
but in 11g it is possible
> PL/SQL "continue" keyword - It is same as we read in c/c++ loop
> Support for “super”: It is same "super" in Java.
> Powerfull Regular Expression:
Now we can access data between TAGS like data between tags
The new built-in REGEXP_COUNT returns the number of times the pattern is matched in the
input string.
> New table Data Type "simple_integer"
> SQL Performance Analyzer(SPA) :
It is same as Database replay except it not capture all transaction.The SQL Performance
Analyzer (SPA) leverages existing Oracle Database 10g SQL tuning components. The SPA
provides the ability to capture a specific SQL workload in a SQL Tuning Set, take a
performance baseline before a major database or system change, make the desired change
to the system, and then replay the SQL workload against the modified database or
configuration. The before and after performance of the SQL workload can then be compared
with just a few clicks of the mouse. The DBA only needs to isolate any SQL statements that
are now performing poorly and tune them via the SQL Tuning Advisor
> Caching The Results with /*+ result_cache */ :
select /*+ result_cache */ * from my_table, New for Oracle 11g, the result_cache hint caches
the result set of a select statement. This is similar to alter table table_name cache,but as you
can adding predicates makes /*+ result_cache */ considerably more powerful by caching a
subset of larger tables and common queries.
select /*+ result_cache */ col1, col2, col3 from my_table where colA = :B1
> The compound trigger :
A compound trigger lets you implement actions for each of the table DML timing points in a
single trigger
> PL/SQL unit source can exceeds 32k characters
> Easier to execute table DDL operations online:
Option to wait for active DML operations instead of aborting
> Fast add column with default value:
Does not need to updateall rows to default value.
Oracle 11g Database Backup & Recovery New Features
------------------------------------------------
* Enhanced configuration of archive deletion policies Archive can be deleted , if it is not
need DG , Streams Flashback etc When you CONFIGURE an archived log deletion policy
applies to all archiving destinations, including the flash recovery area. BACKUP ... DELETE
INPUT and DELETE... ARCHIVELOG use this configuration, as does the flash recovery area.
When we back up the recovery area, RMAN can fail over to other archived redo log
destinations if the flash recovery area is inaccessible.
* Configuring backup compression:
In 11g can use CONFIGURE command to choose between the BZIP2 and ZLIB compression
algorithms for RMAN backups.
* Active Database Duplication:
Now DUPLICATE command is network aware i.e.we can create a duplicate or standby
database over the network without taking backup or using old backup.
* Parallel backup and restore for very large files:
RMAN Backups of large data files now use multiple parallel server processes to efficiently
distribute theworkload for each file. This features improves the performance of backups.
* Improved block media recovery performance:
RECOVER command can recover individual data blocks.
RMAN take older, uncorrupted blocks from flashback and the RMAN can use these blocks,
thereby speeding up block media recovery.
* Fast incremental backups on physical standby database:
11g has included new feature of enable block change tracking on a physical standby
database (ALTER DATABASE ENABLE/DISABLE BLOCK CHANGE TRACKING SQL statement).
This new 11g feature enables faster incremental backups on a physical standby database
than in previous releases.because RMAN identifywe the changed blocks sincethe last
incremental backup.
11g ASM New Features
-----------------------
The new features in Automatic Storage Management (ASM) extend the storage
management automation, improve scalability, and further simplify management for
Oracle Database files.
■ ASM Fast Mirror Resync
A new SQL statement, ALTER DISKGROUP ... DISK ONLINE, can be executed
after a failed disk has been repaired. The command first brings the disk online for
writes so that no new writes are missed. Subsequently, it initiates a copy of all extents
marked as stale on a disk from their redundant copies.
This feature significantly reduces the time it takes to repair a failed diskgroup,
potentially from hours to minutes. The repair time is proportional to the number of
extents that have been written to or modified since the failure.
■ ASM Manageability Enhancements
The new storage administration features for ASM manageability include the following:
■ New attributes for disk group compatibility
To enable some of the new ASM features, you can use two new disk group
compatibility attributes, compatible.rdbms and compatible.asm. These
attributes specify the minimum software version that is required to use disk
groups for the database and for ASM, respectively. This feature enables
heterogeneous environments with disk groups from both Oracle Database 10g and
Oracle Database 11g. By default, both attributes are set to 10.1. You must advance
these attributes to take advantage of the new features.
■ New ASM command-line utility (ASMCMD) commands and options
ASMCMD allows ASM disk identification, disk bad block repair, and backup and
restore operations in your ASM environment for faster recovery.
■ ASM fast rebalance
Rebalance operations that occur while a disk group is in RESTRICTED mode
eliminate the lock and unlock extent map messaging between ASM instances in
Oracle RAC environments, thus improving overall rebalance throughput.
This collection of ASM management features simplifies and automates storage
management for Oracle databases.
■ ASM Preferred Mirror Read
When ASM failure groups are defined, ASM can now read from the extent that is
closest to it, rather than always reading the primary copy. A new initialization
parameter, ASM_PREFERRED_READ_FAILURE_GROUPS, lets the ASM administrator
specify a list of failure group names that contain the preferred read disks for each node
in a cluster.
In an extended cluster configuration, reading from a local copy provides a great
performance advantage. Every node can read from its local diskgroup (failure group),
resulting in higher efficiency and performance and reduced network traffic.
■ ASM Rolling Upgrade
Rolling upgrade is the ability of clustered software to function when one or more of
the nodes in the cluster are at different software versions. The various versions of the
software can still communicate with each other and provide a single system image.
The rolling upgrade capability will be available when upgrading from Oracle
Database 11g Release 1 (11.1).
This feature allows independent nodes of an ASM cluster to be migrated or patched
without affecting the availability of the database. Rolling upgrade provides higher
uptime and graceful migration to new releases.
■ ASM Scalability and Performance Enhancements
This feature increases the maximum data file size that Oracle can support to 128 TB.
ASM supports file sizes greater than 128 TB in any redundancy mode. This provides
near unlimited capacity for future growth. The ASM file size limits are:
■ External redundancy - 140 PB
■ Normal redundancy - 42 PB
■ High redundancy - 15 PB
Customers can also increase the allocation unit size for a disk group in powers of 2 up
to 64 MB.
■ Convert Single-Instance ASM to Clustered ASM
This feature provides support within Enterprise Manager to convert a non-clustered
ASM database to a clustered ASM database by implicitly configuring ASM on all
nodes. It also extends the single-instance to Oracle RAC conversion utility to support
standby databases.
Simplifying the conversion makes it easier for customers to migrate their databases
and achieve the benefits of scalability and high availability provided by Oracle RAC.
■ New SYSASM Privilege for ASM Administration
This feature introduces the new SYSASM privilege to allow for separation of database
management and storage management responsibilities.
The SYSASM privilege allows an administrator to manage the disk groups that can be
shared by multiple databases. The SYSASM privilege provides a clear separation of
duties from the SYSDBA privilege.
For complete list of 11g ASM New Feature, You can refer the following
Note 551205.1 11g ASM New Features Technical White Paper
http://www.oracle.com/technology/pub/articles/oracle-database-11g-top-features/11g-asm.html
For Complete list of 11g New Features, You can refer to the following link
http://www.oracle.com/technology/pub/articles/oracle-database-11g-top-features/index.html
Wednesday, October 29, 2008
Exporting and restoring Statistics
1) DBMS_STATS.CREATE_STAT_TABLE
This will create a statistics table in the schema specified.
· ownname – Schema where the table can be created.
· stattab - statistics table name.
· tblspace - tablespace to be used.
exec dbms_stats.create_stat_table (
ownname=>'OWNER',
stattab=>'STAT_TAB',
tblspace=>'USER');
2) DBMS_STATS.EXPORT_TABLE_STATS
This method exports the statistics of the table specified.
ownname - schema name
tabname - table name
stattab - stat table name
cascade - TRUE = indexes too
statown - stat table schema
exec dbms_stats.export_table_stats (
ownname =>'OWNER',
tabname =>'TABLE_NAME',
stattab =>'STAT_TAB',
cascade =>true);
3) DBMS_STATS.EXPORT_SCHEMA_STATS
This method exports the statistics of the SCHEMA specified.
ownname - schema name
stattab - stat table name
statown - stat table schema
exec dbms_stats.export_schema_stats(
ownname=>’OWNER’,
stattab=>'STAT_TAB');
4) DBMS_STATS.EXPORT_DATABASE_STATS
This method exports the statistics of the entire database.
stattab - stat table name
statid - optional identifier
statown - stat table schema
exec dbms_stats.export_database_stats(
stattab=>'STAT_TAB');
Ø dbms_stats.export_dictionary_stats – Retrieves statistics for all dictionary schemas (SYS and SYSTEM)
Ø dbms_stats.export_fixed_object_stats- Retrieves statistics for fixed tables
Ø dbms_stats.export_system_stats - Retrieves and stores system statistics
The STAT_TAB created will hold the database/schema/table statistics in the form of an oracle table. If we wish to keep it safe outside of the database, use the traditional export(exp utility) to export the contents of the same.
exp user/****** tables=STAT_TAB file=stat_tab.dmp
Now, we will see the methods and options available on how to import the statistics.
Before importing any statistics from a table or restoring them back from database, it is recommended to delete the existing statistics using DBMS_STATS.DELETE_TABLE_STATS package.
II. Deleting Statistics
This method deletes particular statistics from the user statistics table identified by stattab and stores them in the dictionary.
ownname - schema name
tabname - table name
exec dbms_stats.delete_table_stats(
ownname =>'OWNER',
tabname =>'TABLE_NAME');
Following methods are available for deleting statistics on schema/dictionary/database level.
exec dbms_stats.delete_schema_stats(OWNER);
exec dbms_stats.delete_dictionary_stats;
exec dbms_stats.delete_fixed_object_stats;
exec dbms_stats.delete_database_stats;
III. Import Statistics
1) DBMS_STATS.IMPORT_TABLE_STATS
This method imports particular table statistics from the user statistics table identified by stattab and stores them in the dictionary.
ownname - schema name
tabname - table name
partname - partition name
stattab - stat table name
statid - optional identifier
cascade - TRUE = indexes too
statown - stat table schema
exec dbms_stats.import_table_stats(
ownname =>'OWNER',
tabname =>'TABLE_NAME',
stattab =>'STAT_TAB',
cascade =>true);
2) DBMS_STATS.IMPORT_SCHEMA_STATS
This method imports the statistics of the SCHEMA specified.
ownname - schema name
stattab - stat table name
statown - stat table schema
exec dbms_stats.import_schema_stats(
ownname=>’OWNER’,
stattab=>’STAT_TAB’);
3) DBMS_STATS.IMPORT_DATABASE_STATS
This method imports the statistics of the entire database.
stattab - stat table name
statid - optional identifier
statown - stat table schema
exec dbms_stats.import_database_stats(
stattab=>'STAT_TAB');
Ø dbms_stats.import_dictionary_stats – Retrieves statistics for all dictionary schemas (SYS and SYSTEM)
Ø dbms_stats.import_fixed_object_stats- Retrieves statistics for fixed tables
Ø dbms_stats.import_system_stats - Retrieves and stores system statistics
Now, we will see the options available on how to restore statistics from the database, within the stats retention period.
V. Restoring Database Statistics
The old statistics are retained at the database level and if there’s any problem with performance of queries, the same can be restored. By default, the statistics are retained at the database level for 31 days.
To see the retention period, the below SQL will return the current retention period(in days) for the stats.
select DBMS_STATS.GET_STATS_HISTORY_RETENTION from dual;
GET_STATS_HISTORY_RETENTION
---------------------------
31
The below SQL will return the oldest possible stats date availability and can be restored.
select DBMS_STATS.GET_STATS_HISTORY_AVAILABILITY from dual;
GET_STATS_HISTORY_AVAILABILITY
--------------------------------------
08-SEP-08 12.47.26.580621000 AM -04:00
To find the history of statistics availability for a table,
select TABLE_NAME, STATS_UPDATE_TIME from dba_tab_stats_history
where table_name='