Click hot pictures and get the gallery

Wednesday, July 29, 2009

all about oracle 11g

1 Oracle 11g Database New Features
This chapter contains descriptions of all of the features that are new to Oracle 11g Database Release 1 (11.1). This chapter contains the following sections:
• Application Development
• Availability
• Database Overall
• Business Intelligence and Data Warehousing
• Clustering
• Content Management Services
• Fault Diagnosability
• Information Integration
• Location Services and Specialty Data
• Manageability
• Performance
• Security
• Windows
1.1 Application Development
1.1.1 APIs and Precompilers
The following sections describe new Oracle Database 11g features in application programmatic interfaces. These features improve performance and scalability of applications and enable easy deployment of the Oracle client-side stack.
1.1.1.1 Client-Side Query Cache
This feature enables caching of query result sets in client memory. The cached result set data is transparently kept consistent with any changes done on the server side.
Applications leveraging this feature see improved performance for queries which have a cache hit. Additionally, a query serviced by the cache avoids round trips to the server for sending the query and fetching the results. It also reduces the server CPU that would have been consumed for processing the query, thereby improving server scalability.
See Also:
Oracle Call Interface Programmer's Guide for details
1.1.1.2 OCI Client Session NLS Character Set Status Information
This new feature adds client session NLS and character set information to the V$SESSION_CONNECT_INFO and GV$SESSION_CONNECT_INFO views.
This enhancement provides DBAs with access to client-side session character set information for all clients. This information is especially useful in troubleshooting problems.
See Also:
Oracle Database Globalization Support Guide for details
1.1.1.3 Precompilers: Additional Array INSERT and SELECT Syntax Support by Pro*C/C++ and Pro*COBOL
In this Oracle Database 11g release, there is added support for IBM DB2 array INSERT and array SELECT syntax for Pro*C/C++ and Pro*COBOL.
Adding support for IBM DB2 array INSERT and array SELECT syntax helps with the migration of IBM DB2 installations to Oracle.
See Also:
Pro*C/C++ Programmer's Guide for details
1.1.1.4 Precompilers: Dynamic SQL Statement Caching in Pro*C/C++ and Pro*COBOL
Application developers can now precompile Pro*C/C++ and Pro*COBOL applications with the new statement caching option.
The potential benefit of this feature is an increase in performance by enabling statement caching in precompiled programs. The performance improvement is achieved by removing the overhead of parsing the dynamic statements on reuse.
See Also:
Pro*C/C++ Programmer's Guide for details
1.1.1.5 Precompilers: Fix Execution Plan in Pro*C/C++ and Pro*COBOL
This new feature focuses on fixing an execution plan for a Pro*C/C++ and Pro*COBOL application by using the outline feature.
By using the outline feature, you can ensure that the performance of the application is not affected when modules are integrated and deployed into different environments.
1.1.1.6 Precompilers: Flexible B Area Length for Pro*COBOL
The length of B Area for the Pro*COBOL application can now be from 8 to 253 columns.
The length of B Area for a Pro*COBOL program was limited to 72 when the format is set to ANSI. COBOL compilers now can support B Area length up to 253. This provides a programmer with the flexibility to type a line that is longer than 72 columns.
1.1.1.7 Precompilers: Implicit Buffered Insert in Pro*C/C++ and Pro*COBOL
Some applications that require periodic insertion of new data use a single INSERT statement within a loop. When queried by a command-line argument, the precompiler buffers the rows being inserted, reducing network round trips.
The benefit is that an implicit buffered INSERT provides performance improvement that is comparable to using the precompiler array interface.
See Also:
Pro*C/C++ Programmer's Guide for details
1.1.1.8 Precompilers: Platform Endianness Support by Pro*COBOL
Oracle always stores Unicode data (UTF16) in Big Endian representation. Linux and Windows have Little Endian representation and Solaris has Big Endian representation. With this enhancement, Unicode data can be fetched in Little Endian format on Windows and Linux platforms using a Pro*COBOL application.
When a UTF16 (UCS2) string is fetched in PIC N variable in a Pro*COBOL application running on Little Endian platforms, the application can now be precompiled with the appropriate command-line option to have the correct platform endianness.
See Also:
Pro*COBOL Programmer's Guide for details
1.1.1.9 Precompilers: Scrollable Cursor Support in Pro*COBOL
Pro*COBOL now supports scrollable cursors to fetch data in a nonsequential manner.
A scrollable cursor enables you to access the rows of a database result set in a forward, backward, and random manner. This enables the program to fetch any row in the result set.
1.1.1.10 Precompilers: SQL99 Syntax Support by Pro*C/C++
With this enhancement, the SQL99 syntax for SELECT, INSERT, DELETE, and UPDATE statements and the body of the cursor in a DECLARE CURSOR statement is supported by Pro*C/C++.
Oracle Database supports most of the SQL99 syntax. With this enhancement, Pro*C/C++ also supports the SQL99 syntax that is supported by Oracle Database.
See Also:
Pro*C/C++ Programmer's Guide for details
1.1.2 Application Express
The following sections describe new features for Oracle Application Express. Application Express provides an application development tool that is built into the database and is installed in the database by default which is different from Oracle Database 10g implementation.
1.1.2.1 Application and Schema Comparison
New application and schema comparison capabilities enable you to identify differences between two selected applications.
You can also identify differences between objects in two different schemas.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.2 Drag and Drop Item Layout
The Drag and Drop Layout page enables you to interactively reorder items within a given region, change select item attributes, create new items, and delete existing items.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.3 Flash Charts
Oracle Application Express includes support for 18 different types of Flash charts. You can create Flash charts when creating a new page or by defining a Chart region.
This release also includes a utility that enables you to convert existing Scalable Vector Graphics (SVG) charts to Flash.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.4 Friendly URL Syntax to Facilitate Bookmarks
By specifying zero as the session ID, you can now make it easier for application users to bookmark pages within an application.
This features makes all public page links consistent, making them easier to bookmark.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.5 Improved Web Services
Oracle Application Express now supports more loosely defined Web services types and document styles. Both of these enhancements enable support for Web services created with JDeveloper and Oracle BPEL synchronous processes. You can now interact with Web services over a Secure Sockets Layer (SSL) and work with Web services that require basic authentication.
Finally, this release also enables you to manually create a Web services reference even if the Application Express engine cannot correctly parse a WSDL document.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.6 Improved Workspace Management
This release also includes a number of workspace management enhancements. For users requesting new workspaces or requesting additional storage, you can control what sizes display.
You can also request an e-mail of your workspace names. And, finally, you can view a log of login attempts.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.7 Microsoft Access Migration
Application Migration enables you to migrate a Microsoft Access application and generate an Oracle Application Express application.
This feature provides an easy way to migrate applications from Microsoft Access to Oracle Express.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.8 New Password and Account Controls
You can now specify rules for password expiration, mandate strong passwords (that is, specify the minimum number of and type of characters), require that users change their passwords on first use, and lock accounts.
With this new feature, you can configure account login controls and password policies across a development instance in Oracle Application Express Administration Services. You can also specify controls for a specific account under Account Controls on the Edit User page.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.9 Page and Region Caching
You can improve the performance of your application by taking advantage of page and region caching. New Cache attributes have been added to the Page attributes and Region Definition pages.
Page caching works well for static pages and region caching is a good choice for regions such as lists that do not have any conditions or regions containing HTML text.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.10 PDF Printing
You can now include the ability to print a report by exporting a report region to PDF. You can also define report queries and print attributes for report regions as Shared Components making them accessible to all pages within an application.
The advantage of this feature is that it provides production of high quality, easily printable reports.
See Also:
Oracle Database Application Express User's Guide for details
1.1.3 Extensible Indexing
The following sections describe extensible indexing features for Oracle Database 11g Release 1 (11.1).
1.1.3.1 Create Rules and Actions for DML Events With Rules Manager
Rules Manager now adds the ability to treat DELETE and UPDATE operations on a table as events that drive the rule evaluation and action execution (INSERT operations are already supported). In addition to pre-commit evaluation of rules based on trigger, this release supports post-transaction evaluation through use of the Change Notification feature of Oracle Database.
Because rules can now be processed during UPDATE and DELETE statements, developers can now model the entire business process for OLTP workloads in addition to the current "append-only" workloads characteristic of data warehouse and sensor-based applications.
See Also:
Oracle Database Rules Manager and Expression Filter Developer's Guide for details
1.1.3.2 Enhanced Rules Manager
Rules Manager now includes a PL/SQL API to store reusable and shareable rule conditions in SQL WHERE clause format. Complex rule conditions can be assembled from these shared elements.
In addition, rules can now be enabled and disabled through standard SQL.
Application developers can reuse rule conditions to speed the rule definition process. Since these shared conditions are stored once, changes propagate to all the complex rules referring to them. For example, if a rule component defines a "suspicious bank transaction" as involving an international bank transfer over $10,000, a change to the amount, location, or other condition needs to be made only once and it is updated in all complex rules using "suspicious bank transaction" in their event scenario.
Rules can be turned on and off to facilitate rule testing and control introduction into the system as well as to reflect changes in business conditions.
See Also:
Oracle Database Rules Manager and Expression Filter Developer's Guide for details
1.1.3.3 New Capabilities for Domain Index Operations
A new domain index callout updates table and column name metadata for a domain index during an ALTER TABLE ... RENAME or ALTER TABLE ... RENAME COLUMN command to ensure domain index metadata is kept up-to-date.
A partition-specific parameter string provides control over placement of domain index data during partition maintenance operations.
The SQL MERGE statement can now be used with a domain index.
See Also:
Oracle Database SQL Language Reference for details
1.1.3.4 Oracle Text Predicates and Aggregate Operators are Included in Rule Conditions
The Rules Manager feature of Oracle Database now supports the use of the Oracle Text CONTAINS operator with the SQL WHERE clause rule conditions.
Rules Manager can now compute aggregate values (SUM, AVG, MIN, MAX, and COUNT) using moving windows semantics. The window size can be based on time or number of events. The aggregate values for a group of events can be computed and tested against predefined or relative thresholds in rule conditions.
Rules can respond to real-world trends identified from a collection of events occurring over a particular length of time or a sliding window of time, such as for Business Activity Monitoring and Business Intelligence applications. For example, you can offer a promotion to a customer if the sum of purchases in the last three days is over $1000.00.
See Also:
Oracle Database Rules Manager and Expression Filter Developer's Guide for details
1.1.3.5 Oracle Text Predicates Included in Stored Expressions
The Expression Filter feature of Oracle Database now supports the use of the Oracle Text CONTAINS operator with the SQL WHERE clause stored expressions.
Stored expressions can evaluate text and XML data.
See Also:
Oracle Database Rules Manager and Expression Filter Developer's Guide for details
1.1.3.6 System-Managed Partitioning of Extensible Indexes
System-managed domain indexes (both non-partitioned and local partitioned) use Oracle Database to track and maintain the domain index storage tables during DDLs and partition maintenance operations on the base table. System-partitioned tables can be used as index storage tables for local domain indexes. System-managed domain indexes with range partitioning are supported in this release.
System-managed partitioning of domain indexes enhances local domain index manageability and performance.
See Also:
Oracle Database Data Cartridge Developer's Guide for details
1.1.4 Globalization and Unicode
This section lists improvements to globalization features and Unicode support of Oracle Database.
1.1.4.1 Unicode 5.0 Support
The NLS data files for AL32UTF8 and AL16UTF16 character sets have been updated to match version 5.0 of the Unicode Standard character database.
With this enhancement, Oracle Database conforms to the newest version of the standard.
See Also:
Oracle Database Globalization Support Guide for details
1.1.5 Java in the Database
The major enhancements to the Java runtime in this release include performance with a new JIT compiler, ease-of-use with a JDK-like command-line interface, and tooling.
1.1.5.1 OracleJVM Java/JDK 5.0 Compatibility
OracleJVM supports Sun's JDK 1.5.
This feature provides portability of J2SE applications (stand-alone JDBC or middle-tier) into Oracle Database and the ability to take advantage of the key benefits of J2SE 5.0 such as the "declarative" programming style enabled by Java Annotations.
This feature allows sharing metadata of Java classes loaded by user class loader among different database user sessions.
See Also:
Oracle Database Java Developer's Guide for details
1.1.5.2 OracleJVM JIT Configuration
The JIT is enabled by default (out-of-the-box) and does not need further configuration. However, it can be disabled or reenabled by setting JAVA_JIT_ENABLED to TRUE or FALSE in the parameter file or dynamically by altering the instance or the session, for example:
ALTER SYSTEM SET JAVA_JIT_ENABLED=true
or
ALTER SESSION SET JAVA_JIT_ENABLED=true

In addition, the OJVM_JIT_PROPERTIES are used to specify the list of properties, for example:
OJVM_JIT_PROPERTIES="key0-value0","key1=value1","keyword0"

Currently, supported properties are:
• DISABLE_OPTIM_* which are various switches to disable optimization passes.
• New dictionary table and Oracle Runtime methods for checking the compilation status of classes or methods.
• New column IS_COMPILED in USER_JAVA_METHODS, ALL_JAVA_METHODS, and DBA_JAVA_METHODS views set to YES or NO.
This feature allows fine-grained control on the behavior of the JIT. In addition, you have the ability to query the status of compiled classes and methods.
See Also:
Oracle Database Java Developer's Guide for details
1.1.5.3 OracleJVM JIT (Transparent Native Java Compilation Without a C Compiler)
Enabled by default and similar to the JDK JIT, this feature compiles Java in the database natively and transparently without the need of a C compiler.
The JIT runs as an independent session in a dedicated Oracle server process. There is at most one compiler session per database instance and it is Oracle RAC-aware and amortized over all Java sessions.
The compilation session uses profiling feedback data gathered by all Java sessions to compile the most often used methods, so as to get the best overall performance. The executable binary persists in the database.
Java sessions just use the executable binaries of already compiled methods or discover newly compiled methods through an event polling performed by OracleJVM at regular intervals. When there is a compiled code for a given method, future executions of that method use the compiled version.
Conversely, when a Java class is invalidated, the persisted compiled code of the class or method is removed.
This feature brings two major benefits to Java in the database:
• Increased performance of pure Java execution in the database resulting from the transparent compilation of Java into native machine code, similar in behavior to a JDK JIT.
• Ease-of-use. Unlike the Static Native Java compiler (also known as NCOMP or JAccelerator) in previous releases, the new JIT Compiler (when enabled at database configuration level) is activated transparently, without the need of an explicit command, when Java is executed in the database.
In addition, this feature removes the need for a C compiler.
See Also:
Oracle Database Java Developer's Guide for details
1.1.5.4 OracleJVM Ease-of-Use: JDK-Like Interface
Similar to the JDK VM, this feature provides a command-line interface to OracleJVM through new PL/SQL interfaces, for example:
FUNCTION runjava (cmdline VARCHAR2) RETURN VARCHAR2;
or
FUNCTION runjava_in_current_session (cmdline VARCHAR2) RETURN VARCHAR2;

Analogous to the JDK/JRE Java shell command, the JDK-like interface takes a subset of the JDK/JRE command-line syntax including:
[-options] classname [arguments...]
or
[-options] -jar jarfile [arguments...]

The supported options include:
• {cp|classpath} < ":" separated list of file system directories/JAR/ZIP to search for class files>
• D= set a system property
• Xbootclasspath:<":" separated directories/zip/jar files to search for bootstrap classes and resources>
• Xbootclasspath/a:<":" separated directories/zip/jar files to append to the end of bootstrap class path>
• Xbootclasspath/p:<":" directories/zip/jar files to prepend in front of bootstrap class path>
This feature makes Java easy to use using command-line syntax, which is similar to the JDK JAVA command line. In addition to database resident Java classes, this feature allows the execution in the database runtime environment of file system resident Java class, using the standard classpath syntax. In addition, it allows setting system properties using the standard -D syntax.
See Also:
Oracle Database Java Developer's Guide for details
1.1.5.5 OracleJVM Ease-of-Use: Property Management Interface
This feature provides DBMS_JAVA functions to emulate JDK System property setting for the duration of the session. The settings are set_property, get_property, remove_property, and show_property.
Java developers can now emulate familiar JDK behavior such as system properties support when using Java in the database.
1.1.5.6 OracleJVM Ease-of-Use: Output Redirect
This feature provides DBMS_JAVA functions and procedures for controlling the redirection of Java output, for example:
{set | remove | enable | disable | query}_output_to_{sql | java | file}

And for enabling or disabling sending output to trace, for example:
trace {enable | disable}_output_to_trc

Java developers can now emulate familiar JDK behavior such as output redirect. In addition, they can now disable sending output to a trace file, which was not possible in previous releases.
1.1.5.7 OracleJVM Ease of Use: Database Resident Jars
This feature allows supporting JAR as a unit of operations (and as a result of support for signed JARs) using new loadjava options, -jarsasdbobjects and -prependjarnames.
When these new options are not used, loadjava explodes the jar into individual classes, while dropjava goes back to the original jar (from which the classes are loaded) and drop the classes each at a time.
Java developers using OracleJVM benefit from the same JDK features and behavior such as JAR support.
1.1.5.8 OracleJVM Ease of Use: Two-Tier Java Session Termination
This feature allows the termination of Java within a database session, with and without retention of system properties, using endsession and endsession_and_related_state.
Java developers can terminate Java in a session while keeping the property settings so as to speed up Java reinitialization within the same database session. This feature also allows immediate termination of Java sessions, without requiring the use of System.exit.
1.1.5.9 OracleJVM Utilities Enhancements
Enhancements to existing OracleJVM utilities (loadjava, dropjava, and ojvmjava) include the deprecation of least-frequently-used options of loadjava and the ability to load Java classes over the web (HTTP URL support). For example:
loadjava -u scott/tiger -r
-v http://my.server.com/this/is/the/path/my.jar

Enhancements to dropjava include:
• list-based deletion
• exception handling
• ability to connect to a different user
• invalid command reporting
ojvmjava has been extended to support the JDK-like command such as runjava and its options. For example:
ojvmjava -u scott/tiger -runjava -d :1521: -t

And, then followed with:
$java -cp .

In addition, a new standalone Class Closure Tool (ojvmtc) is provided for ensuring that a given list of file system resident classes and deployable JARs to be closed as much as possible before loading (for example, loadjava invocation).
The benefits are increased usability and simplified deployment of Java applications in Oracle Database.
See Also:
Oracle Database Java Developer's Guide for details
1.1.5.10 OracleJVM Manageability: JMX Interface
This feature provides support for OracleJVM with the standard JMX interface.
Support for JMX interface provides:
• Ease-of-use (any standard JMX-enabled GUI or console)
• Runtime monitoring of OracleJVM (memory objects heaps, threads, GC and classes)
• Ability to trigger GC from the console
1.1.6 JDBC and SQLJ
For Java developers, this release provides the following enhancements to JDBC and SQLJ APIs:
• Support for the latest Java standards including Java SE 1.5 and JDBC 4.0.
• A faster protocol for the Streams/AQ Java interface.
• Support for Oracle advanced security in JDBC-Thin.
• Enhancements to SQLJ code generation and customizer.
• Enhancements to XA support.
• Support of event notification.
1.1.6.1 JDBC 4.0 Connection and Statement Enhancements
JDBC 4.0 introduces new methods for:
• Validating a connection.
• Setting and fetching client information on a connection.
• Returning a list of client properties supported by the driver.
• Allowing an application to mark that a statement should not be pooled.
• Allowing a statement pool manager to register a StatementEventListener on the pooled connection.
In addition, it provides a new StatementEventListener interface and a new StatementEvent class.
These JDBC 4.0 enhancements improve the scalability of JDBC applications and provide better control and management of statement objects.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.2 JDBC 4.0 Support for New Data Types
This feature provides new standard types including java.sql.XMLType, java.sql.RowID, and java.sql.Nclob to support the National Character Set (NCHAR, NVARCHAR, LONGVARCHAR). In addition, the JDBC 4.0 implementation enhances BLOB and CLOB data type manipulation.
Standard support for new SQL types significantly increases the portability of JDBC applications across databases.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.3 JDBC Support for ANYTYPE, ANYDATA, and ANYDATASET
The following support has been added to JDBC in this release:
• ANYTYPE which represents any SQL type including persistent database scalar or object types, and transient unnamed types.
• ANYDATA as a table column type to store heterogeneous values (built-in and user-defined) within the same column, along with the metadata.
• ANYDATASET which represents a set of data instances of the same type, along with the metadata.
The benefits include:
• Mapping any Java types to a general purpose SQL data type (ANYTYPE).
• Persisting Java objects to the same database table column (ANYDATA).
• Mapping any Java collections into ANYDATASET.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.4 JDBC Support for Continuous Query Notification
This feature allows Java Applications or Containers to subscribe to SQL queries watch list in the database and be notified when:
• DML or DDL changes affect the objects associated with the queries, or
• DML or DDL changes affect the result set
The notifications are published when the transaction (DML or DDL) commits.
Java Applications and Container prevents unnecessary database querying and implements efficient and consistent result set caching and cache invalidation.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.5 JDBC Support for Database Diagnosability
Through this feature, JDBC provides better support for logging, diagnosability and DMS monitoring:
• Logging has been reimplemented to fully utilize java.util.logging. This allows you to selectively log events that occur during the execution of the JDBC driver code such as SQL exceptions, SQL statement executions, or entry or exit from internal JDBC methods.
• JDBC support for performance monitoring uses DMS to capture performance-critical JDBC events including:
o Connection cache statistics
o Connection creation
o Statement cache statistics
o Query execution
o Result fetch
o Oracle RAC events
o Load balancing statistics
o New Oracle Database 11g features
• JDBC support for Diagnosability Management consists of an MBean, oracle.jdbc.DiagnosabilityMBean. This MBean provides the means to enable and disable JDBC logging and provides additional statistics about JDBC internals.
This feature simplifies JDBC logging and makes the interpretation of the results easy. Dynamic Monitoring System (DMS) metrics give Java applications the ability to track JDBC events and performance metrics, as well as a programmatic control and configuration of diagnosability features.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.6 JDBC Support for Database Startup and Shutdown
You can now perform database startup or shutdown using the following JDBC Oracle Connection methods:
• DBSTARTUP_NO_RESTRICTION
• DBSTARTUP_FORCE
• DBSTARTUP_RESTRICT
• DBSHUTDOWN_CONNECT
• DBSHUTDOWN_TRANSACTIONAL
• DBSHUTDOWN_TRANSACTIONAL_LOCAL
• DBSHUTDOWN_IMMEDIATE
• DBSHUTDOWN_ABORT
• DBSHUTDOWN_FINAL
Note that you must be connected to a dedicated server as SYSOPER or SYSDBA in PRELIM_AUTH mode.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.7 JDBC Support for Native Streams AQ Protocol
This feature exposes a new Java package (oracle.jdbc.aq) that leverages the new native JDBC APIs for Streams AQ. This package contains the following classes and interfaces:
• AQQueue
• AQMessage
• AQAgent
• AQDequeueOptions
• AQEnqueueOptions
• AQMessageProperties
• AQRawPayload
• AQObjectPayload
• AQNotificationEvent
• AQNotificationListener
• AQNotificationRegistration
Java and JMS applications run faster (using Native AQ operations as opposed to PL/SQL procedures) when accessing Streams AQ and OJMS queues. In addition, these APIs allow asynchronous notifications of AQ events and exchange rich message payloads including RAW data type, ANYDATA data type, and OBJECT data type.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.8 JDBC-Thin Support for Oracle Advanced Security
This feature provides complete JDBC-Thin support for Oracle Advanced Security in terms of encryption, password authentication, strong authentication, and data integrity or checksum.
New security features include Secure Sockets Layer (SSL), Remote Authentication Dial-In User Service (RADIUS) and Kerberos authentication, AES encryption, and SHA1 checksum algorithm. Advanced security support in JDBC-Thin simplifies the development and deployment of secure Java applications.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.9 SQLJ: Enhanced Profile Print Option of the Customizer
SQLJ customizer is used during ISO standard code generation. The customizer tailors SQLJ profiles for a particular database implementation and vendor-specific features and data types. The profile print option (-P-print) of SQLJ has been enhanced to print all the customizer options that were passed into the SQLJ translator.
This feature provides information about customizations that SQLJ has received during the precompilation phase to help diagnose any problems that may arise and are specific to different customizations.
See Also:
Oracle Database SQLJ Developer's Guide and Reference for details
1.1.6.10 SQLJ: Outline Generation Option
An application can support SQL execution plan stability by using the outline feature of Oracle. An outline is implemented as a set of optimizer hints that are associated with the SQL statement. If the use of the outline is enabled for the statement, Oracle automatically considers the stored hints and tries to generate an execution plan in accordance with those hints.
A new translation time option is provided in SQLJ to generate and run a SQL file containing the Oracle outline creation commands for all the SQL statements present in a SQLJ application.
This feature helps in ensuring the expected behavior of a database query at development time and helps to better diagnose problems.
See Also:
Oracle Database SQLJ Developer's Guide and Reference for details
1.1.6.11 SQLJ: Support for JDK 1.5
SQLJ applications can now be translated and run under JDK 1.5.
The JDK 1.4 and JDK 1.5 specific language structures outside the #sql region are recognized by the translator.
See Also:
Oracle Database SQLJ Developer's Guide and Reference for details
1.1.6.12 SQLJ: XA Support
The javax.sql.XADataSource interface of JDBC outlines standard functionality of XA data sources. An XA data source is a factory for XA connections. Oracle JDBC implements the XADataSource interface through the OracleXADataSource class. The getConnection() method of the OracleXADataSource class returns an XA connection to the underlying data source.
The benefit of this feature is that these connections can be used in SQLJ applications by creating the appropriate connection contexts in SQLJ.
See Also:
Oracle Database SQLJ Developer's Guide and Reference for details
1.1.7 Oracle Developer Tools for Visual Studio .NET
These features enhance developer productivity for building .NET applications with Oracle Database. They provide native integration with ADO.NET 2.0 functionality using Visual Studio development environments with which .NET developers are familiar. In addition, these features reduce the time it takes to develop .NET applications for Oracle.
1.1.7.1 General Visual Studio 2005 Support
This feature provides users of Visual Studio 2005 the same support currently offered for Oracle Develop Tools (ODT) users using Visual Studio 2003. The changes include using different icons and integrating visually with the Visual Studio 2005 look and feel.
This feature makes it easy for customers to continue using ODT when they migrate from Visual Studio 2003 to the Visual Studio 2005 environment.
1.1.7.2 Oracle PL/SQL Debugger in Visual Studio
The Oracle PL/SQL debugger is now integrated directly into Visual Studio. Developers can debug code, set breakpoints, and watch variables exactly as they would for any other language. Three types of debugging are supported:
• Direct Database Debugging
The developer runs the stored procedure from the Oracle Explorer inside of Visual Studio and enters in the parameters.
• Multi-Tier Application Debugging
The developer steps from .NET code directly into PL/SQL and back again with the parameters automatically being passed.
• External Application Debugging
The developer runs any 9.2 or later Oracle application that can be located anywhere (for example, from SQL*Plus). When it calls the stored procedure, the break point in Visual Studio fires and the developer can begin debugging with the stored procedure parameters being passed automatically.
This feature enables developers to seamlessly debug .NET applications that make calls to PL/SQL stored procedures. Developers can debug both .NET code and PL/SQL without having to leave Visual Studio. They can also debug PL/SQL stored procedures that are called from any arbitrary Oracle program, written in any language, and located on the same machine or on a remote machine.
1.1.7.3 Support for Visual Studio 2005 Data Sources Window and Designers
This feature exposes the DDEX interface to enable some Visual Studio 2005 designers as well as integrate with the Data Sources window to enable the new style drag-drop code generation in Visual Studio 2005.
1.1.8 Oracle Data Provider for .NET (ODP.NET)
These features enhance developer productivity for building .NET applications with Oracle Database. They provide native integration with ADO.NET 2.0 functionality using Oracle Data Provider for .NET (ODP.NET) development environments with which .NET developers are familiar. In addition, these features reduce the time it takes to develop .NET applications for Oracle.
1.1.8.1 Provider-Independent API Using Base Classes and Factories
ODP.NET inherits from the System.Data.Common namespace to provide access through a single API to databases across multiple providers.
ADO.NET developers can build applications that work with multiple vendors' database servers with one set of data access code and with a minimum of vendor-specific code. Developers can now be more productive when building one set of code that works against multiple vendors' databases.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.2 Connection String Builder
ODP.NET provides a strongly typed connection string builder class that inherits from DbConnectionStringBuilder. The connection string builder lets developers programmatically create syntactically correct connection strings based on user input, as well as parse and rebuild existing connection strings by using class methods. Connection string builders provide strongly-typed properties that correspond to known key/values pairs.
ODP.NET connection strings are now more secure and more manageable. Because connection string parameters can now be strongly typed, they are less subject to string injection attacks. Connection string parameters can now be referenced in configuration files or as ODP.NET properties, making managing connection information easier.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.3 OracleDataAdapter Batch Processing
During updates to Oracle Database, the ODP.NET OracleDataAdapter can batch a set of rows back to the database per round trip. The number of rows per round trip can be set by the developer.
This feature enhances application performance by reducing the number of round trips to the database when applying updates from the DataSet.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.4 Row-Level Change Notifications
.NET developers often used client-side cached data. When another user changes the original data on the server, the database sends a change notification message to the client, indicating that the client data is now invalid. Previously, change notifications were registered at the table level. In this release, developers can register their queries at the row level so that they are alerted only when the rows they selected have changed.
.NET clients can now receive more accurate change notification alerts.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.5 Schema Discovery
ODP.NET schema discovery allows applications to request and return information about the database schema to the client. Different database schema elements such as tables, columns, and stored procedures are exposed through the GetSchema methods of the OracleConnection class.
ODP.NET can retrieve a set of generic and Oracle-specific schema information.
Schema discovery supplies a common API for all ADO.NET 2.0 drivers to retrieve database schema information to the client application.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.6 Data Source Enumeration
The ODP.NET OracleDataSourceEnumerator class provides a list of active Oracle database servers.
Data source enumeration can be retrieved programmatically in a generic manner common to all ADO.NET 2.0 providers.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.7 Faster LOB Retrieval
ODP.NET now makes fewer round trips to the database server to retrieve LOB information.
ODP.NET LOB retrieval performance is now faster.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.8 Improved Parameter Context Caching in Statement Caching
For statement caching, ODP.NET now caches parameter contexts after the first statement execution.
Many applications execute the same SQL or PL/SQL statement repeatedly. In the first execution of the statement, ODP.NET can now cache parameter contexts so that they can be reused. This improves the performance of subsequent statement executions.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.9 Oracle Provider for OLE DB
These features improve data access performance from Windows clients to Oracle Database. Many of these features are transparent, meaning applications experience faster performance by upgrading the database server and client without any code changes.
1.1.9.1 Faster Performance
Oracle Provider for OLE DB has implemented a number of new features in its provider to improve query performance for the end user.
See Also:
Oracle Provider for OLE DB Developer's Guide for details
1.1.9.2 Improved Metadata Caching
For metadata caching, Oracle Provider for OLE DB now caches the metadata after the first execution when statement caching is turned off. This is useful when a large amount of column metadata is retrieved with a small amount of row data. Oracle Provider for OLE DB has also improved metadata caching when statement caching is turned on.
Many applications execute the same SQL or PL/SQL statement repeatedly. In the first execution of the statement, Oracle Provider for OLE DB can cache a query's metadata so that it can be reused. This improves the performance of subsequent statement executions.
See Also:
Oracle Provider for OLE DB Developer's Guide for details
1.1.9.3 Improved Statement Caching
For statement caching, Oracle Provider for OLE DB now caches large fetch arrays and OCI error handles after the first execution.
Many applications execute the same SQL or PL/SQL statement repeatedly. In the first execution of the statement, Oracle Provider for OLE DB can now cache a statement's parse information so that it can be reused. This improves the performance of subsequent statement executions.
See Also:
Oracle Provider for OLE DB Developer's Guide for details
1.1.10 PHP
The features in the following sections describe the enhancements to Oracle's client-side stack so that data access open source PHP driver performs better than PHP data access drivers for other databases.
1.1.10.1 Database Resident Connection Pooling (DRCP)
Prior to this release, session sharing capabilities were available for multithreaded applications only. With this new feature, different application processes can share sessions within the same host machine as well as across multiple host machines. The pool is maintained on the database server by a new background process.
This feature is useful for applications that cannot be deployed as multithreaded (for example, PHP applications in an Apache Web server environment) and database requests are done in a session state independent manner. These applications no longer have to hold the connections to the database persistently, thereby increasing the scalability of the database.
The pool is managed by the DBA and the OCI and OCCI applications can reuse the sessions by specifying a connection class name within which the application leaves sessions of similar state.
See Also:
Oracle Call Interface Programmer's Guide for details
1.1.11 PL/SQL
The following sections discuss features that:
• Reduce downtime associated with application patching
• Enhance performance and scalability (TPCC, APPS)
• Provide integration between PL/SQL and SQL
1.1.11.1 XA API Available Within PL/SQL
The functionality available in the XA interface to support transactions involving multiple resource managers, such as databases and queues, is now available from PL/SQL.
Application developers are now able to switch or share transactions across SQL*Plus sessions or processes using PL/SQL.
See Also:
Oracle Database Advanced Application Developer's Guide for details
1.1.11.2 Allow Sequences in PL/SQL Expressions
In the previous release of Oracle Database, when a PL/SQL program needed to get a value from syntax, it used SQL. For example:
DECLARE n NUMBER;
BEGIN
SELECT Seq.Nextval INTO n FROM Dual;
END;

This posed a usability problem for PL/SQL programmers and causes runtime performance and scalability problems for the application particularly because it requires the use of a cursor.
In Oracle Database 11g, it is now possible to simply use Seq.Nextval in a PL/SQL expression. For example:
DECLARE n NUMBER := Seq.Nextval;
BEGIN
...

The same is possible for the CURRVAL pseudocolumn.
This feature brings improved usability for the PL/SQL programmer and improved runtime performance and scalability.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.11.3 Enhancements to the Regular Expression Built-Ins
There is new syntax to access the nth subexpression in REGEXP_SUBSTR and REGEXP_INSTR. This is useful if, for example, the matching string is always surrounded by tags like and but you want to extract just what lies between these tags. REGEXP_SUBSTR returns the subexpression. REGEXP_INSTR returns the position.
The new built-in REGEXP_COUNT returns the number of times the pattern is matched in the input string.
This new functionality is available both in SQL and in PL/SQL.
The benefit is increased functionality for the regular expression built-ins. Earlier applications that needed this functionality had to write relatively elaborate application code which is no longer the case.
See Also:
Oracle Database Advanced Application Developer's Guide for details
1.1.11.4 Functional Completeness of Dynamic SQL for PL/SQL
In Oracle Database 11g, native dynamic SQL now supports statements bigger than 32K characters by allowing a CLOB argument. Also included with this feature:
• DBMS_SQL.PARSE() gains a CLOB overload
• A REF CURSOR can be converted to a DBMS_SQL cursor and vice versa to support interoperability
• DBMS_SQL supports the full range of data types (including collections and object types)
• DBMS_SQL allows bulk binds using user-define collection types
The features for executing dynamic SQL from PL/SQL had some restrictions in Oracle Database 10g. DBMS_SQL was needed for Method 4 scenarios but it could not handle the full range of data types and its cursor representation was not usable by a client to the database. Native dynamic SQL was more convenient for non-Method 4 scenarios, but it did not support statements bigger than 32K. Oracle Database 11g removes these and other restrictions to make the support of dynamic SQL from PL/SQL functionally complete.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.11.5 Method Invocation Scoping Operator
A subtype usually adds specific data attributes to its more generic supertype. Typically, a NOT FINAL member procedure, for example, Show_Attributes(), is implemented at each level in the type hierarchy. It is natural to implement this at one level by reusing the implementation at the parent level and by adding new code just for the attributes of the subtype.
Oracle Database 11g supports the ANSI SQL generalized-invocation syntax to allow the following:
( AS )..

Without this syntax, programmers were forced to use a cumbersome workaround which relied on using static subprograms rather than member subprograms.
This feature brings the implementation of object-oriented programming in Oracle Database closer to completeness.
See Also:
Oracle Database Object-Relational Developer's Guide for details
1.1.11.6 Named and Mixed Notation for User-Defined PL/SQL Subprogram in a SQL Statement
Consider a schema-level function f() declared as:
FUNCTION f(
p1 IN INTEGER := 1,
p2 IN INTEGER := 2,
...
pn IN INTEGER := 99)
RETURN INTEGER

Beginning in this release, it is now possible to invoke the function in a SQL statement. For example, named notation syntax is:
SELECT f(pn=>3, p2=>2, p1=>1) FROM dual

Or, mixed notation is:
SELECT f(1, pn=>3) FROM dual

In previous releases, attempting named or mixed notation resulted in an error.
The benefit is improved usability when a PL/SQL function, with many default parameters, is invoked in a SQL statement and only one or a small number of the actual parameters need to differ from their default values.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.11.7 New Compound Trigger Type
A compound trigger has a section for each of the BEFORE STATEMENT, BEFORE EACH ROW, AFTER EACH ROW, and AFTER STATEMENT timing points. All of these sections can access a common PL/SQL state. The common state is created when the firing statement starts and destroyed when it completes, even when the firing statement causes an error. A compound trigger can be used to speed performance in an auditing scenario where audit rows can be accumulated in the EACH ROW section and bulk inserted to the audit table in the AFTER STATEMENT section. A similar approach is sometimes required to avoid the mutating table error. The alternative to using compound triggers is to model the common state with an ancillary package. This approach is both cumbersome to program and subject to memory leak when the triggering statement causes an error and the AFTER STATEMENT trigger does not fire.
This feature brings improved usability for the PL/SQL programmer and improved runtime performance and scalability.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.11.8 PL/Scope
PL/Scope allows you to browse PL/SQL source code analogously to the way that Cscope (see http://cscope.sourceforge.net/) allows you to browse C source code. You can search for and display all types of definitions, declarations, assignments and references in the PL/SQL source code.
The PL/SQL compiler can optionally derive the metadata needed to support PL/Scope and store it in the database catalog. The metadata takes into account the nuances of the language, including scoping and overloading. You can generate reports (especially hyperlinked HTML reports) with supplied report generators. This feature is exposed through Oracle SQL Developer's interactive PL/SQL development environment.
PL/Scope supports increased developer productivity, especially for those who need to maintain someone else's code.
See Also:
Oracle Database Advanced Application Developer's Guide for details
1.1.11.9 PL/SQL CONTINUE Statement
Many programming languages allow transfer of control either out of the loop entirely or within a loop back to a new iteration. In previous releases, PL/SQL only allowed transfer of control out of the loop using the EXIT statement. In Oracle Database 11g Release 1 (11.1), the new CONTINUE statement implements the ability to transfer control within a loop back to a new iteration.
Many algorithms require the loop control that this new CONTINUE statement now provides. With this explicit feature, you are no longer required to code several lines of PL/SQL and maintain commonly-adopted style rules.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.11.10 PL/SQL Hierarchical Profiler
PL/SQL Hierarchical Profiler identifies hot spots and performance tuning opportunities in PL/SQL database applications. It reports the dynamic execution program profile organized by subprogram calls. SQL and PL/SQL execution times are accounted for separately. PL/SQL Hierarchical Profiler requires no special source or compile time preparation.
Start and stop procedures in the new package, DBMS_HPROF, control the recording of raw PL/SQL Hierarchical Profiler data. Then other subprograms in this package are used to transform the raw data into schema-level tables to allow the generation of reports. For example, hyperlinked XML or HTML reports.
This feature is part of Oracle SQL Developer's interactive PL/SQL development environment.
Programmer productivity and program performance are both enhanced because PL/SQL Hierarchical Profiler directs tuning effort towards those PL/SQL functions that will benefit most.
See Also:
Oracle Database Advanced Application Developer's Guide for details
1.1.11.11 PL/SQL Inlining Optimization
Modern PL/SQL software includes many procedures frequently called in various programs. The power of the PL/SQL optimizing compiler is increased by incorporating the inlining optimization (replacement of a procedure call with a copy of the procedure body). The revised code executes more quickly because call overhead has been eliminated and because further optimizations are possible when the compiler knows the actual values with which the inlined procedure is called.
Performance gains can be substantial. The compiler does this optimization automatically. However, you may control the optimization in detail when necessary. Many PL/SQL programs execute faster, as a direct consequence of upgrade, simply by recompiling existing units.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.11.12 SIMPLE_INTEGER Data Type
The new PL/SQL SIMPLE_INTEGER data type is a binary integer for use with native compilation which is neither null checked nor overflow checked. The range is all integer values in the inclusive interval [-2147483648..2147483647] and does not include a null value. These rules allow a direct hardware implementation when used in combination with PL/SQL native compilation.
The SIMPLE_INTEGER data type yields significant performance benefits compared to PLS_INTEGER. It can be used when the value will never be null and when overflow check is not needed.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.12 XML Application Development
The features described in the following sections ensure that PL/SQL, Java, C and .NET programmers can leverage the full capabilities of Oracle XML DB and the Oracle XML DB repository. These new features also extend the infrastructure components to support Binary XML and provides an efficient method for handling very large XML documents. There is also support relevant to JSRs for XML application development including JSR-170 for content repository access and the emerging JSR-225 standard for XQuery. The Oracle XML libraries continue to deliver the best possible application development framework for XML developers working in J2EE and .NET environments, regardless of whether they are using the Oracle XML DB feature. These new features deliver highly optimized XSLT and XQuery engines for use with Oracle Application Server and Fusion Middleware.
1.1.12.1 Binary XML Support for Java
The new XDK binary XML processors include a binary XML encoder, a binary XML decoder, and a token manager to convert the schema or nonschema-based binary XML stream to and from XML 1.0 text and SAX events. The format is the same as the format used within Oracle XML DB.
This feature allows XML processing applications to leverage a compact, pre-parsed XML format which could save in memory and CPU consumption as well as network bandwidth. With a single format supported by Oracle XML DB and Oracle XDK and the Oracle XML DB support within the binary XML processors, this feature allows the performance optimization across tier XML applications.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.2 Binary XML Support for Oracle XML DB
No single approach to persisting XML can solve all of the possible use cases presented by the XML application development paradigm. Binary XML (which is a way of representing the structure of an XML document) adds a third storage model for persisting XML in the database. It complements, rather than replaces, the existing object storage and text storage models.
Binary XML has two significant benefits:
• It enables significant optimizations of XML operations whether or not an XML schema is available.
• It allows the internal representation of XML to be the same regardless of whether the XML is in disk, in memory, or on the wire.
As with other storage mechanisms, the application developer can continue to use XMLType and its associated methods and operators without regard to the details of storage.
See Also:
Oracle XML DB Developer's Guide for details
1.1.12.3 Configurable DOM Support for Java
The following options are provided for building Document Object Model (DOM):
• static final String ACCESS_MODE = "DOM_ACCESS_MODE";
• static final String READ_ONLY = "READ_ONLY";
• static final String UPDATEABLE = "UPDATEABLE";
• static final String FORWARD_READ = "FORWARD_READ";
• static final String STREAMING = "STREAM_READ";
This feature enables XML applications to achieve maximum efficiency in terms of memory usage and performance by configuring the DOM building with different access patterns such as read-only, forward read, or streaming. This feature prevents light-weight XML applications from having to deal with a heavy DOM object tree.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.4 Event-Based XML Pull Parsing for C
XML pull parsing supports the stream-based parsing model which limits memory footprints by not preserving any document states in memory. Compared with SAX, the new pull parsing model only parses events requested by the application and accepts multiple input XML documents.
This feature improves the C XML processing performance and ensures the scalability with the new stream-based XML pull parsing. This feature also limits memory footprints by not preserving any document states in memory and improves the performance of the XML processing by only parsing stream events requested by the application. The pull parsing also makes the XML processing easy-to-use by allowing one parsing process to handle multiple XML documents.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.5 High Performance XPath Query for Java
Support JAXP 1.3 APIs for query XML content using XPath with the following extensions:
• Supports variable resolver in both static and dynamic context.
• Allows users to register runtime context.
This feature improves the performance and the usability of Java XPath/XSLT implementation.
1.1.12.6 In-Place XML Schema Evolution
This feature lets users make changes to a registered XML schema without having to unload and reload all of the XML documents that are compliant with the XML schema. Existing documents are not modified during in-place evolution, so only changes that do not invalidate the existing corpus of XML documents are permitted.
This feature enables rapid responses to changes in requirements by allowing certain common changes to XML schemas be made without having to unload and reload data. Organizations can take advantage of the benefits of XML schema-based XML storage in environments where the dynamic nature of the application or the large volume of XML content might make unloading and reloading the entire XML corpus to accommodate a change in the XML schema unrealistic.
The feature greatly reduces the overhead involved in making changes to XML schema in the majority of cases. Evolving an XML schema in cases where there are large number of documents compliant with the XML schema is a very expensive process that can take days to complete. In-place XML schema evolution allows the majority of common changes to be made almost instantaneously, with zero downtime, resulting in significant cost savings for the organization.
See Also:
Oracle XML DB Developer's Guide for details
1.1.12.7 Mid-Tier XQuery Engine Performance Improvements
XQuery performance improvements have been made in this release.
XQuery performance improvements for the mid-tier speed up applications relying on the mid-tier XQuery services.
1.1.12.8 Pluggable DOM Support for Java
The pluggable DOM splits the DOM implementation into two separate layers, the DOM API layer and the data layer. The API layer consists of a lightweight, transient node fragment that links to underlying data, which can be backed by external storage for scalability. The data has two varieties, internal data and plug-in data. The plug-in data support is through the InfosetReader implementations.
This feature allows XML applications to build DOM based on different forms of XML data through a unified interface. This feature improves portability of the XML applications.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.9 Scalable and High Performance XML Validation for C
The stream-based XML Schema validation allows XML applications to validate XML content against XML schemas in XML pull parsing process.
High performance XML processing and its scalability are very critical for enterprise XML applications. This feature improves the C XML processing performance and ensures the scalability with the new stream-based XML Schema validation.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.10 Scalable DOM Support for Java
This feature ensures the scalability of Database Object Model (DOM) processing for XML applications with the following support:
• Allows XML applications to process large XML documents by loading and saving DOM nodes in memory and using a page manager for physical binary data management.
• Allows storing DOM updates with references to the source data in Binary XML.
• Allows multiple applications sharing same DOM data source and operating on a lightweight, transient node fragment that links to underlying data, which can be backed by external storage for scalability.
• Supports Binary XML as the data source or the output.
• Supports shadow copy in DOM (cloneNode() or importNode()) which does not require the whole content being deep copied.
Scalability is the key to the success of the enterprise XML applications. This feature ensures the scalability of DOM processing for XML applications.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.11 Unified Java API for XML
The new unified Java API for XML allows mid-tier Java programs to leverage all of the benefits of XMLType by providing a disconnected mode of operation that allows XMLType to be used with a session pool model of connection management.
This allows the XMLType object to be disconnected from the database session that was used to create it.
This feature improves Java programmer productivity by allowing a single API to be used to manipulate XML content stored in Oracle XML DB and XML content stored in other sources.
Unified Java API also provides a disconnection mode of operation that allows XMLType to be used in a mid-tier environment where session pooling makes it impractical to hold the database connection that was used to instantiate the XMLType.
1.1.12.12 Unified Java API for XML
This feature allows mid-tier Java programs to leverage all of the benefits of XMLType by providing a disconnected mode of operation that allows XMLType to be used with a session pool model of connection management. This allows the XMLType object to be disconnected from the database session that was used to create it.
This feature improves Java programming productivity by allowing a single API to be used to manipulate the XML content stored in Oracle XML DB and the XML content stored in other sources.
This feature provides a disconnection mode of operation that allows XMLType to be used in a mid-tier environment where session pooling makes it impractical to hold the database connection that was used to instantiate the XMLType.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.13 XMLDiff Support for C
The XMLDiff detects the differences between the two XML documents and represents the difference in XML. The XMLPatch takes the differences created by XMLDiff and applies the changes on the target XML document.
This feature allows high performance XML document comparison and user controlled updates. With the support for detecting differences between two XML documents, XML applications can easily control document versions, merge and synchronize the content. The feature also reduces the processor demand by handling only the changed data, reduces bandwidth demands by transmitting only updates, and increases security by splitting sensitive data into separate streams which can then be reassembled on delivery.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.14 XMLIndex Enhancements
This feature provides an asynchronous mode for XMLIndex, where the indexing operations take place separately from the INSERT or UPDATE operations. Applications no longer have to wait for indexing to complete (which, for large documents, can be a significant operation) before being able to complete a transaction.
This feature also provides the ability to define the set of XPath expressions that are indexed by a given XMLIndex. The subset can be defined using INCLUDE or EXCLUDE syntax.
Subsetting XPath expressions that are indexed allows organizations to balance index size with disk usage, and to balance performance on insert with flexibility on retrieval.
This feature provides more flexibility for the organizations using XMLIndex. XMLIndex can be used in a wide range of applications. The feature improves application performance by allowing indexing to take place separately from INSERT and UPDATE operations. It also allows organizations to balance performance, flexibility, and disk usage when using XMLIndex.
See Also:
Oracle XML DB Developer's Guide for details
1.2 Availability
The following sections describe Availability features for Oracle Database 11g Release 1 (11.1).
1.2.1 Availability Interfaces in Oracle Enterprise Manager
The following sections describe improvements to the Enterprise Manager interfaces for high availability features.
1.2.1.1 Browser-Based Enterprise Manager Integrated Interface for LogMiner
This feature now makes it possible to use the browser-based Oracle Enterprise Manager Database Control interface for LogMiner. In prior releases, administrators were required to use the standalone Java Console to use LogMiner. The Console was not integrated with the rest of Enterprise Manager and was cumbersome to install. With this new interface, administrators have a task-based, intuitive approach to using LogMiner.
This new feature improves the manageability of LogMiner. The task-based work flows enable log mining and are integrated with Flashback Transactions.
1.2.2 Data Guard Improvements
The features in the following sections describe enhancements to Oracle Data Guard.
1.2.2.1 Fast-Start Failover for Maximum Performance Mode in a Data Guard Configuration
This feature enables fast-start failover to be used in a Data Guard configuration that is set up in the maximum performance protection mode. Since there is some possibility of data loss when a Data Guard failover occurs in maximum performance mode, administrators can now choose not to do a fast-start failover if the redo loss exposure exceeds a certain amount.
This enhancement allows a larger number of disaster recovery configurations to take advantage of Data Guard's automatic failover feature.
See Also:
Oracle Data Guard Broker for details
1.2.2.2 Compression of Redo Traffic (Only for Gap Resolution) Over the Network in a Data Guard Configuration
Archived redo logs, if needed to be transmitted to the standby database in an Oracle Data Guard configuration, can now be compressed as they are sent over the network.
This feature improves the network bandwidth utilization in an Oracle Data Guard configuration.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.2.3 Real-Time Query Capability of Physical Standby Database
It is now possible to query a physical standby database while Redo Apply is active.
This new capability increases your return on investment in Data Guard technology because a physical standby database can now be used to offload queries from the primary database in addition to providing data protection.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.2.4 Fast Role Transitions in a Data Guard Configuration
This feature improves the performance of Oracle Data Guard role transitions.
The benefit is increased flexibility and manageability of your disaster recovery configurations using Oracle Data Guard.
1.2.2.5 User Configurable Conditions to Initiate Fast-Start Failover in a Data Guard Configuration
This feature enables the administrator to choose and configure a list of conditions which, if they occur, will initiate fast-start failover.
This feature increases the flexibility and manageability of customers' disaster recovery configurations.
See Also:
Oracle Data Guard Broker for details
1.2.3 Data Guard Integration, Simplification, and Performance
The new features in the following sections simplify the configuration and use of Oracle Data Guard. For example, some features provide a smaller set of integrated parameters, a unified SQL/Broker syntax, and better integration with other High Availability features like RMAN and Oracle RAC. Other features enhance the performance of key Oracle Data Guard features like redo transport, gap resolution, switchover/failover times, and Logical Standby Apply.
1.2.3.1 Dynamic Setting of Oracle Data Guard SQL Apply Parameters
It is now possible to configure specific SQL Apply parameters without requiring SQL Apply to be restarted.
This ability improves the manageability, uptime, and automation of a Logical Standby configuration.
1.2.3.2 Enhanced Data Guard Broker Based Management Framework
The enhancements for this release include:
• Data Guard Broker improved logging and tracing
• OMF support for Data Guard Broker configuration files
• Data Guard Broker integration with database startup
• Data Guard Broker support for advanced redo transport settings
• Data Guard Broker support of prepared switchovers for Logical Standby
These enhancements make it possible to use Data Guard Broker in a wider variety of disaster recovery configurations.
See Also:
Oracle Data Guard Broker for details
1.2.3.3 Enhanced Data Guard Management Interface (Using SQL*Plus)
This feature makes it much simpler to use Oracle Data Guard administration-related SQL statements and initialization parameters.
The benefit of this feature is increased flexibility and manageability of disaster recovery configurations using Oracle Data Guard.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.3.4 Histogram for Redo Transport Response Time in a Data Guard Configuration
This feature advises on a suitable value for NET_TIMEOUT based on the response times for SYNC redo transport destinations.
The benefit is an increase in the flexibility and manageability of disaster recovery configurations using Data Guard.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.3.5 Snapshot Standby
A physical standby database can be open temporarily (that is, activated) for read/write activities such as reporting and testing. A physical standby database in such a state can still receive redo data from the primary database, thereby providing data protection for the primary database while still in the reporting database role.
This feature provides the combined benefit of disaster recovery, and reporting and testing using a physical standby database.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.3.6 Strong Authentication for Data Guard Redo Transport
Redo transport network sessions can now be authenticated using SSL. This provides strong authentication and makes the use of remote login password files optional in a Data Guard configuration.
The benefit is increased security of your disaster recovery configurations using Oracle Data Guard.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.3.7 Enhanced DDL Handling in Oracle Data Guard SQL Apply
SQL Apply executes in parallel (based on availability of parallel servers) DDLs that were executed with a parallel hint at the primary database.
1.2.3.8 Enhanced Oracle RAC Switchover Support for Logical Standby Databases
When switching over to a logical standby database where either the primary database or the standby database is using Oracle RAC, the SWITCHOVER command can be used without having to shut down any instance either at the primary or at the logical standby database.
1.2.4 Data Guard Logical Apply Completeness
The following sections describe features that add support for other database server features that are not currently handled by Oracle Data Guard. For example:
• LogMiner support for unsupported data types
• Objects and XML
1.2.4.1 Oracle Scheduler Support in Data Guard SQL Apply
It is now possible to use a logical standby database to provide data protection for a primary database in which the DBMS_SCHEDULER package was executed.
This enhancement allows Data Guard SQL Apply (logical standby database) to be used for a wider variety of applications.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.4.2 Fine-Grained Auditing (FGA) Support in Data Guard SQL Apply
It is now possible to use a logical standby database to provide data protection for primary databases using Oracle Fine-Grained Auditing (FGA).
This new support allows Data Guard SQL Apply (logical standby database) to be used for a wider variety of applications. In this case, applications with security features built-in.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.4.3 Support Transparent Data Encryption (TDE) with Data Guard SQL Apply
It is now possible to use a logical standby database to provide data protection for the primary database tables with Transparent Data Encryption (TDE).
This new support allows Data Guard SQL Apply (logical standby database) to be used for a wider variety of applications. In the case, applications with security features built-in.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.4.4 Support XMLType Data Type (Only CLOB) in Data Guard SQL Apply
It is now possible to use a logical standby database to provide data protection for primary database tables with the XMLType data type (only the CLOB representation).
This new support allows Data Guard SQL Apply (logical standby database) to be used in a wider variety of applications.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.4.5 Virtual Private Database (VPD) Support in Data Guard SQL Apply
It is now possible to use a logical standby database to provide data protection for primary database tables with Oracle Virtual Private Database (VPD).
This new support allows Data Guard SQL Apply (logical standby database) to be used for a wider variety of applications. In this case, applications with security features built-in.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.5 High Availability Improvements
The following sections describe general improvements in High Availability.
1.2.5.1 Flashback Transaction
Flashback transaction is a new feature that can easily back out a transaction and its dependent transactions. This recovery operation utilizes undo data to create and execute the corresponding, compensating transactions that revert the affected data back to its original state.
This feature increases availability during logical recovery by easily and quickly backing out a specific transaction or set of transactions and their dependent transactions, with one command, while the database remains online.
See Also:
Oracle Database Advanced Application Developer's Guide for details
1.2.5.2 SMP Scalable Redo Apply
Redo Apply performance has been significantly improved as a result of some internal optimizations in media recovery. Wait event generation in media recovery has also been enhanced.
This feature enables faster performance of media recovery and also Data Guard Redo Apply (physical standby database), thereby enabling real-time disaster recovery for more voluminous and highly transactional databases.
1.2.5.3 Transportable Databases Between Linux and Windows
This feature enables simple moving of databases between Linux and Windows.
This results in transportable databases between Linux and Windows enabling cross-platform physical standby and simple moving of databases between Linux and Windows.
1.2.6 Information Life Cycle Management
The features described in the following sections provide automated and policy-based movement of data between storage tiers and they provide mechanisms for complying with retention and immutability regulations.
1.2.6.1 Flashback Data Archive
The historical data store provides the ability to store and track all transactional changes to a record for the duration of its lifetime.
The database maintains every state of the record during its lifetime. You no longer need to build this intelligence into the application. This feature is useful for compliance reporting and audit reports.
See Also:
Oracle Database Advanced Application Developer's Guide for details
1.2.7 Integration, Simplification, and Performance of Availability Features
These features describe improvements to the interoperability, usability, performance and robustness of existing functionality.
1.2.7.1 Automatic Reporting of Corrupt Blocks
During instance recovery, if corrupt blocks are encountered, the DBA_CORRUPTION_LIST is automatically populated.
Block validation occurs at every level of backup, media recovery, and instance recovery.
1.2.7.2 Block Media Recovery Performance Improvements
In prior releases, block media recovery needed to restore original block images from disk or tape backup before applying needed archived logs. In this release, if flashback logging is enabled and contains older, uncorrupted blocks of the corrupt blocks in question, then these blocks will be used, speeding up the recovery operation.
The benefit is a reduction in the time it takes for block media recovery by restoring block images from flashback logs instead of from disk or tape backups.
See Also:
Oracle Database Backup and Recovery User's Guide for details
1.2.7.3 Creation and Recovery of Long-Term Backups Improved
Long-term backups created with the KEEP option only back up the archive logs needed to make the backup consistent. No further archive log backups are retained.
This feature reduces the archive log backup storage needed for online, long-term KEEP backups by only backing up the archive logs needed to recover the long-term backup.
See Also:
Oracle Database Backup and Recovery User's Guide for details
1.2.7.4 End-to-End Redo Validation
This feature enhances redo validation.
End-to-end redo validation provides foreground redo checksum at generation time. This improves CPU and cache efficiency for the checksum computation.
1.2.7.5 Merge Catalogs
The new IMPORT CATALOG command allows one catalog schema to be merged into another, either the whole schema or just the metadata for specific database IDs.
This feature simplifies catalog management by allowing separate catalog schemas, created at different versions, to be merged into a single catalog schema.
See Also:
Oracle Database Backup and Recovery User's Guide for details
1.2.7.6 Parallel Backup and Restore for Very Large Files
Backups of large data files now use multiple parallel server processes to efficiently distribute the workload for each file. This is especially useful for very large files.
This features improves the performance backups of large data files by parallelizing the workload for each file.
See Also:
Oracle Database Backup and Recovery User's Guide for details
1.2.8 Intelligent Data Protection and Repair
The following sections describe features that automate the process of determining what kind of recovery is needed and applying that needed recovery.
1.2.8.1 Data Recovery Advisor
Data Recovery Advisor is a built-in tool that automatically diagnoses data failures and reports the appropriate repair options.
Data Recovery Advisor ensures the correct repair is performed for a failure and decreases the amount of time to recover from a failure.
See Also:
Oracle Database Backup and Recovery User's Guide for details
1.2.8.2 Enhance LogMiner to Support Automatic Data Repair
This new feature adds support for Automatic Data Repair (ADR).
Automatic Data Repair (ADR) requires the ability to lookup metadata when the database is not available. This project enhances the existing functionality in LogMiner to support ADR.
1.2.8.3 Integrated Protection From Various Data Corruptions
Through the creation of a new initialization parameter, DB_ULTRA_SAFE={off, data_only, data_and_index}, this capability provides an integrated mechanism to offer protection from various possible data corruptions that may impact Oracle Database. This parameter controls the setting of other related parameters such as DB_BLOCK_CHECKING, DB_BLOCK_CHECKSUM, and DB_LOST_WRITE_PROTECT, and also controls other data protection behavior within Oracle Database (for example, requiring ASM to do sequential mirror writes).
This feature improves the data protection capabilities of Oracle Database by offering an integrated mechanism to control various levels of protection from data corruptions. By making it possible to detect data corruptions in a timely manner, this feature also provides critical high availability benefits for Oracle Database.
1.2.8.4 Lost-Write Detection Using a Physical Standby Database
Lost-write is a serious form of data corruption that can adversely impact a database. Lost-write occurs when an I/O subsystem acknowledges the completion of a block write in the database while, in fact, the write did not occur in the persistent storage. This arises mostly because of hardware or software malfunctioning. This feature enables the use of the physical standby database to detect data corruptions that could arise as a result of lost-writes on the primary database.
This feature allows for more comprehensive data corruption detection using a physical standby database, helping you get increased value from your disaster recovery investment and maintain the uptime requirements of your business.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.9 Online Application Maintenance and Upgrade
The following features can significantly reduce the downtime required to make changes to an application's database objects.
1.2.9.1 DDL With the WAIT Option
Data definition language (DDL) commands require exclusive locks on internal structures. If DDL commands are issued, these locks may not be available causing the statement to immediately fail even though the DDL could have possibly succeeded sub-seconds later. This can be resolved by setting the WAIT option in the DDL_LOCK_TIMEOUT initialization parameter.
The WAIT option is the new default. The wait time is specified instance-wide (in the initialization parameter file) and can be modified on a session level.
The WAIT option gives you more flexibility to define grace periods for such commands to succeed instead of raising an error right away, thus requiring additional application logic to handle such errors.
See Also:
Oracle Database Administrator's Guide for details

all about oracle 11g

1 Oracle 11g Database New Features
This chapter contains descriptions of all of the features that are new to Oracle 11g Database Release 1 (11.1). This chapter contains the following sections:
• Application Development
• Availability
• Database Overall
• Business Intelligence and Data Warehousing
• Clustering
• Content Management Services
• Fault Diagnosability
• Information Integration
• Location Services and Specialty Data
• Manageability
• Performance
• Security
• Windows
1.1 Application Development
1.1.1 APIs and Precompilers
The following sections describe new Oracle Database 11g features in application programmatic interfaces. These features improve performance and scalability of applications and enable easy deployment of the Oracle client-side stack.
1.1.1.1 Client-Side Query Cache
This feature enables caching of query result sets in client memory. The cached result set data is transparently kept consistent with any changes done on the server side.
Applications leveraging this feature see improved performance for queries which have a cache hit. Additionally, a query serviced by the cache avoids round trips to the server for sending the query and fetching the results. It also reduces the server CPU that would have been consumed for processing the query, thereby improving server scalability.
See Also:
Oracle Call Interface Programmer's Guide for details
1.1.1.2 OCI Client Session NLS Character Set Status Information
This new feature adds client session NLS and character set information to the V$SESSION_CONNECT_INFO and GV$SESSION_CONNECT_INFO views.
This enhancement provides DBAs with access to client-side session character set information for all clients. This information is especially useful in troubleshooting problems.
See Also:
Oracle Database Globalization Support Guide for details
1.1.1.3 Precompilers: Additional Array INSERT and SELECT Syntax Support by Pro*C/C++ and Pro*COBOL
In this Oracle Database 11g release, there is added support for IBM DB2 array INSERT and array SELECT syntax for Pro*C/C++ and Pro*COBOL.
Adding support for IBM DB2 array INSERT and array SELECT syntax helps with the migration of IBM DB2 installations to Oracle.
See Also:
Pro*C/C++ Programmer's Guide for details
1.1.1.4 Precompilers: Dynamic SQL Statement Caching in Pro*C/C++ and Pro*COBOL
Application developers can now precompile Pro*C/C++ and Pro*COBOL applications with the new statement caching option.
The potential benefit of this feature is an increase in performance by enabling statement caching in precompiled programs. The performance improvement is achieved by removing the overhead of parsing the dynamic statements on reuse.
See Also:
Pro*C/C++ Programmer's Guide for details
1.1.1.5 Precompilers: Fix Execution Plan in Pro*C/C++ and Pro*COBOL
This new feature focuses on fixing an execution plan for a Pro*C/C++ and Pro*COBOL application by using the outline feature.
By using the outline feature, you can ensure that the performance of the application is not affected when modules are integrated and deployed into different environments.
1.1.1.6 Precompilers: Flexible B Area Length for Pro*COBOL
The length of B Area for the Pro*COBOL application can now be from 8 to 253 columns.
The length of B Area for a Pro*COBOL program was limited to 72 when the format is set to ANSI. COBOL compilers now can support B Area length up to 253. This provides a programmer with the flexibility to type a line that is longer than 72 columns.
1.1.1.7 Precompilers: Implicit Buffered Insert in Pro*C/C++ and Pro*COBOL
Some applications that require periodic insertion of new data use a single INSERT statement within a loop. When queried by a command-line argument, the precompiler buffers the rows being inserted, reducing network round trips.
The benefit is that an implicit buffered INSERT provides performance improvement that is comparable to using the precompiler array interface.
See Also:
Pro*C/C++ Programmer's Guide for details
1.1.1.8 Precompilers: Platform Endianness Support by Pro*COBOL
Oracle always stores Unicode data (UTF16) in Big Endian representation. Linux and Windows have Little Endian representation and Solaris has Big Endian representation. With this enhancement, Unicode data can be fetched in Little Endian format on Windows and Linux platforms using a Pro*COBOL application.
When a UTF16 (UCS2) string is fetched in PIC N variable in a Pro*COBOL application running on Little Endian platforms, the application can now be precompiled with the appropriate command-line option to have the correct platform endianness.
See Also:
Pro*COBOL Programmer's Guide for details
1.1.1.9 Precompilers: Scrollable Cursor Support in Pro*COBOL
Pro*COBOL now supports scrollable cursors to fetch data in a nonsequential manner.
A scrollable cursor enables you to access the rows of a database result set in a forward, backward, and random manner. This enables the program to fetch any row in the result set.
1.1.1.10 Precompilers: SQL99 Syntax Support by Pro*C/C++
With this enhancement, the SQL99 syntax for SELECT, INSERT, DELETE, and UPDATE statements and the body of the cursor in a DECLARE CURSOR statement is supported by Pro*C/C++.
Oracle Database supports most of the SQL99 syntax. With this enhancement, Pro*C/C++ also supports the SQL99 syntax that is supported by Oracle Database.
See Also:
Pro*C/C++ Programmer's Guide for details
1.1.2 Application Express
The following sections describe new features for Oracle Application Express. Application Express provides an application development tool that is built into the database and is installed in the database by default which is different from Oracle Database 10g implementation.
1.1.2.1 Application and Schema Comparison
New application and schema comparison capabilities enable you to identify differences between two selected applications.
You can also identify differences between objects in two different schemas.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.2 Drag and Drop Item Layout
The Drag and Drop Layout page enables you to interactively reorder items within a given region, change select item attributes, create new items, and delete existing items.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.3 Flash Charts
Oracle Application Express includes support for 18 different types of Flash charts. You can create Flash charts when creating a new page or by defining a Chart region.
This release also includes a utility that enables you to convert existing Scalable Vector Graphics (SVG) charts to Flash.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.4 Friendly URL Syntax to Facilitate Bookmarks
By specifying zero as the session ID, you can now make it easier for application users to bookmark pages within an application.
This features makes all public page links consistent, making them easier to bookmark.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.5 Improved Web Services
Oracle Application Express now supports more loosely defined Web services types and document styles. Both of these enhancements enable support for Web services created with JDeveloper and Oracle BPEL synchronous processes. You can now interact with Web services over a Secure Sockets Layer (SSL) and work with Web services that require basic authentication.
Finally, this release also enables you to manually create a Web services reference even if the Application Express engine cannot correctly parse a WSDL document.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.6 Improved Workspace Management
This release also includes a number of workspace management enhancements. For users requesting new workspaces or requesting additional storage, you can control what sizes display.
You can also request an e-mail of your workspace names. And, finally, you can view a log of login attempts.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.7 Microsoft Access Migration
Application Migration enables you to migrate a Microsoft Access application and generate an Oracle Application Express application.
This feature provides an easy way to migrate applications from Microsoft Access to Oracle Express.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.8 New Password and Account Controls
You can now specify rules for password expiration, mandate strong passwords (that is, specify the minimum number of and type of characters), require that users change their passwords on first use, and lock accounts.
With this new feature, you can configure account login controls and password policies across a development instance in Oracle Application Express Administration Services. You can also specify controls for a specific account under Account Controls on the Edit User page.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.9 Page and Region Caching
You can improve the performance of your application by taking advantage of page and region caching. New Cache attributes have been added to the Page attributes and Region Definition pages.
Page caching works well for static pages and region caching is a good choice for regions such as lists that do not have any conditions or regions containing HTML text.
See Also:
Oracle Database Application Express User's Guide for details
1.1.2.10 PDF Printing
You can now include the ability to print a report by exporting a report region to PDF. You can also define report queries and print attributes for report regions as Shared Components making them accessible to all pages within an application.
The advantage of this feature is that it provides production of high quality, easily printable reports.
See Also:
Oracle Database Application Express User's Guide for details
1.1.3 Extensible Indexing
The following sections describe extensible indexing features for Oracle Database 11g Release 1 (11.1).
1.1.3.1 Create Rules and Actions for DML Events With Rules Manager
Rules Manager now adds the ability to treat DELETE and UPDATE operations on a table as events that drive the rule evaluation and action execution (INSERT operations are already supported). In addition to pre-commit evaluation of rules based on trigger, this release supports post-transaction evaluation through use of the Change Notification feature of Oracle Database.
Because rules can now be processed during UPDATE and DELETE statements, developers can now model the entire business process for OLTP workloads in addition to the current "append-only" workloads characteristic of data warehouse and sensor-based applications.
See Also:
Oracle Database Rules Manager and Expression Filter Developer's Guide for details
1.1.3.2 Enhanced Rules Manager
Rules Manager now includes a PL/SQL API to store reusable and shareable rule conditions in SQL WHERE clause format. Complex rule conditions can be assembled from these shared elements.
In addition, rules can now be enabled and disabled through standard SQL.
Application developers can reuse rule conditions to speed the rule definition process. Since these shared conditions are stored once, changes propagate to all the complex rules referring to them. For example, if a rule component defines a "suspicious bank transaction" as involving an international bank transfer over $10,000, a change to the amount, location, or other condition needs to be made only once and it is updated in all complex rules using "suspicious bank transaction" in their event scenario.
Rules can be turned on and off to facilitate rule testing and control introduction into the system as well as to reflect changes in business conditions.
See Also:
Oracle Database Rules Manager and Expression Filter Developer's Guide for details
1.1.3.3 New Capabilities for Domain Index Operations
A new domain index callout updates table and column name metadata for a domain index during an ALTER TABLE ... RENAME or ALTER TABLE ... RENAME COLUMN command to ensure domain index metadata is kept up-to-date.
A partition-specific parameter string provides control over placement of domain index data during partition maintenance operations.
The SQL MERGE statement can now be used with a domain index.
See Also:
Oracle Database SQL Language Reference for details
1.1.3.4 Oracle Text Predicates and Aggregate Operators are Included in Rule Conditions
The Rules Manager feature of Oracle Database now supports the use of the Oracle Text CONTAINS operator with the SQL WHERE clause rule conditions.
Rules Manager can now compute aggregate values (SUM, AVG, MIN, MAX, and COUNT) using moving windows semantics. The window size can be based on time or number of events. The aggregate values for a group of events can be computed and tested against predefined or relative thresholds in rule conditions.
Rules can respond to real-world trends identified from a collection of events occurring over a particular length of time or a sliding window of time, such as for Business Activity Monitoring and Business Intelligence applications. For example, you can offer a promotion to a customer if the sum of purchases in the last three days is over $1000.00.
See Also:
Oracle Database Rules Manager and Expression Filter Developer's Guide for details
1.1.3.5 Oracle Text Predicates Included in Stored Expressions
The Expression Filter feature of Oracle Database now supports the use of the Oracle Text CONTAINS operator with the SQL WHERE clause stored expressions.
Stored expressions can evaluate text and XML data.
See Also:
Oracle Database Rules Manager and Expression Filter Developer's Guide for details
1.1.3.6 System-Managed Partitioning of Extensible Indexes
System-managed domain indexes (both non-partitioned and local partitioned) use Oracle Database to track and maintain the domain index storage tables during DDLs and partition maintenance operations on the base table. System-partitioned tables can be used as index storage tables for local domain indexes. System-managed domain indexes with range partitioning are supported in this release.
System-managed partitioning of domain indexes enhances local domain index manageability and performance.
See Also:
Oracle Database Data Cartridge Developer's Guide for details
1.1.4 Globalization and Unicode
This section lists improvements to globalization features and Unicode support of Oracle Database.
1.1.4.1 Unicode 5.0 Support
The NLS data files for AL32UTF8 and AL16UTF16 character sets have been updated to match version 5.0 of the Unicode Standard character database.
With this enhancement, Oracle Database conforms to the newest version of the standard.
See Also:
Oracle Database Globalization Support Guide for details
1.1.5 Java in the Database
The major enhancements to the Java runtime in this release include performance with a new JIT compiler, ease-of-use with a JDK-like command-line interface, and tooling.
1.1.5.1 OracleJVM Java/JDK 5.0 Compatibility
OracleJVM supports Sun's JDK 1.5.
This feature provides portability of J2SE applications (stand-alone JDBC or middle-tier) into Oracle Database and the ability to take advantage of the key benefits of J2SE 5.0 such as the "declarative" programming style enabled by Java Annotations.
This feature allows sharing metadata of Java classes loaded by user class loader among different database user sessions.
See Also:
Oracle Database Java Developer's Guide for details
1.1.5.2 OracleJVM JIT Configuration
The JIT is enabled by default (out-of-the-box) and does not need further configuration. However, it can be disabled or reenabled by setting JAVA_JIT_ENABLED to TRUE or FALSE in the parameter file or dynamically by altering the instance or the session, for example:
ALTER SYSTEM SET JAVA_JIT_ENABLED=true
or
ALTER SESSION SET JAVA_JIT_ENABLED=true

In addition, the OJVM_JIT_PROPERTIES are used to specify the list of properties, for example:
OJVM_JIT_PROPERTIES="key0-value0","key1=value1","keyword0"

Currently, supported properties are:
• DISABLE_OPTIM_* which are various switches to disable optimization passes.
• New dictionary table and Oracle Runtime methods for checking the compilation status of classes or methods.
• New column IS_COMPILED in USER_JAVA_METHODS, ALL_JAVA_METHODS, and DBA_JAVA_METHODS views set to YES or NO.
This feature allows fine-grained control on the behavior of the JIT. In addition, you have the ability to query the status of compiled classes and methods.
See Also:
Oracle Database Java Developer's Guide for details
1.1.5.3 OracleJVM JIT (Transparent Native Java Compilation Without a C Compiler)
Enabled by default and similar to the JDK JIT, this feature compiles Java in the database natively and transparently without the need of a C compiler.
The JIT runs as an independent session in a dedicated Oracle server process. There is at most one compiler session per database instance and it is Oracle RAC-aware and amortized over all Java sessions.
The compilation session uses profiling feedback data gathered by all Java sessions to compile the most often used methods, so as to get the best overall performance. The executable binary persists in the database.
Java sessions just use the executable binaries of already compiled methods or discover newly compiled methods through an event polling performed by OracleJVM at regular intervals. When there is a compiled code for a given method, future executions of that method use the compiled version.
Conversely, when a Java class is invalidated, the persisted compiled code of the class or method is removed.
This feature brings two major benefits to Java in the database:
• Increased performance of pure Java execution in the database resulting from the transparent compilation of Java into native machine code, similar in behavior to a JDK JIT.
• Ease-of-use. Unlike the Static Native Java compiler (also known as NCOMP or JAccelerator) in previous releases, the new JIT Compiler (when enabled at database configuration level) is activated transparently, without the need of an explicit command, when Java is executed in the database.
In addition, this feature removes the need for a C compiler.
See Also:
Oracle Database Java Developer's Guide for details
1.1.5.4 OracleJVM Ease-of-Use: JDK-Like Interface
Similar to the JDK VM, this feature provides a command-line interface to OracleJVM through new PL/SQL interfaces, for example:
FUNCTION runjava (cmdline VARCHAR2) RETURN VARCHAR2;
or
FUNCTION runjava_in_current_session (cmdline VARCHAR2) RETURN VARCHAR2;

Analogous to the JDK/JRE Java shell command, the JDK-like interface takes a subset of the JDK/JRE command-line syntax including:
[-options] classname [arguments...]
or
[-options] -jar jarfile [arguments...]

The supported options include:
• {cp|classpath} < ":" separated list of file system directories/JAR/ZIP to search for class files>
• D= set a system property
• Xbootclasspath:<":" separated directories/zip/jar files to search for bootstrap classes and resources>
• Xbootclasspath/a:<":" separated directories/zip/jar files to append to the end of bootstrap class path>
• Xbootclasspath/p:<":" directories/zip/jar files to prepend in front of bootstrap class path>
This feature makes Java easy to use using command-line syntax, which is similar to the JDK JAVA command line. In addition to database resident Java classes, this feature allows the execution in the database runtime environment of file system resident Java class, using the standard classpath syntax. In addition, it allows setting system properties using the standard -D syntax.
See Also:
Oracle Database Java Developer's Guide for details
1.1.5.5 OracleJVM Ease-of-Use: Property Management Interface
This feature provides DBMS_JAVA functions to emulate JDK System property setting for the duration of the session. The settings are set_property, get_property, remove_property, and show_property.
Java developers can now emulate familiar JDK behavior such as system properties support when using Java in the database.
1.1.5.6 OracleJVM Ease-of-Use: Output Redirect
This feature provides DBMS_JAVA functions and procedures for controlling the redirection of Java output, for example:
{set | remove | enable | disable | query}_output_to_{sql | java | file}

And for enabling or disabling sending output to trace, for example:
trace {enable | disable}_output_to_trc

Java developers can now emulate familiar JDK behavior such as output redirect. In addition, they can now disable sending output to a trace file, which was not possible in previous releases.
1.1.5.7 OracleJVM Ease of Use: Database Resident Jars
This feature allows supporting JAR as a unit of operations (and as a result of support for signed JARs) using new loadjava options, -jarsasdbobjects and -prependjarnames.
When these new options are not used, loadjava explodes the jar into individual classes, while dropjava goes back to the original jar (from which the classes are loaded) and drop the classes each at a time.
Java developers using OracleJVM benefit from the same JDK features and behavior such as JAR support.
1.1.5.8 OracleJVM Ease of Use: Two-Tier Java Session Termination
This feature allows the termination of Java within a database session, with and without retention of system properties, using endsession and endsession_and_related_state.
Java developers can terminate Java in a session while keeping the property settings so as to speed up Java reinitialization within the same database session. This feature also allows immediate termination of Java sessions, without requiring the use of System.exit.
1.1.5.9 OracleJVM Utilities Enhancements
Enhancements to existing OracleJVM utilities (loadjava, dropjava, and ojvmjava) include the deprecation of least-frequently-used options of loadjava and the ability to load Java classes over the web (HTTP URL support). For example:
loadjava -u scott/tiger -r
-v http://my.server.com/this/is/the/path/my.jar

Enhancements to dropjava include:
• list-based deletion
• exception handling
• ability to connect to a different user
• invalid command reporting
ojvmjava has been extended to support the JDK-like command such as runjava and its options. For example:
ojvmjava -u scott/tiger -runjava -d :1521: -t

And, then followed with:
$java -cp .

In addition, a new standalone Class Closure Tool (ojvmtc) is provided for ensuring that a given list of file system resident classes and deployable JARs to be closed as much as possible before loading (for example, loadjava invocation).
The benefits are increased usability and simplified deployment of Java applications in Oracle Database.
See Also:
Oracle Database Java Developer's Guide for details
1.1.5.10 OracleJVM Manageability: JMX Interface
This feature provides support for OracleJVM with the standard JMX interface.
Support for JMX interface provides:
• Ease-of-use (any standard JMX-enabled GUI or console)
• Runtime monitoring of OracleJVM (memory objects heaps, threads, GC and classes)
• Ability to trigger GC from the console
1.1.6 JDBC and SQLJ
For Java developers, this release provides the following enhancements to JDBC and SQLJ APIs:
• Support for the latest Java standards including Java SE 1.5 and JDBC 4.0.
• A faster protocol for the Streams/AQ Java interface.
• Support for Oracle advanced security in JDBC-Thin.
• Enhancements to SQLJ code generation and customizer.
• Enhancements to XA support.
• Support of event notification.
1.1.6.1 JDBC 4.0 Connection and Statement Enhancements
JDBC 4.0 introduces new methods for:
• Validating a connection.
• Setting and fetching client information on a connection.
• Returning a list of client properties supported by the driver.
• Allowing an application to mark that a statement should not be pooled.
• Allowing a statement pool manager to register a StatementEventListener on the pooled connection.
In addition, it provides a new StatementEventListener interface and a new StatementEvent class.
These JDBC 4.0 enhancements improve the scalability of JDBC applications and provide better control and management of statement objects.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.2 JDBC 4.0 Support for New Data Types
This feature provides new standard types including java.sql.XMLType, java.sql.RowID, and java.sql.Nclob to support the National Character Set (NCHAR, NVARCHAR, LONGVARCHAR). In addition, the JDBC 4.0 implementation enhances BLOB and CLOB data type manipulation.
Standard support for new SQL types significantly increases the portability of JDBC applications across databases.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.3 JDBC Support for ANYTYPE, ANYDATA, and ANYDATASET
The following support has been added to JDBC in this release:
• ANYTYPE which represents any SQL type including persistent database scalar or object types, and transient unnamed types.
• ANYDATA as a table column type to store heterogeneous values (built-in and user-defined) within the same column, along with the metadata.
• ANYDATASET which represents a set of data instances of the same type, along with the metadata.
The benefits include:
• Mapping any Java types to a general purpose SQL data type (ANYTYPE).
• Persisting Java objects to the same database table column (ANYDATA).
• Mapping any Java collections into ANYDATASET.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.4 JDBC Support for Continuous Query Notification
This feature allows Java Applications or Containers to subscribe to SQL queries watch list in the database and be notified when:
• DML or DDL changes affect the objects associated with the queries, or
• DML or DDL changes affect the result set
The notifications are published when the transaction (DML or DDL) commits.
Java Applications and Container prevents unnecessary database querying and implements efficient and consistent result set caching and cache invalidation.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.5 JDBC Support for Database Diagnosability
Through this feature, JDBC provides better support for logging, diagnosability and DMS monitoring:
• Logging has been reimplemented to fully utilize java.util.logging. This allows you to selectively log events that occur during the execution of the JDBC driver code such as SQL exceptions, SQL statement executions, or entry or exit from internal JDBC methods.
• JDBC support for performance monitoring uses DMS to capture performance-critical JDBC events including:
o Connection cache statistics
o Connection creation
o Statement cache statistics
o Query execution
o Result fetch
o Oracle RAC events
o Load balancing statistics
o New Oracle Database 11g features
• JDBC support for Diagnosability Management consists of an MBean, oracle.jdbc.DiagnosabilityMBean. This MBean provides the means to enable and disable JDBC logging and provides additional statistics about JDBC internals.
This feature simplifies JDBC logging and makes the interpretation of the results easy. Dynamic Monitoring System (DMS) metrics give Java applications the ability to track JDBC events and performance metrics, as well as a programmatic control and configuration of diagnosability features.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.6 JDBC Support for Database Startup and Shutdown
You can now perform database startup or shutdown using the following JDBC Oracle Connection methods:
• DBSTARTUP_NO_RESTRICTION
• DBSTARTUP_FORCE
• DBSTARTUP_RESTRICT
• DBSHUTDOWN_CONNECT
• DBSHUTDOWN_TRANSACTIONAL
• DBSHUTDOWN_TRANSACTIONAL_LOCAL
• DBSHUTDOWN_IMMEDIATE
• DBSHUTDOWN_ABORT
• DBSHUTDOWN_FINAL
Note that you must be connected to a dedicated server as SYSOPER or SYSDBA in PRELIM_AUTH mode.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.7 JDBC Support for Native Streams AQ Protocol
This feature exposes a new Java package (oracle.jdbc.aq) that leverages the new native JDBC APIs for Streams AQ. This package contains the following classes and interfaces:
• AQQueue
• AQMessage
• AQAgent
• AQDequeueOptions
• AQEnqueueOptions
• AQMessageProperties
• AQRawPayload
• AQObjectPayload
• AQNotificationEvent
• AQNotificationListener
• AQNotificationRegistration
Java and JMS applications run faster (using Native AQ operations as opposed to PL/SQL procedures) when accessing Streams AQ and OJMS queues. In addition, these APIs allow asynchronous notifications of AQ events and exchange rich message payloads including RAW data type, ANYDATA data type, and OBJECT data type.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.8 JDBC-Thin Support for Oracle Advanced Security
This feature provides complete JDBC-Thin support for Oracle Advanced Security in terms of encryption, password authentication, strong authentication, and data integrity or checksum.
New security features include Secure Sockets Layer (SSL), Remote Authentication Dial-In User Service (RADIUS) and Kerberos authentication, AES encryption, and SHA1 checksum algorithm. Advanced security support in JDBC-Thin simplifies the development and deployment of secure Java applications.
See Also:
Oracle Database JDBC Developer's Guide and Reference for details
1.1.6.9 SQLJ: Enhanced Profile Print Option of the Customizer
SQLJ customizer is used during ISO standard code generation. The customizer tailors SQLJ profiles for a particular database implementation and vendor-specific features and data types. The profile print option (-P-print) of SQLJ has been enhanced to print all the customizer options that were passed into the SQLJ translator.
This feature provides information about customizations that SQLJ has received during the precompilation phase to help diagnose any problems that may arise and are specific to different customizations.
See Also:
Oracle Database SQLJ Developer's Guide and Reference for details
1.1.6.10 SQLJ: Outline Generation Option
An application can support SQL execution plan stability by using the outline feature of Oracle. An outline is implemented as a set of optimizer hints that are associated with the SQL statement. If the use of the outline is enabled for the statement, Oracle automatically considers the stored hints and tries to generate an execution plan in accordance with those hints.
A new translation time option is provided in SQLJ to generate and run a SQL file containing the Oracle outline creation commands for all the SQL statements present in a SQLJ application.
This feature helps in ensuring the expected behavior of a database query at development time and helps to better diagnose problems.
See Also:
Oracle Database SQLJ Developer's Guide and Reference for details
1.1.6.11 SQLJ: Support for JDK 1.5
SQLJ applications can now be translated and run under JDK 1.5.
The JDK 1.4 and JDK 1.5 specific language structures outside the #sql region are recognized by the translator.
See Also:
Oracle Database SQLJ Developer's Guide and Reference for details
1.1.6.12 SQLJ: XA Support
The javax.sql.XADataSource interface of JDBC outlines standard functionality of XA data sources. An XA data source is a factory for XA connections. Oracle JDBC implements the XADataSource interface through the OracleXADataSource class. The getConnection() method of the OracleXADataSource class returns an XA connection to the underlying data source.
The benefit of this feature is that these connections can be used in SQLJ applications by creating the appropriate connection contexts in SQLJ.
See Also:
Oracle Database SQLJ Developer's Guide and Reference for details
1.1.7 Oracle Developer Tools for Visual Studio .NET
These features enhance developer productivity for building .NET applications with Oracle Database. They provide native integration with ADO.NET 2.0 functionality using Visual Studio development environments with which .NET developers are familiar. In addition, these features reduce the time it takes to develop .NET applications for Oracle.
1.1.7.1 General Visual Studio 2005 Support
This feature provides users of Visual Studio 2005 the same support currently offered for Oracle Develop Tools (ODT) users using Visual Studio 2003. The changes include using different icons and integrating visually with the Visual Studio 2005 look and feel.
This feature makes it easy for customers to continue using ODT when they migrate from Visual Studio 2003 to the Visual Studio 2005 environment.
1.1.7.2 Oracle PL/SQL Debugger in Visual Studio
The Oracle PL/SQL debugger is now integrated directly into Visual Studio. Developers can debug code, set breakpoints, and watch variables exactly as they would for any other language. Three types of debugging are supported:
• Direct Database Debugging
The developer runs the stored procedure from the Oracle Explorer inside of Visual Studio and enters in the parameters.
• Multi-Tier Application Debugging
The developer steps from .NET code directly into PL/SQL and back again with the parameters automatically being passed.
• External Application Debugging
The developer runs any 9.2 or later Oracle application that can be located anywhere (for example, from SQL*Plus). When it calls the stored procedure, the break point in Visual Studio fires and the developer can begin debugging with the stored procedure parameters being passed automatically.
This feature enables developers to seamlessly debug .NET applications that make calls to PL/SQL stored procedures. Developers can debug both .NET code and PL/SQL without having to leave Visual Studio. They can also debug PL/SQL stored procedures that are called from any arbitrary Oracle program, written in any language, and located on the same machine or on a remote machine.
1.1.7.3 Support for Visual Studio 2005 Data Sources Window and Designers
This feature exposes the DDEX interface to enable some Visual Studio 2005 designers as well as integrate with the Data Sources window to enable the new style drag-drop code generation in Visual Studio 2005.
1.1.8 Oracle Data Provider for .NET (ODP.NET)
These features enhance developer productivity for building .NET applications with Oracle Database. They provide native integration with ADO.NET 2.0 functionality using Oracle Data Provider for .NET (ODP.NET) development environments with which .NET developers are familiar. In addition, these features reduce the time it takes to develop .NET applications for Oracle.
1.1.8.1 Provider-Independent API Using Base Classes and Factories
ODP.NET inherits from the System.Data.Common namespace to provide access through a single API to databases across multiple providers.
ADO.NET developers can build applications that work with multiple vendors' database servers with one set of data access code and with a minimum of vendor-specific code. Developers can now be more productive when building one set of code that works against multiple vendors' databases.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.2 Connection String Builder
ODP.NET provides a strongly typed connection string builder class that inherits from DbConnectionStringBuilder. The connection string builder lets developers programmatically create syntactically correct connection strings based on user input, as well as parse and rebuild existing connection strings by using class methods. Connection string builders provide strongly-typed properties that correspond to known key/values pairs.
ODP.NET connection strings are now more secure and more manageable. Because connection string parameters can now be strongly typed, they are less subject to string injection attacks. Connection string parameters can now be referenced in configuration files or as ODP.NET properties, making managing connection information easier.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.3 OracleDataAdapter Batch Processing
During updates to Oracle Database, the ODP.NET OracleDataAdapter can batch a set of rows back to the database per round trip. The number of rows per round trip can be set by the developer.
This feature enhances application performance by reducing the number of round trips to the database when applying updates from the DataSet.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.4 Row-Level Change Notifications
.NET developers often used client-side cached data. When another user changes the original data on the server, the database sends a change notification message to the client, indicating that the client data is now invalid. Previously, change notifications were registered at the table level. In this release, developers can register their queries at the row level so that they are alerted only when the rows they selected have changed.
.NET clients can now receive more accurate change notification alerts.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.5 Schema Discovery
ODP.NET schema discovery allows applications to request and return information about the database schema to the client. Different database schema elements such as tables, columns, and stored procedures are exposed through the GetSchema methods of the OracleConnection class.
ODP.NET can retrieve a set of generic and Oracle-specific schema information.
Schema discovery supplies a common API for all ADO.NET 2.0 drivers to retrieve database schema information to the client application.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.6 Data Source Enumeration
The ODP.NET OracleDataSourceEnumerator class provides a list of active Oracle database servers.
Data source enumeration can be retrieved programmatically in a generic manner common to all ADO.NET 2.0 providers.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.7 Faster LOB Retrieval
ODP.NET now makes fewer round trips to the database server to retrieve LOB information.
ODP.NET LOB retrieval performance is now faster.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.8.8 Improved Parameter Context Caching in Statement Caching
For statement caching, ODP.NET now caches parameter contexts after the first statement execution.
Many applications execute the same SQL or PL/SQL statement repeatedly. In the first execution of the statement, ODP.NET can now cache parameter contexts so that they can be reused. This improves the performance of subsequent statement executions.
See Also:
Oracle Data Provider for .NET Developer's Guide for details
1.1.9 Oracle Provider for OLE DB
These features improve data access performance from Windows clients to Oracle Database. Many of these features are transparent, meaning applications experience faster performance by upgrading the database server and client without any code changes.
1.1.9.1 Faster Performance
Oracle Provider for OLE DB has implemented a number of new features in its provider to improve query performance for the end user.
See Also:
Oracle Provider for OLE DB Developer's Guide for details
1.1.9.2 Improved Metadata Caching
For metadata caching, Oracle Provider for OLE DB now caches the metadata after the first execution when statement caching is turned off. This is useful when a large amount of column metadata is retrieved with a small amount of row data. Oracle Provider for OLE DB has also improved metadata caching when statement caching is turned on.
Many applications execute the same SQL or PL/SQL statement repeatedly. In the first execution of the statement, Oracle Provider for OLE DB can cache a query's metadata so that it can be reused. This improves the performance of subsequent statement executions.
See Also:
Oracle Provider for OLE DB Developer's Guide for details
1.1.9.3 Improved Statement Caching
For statement caching, Oracle Provider for OLE DB now caches large fetch arrays and OCI error handles after the first execution.
Many applications execute the same SQL or PL/SQL statement repeatedly. In the first execution of the statement, Oracle Provider for OLE DB can now cache a statement's parse information so that it can be reused. This improves the performance of subsequent statement executions.
See Also:
Oracle Provider for OLE DB Developer's Guide for details
1.1.10 PHP
The features in the following sections describe the enhancements to Oracle's client-side stack so that data access open source PHP driver performs better than PHP data access drivers for other databases.
1.1.10.1 Database Resident Connection Pooling (DRCP)
Prior to this release, session sharing capabilities were available for multithreaded applications only. With this new feature, different application processes can share sessions within the same host machine as well as across multiple host machines. The pool is maintained on the database server by a new background process.
This feature is useful for applications that cannot be deployed as multithreaded (for example, PHP applications in an Apache Web server environment) and database requests are done in a session state independent manner. These applications no longer have to hold the connections to the database persistently, thereby increasing the scalability of the database.
The pool is managed by the DBA and the OCI and OCCI applications can reuse the sessions by specifying a connection class name within which the application leaves sessions of similar state.
See Also:
Oracle Call Interface Programmer's Guide for details
1.1.11 PL/SQL
The following sections discuss features that:
• Reduce downtime associated with application patching
• Enhance performance and scalability (TPCC, APPS)
• Provide integration between PL/SQL and SQL
1.1.11.1 XA API Available Within PL/SQL
The functionality available in the XA interface to support transactions involving multiple resource managers, such as databases and queues, is now available from PL/SQL.
Application developers are now able to switch or share transactions across SQL*Plus sessions or processes using PL/SQL.
See Also:
Oracle Database Advanced Application Developer's Guide for details
1.1.11.2 Allow Sequences in PL/SQL Expressions
In the previous release of Oracle Database, when a PL/SQL program needed to get a value from syntax, it used SQL. For example:
DECLARE n NUMBER;
BEGIN
SELECT Seq.Nextval INTO n FROM Dual;
END;

This posed a usability problem for PL/SQL programmers and causes runtime performance and scalability problems for the application particularly because it requires the use of a cursor.
In Oracle Database 11g, it is now possible to simply use Seq.Nextval in a PL/SQL expression. For example:
DECLARE n NUMBER := Seq.Nextval;
BEGIN
...

The same is possible for the CURRVAL pseudocolumn.
This feature brings improved usability for the PL/SQL programmer and improved runtime performance and scalability.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.11.3 Enhancements to the Regular Expression Built-Ins
There is new syntax to access the nth subexpression in REGEXP_SUBSTR and REGEXP_INSTR. This is useful if, for example, the matching string is always surrounded by tags like and but you want to extract just what lies between these tags. REGEXP_SUBSTR returns the subexpression. REGEXP_INSTR returns the position.
The new built-in REGEXP_COUNT returns the number of times the pattern is matched in the input string.
This new functionality is available both in SQL and in PL/SQL.
The benefit is increased functionality for the regular expression built-ins. Earlier applications that needed this functionality had to write relatively elaborate application code which is no longer the case.
See Also:
Oracle Database Advanced Application Developer's Guide for details
1.1.11.4 Functional Completeness of Dynamic SQL for PL/SQL
In Oracle Database 11g, native dynamic SQL now supports statements bigger than 32K characters by allowing a CLOB argument. Also included with this feature:
• DBMS_SQL.PARSE() gains a CLOB overload
• A REF CURSOR can be converted to a DBMS_SQL cursor and vice versa to support interoperability
• DBMS_SQL supports the full range of data types (including collections and object types)
• DBMS_SQL allows bulk binds using user-define collection types
The features for executing dynamic SQL from PL/SQL had some restrictions in Oracle Database 10g. DBMS_SQL was needed for Method 4 scenarios but it could not handle the full range of data types and its cursor representation was not usable by a client to the database. Native dynamic SQL was more convenient for non-Method 4 scenarios, but it did not support statements bigger than 32K. Oracle Database 11g removes these and other restrictions to make the support of dynamic SQL from PL/SQL functionally complete.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.11.5 Method Invocation Scoping Operator
A subtype usually adds specific data attributes to its more generic supertype. Typically, a NOT FINAL member procedure, for example, Show_Attributes(), is implemented at each level in the type hierarchy. It is natural to implement this at one level by reusing the implementation at the parent level and by adding new code just for the attributes of the subtype.
Oracle Database 11g supports the ANSI SQL generalized-invocation syntax to allow the following:
( AS )..

Without this syntax, programmers were forced to use a cumbersome workaround which relied on using static subprograms rather than member subprograms.
This feature brings the implementation of object-oriented programming in Oracle Database closer to completeness.
See Also:
Oracle Database Object-Relational Developer's Guide for details
1.1.11.6 Named and Mixed Notation for User-Defined PL/SQL Subprogram in a SQL Statement
Consider a schema-level function f() declared as:
FUNCTION f(
p1 IN INTEGER := 1,
p2 IN INTEGER := 2,
...
pn IN INTEGER := 99)
RETURN INTEGER

Beginning in this release, it is now possible to invoke the function in a SQL statement. For example, named notation syntax is:
SELECT f(pn=>3, p2=>2, p1=>1) FROM dual

Or, mixed notation is:
SELECT f(1, pn=>3) FROM dual

In previous releases, attempting named or mixed notation resulted in an error.
The benefit is improved usability when a PL/SQL function, with many default parameters, is invoked in a SQL statement and only one or a small number of the actual parameters need to differ from their default values.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.11.7 New Compound Trigger Type
A compound trigger has a section for each of the BEFORE STATEMENT, BEFORE EACH ROW, AFTER EACH ROW, and AFTER STATEMENT timing points. All of these sections can access a common PL/SQL state. The common state is created when the firing statement starts and destroyed when it completes, even when the firing statement causes an error. A compound trigger can be used to speed performance in an auditing scenario where audit rows can be accumulated in the EACH ROW section and bulk inserted to the audit table in the AFTER STATEMENT section. A similar approach is sometimes required to avoid the mutating table error. The alternative to using compound triggers is to model the common state with an ancillary package. This approach is both cumbersome to program and subject to memory leak when the triggering statement causes an error and the AFTER STATEMENT trigger does not fire.
This feature brings improved usability for the PL/SQL programmer and improved runtime performance and scalability.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.11.8 PL/Scope
PL/Scope allows you to browse PL/SQL source code analogously to the way that Cscope (see http://cscope.sourceforge.net/) allows you to browse C source code. You can search for and display all types of definitions, declarations, assignments and references in the PL/SQL source code.
The PL/SQL compiler can optionally derive the metadata needed to support PL/Scope and store it in the database catalog. The metadata takes into account the nuances of the language, including scoping and overloading. You can generate reports (especially hyperlinked HTML reports) with supplied report generators. This feature is exposed through Oracle SQL Developer's interactive PL/SQL development environment.
PL/Scope supports increased developer productivity, especially for those who need to maintain someone else's code.
See Also:
Oracle Database Advanced Application Developer's Guide for details
1.1.11.9 PL/SQL CONTINUE Statement
Many programming languages allow transfer of control either out of the loop entirely or within a loop back to a new iteration. In previous releases, PL/SQL only allowed transfer of control out of the loop using the EXIT statement. In Oracle Database 11g Release 1 (11.1), the new CONTINUE statement implements the ability to transfer control within a loop back to a new iteration.
Many algorithms require the loop control that this new CONTINUE statement now provides. With this explicit feature, you are no longer required to code several lines of PL/SQL and maintain commonly-adopted style rules.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.11.10 PL/SQL Hierarchical Profiler
PL/SQL Hierarchical Profiler identifies hot spots and performance tuning opportunities in PL/SQL database applications. It reports the dynamic execution program profile organized by subprogram calls. SQL and PL/SQL execution times are accounted for separately. PL/SQL Hierarchical Profiler requires no special source or compile time preparation.
Start and stop procedures in the new package, DBMS_HPROF, control the recording of raw PL/SQL Hierarchical Profiler data. Then other subprograms in this package are used to transform the raw data into schema-level tables to allow the generation of reports. For example, hyperlinked XML or HTML reports.
This feature is part of Oracle SQL Developer's interactive PL/SQL development environment.
Programmer productivity and program performance are both enhanced because PL/SQL Hierarchical Profiler directs tuning effort towards those PL/SQL functions that will benefit most.
See Also:
Oracle Database Advanced Application Developer's Guide for details
1.1.11.11 PL/SQL Inlining Optimization
Modern PL/SQL software includes many procedures frequently called in various programs. The power of the PL/SQL optimizing compiler is increased by incorporating the inlining optimization (replacement of a procedure call with a copy of the procedure body). The revised code executes more quickly because call overhead has been eliminated and because further optimizations are possible when the compiler knows the actual values with which the inlined procedure is called.
Performance gains can be substantial. The compiler does this optimization automatically. However, you may control the optimization in detail when necessary. Many PL/SQL programs execute faster, as a direct consequence of upgrade, simply by recompiling existing units.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.11.12 SIMPLE_INTEGER Data Type
The new PL/SQL SIMPLE_INTEGER data type is a binary integer for use with native compilation which is neither null checked nor overflow checked. The range is all integer values in the inclusive interval [-2147483648..2147483647] and does not include a null value. These rules allow a direct hardware implementation when used in combination with PL/SQL native compilation.
The SIMPLE_INTEGER data type yields significant performance benefits compared to PLS_INTEGER. It can be used when the value will never be null and when overflow check is not needed.
See Also:
Oracle Database PL/SQL Language Reference for details
1.1.12 XML Application Development
The features described in the following sections ensure that PL/SQL, Java, C and .NET programmers can leverage the full capabilities of Oracle XML DB and the Oracle XML DB repository. These new features also extend the infrastructure components to support Binary XML and provides an efficient method for handling very large XML documents. There is also support relevant to JSRs for XML application development including JSR-170 for content repository access and the emerging JSR-225 standard for XQuery. The Oracle XML libraries continue to deliver the best possible application development framework for XML developers working in J2EE and .NET environments, regardless of whether they are using the Oracle XML DB feature. These new features deliver highly optimized XSLT and XQuery engines for use with Oracle Application Server and Fusion Middleware.
1.1.12.1 Binary XML Support for Java
The new XDK binary XML processors include a binary XML encoder, a binary XML decoder, and a token manager to convert the schema or nonschema-based binary XML stream to and from XML 1.0 text and SAX events. The format is the same as the format used within Oracle XML DB.
This feature allows XML processing applications to leverage a compact, pre-parsed XML format which could save in memory and CPU consumption as well as network bandwidth. With a single format supported by Oracle XML DB and Oracle XDK and the Oracle XML DB support within the binary XML processors, this feature allows the performance optimization across tier XML applications.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.2 Binary XML Support for Oracle XML DB
No single approach to persisting XML can solve all of the possible use cases presented by the XML application development paradigm. Binary XML (which is a way of representing the structure of an XML document) adds a third storage model for persisting XML in the database. It complements, rather than replaces, the existing object storage and text storage models.
Binary XML has two significant benefits:
• It enables significant optimizations of XML operations whether or not an XML schema is available.
• It allows the internal representation of XML to be the same regardless of whether the XML is in disk, in memory, or on the wire.
As with other storage mechanisms, the application developer can continue to use XMLType and its associated methods and operators without regard to the details of storage.
See Also:
Oracle XML DB Developer's Guide for details
1.1.12.3 Configurable DOM Support for Java
The following options are provided for building Document Object Model (DOM):
• static final String ACCESS_MODE = "DOM_ACCESS_MODE";
• static final String READ_ONLY = "READ_ONLY";
• static final String UPDATEABLE = "UPDATEABLE";
• static final String FORWARD_READ = "FORWARD_READ";
• static final String STREAMING = "STREAM_READ";
This feature enables XML applications to achieve maximum efficiency in terms of memory usage and performance by configuring the DOM building with different access patterns such as read-only, forward read, or streaming. This feature prevents light-weight XML applications from having to deal with a heavy DOM object tree.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.4 Event-Based XML Pull Parsing for C
XML pull parsing supports the stream-based parsing model which limits memory footprints by not preserving any document states in memory. Compared with SAX, the new pull parsing model only parses events requested by the application and accepts multiple input XML documents.
This feature improves the C XML processing performance and ensures the scalability with the new stream-based XML pull parsing. This feature also limits memory footprints by not preserving any document states in memory and improves the performance of the XML processing by only parsing stream events requested by the application. The pull parsing also makes the XML processing easy-to-use by allowing one parsing process to handle multiple XML documents.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.5 High Performance XPath Query for Java
Support JAXP 1.3 APIs for query XML content using XPath with the following extensions:
• Supports variable resolver in both static and dynamic context.
• Allows users to register runtime context.
This feature improves the performance and the usability of Java XPath/XSLT implementation.
1.1.12.6 In-Place XML Schema Evolution
This feature lets users make changes to a registered XML schema without having to unload and reload all of the XML documents that are compliant with the XML schema. Existing documents are not modified during in-place evolution, so only changes that do not invalidate the existing corpus of XML documents are permitted.
This feature enables rapid responses to changes in requirements by allowing certain common changes to XML schemas be made without having to unload and reload data. Organizations can take advantage of the benefits of XML schema-based XML storage in environments where the dynamic nature of the application or the large volume of XML content might make unloading and reloading the entire XML corpus to accommodate a change in the XML schema unrealistic.
The feature greatly reduces the overhead involved in making changes to XML schema in the majority of cases. Evolving an XML schema in cases where there are large number of documents compliant with the XML schema is a very expensive process that can take days to complete. In-place XML schema evolution allows the majority of common changes to be made almost instantaneously, with zero downtime, resulting in significant cost savings for the organization.
See Also:
Oracle XML DB Developer's Guide for details
1.1.12.7 Mid-Tier XQuery Engine Performance Improvements
XQuery performance improvements have been made in this release.
XQuery performance improvements for the mid-tier speed up applications relying on the mid-tier XQuery services.
1.1.12.8 Pluggable DOM Support for Java
The pluggable DOM splits the DOM implementation into two separate layers, the DOM API layer and the data layer. The API layer consists of a lightweight, transient node fragment that links to underlying data, which can be backed by external storage for scalability. The data has two varieties, internal data and plug-in data. The plug-in data support is through the InfosetReader implementations.
This feature allows XML applications to build DOM based on different forms of XML data through a unified interface. This feature improves portability of the XML applications.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.9 Scalable and High Performance XML Validation for C
The stream-based XML Schema validation allows XML applications to validate XML content against XML schemas in XML pull parsing process.
High performance XML processing and its scalability are very critical for enterprise XML applications. This feature improves the C XML processing performance and ensures the scalability with the new stream-based XML Schema validation.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.10 Scalable DOM Support for Java
This feature ensures the scalability of Database Object Model (DOM) processing for XML applications with the following support:
• Allows XML applications to process large XML documents by loading and saving DOM nodes in memory and using a page manager for physical binary data management.
• Allows storing DOM updates with references to the source data in Binary XML.
• Allows multiple applications sharing same DOM data source and operating on a lightweight, transient node fragment that links to underlying data, which can be backed by external storage for scalability.
• Supports Binary XML as the data source or the output.
• Supports shadow copy in DOM (cloneNode() or importNode()) which does not require the whole content being deep copied.
Scalability is the key to the success of the enterprise XML applications. This feature ensures the scalability of DOM processing for XML applications.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.11 Unified Java API for XML
The new unified Java API for XML allows mid-tier Java programs to leverage all of the benefits of XMLType by providing a disconnected mode of operation that allows XMLType to be used with a session pool model of connection management.
This allows the XMLType object to be disconnected from the database session that was used to create it.
This feature improves Java programmer productivity by allowing a single API to be used to manipulate XML content stored in Oracle XML DB and XML content stored in other sources.
Unified Java API also provides a disconnection mode of operation that allows XMLType to be used in a mid-tier environment where session pooling makes it impractical to hold the database connection that was used to instantiate the XMLType.
1.1.12.12 Unified Java API for XML
This feature allows mid-tier Java programs to leverage all of the benefits of XMLType by providing a disconnected mode of operation that allows XMLType to be used with a session pool model of connection management. This allows the XMLType object to be disconnected from the database session that was used to create it.
This feature improves Java programming productivity by allowing a single API to be used to manipulate the XML content stored in Oracle XML DB and the XML content stored in other sources.
This feature provides a disconnection mode of operation that allows XMLType to be used in a mid-tier environment where session pooling makes it impractical to hold the database connection that was used to instantiate the XMLType.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.13 XMLDiff Support for C
The XMLDiff detects the differences between the two XML documents and represents the difference in XML. The XMLPatch takes the differences created by XMLDiff and applies the changes on the target XML document.
This feature allows high performance XML document comparison and user controlled updates. With the support for detecting differences between two XML documents, XML applications can easily control document versions, merge and synchronize the content. The feature also reduces the processor demand by handling only the changed data, reduces bandwidth demands by transmitting only updates, and increases security by splitting sensitive data into separate streams which can then be reassembled on delivery.
See Also:
Oracle XML Developer's Kit Programmer's Guide for details
1.1.12.14 XMLIndex Enhancements
This feature provides an asynchronous mode for XMLIndex, where the indexing operations take place separately from the INSERT or UPDATE operations. Applications no longer have to wait for indexing to complete (which, for large documents, can be a significant operation) before being able to complete a transaction.
This feature also provides the ability to define the set of XPath expressions that are indexed by a given XMLIndex. The subset can be defined using INCLUDE or EXCLUDE syntax.
Subsetting XPath expressions that are indexed allows organizations to balance index size with disk usage, and to balance performance on insert with flexibility on retrieval.
This feature provides more flexibility for the organizations using XMLIndex. XMLIndex can be used in a wide range of applications. The feature improves application performance by allowing indexing to take place separately from INSERT and UPDATE operations. It also allows organizations to balance performance, flexibility, and disk usage when using XMLIndex.
See Also:
Oracle XML DB Developer's Guide for details
1.2 Availability
The following sections describe Availability features for Oracle Database 11g Release 1 (11.1).
1.2.1 Availability Interfaces in Oracle Enterprise Manager
The following sections describe improvements to the Enterprise Manager interfaces for high availability features.
1.2.1.1 Browser-Based Enterprise Manager Integrated Interface for LogMiner
This feature now makes it possible to use the browser-based Oracle Enterprise Manager Database Control interface for LogMiner. In prior releases, administrators were required to use the standalone Java Console to use LogMiner. The Console was not integrated with the rest of Enterprise Manager and was cumbersome to install. With this new interface, administrators have a task-based, intuitive approach to using LogMiner.
This new feature improves the manageability of LogMiner. The task-based work flows enable log mining and are integrated with Flashback Transactions.
1.2.2 Data Guard Improvements
The features in the following sections describe enhancements to Oracle Data Guard.
1.2.2.1 Fast-Start Failover for Maximum Performance Mode in a Data Guard Configuration
This feature enables fast-start failover to be used in a Data Guard configuration that is set up in the maximum performance protection mode. Since there is some possibility of data loss when a Data Guard failover occurs in maximum performance mode, administrators can now choose not to do a fast-start failover if the redo loss exposure exceeds a certain amount.
This enhancement allows a larger number of disaster recovery configurations to take advantage of Data Guard's automatic failover feature.
See Also:
Oracle Data Guard Broker for details
1.2.2.2 Compression of Redo Traffic (Only for Gap Resolution) Over the Network in a Data Guard Configuration
Archived redo logs, if needed to be transmitted to the standby database in an Oracle Data Guard configuration, can now be compressed as they are sent over the network.
This feature improves the network bandwidth utilization in an Oracle Data Guard configuration.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.2.3 Real-Time Query Capability of Physical Standby Database
It is now possible to query a physical standby database while Redo Apply is active.
This new capability increases your return on investment in Data Guard technology because a physical standby database can now be used to offload queries from the primary database in addition to providing data protection.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.2.4 Fast Role Transitions in a Data Guard Configuration
This feature improves the performance of Oracle Data Guard role transitions.
The benefit is increased flexibility and manageability of your disaster recovery configurations using Oracle Data Guard.
1.2.2.5 User Configurable Conditions to Initiate Fast-Start Failover in a Data Guard Configuration
This feature enables the administrator to choose and configure a list of conditions which, if they occur, will initiate fast-start failover.
This feature increases the flexibility and manageability of customers' disaster recovery configurations.
See Also:
Oracle Data Guard Broker for details
1.2.3 Data Guard Integration, Simplification, and Performance
The new features in the following sections simplify the configuration and use of Oracle Data Guard. For example, some features provide a smaller set of integrated parameters, a unified SQL/Broker syntax, and better integration with other High Availability features like RMAN and Oracle RAC. Other features enhance the performance of key Oracle Data Guard features like redo transport, gap resolution, switchover/failover times, and Logical Standby Apply.
1.2.3.1 Dynamic Setting of Oracle Data Guard SQL Apply Parameters
It is now possible to configure specific SQL Apply parameters without requiring SQL Apply to be restarted.
This ability improves the manageability, uptime, and automation of a Logical Standby configuration.
1.2.3.2 Enhanced Data Guard Broker Based Management Framework
The enhancements for this release include:
• Data Guard Broker improved logging and tracing
• OMF support for Data Guard Broker configuration files
• Data Guard Broker integration with database startup
• Data Guard Broker support for advanced redo transport settings
• Data Guard Broker support of prepared switchovers for Logical Standby
These enhancements make it possible to use Data Guard Broker in a wider variety of disaster recovery configurations.
See Also:
Oracle Data Guard Broker for details
1.2.3.3 Enhanced Data Guard Management Interface (Using SQL*Plus)
This feature makes it much simpler to use Oracle Data Guard administration-related SQL statements and initialization parameters.
The benefit of this feature is increased flexibility and manageability of disaster recovery configurations using Oracle Data Guard.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.3.4 Histogram for Redo Transport Response Time in a Data Guard Configuration
This feature advises on a suitable value for NET_TIMEOUT based on the response times for SYNC redo transport destinations.
The benefit is an increase in the flexibility and manageability of disaster recovery configurations using Data Guard.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.3.5 Snapshot Standby
A physical standby database can be open temporarily (that is, activated) for read/write activities such as reporting and testing. A physical standby database in such a state can still receive redo data from the primary database, thereby providing data protection for the primary database while still in the reporting database role.
This feature provides the combined benefit of disaster recovery, and reporting and testing using a physical standby database.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.3.6 Strong Authentication for Data Guard Redo Transport
Redo transport network sessions can now be authenticated using SSL. This provides strong authentication and makes the use of remote login password files optional in a Data Guard configuration.
The benefit is increased security of your disaster recovery configurations using Oracle Data Guard.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.3.7 Enhanced DDL Handling in Oracle Data Guard SQL Apply
SQL Apply executes in parallel (based on availability of parallel servers) DDLs that were executed with a parallel hint at the primary database.
1.2.3.8 Enhanced Oracle RAC Switchover Support for Logical Standby Databases
When switching over to a logical standby database where either the primary database or the standby database is using Oracle RAC, the SWITCHOVER command can be used without having to shut down any instance either at the primary or at the logical standby database.
1.2.4 Data Guard Logical Apply Completeness
The following sections describe features that add support for other database server features that are not currently handled by Oracle Data Guard. For example:
• LogMiner support for unsupported data types
• Objects and XML
1.2.4.1 Oracle Scheduler Support in Data Guard SQL Apply
It is now possible to use a logical standby database to provide data protection for a primary database in which the DBMS_SCHEDULER package was executed.
This enhancement allows Data Guard SQL Apply (logical standby database) to be used for a wider variety of applications.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.4.2 Fine-Grained Auditing (FGA) Support in Data Guard SQL Apply
It is now possible to use a logical standby database to provide data protection for primary databases using Oracle Fine-Grained Auditing (FGA).
This new support allows Data Guard SQL Apply (logical standby database) to be used for a wider variety of applications. In this case, applications with security features built-in.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.4.3 Support Transparent Data Encryption (TDE) with Data Guard SQL Apply
It is now possible to use a logical standby database to provide data protection for the primary database tables with Transparent Data Encryption (TDE).
This new support allows Data Guard SQL Apply (logical standby database) to be used for a wider variety of applications. In the case, applications with security features built-in.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.4.4 Support XMLType Data Type (Only CLOB) in Data Guard SQL Apply
It is now possible to use a logical standby database to provide data protection for primary database tables with the XMLType data type (only the CLOB representation).
This new support allows Data Guard SQL Apply (logical standby database) to be used in a wider variety of applications.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.4.5 Virtual Private Database (VPD) Support in Data Guard SQL Apply
It is now possible to use a logical standby database to provide data protection for primary database tables with Oracle Virtual Private Database (VPD).
This new support allows Data Guard SQL Apply (logical standby database) to be used for a wider variety of applications. In this case, applications with security features built-in.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.5 High Availability Improvements
The following sections describe general improvements in High Availability.
1.2.5.1 Flashback Transaction
Flashback transaction is a new feature that can easily back out a transaction and its dependent transactions. This recovery operation utilizes undo data to create and execute the corresponding, compensating transactions that revert the affected data back to its original state.
This feature increases availability during logical recovery by easily and quickly backing out a specific transaction or set of transactions and their dependent transactions, with one command, while the database remains online.
See Also:
Oracle Database Advanced Application Developer's Guide for details
1.2.5.2 SMP Scalable Redo Apply
Redo Apply performance has been significantly improved as a result of some internal optimizations in media recovery. Wait event generation in media recovery has also been enhanced.
This feature enables faster performance of media recovery and also Data Guard Redo Apply (physical standby database), thereby enabling real-time disaster recovery for more voluminous and highly transactional databases.
1.2.5.3 Transportable Databases Between Linux and Windows
This feature enables simple moving of databases between Linux and Windows.
This results in transportable databases between Linux and Windows enabling cross-platform physical standby and simple moving of databases between Linux and Windows.
1.2.6 Information Life Cycle Management
The features described in the following sections provide automated and policy-based movement of data between storage tiers and they provide mechanisms for complying with retention and immutability regulations.
1.2.6.1 Flashback Data Archive
The historical data store provides the ability to store and track all transactional changes to a record for the duration of its lifetime.
The database maintains every state of the record during its lifetime. You no longer need to build this intelligence into the application. This feature is useful for compliance reporting and audit reports.
See Also:
Oracle Database Advanced Application Developer's Guide for details
1.2.7 Integration, Simplification, and Performance of Availability Features
These features describe improvements to the interoperability, usability, performance and robustness of existing functionality.
1.2.7.1 Automatic Reporting of Corrupt Blocks
During instance recovery, if corrupt blocks are encountered, the DBA_CORRUPTION_LIST is automatically populated.
Block validation occurs at every level of backup, media recovery, and instance recovery.
1.2.7.2 Block Media Recovery Performance Improvements
In prior releases, block media recovery needed to restore original block images from disk or tape backup before applying needed archived logs. In this release, if flashback logging is enabled and contains older, uncorrupted blocks of the corrupt blocks in question, then these blocks will be used, speeding up the recovery operation.
The benefit is a reduction in the time it takes for block media recovery by restoring block images from flashback logs instead of from disk or tape backups.
See Also:
Oracle Database Backup and Recovery User's Guide for details
1.2.7.3 Creation and Recovery of Long-Term Backups Improved
Long-term backups created with the KEEP option only back up the archive logs needed to make the backup consistent. No further archive log backups are retained.
This feature reduces the archive log backup storage needed for online, long-term KEEP backups by only backing up the archive logs needed to recover the long-term backup.
See Also:
Oracle Database Backup and Recovery User's Guide for details
1.2.7.4 End-to-End Redo Validation
This feature enhances redo validation.
End-to-end redo validation provides foreground redo checksum at generation time. This improves CPU and cache efficiency for the checksum computation.
1.2.7.5 Merge Catalogs
The new IMPORT CATALOG command allows one catalog schema to be merged into another, either the whole schema or just the metadata for specific database IDs.
This feature simplifies catalog management by allowing separate catalog schemas, created at different versions, to be merged into a single catalog schema.
See Also:
Oracle Database Backup and Recovery User's Guide for details
1.2.7.6 Parallel Backup and Restore for Very Large Files
Backups of large data files now use multiple parallel server processes to efficiently distribute the workload for each file. This is especially useful for very large files.
This features improves the performance backups of large data files by parallelizing the workload for each file.
See Also:
Oracle Database Backup and Recovery User's Guide for details
1.2.8 Intelligent Data Protection and Repair
The following sections describe features that automate the process of determining what kind of recovery is needed and applying that needed recovery.
1.2.8.1 Data Recovery Advisor
Data Recovery Advisor is a built-in tool that automatically diagnoses data failures and reports the appropriate repair options.
Data Recovery Advisor ensures the correct repair is performed for a failure and decreases the amount of time to recover from a failure.
See Also:
Oracle Database Backup and Recovery User's Guide for details
1.2.8.2 Enhance LogMiner to Support Automatic Data Repair
This new feature adds support for Automatic Data Repair (ADR).
Automatic Data Repair (ADR) requires the ability to lookup metadata when the database is not available. This project enhances the existing functionality in LogMiner to support ADR.
1.2.8.3 Integrated Protection From Various Data Corruptions
Through the creation of a new initialization parameter, DB_ULTRA_SAFE={off, data_only, data_and_index}, this capability provides an integrated mechanism to offer protection from various possible data corruptions that may impact Oracle Database. This parameter controls the setting of other related parameters such as DB_BLOCK_CHECKING, DB_BLOCK_CHECKSUM, and DB_LOST_WRITE_PROTECT, and also controls other data protection behavior within Oracle Database (for example, requiring ASM to do sequential mirror writes).
This feature improves the data protection capabilities of Oracle Database by offering an integrated mechanism to control various levels of protection from data corruptions. By making it possible to detect data corruptions in a timely manner, this feature also provides critical high availability benefits for Oracle Database.
1.2.8.4 Lost-Write Detection Using a Physical Standby Database
Lost-write is a serious form of data corruption that can adversely impact a database. Lost-write occurs when an I/O subsystem acknowledges the completion of a block write in the database while, in fact, the write did not occur in the persistent storage. This arises mostly because of hardware or software malfunctioning. This feature enables the use of the physical standby database to detect data corruptions that could arise as a result of lost-writes on the primary database.
This feature allows for more comprehensive data corruption detection using a physical standby database, helping you get increased value from your disaster recovery investment and maintain the uptime requirements of your business.
See Also:
Oracle Data Guard Concepts and Administration for details
1.2.9 Online Application Maintenance and Upgrade
The following features can significantly reduce the downtime required to make changes to an application's database objects.
1.2.9.1 DDL With the WAIT Option
Data definition language (DDL) commands require exclusive locks on internal structures. If DDL commands are issued, these locks may not be available causing the statement to immediately fail even though the DDL could have possibly succeeded sub-seconds later. This can be resolved by setting the WAIT option in the DDL_LOCK_TIMEOUT initialization parameter.
The WAIT option is the new default. The wait time is specified instance-wide (in the initialization parameter file) and can be modified on a session level.
The WAIT option gives you more flexibility to define grace periods for such commands to succeed instead of raising an error right away, thus requiring additional application logic to handle such errors.
See Also:
Oracle Database Administrator's Guide for details

Wednesday, July 22, 2009

An Introduction to Red Hat Linux

An Introduction to Red Hat Linux


Course Contents of Red Hat Linux –

1. File and Directory Operations
2. User Information
3. File Permissions
4. Linux File System Essentials
5. X-Window System and GUI application (introduction)
6. Standard I/O Pipes
7. String Processing
8. Process
9. VI editor
10. Bash Shell and Shell Scripting
11. Basic Network Clients



Introduction

An operating system (OS) is software designed to act as an interface between the computer and the user. It performs various important functions such as ,

· An OS is a command interpreter. It translates the high level language to machine language and vice versa.
· An OS acts as process manager. There are various processes running simultaneously in a computer. The amount of time to be spent on a process by the CPU is decided by the OS.
· An OS is a memory manager. As said above, there are various processes running simultaneously in a computer which require memory from CPU. The amount of memory to be allocated on certain process is also decided by the OS.
· An OS acts as a hardware or peripheral manager. The task of accepting input producing the output and redirecting to different peripherals is done by the OS.

About Linux

Linux is one of the popular OS in the market today. It is developed form of UNIX. So, most of its features are UNIX-like. Most of the tools found in UNIX are supported in Linux.

UNIX was designed and developed in 1960s to provide an environment to create programs. It became popular and got spread to educational institutes, research labs and industries. Later a Finnish student Linus Torvalds developed LINUX from UNIX and made the source code available on the internet. Later more developers added additional functions to LINUX.

UNIX principles
· Everything is a file including hardware.
· Configuration data are stored in the text format.
· Small-single purpose programs are present.
· It has ability to chain programs.

Linux has many unique features.
· It has a kernel programming interface. Kernel is responsible for controlling the resource and scheduling user jobs. All the programs interact with the kernel through system calls.
· Linux is a multi-user OS. This allows many users to access all the system resource almost simultaneously.
· It is a multitasking OS. It can run up to 32768 processes at a time.
· Files are arranged under a directory.


Structure of Linux system
Linux system structure consists of Kernel, Shell, Tools and Applications.

User Applications
Hardware
Kernel
Shell and Utilities

Layer view of Linux Operating System

Kernel is the heart of the Linux OS. It is loaded in the memory when computer is booted. It interacts with the hardware. It manages the system resources, allocates time for different users and process, and sets process priorities.

Shell acts as the interface between user and the computer. There are different types of Shell available in Linux. Among them, bash shell is widely used.

Linux has its own applications for word-processing, spreadsheet, creating presentation, image processing etc.


Simple Commands

Linux has six virtual consoles and one GUI console.
1. To switch between the text consoles, press
Ctrl+Alt+F1
Ctrl+Alt+F2
Ctrl+Alt+F3
Ctrl+Alt+F4
Ctrl+Alt+F5
Ctrl+Alt+F6,
To switch to GUI console, press
Ctrl+Alt+F7

2. To shut down the system, type “halt” in the command line and press enter.

3. date: To view and change current date and time.
· date (<┘): to view current system date and time.
· date –s mm/dd/yy : to change date
· date –s hh:mm:ss : to change time
· date –s ‘mm/dd/yy hh:mm:ss’ : to change both
· cal (<┘) : to view calendar of the current month and year
· cal 2004 (<┘) : to view calendar of the year 2004
· cal 7 2003 (<┘) : to view calendar of July 2003

4. To pause
more
or
less

press (<┘) to scroll one line at a time.
press ‘spacebar’ to scroll one page at a time.

5. To quit
press q (<┘)

6. To cancel a command, press
ctrl+c (<┘)

7. To clear screen
clear (<┘)


Getting Help

· For quick help
--help (<┘)

· For detailed help
man (<┘)

· Help files are also available in the directory
/usr/share/doc/

· Or we may also check the site
http://www.tldp.org
for linux documentation project.


File and Directory Commands

Directory Commands

NOTE:
. : represents current directory
.. : represents parent directory
/ : represents root directory
~ : represents home directory

1. pwd (<┘)
Displays the full pathname for the current directory.

2. ls (<┘)
Displays the list of files in the current directory.

ls /directory name (<┘)
Displays the contents of the specified directory.

This command various options to use. Some of them are as follows:
ls –l
Lists file in long format. Filenames are displayed along with their mode, number of links, owner, size, modification date and time.
ls –t
Lists in order of last modification time
ls –a
Lists all entries along with hidden files
ls –u
Lists in order of last access time


3. mkdir (<┘)
This command is used to create a new directory of specified name.

4. cd (<┘)
This command is used to change from working directory to any other directory specified.


5. rmdir (<┘)
This command removes or deletes the specified directory. The specified directory must be empty.



File Commands

1. cat command
Lists the contents of the specified file. If we do not specify the name of the file , it takes input form the standard input.

Options of cat commands are as follows:
cat
Displays the contents of the specified file.
cat –s
Suppresses warning about non-existent files
cat >
Creates a new file with specified file name. Takes input from standard input file. We can type in our text and terminate with ctrl+d to take us back to prompt.
cat >>
Appends data to the specified file

Conventions of filename
· Filename can be of maximum 255 characters.
· Special chars can be protected with quotes.
· Filename are case sensitive.
· Filenames beginning with dot is hidden file.

2. head (<┘)
Displays the first ten lines (default) the text file.
head –n N (<┘)
Displays the first N lines of the text file.
tail command is just the complement of the head command.


3. cp command
This command creates a copy of source file and gives the file name specified in destination file.
cp (<┘)

Options:
cp –i
Interactive
cp –r
Copies all the contents of dir1 to new directory dir2


4. touch …. (<┘)
Creates zero length (blank) files namely file1, file2, ….. fileN.

5. mv command
This command is used to rename and move ordinary and directory files.For this we need both execute and write permissions.
mv (<┘)

We can also use this command to rename files as follows:
mv (<┘)

6. rm command
This command removes the specified file.
The options available with this command are
rm -i
Prompts the user if he/she wants to delete the mentioned file.
rm -r
Recursively deletes the entire contents of the directory as well as the directory itself.
rm –ir
Interact with the rm command and deletes a directory.





Wild Card Characters
Group of files can be accessed using the wild card patterns.Various wild card patterns are as follows:
*
Match zero or more characters
?
Match any single character
[abx]
Matches any single character from given character
[a-e]
Matches by single character from given range
[^a-e]
Matches any single character except given range of character (^ stands for ‘not’)


User Information

The user information are stored in /etc/passwd. The file could be viewed by the root user.
The user information is stored and displayed in the following format.
username:x:user-id:GID:comment:/home-dir:/login shell

·Here, username specifies the name of the current user.
·x represents the shadow password. It is displayed instead of the actual password. The passwords are saved in /etc/shadow.
·User-id are the numbers. Zero (0) is for the root user by default Above zero till 499 specifies system users. While for the normal user it starts from 500.
·GID is the short form of Group ID. All the users are assosciates with a group in Linux OS. GID donates the user’s primary group number. User may be the member of more than one group. Primary GID is unique for all the users.
·Comments (finger information) are the information about the user. These are the common information which are not used in system.
·Home-dir is the home directory of the user. The user has the whole right in his/her home directory.
·Login shell


Some commands related to User Information

1. To create new user
useradd (<┘)

2. To assign password to new user
passwd (<┘)
Enter new password.

3. To change the user password
passwd (<┘) This command can be used by the user himself.
or
passwd (<┘) This command can be used by the root user.
Enter new password.
4. To change the comment of a user
chfn (<┘) chfn stands for “change finger”. This command can be used by the user himself.
chfn (<┘) This command can be used by the root user.

5. To view the finger information of any user
finger (<┘) This command can be used by the user himself.
finger (<┘) This command can be used by the root user.


6. To display the username of currently logged on users
· who (<┘)
Gives the details of the users who have logged in to the Linux system lately.


· whoami (<┘)
Gives details regarding login time and system’s name for the connection being used.
· w
Displays the users who are currently logged in.
· users
Displays the username of the users who have currently logged in. It displays only the usernames.

File Permission

Linux helps a very great deal in file security.
The Linux files can be classified into
- Directory files
- Ordinary files
- Special files
When a list of files is displayed using “ls –l” command, we can see the file-type and file permission specification in the first column (which is in the format drwxrwxrwx).

The first character represents the file type. Ordinary file starts with ‘-‘ and the directory files start with ‘d’.

The last nine charcters specifies the file permission.
The owner (one who created the file) of the file can perform any operation on the file. If the owner wants other people to access his/her files, then permission has to be granted by the owner.
Permission available are
r -> read (display, copy or compile a file)
w ->write (write, edit or delete a file)
x -> execute (execute a file)
The permissions are given from the second position onwards. The first three characters indicate the permissions of the owner of the file. The next three positions indicate the permissions of the group which consist of the owner and the last three indicates the permission for others.

To change the file access permission (FAP)

The mode of the file can be changed using ‘chmod’ command.
FAP can be changed for one user or for all the users. This can be done by specifying the name of the user before +/- sign.


‘u’ indicates the owner of the file.
‘g’ indicates the group which consists of the owner.
‘o’ indicates the others.
‘a’ indicates the all.

‘+’ is used to grant permission
‘-‘ is used to revoke permission
‘=’ is used for absolute assignment

syntax:
chmod user+/-permission characters (<┘)

For example,
chmod u+rwx file1 (<┘)
This command grants all the permissions to the owner.

chmod u-wx,g-wx,o-wx file1 (<┘)
This command revokes write and execute permissions from the entire user category.


Octadecimal Representation of FAP

FAP can be represented Octadecimally. The octadecimal values are as follows:
Numbers
Values
0
000
1
001
2
010
3
011
4
100
5
101
6
110
7
111

If a file has the permission set, then the value allotted is 1 else it is 0. If FAP is represented by 111, it means all the permissions are granted. The corresponding value for 111 is 7. So, the following command
chmod 777 file1 (<┘)
grants all the permissions for all the users.




Linux File System Essentials

Linux treats all the information as files. Directories and hard devices are also treated as files. They are stored in single rooted hierarchical order and grouped together which enables easier search of files. The supermost directory is called root directory and is represented by ‘/’. Only root doesn’t have a parent directory.

Linux file system can be shown as follows:

Root ‘/’ directory consists following subdirectories:

/bin
Consists of executable user programs
/usr
It is the home directory of the
/sbin
Contains system programs
/lib
Contains library files
/root
It is the home directory of the super user ie root user
/var
Location for variable files such as mail spools, print spools, log files etc
/mnt
Typical location for mount points mounted after system is booted
/etc
Consists of configuration files
/boot
Kernel and other files used during system startup
/lost+found
Used by file system check to place orphand files
/dev
Contains device files
/proc
It is the virtual file system containing system information used by other programs and kernel parameters
/home
Default location for user’s home directory
/opt
Installation directory for some third party programs such as star office
/tmp
Consists of temporary files

***----------------------------------------***
Remained to write about ext2/3 file systems
Filesystem metadata etc etc

Inode metadata

Stat command
***---------------------------------------***



Managing Devices

As has already been stated, Linux treat everything as a file. Even the hardware devices in which files are stored are treated as files. The special files that represent the hardware devices are kept in the directory /dev. Devices may be either Character Device or a Block Device.

The character device is a device in which we can read a sequence of characters. For instance, keyboard is a character device. They are also called sequentially accessed device.
While, a block device is the one in which we can read a block of data at once. Blocked devices have a fixed capacity and it allows accessing every part equally. Hence also called random access device. Floppy and Hard disks its examples.
The kernel identifies the type of the device by looking at the file mode, at the far left of the output of ls –l command.

Mounting Removable Media

The mount command can be used to mount blocked device (only) on the filesystem.
Syntax:
mount –t (<┘)

- fstype signifies the file system type to mount.
- device file represents a particular device to be mounted.
- mount point must be a directory and it need not be empty. When a filesystem is mounted in this directory, all files under the directory become inaccessible.

Floppy Disks
A floppy could be mounted with a filesystem such as msdos or vfat for FAT file system.
The device file corresponding to the floppy disks begin with the letters fd. /dev/fd0 represents the first floppy disk and /dev/fd1 for the second if exists. The device file /dev/fd0H1220 denotes a 1.44MB high density floppy.
CD-ROM Drive
A CD-ROM have a standard iso9660 filesystem.
The device name /dev/cdrom is used as a symbolic link to the actual device.
The audio CDs cannot be mounted.

In the above syntax, the fstype and deivce file are optional. Those details are retrieved from the /etc/fstab file. The mount point can be specified only if filesystem to mount is specified in /etc/fstab file.
Example of mount command :

mount /mnt/floppy (<┘)
mount /mnt/cdrom (<┘)
mount -t msdos /dev/fd0 /mnt/floppy (<┘)
mount -t iso9660 /dev/cdrom /mnt/cdrom (<┘)


To view the contents of the files in the media

cd /mnt/floppy (<┘) (for floppy disk)
ls (<┘)

cd /mnt/cdrom (<┘) (for cds)
ls (<┘)

After the use of the media, it is necessary to unmount it.

To unmount the media,
unmount (<┘)

Mounted CD-ROM cannot be ejected before unmounting. The following command first unmounts the CD Drive and then ejects it.

eject (<┘)


Links

There are two types of link available in Linux.
Hard Link and Soft or Symbolic Link.

The hard link establishes an additional filename for the existing file. Any modification made in one is reflected in both of them. Creating hard link does not take additional memory. Although we see two files, the same hard drive space is used for both.

Symbolic links are different from hard links in the sense that a symbolic link is a pathname, or alias, to the original file. Nothing happens to the original file if you delete the symbolic link.



To create hard link,
ln (<┘)
For directories, hardlinks cannot be created.

To create symbolic link,
ln –s (<┘)


Searching Files
There are two commands in Linux to search files in a directory and subdirectory.

slocate: This command accesses the database containing filenames and location to
find a file.

syntax:
slocate (<┘)

find: This command scans the actual file system.
syntax:
find ≥ dir ≤ [options] [action]

- dir is the directory name where file is to be searched.
- There are various options available with the find command. They are as follows:
-atime +/-N
List files that were accessed more or less than N days ago
-mtime +/-N
List files that were accessed more or less than N days
-user username
List files owned by user in username
-size N[c]
List files containing N blocks or if c is specified N characters long
-type filetypechar
List files whose type is filetype character
File type characters :
d for directories
b for block device file
c for character device file
l for soft link
f for regular or normal file
-name pattern
List files whose name matches to the pattern
-iname pattern
Same as above but case sensitive

- action can be as follows
-exec command {} \;
or
-ok command {} \;
The exec action executes the specified command on the found files.
The ok action is similar to exec. The only difference is that, it is interactive in nature.

Compression Utilities

Compression utilities are used for saving disk space by compressing large, less often used files. The compression utilities in Linux are
- gzip , gunzip (By default, extension of the compressed file will be .gz )
- bzip , bunzip (By default, extension of the compressed file will be .bz2 )

To compress file
gzip (<┘)
The compressed file is created in the current
directory. The original file is deleted.
gzip -c > (<┘)
The original file is not deleted.
bzip2 (<┘)
bzip2 –c > (<┘)

To uncompress file
gunzip (<┘)
The uncompressed file is created in the current
directory. The original file is deleted.
gunzip -c > (<┘)
The original file is not deleted.
bunzip2 (<┘)
bunzip2 –c > (<┘)


Archive Files (Backups)

Taking regular backups is one of the most important tasks. Backup copies are essential when the system malfunctions and files are lost or when a user deletes a file accidentally. Backup files are usually kept on floppy or magnetic taps. Writable CDs are also used.
One of the Backup Utilities provided by Linux is “tar”. The tar (tape archive) utility is used to store and retrieve files from a tape archive. Compression utilities could also be used to compress the archive, thus saving space. The archive can be written into hard drive, a tape drive, or nearly any other Linux device.
syntax:
tar [options] (<┘) .

The following options are available for tar command:
-c
Creates a new archive
-v
Verbose
-f
Specifies filename
-x
Extracts file from archive
-t
Test (list files in archive)
-z
Use gzip compression utility
-j
Use bzip compression utility

Here, ‘-‘ is optional. –c and –x can’t be used together.

Tar always restores files in the current directory. To restore file,
tar [options] (<┘)


X-Window System and GUI Applications (introduction)

An X-Window System is an application to provide GUI Environment. It is designed to be a machine/OS independent networked client/server program. As a result, the system is broken up into two major components: the X-Window server that runs on the machine and interacts with the monitor, hardware and the various clients. Component displaying is done by X-Client.
X-Free86 Package is used in Linux for GUI environment.

There are different window managers available with the X-Window System under Linux, each with different features. They are
- gnome
- KDE
- TWM
All these allow us to perform the basic operations.
To switch between displays, we may use following command.
If we are in run level 3,
switchdesk (<┘)
If we are in run level 5, then
- click start
- run program
- switchdesk
- select the display


The various GUI applications available in Linux are as follows.

Text Editors
- xemacs
- gvim
- dedit
- kwrite
Web Browsers
- mozilla
- galleon
- conqueror
- lynx
- links
File Manager/Web Browser
- nautilus
Task Manager
- Gnome-system-monitor
FTP Client
- gftp (to upload and download files)
Graphics Manipulation Program
- gimp
IRC chat client
- xchat
Mail Clients
- kmail
- balsa
- evolution
- mozilla
Office application
- koffice
- Gnome
- OpenOffice
Audio Application
- xmms
- gnome-volume-control
- gnome-cd
- mplayer for video CDs
Develop Environment
- kdevelop
X-Configuration
- redhat-config-xfree86 (Could be run in GUI or Text terminal)


Input/Output Redirection

By default,
- the standard input device is keyboard
- the standard output device is terminal window and
- the standard error is also displayed in the terminal window.
However, input can be taken from other sources like file itself and output can be passed to sources like printers or files etc. Such a process of changing the default assignment of input and output devices is called redirection.

For output redirection, following command is used.

command > (<┘)
Redirects the output to the specified file in overwrite mode.
command >> (<┘)
Redirects the output to the specified file in append mode.
command 2> (<┘)
Redirects the error to the file in overwrite mode.
command 2>> (<┘)
Redirects the error to the specified file in append mode.

For input redirection,
command < (<┘)
Redirects the input from the specified file. If the file does not exist, the shell will issue an error and abort the operation.

For input and output redirection
command < > (<┘)
This command takes it’s input from the source and redirects the output to destination.


Standard Input/Output Pipes

Pipes help in performing multiple tasks in a single command line. A pipe takes output of a command as input to another command. The pipes are considered as temporary unnamed files stored in memory. This prevents the user from making temporary files using redirection.

syntax:
command1 command2 command3 (<┘)

Here, the output of command1 acts as the input for command2. And the output of command2 is used as input to command3. The final output will be displayed on the standard output if the output redirection is not done.

The ‘tee’ command
This command is used to store an output of a command in a file as well as send it to another command as an input.
For instance,
ls –l tee mylist lpr (<┘)
This command will store the output of ‘ls’ command in the file ‘mylist’ and also will send it the printer.


String Processing and Filters

The ‘wc’ command
The wc command is used to count the number of lines, words or characters in a specified file.
syntax:
wc [options] (<┘)

The options for the wc command are as follows:
-l
For line count
-w
For word count
-c
For character count


The ‘cut’ command
This command extracts one particular field from the specified file or output of any command.

syntax:
cut [options] (<┘)

The options are
-d
Represents the delimiter or the field separator
-f
Used to specify the list of fields that have to be displayed
-c
Used to extract single character


The ‘diff’ command
This command compares two files for differences. If found, it displays the lines which are different.
‘<’ refers to the contents of first file
‘>’ refers to the contents of second file.
syntax:
diff (<┘)


The ‘paste’ command
This command merges the contents of two or more files into a single file. It reads a line from each file in the file list specified and combines them column-wise into a single file.
The contents of the first file are displayed in first column.
The contents of the second file are displayed in second column and so on.
They are separated by tab by default. If we wish to change the delimiter, ‘-d’ option can be used as in cut command.

syntax:
paste (<┘)

Example:
paste > (<┘)
This command merges file1 and file2. The merged file will be saved as
newfile.

The ‘tr’ command
‘tr’ stands for translate. This command reads standard input and, for each input character, maps it to an alternate character, deletes the character, or leaves the character alone. The output is written to the standard output.
‘tr’ does not take a filename as a parameter. But redirection operation could be used.

syntax:
tr ‘’ ‘’ (<┘)


The ‘aspell’ command
This command is used to check spelling in a file.
syntax:
aspell check (<┘)


Filters
Filters are used to extract the lines, which contain specific pattern, to sort, to find and replace etc. Filters are also used to store the intermediate results of a long pipe.


The sort Filter
The sort filter arranges the input taken in the alphabetic order. The original file remains unchanged.
The options available with sort are
-r
Reverse alphabetic order
-n
Sorts according to the ascii value (numeric sort)
-u or uniq
Stands for unique. Removes duplicates. This is case sensitive.
-f
The case distinction is ignored.
-t x
Use x as a field separator. The default field separator for sort is blank space or tab.
-k pos
Sorts from the field pos.
syntax:
sort [option] (<┘)


The grep Filter
‘grep’ stands for “global search for regular expression”. It is used to search for a particular pattern from a file or standard input and display those lines on the standard output.
syntax:
grep (<┘)


The ‘sed’ Filter
‘sed’ stands for stream editor. This command searches a particular pattern and replaces it with the replace string. But the changes are not reflected in the original file.
syntax:
sed ‘s/search-string/replace-string/g’ (<┘)

The ‘g’ is used to replace all the search strings. If ‘g’ is not specified, the
command will replace only the first occurrence of the search string in a
line.


The ‘awk’
An ‘awk’ is a scripting language. ‘awk’ program can be entered in a number of ways on the command line. It is also used for pattern recognition. One of the methods of searching a pattern using awk code is as follows.

syntax:
awk ‘pattern {action}’ (<┘)
Example:
ls –l awk ‘$3==”user1” {sum+=$5} END {print sum}’
This command prints the total size of all the files under the ownership of
user1.



Process

A process is the basic context within which all user-requested activity is serviced within an O.S. In Linux, every process runs under another process (called Parent Process). So, every process is a child process. At a time there can be maximum 32768 numbers of running processes and consequently there can be 1 to 32768 processIds. All the processes created after login is controlled by terminal.

Init Process
It is the process that is executed during the booting process in Linux. Its processId is 1. It is the first process that is executed in Linux and is situated in the directory /sbin/init. Init process does not have any parent process because it is directly run by Kernel.

A process can be in following states:
R
Runnable
S
Sleeping
T
Stopped
D
Uninterruptible sleep (Not respondent task)
Z
Defunct (Zombie) process

When child process ask parent process to release its processed, parent process acknowledges releasing the process Id. But, due to some reason, if child process doesn't receive the acknowledgement, it is not released and the resulting state is said to be the zombie state.


Various commands related to the Process are as follows.

· Viewing process
ps command
‘ps’ stands for Process Status. It also displays the cumulative amount of time that the CPU has spent in the execution of the process.

The options of ps command are,
a
display all processes excluding the processes not controlled by terminal. It displays four columns for process Id, terminal, time, and command.

x
displays all processes including the processes not controlled by terminal
l
long listing; includes more information such as process owner's id UID.
u
displays the user name of process owner

· Running a process in the foreground
To run the process in the foreground, simply type the command and press enter.

· Running the process in the background
To run the command in the background following syntax is used.]
command & (<┘)

· Suspending (Stopping) a foreground process
To stop a foreground process, press
Ctrl + Z (<┘)

· Displaying the stopped and background process
To display the stopped processes and the background processes,
jobs (<┘)

· To display the process hierarchy, following command is used.
pstree (<┘)

· Terminating a process
We use KILL or TERM (default) commands to terminate a process.
syntax:
kill [ signal ] <>
TERM sends process the message as 'terminate yourself'
KILL forcefully free the resources using that process.

· Resuming the processes
To resume the jobs in foreground,
fg (<┘)
To resume the jobs in background
bg (<┘)


A process can have its priority form –20 to 19, -20 is the highest priority and 19 is the lowest priority. By default the priority of a process is 0.

· Running a process with specifies priority
syntax :
nice –n priority command (<┘)
Eg:
nice –n 10 find / -ml (<┘)

· Changing the priority of running program
syntax:
renice <-p PID -u username> (<┘)
The priority of the process having “PID” will be changed.
renice <-u username -u username> (<┘)
The priority of the processes under “username” will be changed.


Visual Editor(vi)
The editors help in creating and editing files. The editor in an OS has the same importance as the editor of the newspaper. Linux offers various tuypes of editors like vi, ex, sed, ed etc. Among them, the vi editor is the most powerful and widely used in Linux environment.

The vi editor functions in two different modes – the command mode, and the insert mode.
In the command mode, any key pressed by the user is assumed as commands by the editor. No text is displayed on the screen when any key is pressed.
The insert mode helps us to insert the text we want to.

To invoke the editor,
syntax :
vi (<┘)

To go to the insert mode from the command mode,
press i
To go to the command mode from the insert mode,
press escape key

In command mode the pressed character is the command.
The characters that works as command in the command mode:
i
Insert before the cursor
a
Insert after the cursor
o
Open a line below
I
Insert at beginning of line
A
Append to end of line
O
Open a line above

Saving and exiting from vi editor
:w (<┘)
save(write to disk)
:w (<┘)
if filename is not given
:q (<┘)
quit if saved
:wq (<┘) ] or :x (<┘) or :zz (<┘)
save and exit
:q! (<┘)
quit without saving
:e! (<┘)
abandon the changes and reload the last saved version


Cursor movement
The vi command involves alphabets and the shift and control keys.The cursor movement can be described as follows.

h
left
j
down
k
up
l
right
w
word ahead
b
word back
(
sentence back
)
sentence forward
{
paragraph back
}
paragraph forward

To Change, Delete (cut), Yank (copy) texts,

change
delete
yank
line
cc
dd
yy
letter
cl
dl
yl
word
cw
dw
yw
paragraph above
c{
d{
y{
paragraph below
c}
d}
y}
sentence back
c(
d(
y}
sentence foreward
c)
d(
y)

Paste
p
To paste after cursor/line
P
To paste before the cursor/ line

Undo
u
undo most recent changes
U
undo all changes to the current line since the cursor loaded on the line

Redo
Ctrl + r (<┘)

Searching the text
/searchtext (<┘)
searches the text in forward direction
?searchtext (<┘)
searches the text in backward direction
n
continue search in the same direction
N
continue search in the opposite direction


Search and replace
:s/search text/replacetext/g
searches and replaces on current line only
: 1,$s/searchtext/replacetext/g
searches and replace in entire file
: . , .+10s/searchtext/replacetext/g
searches and replaces on current line and 10 lines forward
:8, 12s/ searchtext/replacetext/g
searches and replaces on 8th lines through 12th lines.


Configuring vi
: set number[spelling] or nu
Displays the line numbers
: set nonunter or nonu
Removes line number
: set ignorecase (<┘)
Ignores case
:set noignorecase (<┘)
Considers case


Getting help
:help (<┘)
To come out of the help
:q (<┘)


Bash Shell and Shell Scripting
A Shell provides features that enable it to be used as a programming language. A set of commands can be grouped together under a single filename and executed. This is referred to as Shell Scripting in Linux. It offer varied of facilities for effective programming.

Various Shells in Linux are
o sh (Bourne shell): developed by Stevene Bourne at AT & T
o csh (C shell): developed by Bill Joy at Berkeley
o ksh (Korn shell): developed by David Korn at AT & T
o tesh (The Enhanced C shell): developed by community effort
o bash (Bourne Again Shell): by GNU, bash is the mostly used shell.

To know the currently using shell,
press ctrl-X, ctrl-V
It displays the current shell and its version.

Creation of Shell Scripts
A set of commands to be performed can be entered into a file by using any of the above editors or by using cat command.

Execution of Shell Script
A Shell Script can be executed using two methods. One is to type “sh ” at the command prompt.
The other method is to grant execute permission to the file and then type the file name at the prompt.



Variable
Variables can be
- shell variable
- environment variable
Shell variables are accessible within the shell only and environment variables are accessible within shell and its child shells as well.

The following commands display the list of variables
set (<┘) : Displays the list of shell variables as well as
environment variables.
env (<┘) : Displays the list of environment variables only.

The # symbol
The # symbol is used in the Shell scripts to insert comment lines. On execution, the comment line will be ignored.


//****
Eg. $a=5 (<┘)
It assigns the value 5 to the variable 'a'.
No space in front and back of '=' is required as the space in command line is taken as an argument.

'Echo' command
This command is used to display the definite value or string embedded in double quotation.
Eg. $echo "Hello" (<┘)
It displays the string “Hello”

Eg. $a=5
$echo $a
It displays the value of the variable 'a' as 5

If the user is in child shell then he cannot operate on shell variable, he has to return from child shell.

To create child shell we use the command 'bash'.
bash (<┘)

To return from the child shell 'exit' command is used.
exit (<┘)

Export command
To transfer the shell variable to environment variable 'export' command is used.
export a (<┘)
The variable 'a' is shell variable.
$ps
If there is more than one bash then you are in child shell.

Eg: $a=10
$bash
$export a
$echo $a
10 is assigned to the variable 'a'. Child shell is created the shell variable is transferred to the environment variable and the value of 'a' is displayed.
$a=10
$bash
$echo $a
It doesn't displays the value of a. You need to return from child shell.
$a=10
$bash
$exit
$echo $a
$export b=6 is equvalent to $b=6
$export b

ps1 is predefined environment variable.
$echo $ps1 defines command prompt with some predefined value as [\u@\h \W]\$
where \u ->user name
\h -> Host name
\H -> Full Host name
\W -> directory
\$ -> normal user ****/


History Command
'history' command is used to display the latest commands those were used by the user. By default, it displays latest thousand commands. It is user specific command and can be viewed only after logout. The history file is saved in the directory ~/. bash_history.
( ~ is home directory of the user.path = /home/user1/. bash_history)
So, we can also read or edit the content of the file using the following command,
vi .bash_history (<┘)

!! (<┘)
executes last used command
!x (<┘)
repeats last used command started with 'x'
!n (<┘)
repeats a command by its number in history output
!-n (<┘)
repeats a command entered n commands back


/************
Command line expansion
Shell function; shell scripting
************/

Programming Structures

Operators:
1. String operators:
· –z string : Returns true, if zero length string
· –n string : Returns true, if length of string is non-zero
· string1 op string2 : Here op may be ‘=’ or ‘!=’
2. Integer operators
· Integer1 op Integer2
Here op may be as follows:
-eq : equal to
-ne : not equal to
-lt : less htan
-le : less or equal to
-gt : greater than
-ge : greater or equal to
3. File operators
-e filename : Returns true if file exists
-f filename : Returns true if regular (normal) file
-d filename : Returns true if directory
-b filename : Returns true if block device file
-c filename : Returns true if character device file
-r filename : Returns true if file has read permission
-w filename : Returns true if file has write permission
-x filename : Returns true if file has execute permission
4. Logical operator:
-a : AND
-o : OR

Condition
Syntax : test expression
or
[ expression ]

Control Statements
1. if statement
The if condition statements may be used in the following four ways.
· if condition
then
statement
fi

· if condition
then
statement
else
statement
fi

· if condition
then
statement
elif condition
then
statement
elif condition
then
statement
else
statement
fi

· if condition
then
if condition
then
statement
else
statement
fi
else
statement
fi


2. Case Statements
The case statement executes a shell script based on a choice.
syntax:
case variable in
value 1)
statements
;;
value 2)
statements
;;
*)
statements
;;
esac

3. Loops
The following sorts of loops are available for shell scripting in Linux.

· for Loop
It is used ot perform the same set of operations on a list of values.
Syntax:
for variable in list_of_values
do
statements
done

· while Loop
The commands within it are executed repeatedly as long as the condition remains true.
syntax:
while condition
do
statements
done
· until Loop
Here, the statements are executed until the condition is false.
syntax:
until condition
do
statements
done


Positional Parameters
Linux accepts commands in the command line. A shell script can be made to accept arguments form the command line. Since the arguments represent their position, they are called positional parameters.

The variables defined for the positional parameters are
$#
Count of arguments
$*
List containing arguments
$0
Filename of the shell script
$1
First argument
$x
xth argument (where 0 &ge x<10)


Printing and Mailing

Printing
The various commands related to “printing” in Linux are as follows:
· lpr (<┘) : prints a named file.
· lpr –P printer (<┘) : configures printer and prints the specified file.
· lpq (<┘) : displays the queued print jobs.
· lprm (<┘) : removes the queued print jobs.

The various utilities related to printing are,
· enscript : Converts text file into PostScript file
· a2ps : Converts text file into PostScript file
· ps2pdf : Converts PostScript file to PDF file
· pdf2ps : Converts PDF file to PostScript file
· ggv : It is used in GUI terminal to view PDF and PostScript files. Could be compared to Adobe Acrobat Reader.

Mailing
There are various mail programs that can be used in Linux to send and receive mails.
In the text terminal, the following can be used.
· mail
· pine
· mutt
While in the GUI, the following applications can be used.
· Kmail
· balsa
· evolution
· mozilla

To send mail using “mail”
mail (<┘)
subject: (<┘)

(<┘)

. (<┘) //This signifies the end of the text.
cc: (<┘)


To check mail
mail (<┘)


Basic Networking

ping Command
This command is used to check if there is a connection between any two computers.

This command is also useful for verifying that your ISP’s IP addresses are valid and for testing the response times of your ISP’s host servers. Ping sends test packets of data and measures the time it takes for the host to send back the information.

Syntax:
ping (<┘)
Example:
ping 192.168.1.X where X is a machine-id

By default, ping will continue to send and receive information until we quit with
the following command:
Ctrl+C (<┘)

traceroute Command
This command is used if there is a network to network connection.

Example:
traceroute www.redhat.com (<┘)

white paper of linux, case study of linux, example of linux command, linux command

Tuesday, July 21, 2009

MIME AND ITS TYPE

MIME Overview
by Mark Grand
Internet e-mail allows mail messages to be exchanged between users of computers around
the world and occasionally beyond… to space shuttles. One of the main reasons that
Internet e-mail has achieved such wide use is because it provides a standard mechanism
for messages to be exchanged between over 1,000,000 computers connected to the
Internet.
The standards that are the basis for Internet e-mail were established in 1982. Though they
were state of the art in 1982, in the intervening years they have begun to show their age.

The 1982 standards allow for mail messages that contain a single human readable message
with the restrictions that:
• the message contains only ASCII characters.
• the message contains no lines longer than 1000 characters.
• the message does not exceed a certain length
The 1982 standards do not allow EDI to be transmitted through Internet mail, since EDI
messages can violate all of these restrictions. There are a number of other types of
messages and services that have are supported by other mail standards that have been
designed more recently. In June of 1992 a new Internet mail standard was approved. This
new standard is called MIME.
MIME is an acronym for Multipurpose Internet Mail Extensions. It builds on the older
standard by standardizing additional fields for mail message headers that describe new
types of content and organization for messages.
MIME allows mail messages to contain:
• Multiple objects in a single message.
• Text having unlimited line length or overall length.
• Character sets other than ASCII.
• Multi-font messages.
• Binary or application specific files.
• Images, Audio, Video and multi-media messages.
MIME defines the following new header fields:
1. A MIME-Version header field, which uses a version number to declare that a
message conforms to the MIME standard.
2. A Content-Type header field, which can be used to specify the type and subtype
of data in the body of a message and to fully specify the encoding of such data.
2.a. A Text Content-Type value, which can be used to represent textual
information in a number of character sets and formatted text description
languages in a standardized manner.
2.b. A Multipart Content-Type value, which can be used to combine several
body parts, possibly of differing types of data, into a single message.
2.c. An Application Content-Type value, which can be used to transmit
application data or binary data.
2.d. A Message Content-Type value, for encapsulating a mail message.
2.e. An Image Content-Type value, for transmitting still image (picture) data.
2.f. An Audio Content-Type value, for transmitting audio or voice data.
2.g. A Video Content-Type value, for transmitting video or moving image
data, possibly with audio as part of the composite video data format.
3. A Content-Transfer-Encoding header field, that specifies how the data is
encoded to allow it to pass through mail transports having data or character set
limitations.
4. Two optional header fields that can be used to further describe the data in a
message body, the Content-ID and Content-Description header fields.
MIME is an extensible mechanism. It is expected that the set of content-type/subtype pairs
and their associated parameters will grow with time. Several other MIME fields, such as
character set names, are likely to have new values defined over time. To ensure that the
set of such values develops in an orderly, and public manner, MIME defines a registration
process which uses the Internet Assigned Numbers Authority (IANA) as a central registry
for such values.
To promote interoperability between implementations, the MIME standard document
specifies a minimal subset of the above mechanisms that are required for an
implementation to claim to conform to the MIME standard.
2
MIME Technical Summary
MIME is defined by an Internet standard document called RFC 1341. This document
summarizes the contents of RFC 1341. Sufficient detail is presented here to understand
the capabilities of MIME. For sufficient detail to implement MIME please read RFC 1341.
MIME allows messages to contain multiple objects. When multiple objects are in a MIME
message, they are represented in a form called a body part. A body part has a header and
a body, so it makes sense to speak about the body of a body part. Also, body parts can be
nested in bodies that contain one or multiple body parts.
The Content-Type values, subtypes, and parameter names defined in the MIME standard
are not case insensitive. However, many parameter values are case sensitive
The MIME standard is written to allow MIME to be extended in certain ways, without
having to revise the standard. MIME specifies sets of values that are allowed for various
fields and parameters. The provides a procedure for extending these sets of values by
registering them with an entity called the Internet Assigned Numbers Authority (IANA).
The MIME-Version Header Field
MIME is designed to be compatible with older Internet mail standards. In particular, it is
compatible with RFC 822. If a mail reading program receives a message that is a MIME
message then it will likely perform additional processing for the MIME message that it
would not perform for non-MIME messages. In order to allow mail reading programs to
recognize MIME messages, MIME messages are required to contain a MIME-Version
header field. The MIME-Version header field specifies the version of the MIME standard
that the message conforms to.
As of this writing there is only version (1.0) of the MIME standard. Messages that comply
with the standard must include a header field, with the following verbatim text:
MIME-Version: 1.0
The MIME-Version header field is required at the top level of a message. It is not required
for each body part of a multipart entity. It is required for the embedded headers of a body
of type "message" if and only if the embedded message is claimed to be MIME-compliant.
The Content-Type Header Field
The Content-Type field describes the data contained in the body fully enough that the
mail reader can pick an appropriate mechanism to present the data to the user, or
otherwise deal with the data in an appropriate manner.
The Content-Type header field is used to specify the nature of data in the body or body
part, by giving type and subtype identifiers, and by providing parameters that may be
3
needed for certain types. After the type and subtype names, the remainder of the header
field is a set of parameters, specified in an attribute/value notation. The set of meaningful
parameters differs for different types. The order of parameters is not significant.
Comments are allowed (in accordance with RFC 822 rules) in structured header fields by
placing them in parentheses.
The top-level Content-Type is used to declare the general type of data, while the subtype
specifies a specific format for that type of data. Thus, a Content-Type of Image/xyz is
enough to tell a mail reader that the data is an image, even if the mail reader has no
knowledge of the specific image format xyz. Such information can be used, to decide
whether or not to show a user the raw data from an unrecognized subtype — such an
action might be reasonable for unrecognized subtypes of Text, but not for unrecognized
subtypes of Image or Audio. For this reason, registered subtypes of Audio, Image, Text,
and Video, should not contain embedded information that is really of a different type.
Such compound types are usually represented using the Multipart or Application
types.
Parameters are modifiers of the content-subtype. Although most parameters make sense
only with certain content-types, others are “global” in the sense that they might apply to
any subtype. For example, the Boundary parameter, which is used to indicate how body
parts are separated from each other, makes sense only for the Multipart content-type.
The Charset parameter might make sense with several content-types.
The MIME standard defines seven content-types. The authors of the MIME standard state
that the set of seven types is “substantially complete”. They expect additional supported
types to be accommodated by creating new subtypes of the seven initial top-level types.
The MIME standard, functioning as a constitution for the MIME community, states that
new standard content types can be defined only by revising the standard (as opposed to
the registration procedure for other types of extensions). However, MIME does provide
for the use of non-standard content types. Non-standard content-types can be used, but
must be given names starting with X-. Future standard content type names will not begin
with X-.

The syntax for the content type header field is
Content-Type := type "/" subtype [";" parameter]…
The defined content types are:
Application
indicates data that does not fit into any of the other categories, such as
uninterpreted binary data or information to be processed by a mail-based
application. In addition to the following subtypes, it is likely that additional
subtypes will be defined for applications such as mail-based scheduling
systems, spreadsheets and EDI.
4
Application/Octet-Stream
indicates uninterpreted binary data, which a mail reading program
may simply offer to write the information into a file. Possible
parameters for Application/Octet-Stream include:
Name
a suggested name for the binary data if stored as a file.
Type
the general type or category of binary data. This is intended for
human recipients rather than for automated processing.
Conversions
the operations that performed on the data before putting it the
body. Note that the standard defines no conversion values.
Any conversion values that do not begin with X- must be
preceded by a published specification and by registration with
IANA.
Padding
the number of bits of padding that were appended to the
bitstream comprising the actual contents to produce the
enclosed byte-oriented data. This is useful for enclosing a
bitstream in a body when the total number of bits is not a
multiple of the byte size.
Application/ODA
indicates a body containing information encoded according to the
Office Document Architecture (ODA) standards, using the ODIF
representation format. For Application/ODA, the Content-Type
line should also specify an attribute/value pair that indicates the
document application profile (DAP), using a Profile parameter.
Thus an appropriate header field might look like this:
Content-Type: application/oda;
profile=Q112
Consult the ODA standard for further information.
Application/PostScript
indicates a body containing a postscript document.
Audio
Indicates audio data. Audio requires an audio output device (such as a
speaker or a telephone) to “display” the contents.
Audio/Basic
The content of the Audio/Basic subtype is audio encoded using 8-
bit ISDN u-law. When this subtype is present, a sample rate of 8000
Hz and a single channel is assumed.
5
Image
Image data. Image requires a display device (such as a graphical display, a
printer, or a FAX machine) to view the information.
Image/Jpeg
indicates an image in JPEG format.
Image/Gif
indicates an image in GIF format.
Message
indicates an encapsulated message.
Message/Rfc822
indicates that the body contains an encapsulated message, with the
syntax of an RFC 822 message.
Message/Partial
indicates a partial message, allowing fragmented transmission of
bodies too large to be passed through mail transport facilities.
Message/Partial indicates that the body contains a fragment of a
larger message.
Three parameters are required in a Content-Type field of type
Message/Partial: The first, Id, is a unique identifier, as close to
world-unique as possible, used to match the parts together. The
second, Number, an integer, is the part number indicating where this
part fits into the sequence of fragments. The third, Total, another
integer, is the total number of parts. Total is required on the final
part, and optional on earlier parts.
Message/External-Body
indicates that the actual body data are not included, but merely
referenced. In this case, the parameters describe a mechanism for
accessing the external data.
When a body or body part is of type Message/External-Body, it
consists of a header, a blank line, and the message header for the
encapsulated message. If another blank line appears, this ends the
message header for the encapsulated message. However, since the
encapsulated message's body is itself external, it does not appear in
the area that follows. For example, consider this message:
Content-type: message/external-body;
access-type=local-file;
name=/u/nsb/Me.gif
Content-type: image/gif
THIS IS NOT REALLY THE BODY!
6

The area at the end, which constitutes a phantom body, is ignored
for most external-body messages. However, it may be used to
contain auxiliary information for a “mail-server”.
The only parameter of Message/External-Body that is always
mandatory is Access-Type. Its other parameters are mandatory or
optional depending on the value of Access-Type. The values
defined for the Access-Type parameter are FTP, ANON-FTP, TFTP,
AFS, LOCAL-FILE, and MAIL-SERVER. Except for values beginning
with X-, other values must be registered with IANA.
The standard also specifies additional parameters that are to be
used in conjunction with the various access types.
In addition to access-type specific parameters, the standard defines
the following parameters which are optional for all access types:
• The Expiration parameter is used to specify a date after
which the existence of the external data is not guaranteed.
• The Size parameter is used to specify the size of the data.
Multipart
indicates data consisting of multiple body parts; each having its own data
type. It is possible to tell where each body part begins and ends because
each body part is preceded by a special string called an encapsulation
boundary; the last body part is followed by a closing boundary.
The boundary strings used are specified by a mandatory parameter called
Boundary. The encapsulation boundary is an end of line followed by two
hyphens followed by the boundary parameter value of the Content-Type
header field. The closing boundary is the same as the encapsulation
boundary with the addition of two hyphens at the end of the line.
The encapsulation boundary must not appear inside any of the
encapsulated parts. It is crucial that the composing user agent be able to
choose and specify the unique boundary that will separate the body parts.
Encapsulation boundaries may be no longer than 70 characters, not
counting the blank line and leading hyphens.
Thus, a typical multipart Content-Type header field might look like:
Content-Type: multipart/mixed; boundary=gc0y0pkb9ex
This indicates a body consisting of several body parts, each having a
structure syntactically identical to an RFC 822 message, except that the
header area may be completely empty, and each part is preceded by the line
--gc0y0pkb9ex
The closing boundary following the last body part indicates that no further
body parts will follow. It is identical to the preceding encapsulation
boundaries, with the addition of two more hyphens at the end of the line:
7
--gc0y0pkb9ex--
There is room for additional information prior to the first encapsulation
boundary and following the final boundary. These areas are often blank.
Anything appearing before the first or after the last boundary is ignored.
As a simple example, the following multipart message has two parts, both
plain text, one explicitly typed and one implicitly typed:
From: Nathaniel Borenstein
To: Ned Freed
Subject: Sample message
MIME-Version: 1.0
Content-type: multipart/mixed;
boundary="simple boundary"
This is the preamble. It is to be ignored, though it is
a handy place for mail composers to include an
explanatory note to non-MIME compliant readers.
--simple boundary
This is implicitly typed plain ASCII text.
--simple boundary
Content-type: text/plain; charset=us-ascii
This is explicitly typed plain ASCII text.
It DOES end with a line break.
--simple boundary--
This is the epilogue. It is also to be ignored.
The use of a Content-Type of multipart in a body part within another
multipart entity is explicitly allowed. In such cases, care must be taken to
ensure that each nested multipart entity uses a different boundary delimiter.
The use of the multipart Content-Type with only a single body part may
be useful in certain contexts, and is explicitly permitted.
Multipart/Mixed
indicates multiple independent body parts to be viewed serially.
Multipart/Alternative
is syntactically identical to Multipart/Mixed. Each part is an
“alternative” version of the same information. Mail readers should
recognize that the content of the parts are interchangeable. The
mail reader should either choose the “best” type based on the user's
environment and preferences, or offer the user the available
alternatives. Generally, choosing the best type means displaying
only the last part that can be displayed. This may be used, for
example, to send mail in a fancy text format in such a way that it
can easily be displayed anywhere:
From: Nathaniel Borenstein
To: Ned Freed
Subject: Formatted text mail
8
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary=boundary42
--boundary42
Content-Type: text/plain; charset=us-ascii
...plain text version of message goes here....
--boundary42
Content-Type: text/richtext
.... richtext version of same message goes here ...
--boundary42
Content-Type: text/x-whatever
.... fanciest formatted version of same message
goes here
...
--boundary42--
In this example, users whose mail system understood the
text/x-whatever format would see only the fancy version, while
other users would see only the richtext or plain text version,
depending on the capabilities of their system.
Some mail reading programs that recognize more than one of the
formats will offer the user a choice of which format to view. This
makes sense, for example, if mail includes both a nicely formatted
image version and an easily edited text version. The point is that
multiple versions of the same data are not automatically shown.
Either the user is shown the last recognized version or explicitly
given the choice.
Multipart/Parallel
is syntactically identical to Multipart/Mixed. However, in a
parallel body, all of the body parts are intended to be presented
simultaneously on hardware and software that are capable of doing
so. Composing agents should be aware that many mail readers will
lack this capability and will show the parts serially in any event.
Multipart/Parallel will likely be used for multimedia messages
that combine such message types as text, audio and/or video.
Multipart/Digest
Indicates that each of the body parts is an RFC 822 mail message.
Multipart/Digest is syntactically identical to Multipart/Mixed,
except that the default Content-Type value for a body part is
changed from Text/Plain to Message/Rfc822.
Text
The text Content-Type is for sending material that is principally textual
in form. It is the default Content-Type. A Charset parameter may be
9
used to indicate the character set of the text. The default Content-Type
for Internet mail is text/plain; Charset=US-ASCII.
The value of the Charset parameter is not case sensitive. Allowable
values are US-ASCII, ISO-8859-1, ISO-8859-2, … and ISO-8859-9. The
default value for Charset is US-ASCII.
Text/Plain
indicates plain (unformatted) text. No special software is required
to get the full meaning of the text, aside from support for the
indicated character set. Other subtypes should be used for enriched
text in forms where application software may enhance the
appearance of the text, but such software must not be required in
order to get the general idea of the content. Possible future
subtypes include any readable word processor format.
Text/Richtext
indicates a simple portable word processing format that is defined
by the MIME standard. It is a very small subset of SGML. Mail
readers that implement Richtext may implement only a subset of
it.
When a mail composing program is given a file in a word
processing format to send and there is no standardized subtype for
that format, then the message composing program may reformat the
file into richtext format which will preserve more of the original
formatting information than reformatting the file to plain ASCII.
Video
indicates that the body contains a time-varying-picture image, possibly with
color and coordinated sound. The term Video is used very generically and
does not refer to any particular technology or format. It is not meant to
preclude subtypes such as animated drawings encoded compactly.
Video/Mpeg
indicates video coded according to the MPEG standard.
X-TypeName
This is any type name that begins with X-. A Content-Type value
beginning with X- is a private value, to be used by consenting mail systems
by mutual agreement. The standard specifies no subtypes.
No type may be specified without a subtype.
The standard allows the use of additional sub-types without having to change the
standard. However, it is important to insure that sub-types used by different user
communities of MIME do not conflict. It would be confusing if Content-Type:
application/foobar meant two different things. The standard specifies two
mechanisms for defining new Content-Type subtypes:
10
1. Private values (starting with X-) may be defined between cooperating mail
composing and reading programs without outside registration. Use of this
mechanism requires knowing that the reader of the message will not mistake the
content type for something other than originally intended.
2. New standard values must be registered with IANA. Where intended for public
use, the formats they refer to must also be defined by a published specification.
Messages that do not have a Content-Type field in their header are displayed by user
agents as if Content-Type: Text/plain; Charset=US-ASCII had been specified.
When a mail reader encounters mail with an unknown Content-Type value, it will
generally treat it as equivalent to application/octet-stream.
The Content-Transfer-Encoding Header Field
Many Content-Types which could usefully be transported via e-mail are represented, in
their “natural” format, as 8-bit character or binary data. Such data cannot be transmitted
over some transport protocols. For example, SMTP (Simple Mail Transfer Protocol is an
Internet standard for transporting e-mail defined by a document called RFC 821) restricts
mail messages to 7-bit ASCII data with lines no longer than 1000 characters.
MIME provides two mechanisms for re-encoding such data into a 7-bit short-line format.
The Content-Transfer-Encoding header field indicates the mechanism used to perform
such an encoding. The Content-Transfer-Encoding field indicates the transformation
that has been used to represent the body in an acceptable manner for transport.
The possible values for the Content-Transfer-Encoding field are:
BASE64
QUOTED-PRINTABLE
8BIT
7BIT
BINARY
x-EncodingName
These values are not case sensitive. That is, Base64, BASE64 and bAsE64 are all
equivalent. An encoding type of 7BIT requires that the body is already in a 7-bit mailready
representation. That is the default value: Content-Transfer-Encoding: 7BIT is
assumed if the Content-Transfer-Encoding header field is not present.
Both BASE64 and the QUOTED-PRINTABLE imply an encoding that consists of lines no
longer than 76 ASCII characters. In other respects the two encoding schemes are very
different.
The encoding scheme implied by QUOTED-PRINTABLE is most appropriate for data that
consists primarily of printable ASCII characters. Using this encoding method, printable
ASCII character are represented as themselves. The equals sign (=) serves as an escape
character. Any character that is not a printable or white space ASCII character is
11
represented as an equals sign followed by two hexadecimal digits. An equals sign in the
message is also represented in this way. Lines that are longer than 76 characters are cut
off after the 75th character and the line ends with a equals sign.
The advantages of using the QUOTED-PRINTABLE encoding for message that are mostly
printable ASCII characters are that few additional characters are required and the message
can be read by human beings who to not have a MIME aware mail reading program. As an
example, here is an EDI interchange in QUOTED-PRINTABLE encoding:
ISA*00* *00* *01*987654321 *12*8005551234 *910=
607*0111*U*00200*110000777*0*T*>
GS*PO*987654321*8005551234*920501*2032*7721*X*002003
ST*850*000000001
BEG*00*NE*MS1112**920501**CONTRACT#
REF*IT*8128827763
N1*ST*MAVERICK SYSTEMS
N3*3312 NEW HAMPSHIRE STREET
N4*SAN JOSE*CA*94811
PO1*1*25*EA***VC*TP8MM*CB*TAPE8MM
PO1*2*30*EA***VC*TP1/4*CB*TAPE1/4INCH
PO1*3*125*EA***VC*DSK31/2*CB*DISK35
CTT*3
SE*11*000000001
GE*1*7721
IEA*1*110000777
Except for the ISA segment having been wrapped onto two lines, the QUOTED-PRINTABLE
encoding of the interchange is identical to its 7BIT representation.
The BASE64 encoding mechanism is well suited for representing binary files. It represents
any sequence of three bytes as four printable ASCII characters. The same interchange as
shown above but using the BASE64 encoding would look like:
SVNBKjAwKiAgICAgICAgICAqMDAqICAgICAgICAgICowMSo5ODc2NTQzMjEgICAgICAqMTIq
ODAwNTU1MTIzNCAgICAgKjkxMDYwNyowMTExKlUqMDAyMDAqMTEwMDAwNzc3KjAqVCo+CkdT
KlBPKjk4NzY1NDMyMSo4MDA1NTUxMjM0KjkyMDUwMSoyMDMyKjc3MjEqWCowMDIwMDMKU1Qq
ODUwKjAwMDAwMDAwMQpCRUcqMDAqTkUqTVMxMTEyKio5MjA1MDEqKkNPTlRSQUNUIwpSRUYq
SVQqODEyODgyNzc2MwpOMSpTVCpNQVZFUklDSyBTWVNURU1TCk4zKjMzMTIgTkVXIEhBTVBT
SElSRSBTVFJFRVQKTjQqU0FOIEpPU0UqQ0EqOTQ4MTEKUE8xKjEqMjUqRUEqKipWQypUUDhN
TSpDQipUQVBFOE1NClBPMSoyKjMwKkVBKioqVkMqVFAxLzQqQ0IqVEFQRTEvNElOQ0gKUE8x
KjMqMTI1KkVBKioqVkMqRFNLMzEvMipDQipESVNLMzUKQ1RUKjMKU0UqMTEqMDAwMDAwMDAx
CkdFKjEqNzcyMQpJRUEqMSoxMTAwMDA3NzcK
BASE64 bears some resemblance to uuencode in both appearance and function. However,
uuencode uses characters that may not be processed properly by an EBCDIC gateway.
The values 8bit, 7bit, and binary all imply that no encoding has been performed.
However, they are useful to indicate of the kind of data contained in the object, and
therefore of the kind of encoding that might need to be performed for transmission in a
given transport system. 7bit means that the data is all represented as short lines of ASCII
data. 8bit means that the lines are short, but there may be non-ASCII characters. Binary
means that not only may non-ASCII characters be present, but also that the lines are not
necessarily short enough for SMTP transport.
12
The difference between 8bit and binary is that binary does not require adherence to
any limits on line length. 8bit and binary are intended for compatibility with future
Internet e-mail transport standards and with gateways to non-Internet environments. As
of this writing there are no standardized Internet e-mail transports for which it is legitimate
to include unencoded 8-bit or binary data in mail bodies.
Note that the five values defined for the Content-Transfer-Encoding field imply
nothing about the Content-Type other than the algorithm by which it was encoded or the
transport system requirements if unencoded.
Some implementations may support additional Content-Transfer-Encoding values (it is
permitted but strongly discouraged by the standard). Any such additional values must
have names that begin with X- to indicate its non-standard status For example:
Content-Transfer-Encoding: x-my-new-encoding.
If a Content-Transfer-Encoding header field appears as part of a message header, it
applies to the entire body of that message. If a Content-Transfer-Encoding header
field appears as part of a body part's headers, it applies only to the body of that body part.
If a message or body part is of type Multipart or Message, the
Content-Transfer-Encoding must be 7bit, 8bit or Binary.
The encoding mechanisms defined here explicitly encode all data in ASCII. Thus, for
example, suppose a message or body part has header fields such as:
Content-Type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: base64
This should be interpreted to mean that the body is a Base64 ASCII encoding of data that
was originally in ISO-8859-1, and will be in that character set again after decoding.
Optional Content-ID Header Field
It may be desirable to allow one body to reference another. Accordingly, bodies may be
labeled using the Content-ID header field, which is syntactically identical to the RFC 822
Message-ID header field: Content-ID values should be be as unique as possible.
Optional Content-Description Header Field
The ability to associate descriptive information with a body is often desirable. For
example, it may be useful to mark an Image body as “a picture of the Space Shuttle
Endeavor.” Such text may be placed in the Content-Description header field.
13
Summary
Using MIME-Version, Content-Type, and Content-Transfer-Encoding header fields,
it is possible to include arbitrary types of data objects in RFC 822 conformant mail
messages. No restrictions imposed by RFC 821 or RFC 822 are violated. MIME has been
designed to avoid problems caused by additional restrictions imposed by some Internet
mail transport mechanisms. The Multipart and Message content types allow mixing and
hierarchical structuring of objects of different types in a single message. Further content
types provide a mechanism for tagging messages or body parts as audio, image, or other
kinds of data. A parameter syntax allows further specification of data format details,
particularly the specification of alternate character sets. Additional optional header fields
provide mechanisms for certain extensions deemed desirable by many implementors.
Finally, a number of useful content types are defined for general use by consenting user
agents, notably Text/Richtext, Message/Partial, and Message/External-Body.
To promote interoperability between user agents, the MIME standard specifies a minimal
subset of MIME features a user agent must support to be considered MIME conformant.
A Complex Multipart Example
The outline of a complex multipart message follows. This message has five parts to be
displayed serially: two introductory plain text parts, an embedded multipart message, a
richtext part, and a closing encapsulated text message in a non-ASCII character set. The
embedded multipart message has two parts to be displayed in parallel, a picture and an
audio fragment.
MIME-Version: 1.0
From: Nathaniel Borenstein
Subject: A multipart example
Content-Type: multipart/mixed;
boundary=unique-boundary-1
This is the preamble area of a multipart message. Mail readers that
understand multipart format should ignore this preamble.
If you are reading this text, you might want to consider changing to
a mail reader that understands how to properly display multipart
messages.
--unique-boundary-1
Some text appears here...
[Note that the preceding blank line means
no header fields were given and this is text,
with charset US ASCII. It could have been
done with explicit typing as in the next part.]
--unique-boundary-1
Content-type: text/plain; charset=US-ASCII
This could have been part of the previous part, but illustrates
explicit versus implicit typing of body parts.
14
--unique-boundary-1
Content-Type: multipart/parallel; boundary=unique-boundary-2
--unique-boundary-2
Content-Type: audio/basic
Content-Transfer-Encoding: base64
… base64-encoded 8000 Hz single-channel
u-law-format audio data goes here …
--unique-boundary-2
Content-Type: image/gif
Content-Transfer-Encoding: Base64
… base64-encoded image data goes here…
--unique-boundary-2--
--unique-boundary-1
Content-type: text/richtext
This is richtext.Isn't it
cool?
--unique-boundary-1
Content-Type: message/rfc822
From: (name in US-ASCII)
Subject: (subject in US-ASCII)
Content-Type: Text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: Quoted-printable
… Additional text in ISO-8859-1 goes here …
--unique-boundary-1--
15


Tuesday, July 7, 2009

all query summary of oracle syntav

Primary key constraints
This constraint avoids duplication of rows and does not allow NULL values, when enforced in a column or set of columns. A a result it is used to identify a row. A table can have only one primary key. If a primary key constraint is assigned to more than one column(i.e) or combination of columns it is said to be a composite primary key (or simply a composite key), which can contain a maximum of 16 columns. Primary key constraint cannot be defined in an alter table command when the table contains rows having NULL values.

Run and Check your out put
- select * from emp;
- select deptno, dname, loc from dept;
- select empno, ename, salary, hiredate from emp;

- select ename,salary, salary+100 from emp;
- select ename, salary, (salary*12)+100 from emp;
- select ename,slary, (salary*12)+comm. from emp;
- select ename,salary, (salary*12)+nvl(comm,0) from emp;

- select ename “Full Name”, salary*12 “Annual Salary” from emp;
- select enamejob from emp;
- select ename’ is a ‘job “Emp Detail” from emp;

- select deptno from emp;
- select distinct deptno from emp;
- select distinct deptno, job from emp;

- In SQL, we can display the structure of a table using the DESCRIBE command. The command shows the column names and data types, as well as whether a column must contain data or not.
- desc emp;
- describe emp;

Comparison Conditions
= > >= < <= <> BETWEEN…AND… IN(set) LIKE IS NULL

We can display rows based on a range of values using the BETWEEN range condition. The range that we specify contains a lower limit and an upper limit.
To test for values in a specified set of values, use the IN condition. The IN condition is also known as the membership condition.
We may not always know the exact value to search for. We can select rows that match a character pattern by using the LIKE condition. The character pattern-matching operation is referred to as a wildcard search. Two symbols can be used to construct the search string. Ie. %(zero or more characters) and _ (single character).
The NULL conditions include the IS NULL condition and the IS NOT NULL condition. The IS NULL condition tests for nulls. A null value means the value is unavailable, unassigned, unknown, or inapplicable. Therefore, we cannot test with = because a null cannot be equal or unequal to any value.

- select empno, ename,job, deptno from emp where deptno=20;
- select empno, ename, salary from emp where lastname=’Lama’;
- select * from emp where hiredate=’01-JAN-95’ and salary>=5000 and lastname=’Smith’;
- select ename,slary from emp where salary between 2300 and 3500;
- select empno,ename,salary,mgr from emp where deptno in(20,30,40);
- select ename,hiredate from emp where hiredate like ‘%95’;
- select ename from emp where ename like ‘_e%’;
- select ename,mgr from emp where mgr is null;
- select ename,salary,comm. from emp where comm. is null;
- select empno, ename,job,salary from emp where salary>=1000 and job like ‘SYS%’;
- select empno, ename,job,salary from emp where salary>=1000 or job like ‘SYS%’;
- select empno, ename from emp where job in (‘MANAGER’, ‘CLERK’, ‘PEON’);

The order of rows returned in a query result is undefined. The ORDER BY clause can be used to sort the rows. If we use the ORDER BY clause, it must be the last clause of the SQL statement. We can specify an expression, or an alias, or column position as the sort condition. Syntax:

SELECT expression
FROM table
WHERE conditions
ORDER BY columns [ASCDESC];

If the ORDER BY clause is not used, the sort order is undefined, and the oracle server may not fetch rows in the same order for the same query twice. Use the ORDER BY clause to display the rows in a specific order.
To reverse the order in which rows are displayed, specify the DESC keyword after the column name in the ORDER BY clause.

- select ename, job, depatno, hiredate from emp order by hiredate;
- select ename, job ,deptno, hiredate from emp order by hiredate desc;
- select empno, ename, salary, salry*12 Annsal from emp order by annsal;
- select ename, deptno, salary from emp order by deptno,salary desc;

Displaying records from multiple tables.
Sometimes we need to use data from more than one table. Here we can fetch record using SELECT statement from two or more than two tables using equality and nonequality joins.

Cartesian Products:
When a join condition is invalid or omitted completely, the result is a Cartesian product, in which all combinations of rows are displayed. All rows in the first table are joined to all rows in the second table.
A Cartesian product tends to generate a large number of rows, and the result is rarely useful. You should always include a valid join condition in a WHERE clause, unless you have a specific need to combine all rows from all tables. Cartesian products are useful for some tests when you need to generate a large number of rows to simulate a reasonable amount of data.
A Cartesian product is generated if a join condition is omitted. The example to display employee name and department name, we write the statements like:
> select ename, dname from emp, dept;

JOIN: When data from more than one table in the database is required, a join condition is used. Rows in one table can be joined to rows in another table according to common values existing in corresponding columns, that is, usually primary and foreign key columns. Syntax:
……. Where table1.column=table2.column;


Remember
• when writing a SELECT statement that joins tables, precede the column name with the table name for clarity and to enhance database access.
If the same column name appears in more than one table, the column name must be prefixed with the table a name. (………where emp.deptno=dept.deptno; )
• To join n tables together, we need a minimum of n-1 join conditions.

Equi-Join:
To determine an employee’s department name, we compare the value in the deptno column in the emp tablw with the deptno values in the dept table. The relationship between the emp and dept tables is an equi-join, ie., values in the deptno column on both tables must be equal. Frequently , this type of join involves primary anf foreign key complements.
Note: Equijoins are also called simple joins or inner joins.
 select emp.empno, emp.ename, emp.deptno, dept.deptno, dept. dname, dept.loc from emp, dept
where emp.deptno=dept.deptno;

Here; the SELECT clause specifies the column names to retrieve, the FROM clause specifies the two tables that the database must access and the WHERE clause specifies how the table are to be joined.

You need to qualify the names of the column in the WHERE clause with the table name to avoid ambiguity. Without the table prefixes, the deptno column could be from either the dept table or the emp table. It is necessary to add the table prefix to execute you query.
If there are not common column names between the two tables, there is no need to qualify the column. However, using the table prefix improves performance, because you tell the Oracle Server exactly where to find the columns.
Qualifying column names with table names can be very time consuming, particularly if table names are lengthy.

 select empno,ename,dname,dloc from emp e, dept d where e.deptno=d.deptno

 select empno,ename,dname,dloc from emp e, dept d where e.deptno=d.deptno
and lastname=’Smith’;

Non-Equi Join:
An non-equi join is a join condition containing something other than an equality operator. The relationship between the emp table and the salgrade table has an example of a non-equijoin. A relationship between the two tables is that the salary column in the emp table must be between the value in the lowsal and hisal columns of the salgrade table. The relationship is obtained using an operator other than equals(=).
 select e.ename,e.salary,s.grade from emp e,salgrade s
where e.salary between s.losal and s.hisal;

Here the example creates a non-equijoin to evaluate an employee’s salary grade. The salary must be between any pair of the low and high salary ranges.

Outer Join
The missing rows can be returned if an outer join operator is used in the join condition. The operator is a plus sign enclosed in parentheses(+), and it is placed on the “side” of the join that is deficient in information. This operator has the effect of creating one or more null rows, to which one or more rows from the non-deficient table can be joined. Syntax:

SELECT column1,column2,column3,..
FROM table1,table2,..
WHERE table1.column(+)=table2.column; or WHERE table1.column=table2.column(+);

Here; table1.column(+), is the outer join symbol, which can be placed on either side of the WHERE clause condition, but not on both sides.
SELECT e.ename,e.deptno,d.deptno FROM emp e, dept d WHERE e.deptno(+)=d.deptno;

The deficient value form employee table will be displayed. Ie. There will be null value at emp table under which department no there is no employee.
Here; The outer join operator can appear on only one side of the expression- the side that has iformatio0n missing. It returns those rows from one table that have no direct match in the other table.

Self Join (Joining a table to Itself or Reflexive Join)
Sometimes we need to join a table to itself. To find the name of each employee’s manager, we need to join the EMP table to itself, or perform a self join. For example, to find the name of SMITH, we need;
- find SMITH in the EMP table by looking at the ename columns.
- Find the manager number for SMITH by looking at the MGR column.
- And find the name of the manager with empno by looking at the empno column. TO DO SO…

SELECT E.emono,E.ename,M.empno,M.ename FROM emp E, emp M WHERE E.mgr=M.empno;

Now again; (check output)
Select worker.ename ’ works for ‘manager.ename from emp worker,emp manager
where worker.mgr=manager.empno;

Here; The example joins the emp table to itself. To simulate two tables in the FROM clause, there are two aliases, namely worker and manager, for the same table emp. In this example, the WHERE clause contains the join that means “where a worker’s manager number matches the employee number for the manager”.

Practise
1. Create a query that displays employee name, department numbers, and all the employees who work in the same department as a given employee. Give each column an appropriate label.
2. Create a query that displays the name,job, department name, salary and grade for all employees.
3. Create a query to display the name and hiredate of any employee hired after employee SMITH.

Aggregate Function (Group Function)
Group functions operate on sets of rows to give one result per group. Types of Group functions.
Syntax: groupfunction([DISTINCTALL]exp)
AVG(n)): average value of n, ignoring null values
COUNT(): number of rows, *-including duplicate records count, DISTINCT count non duplicate records
MAX(): maximum value of expression, ignoring null values
MIN(): minimum value of expression, ignoring null values
SUM(): sum values of n, ignoring null values.

DISTINCT makes the function consider only non-duplicate values, ie. To suppress the counting of any duplicate values within a column. ALL makes it consider even value including duplicates. The default is ALL and therefore does not need to be specified. Here all group functions ignore null values.

 select avg(comm.) from emp; this will not give right answer
 select avg(nvl(comm.,0)) from emp; this will the right answer
All group functions ignore null values in the column. In the example above, the average is calculated based only on the rows in the table where a valid value is stored in the comm. column.

All group functions have treated the table as one large group of information. At times we need to divide the table of information into smaller groups. This can be done by using the GROUP BY clause.
We can use the GROUP BY clause to divide the rows in a table into groups. We can then use the group functions to return summary information for each group. The syntax is
select statement group by ;
Remember:
- if we include a group function in a SELECT clause, we cannot select individual results as well, unless the individual column appears in the GROUP BY clause.
- Using a where clause, we can exclude rows before dividing them into groups.
- We cannot use a column alias in the GROUP BY clause.
- When using the GROUP BY clause, make sure that all columns in the SELECT list that are not group functions are included in the GROUP BY clause.

 select avg(sal) from emp group by deptno; display each department’s average salary
 select deptno,avg(sal) from emp group by deptno; display deptno with their average salary.
 Select deptno, job, sum(sal) from emp group by deptno,job; groups within group
 Select deptno, count(ename) from emp; this statement is wrong
 Select deptno, avg(sal) from emp where avg(sal) >5000 group by deptno; this is wrong

The WHERE clause cannot be used to restrict groups. The SELECT statement on the example results is an error because it uses the WHERE clause to restrict the display of average salaries of those deparements that have an average salary greater than 5000. here, we use the HAVING clause to specify which group are to be displayed, and thus, we further restrict the groups on the basis of aggregate information.
 Select deptno, avg(sal) from emp having avg(sal)>5000 group by deptno;
 Select deptno, max(sal) from emp group by deptno having max(sal)>5000;
 Select job,sum(sal) from emp where job <> ‘MANAGER’ group by job having sum(sal)>5000 order by sum(sal); this is extra, check it out what is it for.

Subqueries (queries within queries)
A subquery is a SELECT statement that is embedded in a clause of another SELECT statement. We can build powerful statements out of simple ones by using subqueries. We can place the subquery in a number of SQL clauses including: The WHERE clause, The GAVING clause, The FROM clause.
- Enclose subqueries in parentheses.
- Place subqueires on the right side of the comparison condition.

Types of subqueries
1. Single-Row subqueries: Queries that return only one row from the inner SELECT statement.
Use single-row comparison operators: = > >= < <= <>
2. Multiple-Row subqueries: Queries that return more than one row from the inner SELECT statement.

Suppose we want to write a query to find out who earns a salary greater than SMITH’s slary. To solve this problem we need two queries: one to find what SMITH earns, and a second query to find who earns more than that amount. We can solve this problem by combining the two queries, placing one query inside the other query. Here the inner query or the subquery returns a value that is used by the outer query or the main query. Using a subquery is equivalent to perform two sequential queries and using the result of the first query as the search value in the second query.

 select ename from emp where sal> (select sal from emp where ename=’SMITH’); display emp’s whose salary is greater than that of SMITH’s salary.
 Select ename, job from emp where job=(select job from emp where empno=2324); display the employee names whose job is like that of empno 2324’s job.
 Select ename,job,sal from emp where sal=(select Min(sal) from emp); shows emp name job with salary with sal is the minimum salary from all.

Return more than one row. Use multiple-row comparison operators.
IN- Equal to any member in the list.
ANY- Compare value to each value returned by the subquery.
ALL- Compare value to every value returned by the subquery.

Suqueries that return more than one row are called multiple row subqueries. We use a multiple-row operator, instead of a single row operator, with a multiple row subquery. The multiple row operator expects one or more values.
Find the employees who earn the same salary as the minimum salary for each department.
 Select ename,sal, deptno from emp where sal in(select min(sal) from emp group by deptno);

Here ANY operator compares a value to each value returned by subquery. The example displays employees who are not MANAGER and whose slary is less than that of any MANAGER.
 Select empno, ename,job, sal from emp where sal < job="’MANAGER’)">’MANAGER’;

The ALL operator compares a value to every value returned by a subquery. The example displays employees whose salary is less than the salary of all employees with a job ie MANAGER and whose job is not MANAGER.
 Select empno, ename,job, sal from emp where sal < job="’MANAGER’)">’MANAGER’;

Data Manipulation Language (DML)
- all new rows to a table INSERT
- modify existing rows in a table UPDATE
- remove existing rows from a table DELETE
DML is a core pare of SQL, when we want to add, update or delete data in the database, we execute a DML statement. A collection of DML statements that form a logical unit of work is called a transaction.
Consider a banking database. When a bank customer transfers money from a saving account to a checking account, the transaction might consist of three separate operation; decrease the savings account, increase the checking account, and record the transaction in the transaction journal. The Oracle server must guarantee that all three SQL statements are perform to maintain the accounts proper balance. When something prevents one of the statements in the transaction from executing other statements of the transaction must be undone.
Add new rows to a table by using the INSERT statement. Syntax: only one row at a time.
INSERT INTO table ([column1, column2,column3,…]) VALUES (value1,value2, value3,….);
Eg.
While entering values enclose character and date values within single quotation marks. List values in the default order of the columns in the table.
 insert into dept (deptno, dname, loc) values(50, ‘Computer Dept’,’Pokhara’);
 insert into dept (deptno,dname) values(60,’Extra Dept’); only two values are inserted here.

 Insert into emp (emno,ename,sal,comm,hiredate,job,mgr,deptno)
values(1111, ‘Ramesh’, 2200,10,’12-JAN-91’,MANAGER,2222,30);
if column order is in sequence as per entered value; write like this
 Insert into emp values(1111, ‘Ramesh’, 2200,10,’12-JAN-91’,MANAGER,2222,30);
If you want to enter date value of your own type style
 Insert into emp
values(1111,‘Ramesh’,2200,10,to_date(’DEC-3-1991’,’MON-DD-YYYY’),MANAGER,22,30);
Coping value from another table and insert into other
 Insert into employee select * from emp;
 Insert into employee select * from emp where deptno=20;

Common errors that can occur during user input:
- Mandatory value missing for a NOT NULL column
- Duplicate value violates uniqueness constraint.
- foreign key constraint violated
- CHECK constraint violated
- Data type mismatch
- Value too wide to fit in column.

Update statement (to modify existing records into the table)
Syntax: update table set column=value, column=value,… where condition;

 update emp set deptno=70 where empno=2222; update information for selected records
 update employe set deptno=20; update information for all employee

Extras
 update employee set job=(select job from employee where empno=2222);
 update employee set job=(select job from employee where empno=2222) where empno=3333;

Removing a Row or Delete statement (to remove existing rows from a table )
Syntax: delete [from] table where [condition];

 delete from dept where deptno=20;
 delete from dept where dname=’FINANCE’;
 delete from emp; to delete all records
 delete from emp where sal>5000 and deptno=20;
we cannot delete a row that contains a primary key that is used as a foreign key I another table.
 Delete from department where deptno=20;

Data Control Language (DCL)
A transaction begins when the first DML statement is encountered and ends when one of the following occurs:
- A COMMIT or ROLLBACK statement is issued.
- A DDL statement, such as CREATE, is issued.
- A DCL statement is issued.
- The user exits from SQL


Statement Description
COMMIT Ends the current transaction by making all pending data changes permanent.
SAVEPOINT name Marks a savepoint within the current transaction
ROLLBACK ROLLBACK ends the current transaction by discarding all pending data changes.
ROLLBACK TO SAVEPAOINT name ROLLBACK TO SAVEPOINT rolls back the current transaction to the specified savepoint, there by discarding any changes and or savepoints created after the savepoint to which we are rolling back.


Creating a New Table
Data Definition Language (DDL)
Database objects are TABLE, VIEW, SEQUENCE, INDEX, SYNONYM.

An Oracle database can contain multiple data structures. Each structure should be outlined in the database design so that it can be created during the build stage of database development.
Table: stores data
View: subset of data from one or more tables.
Index: improves the performance of some queries

In Database; table can be created at any time, even while users are using the database. We need to name database tables and columns according to the standard rules for naming any Oracle database object.
- table and column names must being with a letter and be 1 to 30 characters long.
- Names must contain only the characters A-Z, a-z, 0-9, _ (underscores) $ and # are legal character.
- Names must not duplicate

Create table to store data by executing the SQL CREATE TABLE statement. This statement is one of the data definition language (DDL) statements, which are used to create, modify, or remove database structure.
The Syntax:
CREATE TABLE tablename
( column1 datatype,
column2 datatype,
…….
……..
);
Eg.
CREATE TABLE dept
( deptno number(2),
dname varchar2(14),
loc varchar2(12));
here the example creates the dept table, with three attributes/columns deptno, dname and loc. It further confirms the creation of the table by issuing the DESCRIBE command.
Ie. > desc dept; or
> describe dept;

Oracle Datatypes: varchar2(size), char(size), number(p,s), date, long, clob, row , bfile, rowid...

 create table newtable as select * from emp;
 create table newtable1 as select * from emp where deptno=20;

alter table tablename add (column datatype(size) )
alter table modify (column datatype(size))
alter table drop(column)

drop table employee;

rename dept to department;

truncate table tablename;

What is Views?
Ie. Logical subsets or combinations of data by creating views of tables. A view is a logical table based on a table or another view. A view contains no data of its won but is like a window through which data from tables can be viewed or changed. The tables on which a view is based are called base tables. View is for
- to restrict data access because the view can display selective column from the table.
- Views can be used to make simple queries to retrieve the result of complicated queries. For example, views can be used to query information from multiple tables without the user knowing how to write a join statement.
- to provide data independence ie. One view can be used to retrieve data from several tables.
- to present different views of the same data.

Advantages:
- views restrict access to the data because the view can display selective columns from the table.
- Views can be used to make simple queries to retrieve the results of complicated queries. For example, views can be used to query information from multiple tables without the user knowing how to write a join statements.
- Views provide groups of users access to data according to their particular criteria.


Syntax
CREATE OR REPLACE [FORCENOFORCE] VIEW view-name [alias1,alias2,…..]
AS SELECT statements
WITH CHECK OPTION
WITH READ ONLY;

CREATE OR REPLACE:- creates or re-creates the view if it already exists
FORCE:- creates the view regardless of whether or not the base tables exists
NOFORCE:- creates the vie only if the base tables exist ie. Default
view-name:- is the name of the view
alias:- specifies names for the expressions selected by the view’s query. The number of aliases must match the number of expressions selected by the view.
WITH CHECK OPTION:- specifies that only rows accessible to the view can be inserted or updated. Ie. To perform referential integrity checks through vies. Ie. Integrity level check
WITH READ ONLY:- ie. Ensures that no DML operations can be performed on this view.

Eg.
create or replace view myview20 as select empno,ename,sal,deptno from emp where deptno=20;

There are two classifications for views: simple and complex. The basic difference is related to DML (INSERT, UPDATE, and DELETE) operation.
A simple view is one that: - derives data from only one table. Contains no functions or group of data.
A complex view is one that:- derives data from many tables, contains functions or group of data.


Eg. To create a view, empview20, that contains details of employees in department 20.
> create view empview20 as select empno, ename, sal from emp where deptno=20;
> desc view20; to describe the structure o the view created.
> select * from tab; to check whether created or not.
> select * from empview20;

 create or replace view empview30 (idno,name, salary, dno) as select empno, ename, sal, deptno from emp where deptno=30;

To modify the view created, we can create the same view name again with new structure. Now to create a complex view. Ie. Create a complex view that contains group functions to display values from two tabes.

 create view deptnosum (name,minsal,maxsal, avgsal)
as select d.dname,min(e.sal),max(e.sal), avg(e.sal) from emp e, dept d
where e.deptno=d.deptno group by d.dname;

Modifying Views; With the OR REPLACE option, a view can be created even if one exists with this name already, thus replacing the old version of the view for its owner. That means that the view can be altered without dropping, re-creating, and regranting object privileges.

Set Operators
( to combine multiple queries into a single query)

UNION, INTERSECT and MINUS are useful in constructing queries that refer to different tables. They combine the results of two or more select statements into one result. A query many therefore consist of two or more SQL statements linked by one or more set operators. Set operators are often called vertical joins, because the join is not according to rows between two tables, but columns.

It is possible to construct queries with many set operators. If multiple set operators are used, the execution order for the SQL statements is from top to bottom.

The SET Operatos combine the results of two or more component queires into one result. Queries containing SET operators are called compound queries.




UNION INTERSECT MINUS

Operator Returns
UNION All distinct rows selected by either query
UNION ALL All rows selected by either query, including all duplicates
INTERSECT All distinct rows selected by both queries
MINUS All distinct rows that are selected by the first SELECT statement and not selected in the second SELECT statement

All SET operators have equal precedence. If a SQL statement contains multiple SET operators, the Oracle server evaluates them from left (top) to right (bottom).

The UNION Operator
The UNION operator returns all rows selected by either query. Use the UNION operator to return all rows from multiple tables and eliminate any duplicate rows.
Remember:
- The number of columns and the data types of the columns being selected must be identical in all the SELECT statements used in the query. The names for the columns need not be same.
- UNION operates over all of the columns being selected.
- NULL values are not ignored during duplicate checking.
- By default the output is sorted in ascending order.

UNION ALL operator to return all rows from multiple queries. Unlike UNION, duplicate rows are not eliminated and the output is not sorted by default. The DISTINCT keyword can’t be used.
Eg.
To return all distinct rows retrieved by either of the queries, enter
SELECT JOB FROM EMP WHERE DEPTNO=10
UNION
SELECT JOB FROM EMP WHERE DEPTNO=30;

To return all rows (including duplicates) retrieved by either of the queries,
SELECT JOB FROM EMP WHERE DEPTNO=10
UNION ALL
SELECT JOB FROM EMP WHERE DEPTNO=30;

The INTERSECT Operator
This operator returns all rows common to multiple queries.
Remember:
- the number of columns and the data types of the columns being selected must be identical in all the SELECT statements used in the query. The names for the columns need not be same.
- Not ignore the NULL values.
Eg.
To return only rows retrieved by both of the queries, enter:
SELECT JOB FROM EMP WHERE DEPTNO=10
INTERSECT
SELECT JOB FROM EMP WHERE DEPTNO=30;

The MINUS operator
Use the MINUS operator to return rows returned by the first query that are not present in the second query ( the first SELECT statement MUNUS the second SELECT statement).
Remember:-
- The number of columns and the data types of the columns being selected by the SELECT statements in the queries must be identical in all the ELECT statements used in the query. The names of the columns need not be identical.

Eg.
To return all rows retrieved by first query that are not in the second, enter:
SELECT JOB FROM EMP WHERE DEPTNO=10
MINUS
SELECT JOB FROM EMP WHERE DEPTNO=30;

Order By
ORDER BY can only be used once in a query that employs set operators. I used, the ORDER BY clause must be placed at the end of the query. Also, because you may select different columns in each SELECT you cannot name the columns in the ORDER by clause. Instead, columns in the ORDER BY must be referred to by their relative positions in the SELECT list.
SELECT EMPNO,ENAME,SAL FROM EMP
UNION
SELECT ID,NAME,SALARY FROM EMP_HISTORY
ORDER BY 2;
Notice that on the ORDER BY clause a numeral (2) is used to represent the position of the ENAME column on the SELECT list. This means that rows will be sorted in ascending employee name order.

Rules when using Set Operators
1 SELECT statements must select the same number of columns
2 Corresponding columns must be of the same data type
3 Duplicate rows are automatically eliminated (DISTINCT can’t be used)
4 Column names from the first query appear in the result.
5 ORDER BY clause appears at the end of statements.


Subqueries
A subquery is a SELECT statement that is embedded in a clause of another SQL statement, called parent statement.
The subquery (inner query) returns a value that is used by the parent statement. Using a nested subquery is equivalent to performing two sequential queires and using the result of the inner query as the search value in the outer query (main query).

A sub query is a SELECT statement that is nested within another SELECT statement and which returns intermediate results.
Syntax:
SELLECT column1, column2,….
FROM table
WHERE column=(SELECT column FROM table WHERE condition);

The subquery is often referred to as a subselect or inner select; it generally executes first and its output is used to complete the query condition for the main or outer query. Using subqueries allows a developer to build powerful commands out of simple once. The nested subquery can be very useful when you need to select rows from a table with a condition that depends on the data in the table itself.

Single Row Subqueries
To find the employee who earns the minimum salary in the company, two steps must be taken. Ie
Find the minimum salary
select min(sal) from emp;
Find the employee who earns the minimum salary.
select ename,job, sal from emp where sal=(lowest salary which is unknown);
We can combine the two commands as a nested subquery:
Select ename,jon,sal from emp where sal=(select min(sal) from emp);

select ename,job,sal from emp where sal < (select avg(sal) from emp; How are nested subqueries processed? A SELECT statement can be considered as a query block. The example above consists of two query blocks- the main query and the inner query. The inner select statement or query block is executed first, producing a query result: 800. The main query block is then processed and uses the value returned by the inner query to complete its search condition. In essence, the main query would finally look like this: SELECT ENAME,SAL, DEPTNO FROM EMP WHERE SAL=800; In the above example, the 800 is a single value. The subquery that returned the value 0f 800 is called a single row subquery. When a subquery returns only one row, a single row comparison or logical operator should be used. For example =,<,>,<=..etc. To find all employee who have the same job as BLACK we would enter: SELECT ENAME,JOB FROM EMP WHERE JOB=(SELECT JOB FROM EMP WHERE ENAME=’BLAKE’); The inner query returns BLAKE’s job title which is then used on the right hand side of the main query’s WHERE clause. Subqueries that return more than one row? The following query attempts to find the employees who earn the lowest salary in each department. SELECT ENAME,SAL, DEPTNO FROM EMP WHERE SAL IN (SELECT MIN(SAL) FROM EMP GROUP BY DEPTNO);A Here; notice that the inner query has a GROUP BY clause. This means that it may return more than one value. We therefore need to use a multi-row comparison operator. In this case, the IN operator MUST be used because it expects a list of values. The result obtained does not show the department in which the qualifying employees work. In addition, because we are only comparing salary values, the inner query could return a value simply because it matches the lowest salary for one of the departments, not necessarily the employee’s own department. Therefore, the query should be rewritten in order to match the combination of employee’s salary and department number with the minimum salary and department number: Errors Encountered - When a subquery returns more than one row and a single row comparison operator is used, SQL *Plus issues the error message. Select ename,sal,deptno from emp where sal=(select min(sal) from emp group by deptno); - If the inner query returns no rows, you get the error. Select ename,job from emp where job=(select job from emp where ename=’om’); SOME/ANY or ALL Operators The ANY or ALL operators may be used for subqueries that return more than one row. They are used on the WHERE or HAVING clause in conjunction with the logical operators (=,!=,<,>,>=,<=). ANY (or its synonym SOME) compares a value to each value returned by a subquery. To display employees who earn more than the lowest salary in Department 30. SELECT ENAME,SAL,JOB,DEPTNO FROM EMP WHERE SAL>SOME(SELECT DISTINCT SAL FROM EMP WHERE DEPTNO=30);

The lowest salary in Department 30 is $950 (JAMES’s). the main query has returned employees who earn a salary that is greater than the lowest salary in department 30. So ‘>NY’ means more than the minimum. ‘=ANY’ is equivalent to IN.
When using SOME/ANY, the DISTINCT keyword is frequently used to prevent rows from being selected several times.

ALL compares a value to every value returned by a subquery.
The following query finds employees who earn more than every employee in Department 30.
SELECT ENAME,SAL,JOB,DEPTNO
FROM EMP
WHERE SAL>ALL(SELECT DISTINCT SAL FROM EP WHERE DEPTNO=30);

The highest salary in Department 30 is $2850 (BLAKE’s), so the query has returned those employees whose salary is higher than $2850. That is , greater than the highest salary for Department 30, and consequently more than every salary in that department.
The NOT operator can not be used within, ANY or ALL.

Index
(a table or other data structure used to determine the location of rows in a file that satisfy some condition)

Index is a database object. Its purpose is to increase the performance of data retrieval thereby provide faster access path to the table data. Indexes can be created on more than one column of a table. The syntax is given below.

create index on (column1, column2,….)

Eg. SQL> create index ind1 on price(prodid);

Note:-
- indexes are independent of data. They can be dropped or created whenever needed and their presence or absence will not affect the table.
- Columns of type long, long row cannot be index.
- An index may contain upto 16 columns.

Oracle(DB) indexes have two main purposes
1). To speed up the retrieval of rows via a particular key.
2). To enforce uniqueness on values in a column, usually primary key values.

The use of indexes is strongly recommended to achieve better performance, and generally one of the first indexes to be created on a table is the index on the primary key columns(s).

Saturday, July 4, 2009

click in the photo and get the gallery

click in the photo and get the gallery




updated of petra nemcova hot pictures sameera reddy selvi gallery of petra nemcova
eriko sato gallery,erika ura gallery,erika sawajiri gallery,eri sakai gallery,eri kamei gallery,emi suzuki gallery,eiko koike gallery,crystal liu gallery,coco lee gallery elish curthbert

Health promotion in Nepalese context

Health promotion in Nepalese context
Increasing health awareness and developing positive attitudes and behavior towards healthier living is still a crucial need of the people to cope an alarming health problem like communicable and non-communicable diseases, which are still the leading causes of morbidity and mortality of the people. Emerging diseases such as Japanese Encephalitis, Viral Hepatitis and STD including HIV/AIDS pose increasing threats to the health and well being of the people of the country. Tobacco use, excess use of alcohol, inadequate physical activity, obesity, improper food habit and polluted environment has significant role in increasing burden of communicable and non-communicable diseases in the nation. Similarly, mental health, oral health, hearing impairment, blindness, cardiovascular diseases, diabetes, hypertension, malignancies and problems of elderly are the health issues that need to be addressed effectively by controlling and reducing risk factors and other as necessary.

Nepal is facing several public health problems such as communicable diseases like malaria, kala-azar, tuberculosis, leprosy, encephalitis, meningitis, diarrheas and acute respiratory infections, vaccine preventable diseases, nutritional deficiency problem like malnutrition, Vitamin A deficiency, Iodine deficiency, Anemia, dewormin, poor environmental conditions and high population growth. The health programs related to curative, preventive, promotive and rehabilitative services are regarded to have Health Education, Information and Communication (HEIC) as a core component to bring a desired change in health behavior of the people of Nepal.

The national health education, information and communication centre (NHEICC) is responsible for IEC activities for health promotion. The centre develops and produces various IEC and advocacy materials for the target audience that include people and communities in general, vulnerable population, patients and health system managers and personnel. Messages and materials are disseminated using electronic and print media, health institutions, schools, community groups etc. As a result of the IEC interventions over the years, people’s health awareness has increased, as reflected in higher coverage of immunization and increased demand for health care services. Health education corners have been established in more than 38 districts hospitals and health centre, in which video set including health related VHS cassettes have been provided by the NHEICC. The observance of World Health Day, World No Tobacco Day and other events by the centre has its own impact in terms of sensitization and commitment. However, promotive and preventive health care is yet to be adequately integrated into the mainstream of health services. The people in general, lack of knowledge and awareness about priority health problems, emerging diseases and the importance of their role and healthy practices that contribute significantly to health promotion and protection. Integrated approach involving communities, schools, health facilities and other institutions/organizations is presently lacking.

The organizational wide expectation for this biennium is that capacity for governance, stewardship, planning and implementation of multisectoral health promotion policies and programmes strengthened at country and regional levels, based on gender sensitive approaches to promoting health and well-being throughout and the regional expectation is to National comprehensive health promotion policies and strategies developed and implemented. Office specific result WHO support to integrated health promotion interventions through a network of communities, schools and health institutions. Office specific expected result, product for network mechanism developed, linking selected communities, schools and health facilities for undertaking health promotion activities at individual, family, community and institutional levels. Plan of action mainly focus on health promotion integrated approach and collaborative manner for the set up of the modalities of selected village development committees with coordination sectoral ministries, partners, health institutions, schools, different committees members, communities and family members for effective health massage for preventive , promotive and curative aspect for knowledge, attitude and practices for their areas.

Support for developing integrated approach to health promotion in coordination with other partner through the existing technical committees under the Chairmanship of Director General, Department of Health Services to look the key health issues such as reproductive health, child health, communicable diseases, non-communicable diseases and other main health issues to plan and implement IEC and BCC activities in an integrated and participative manner towards health promotion. Support on baseline survey and advocacy meeting to develop action plan in two VDCs/and schools about knowledge, awareness and practices. It was taken two VDCs (300 household in each VDCs) of Lalitpur districts. Organized advocacy meeting to discuss about the major health issues of the selected community to share the knowledge of IEC/BCC activities and to match need based IEC/BCC activities and to increase awareness among selected community people (300 person) regarding major health issues and the ways to prevent. Support to development, production and dissemination of IEC materials to raise awareness among general public about the causes, ways of prevention and control of major health problems and to ensure positive change in their health behaviors and improve the health status of general public by facilitating them to make right decisions about their health. Organize to celebration of parents’ day conducted in two VDCs of Lalitpur district to highlight the importance of health promotion at the family level .Parents, students and school teachers have major role and responsibility in promoting health at family as well as community level. Celebration of 2006 and 2007, World Health Day is an annual event of WHO through out the country with different programmes. Every year slogan and theme on the aspect of health related message.

Technical back up from the Regional Office, Director, NMH Visited for interaction and implementation status of the programmes. Visit of Director, NMH,SEARO is quite useful for his feedback regarding further planning and implementation of the health promotion and other related areas. Participation with national focal point of Regional Consultation on Regional Strategy for health Promotion for South-East Asia, Chiang Mai, Thailand on 26-29 June 2006. On that workshop sharing experiences by countries and organizations review of the Regional strategy for health promotion. After discussion recommendations on health promotion needs to be managed as well as sustained by involving various partners, allocation of resources and gathering evidence of the effectiveness at all levels.

Main Issues and Challenges:
Lack of knowledge and awareness about priority of health problems on communicable and non communicable diseases, tobacco control activities, disability, injury prevention and role of their healthy practices for health promotion.
Lack of proper approach, using of IEC materials and equipments at all levels.
Inadequate proper trained manpower at all levels to give the proper health promotion message
Inadequate awareness program and active community participation
Inadequate appropriate multi-media campaign and relevant advocacy materials for IEC/BCC.
Security, political instability and restriction movement of relevant staff for the community level activities for the implementation of planned activities in time
Technical input and coordination with other partners but implementation part with concerning programme manager and their staff in the field level for quality of the programme.
Lack of proper coordination among relevant sectoral ministries and partners
Inadequate supervision, monitoring and evaluation of the programmes for further planning and implementation.

History of Public health in world

History of Public health in world

Introduction
Health promotion has been defined by the 2005 Bangkok charter for Health Promotion in Globalized World as "the process of enabling people to increase control over their health and its determinants, and thereby improve their health”. Means of health promotion include health education and social marketing.
The "first and best known" definition of health promotion, promulgated by the American Journal of Health Promotion since at least 1986, is "the science and art of helping people change their lifestyle to move toward a state of optimal health”. This definition was derived from the 1974 Lalonde report from the Government of Canada, which contained a health promotion strategy "aimed at informing, influencing and assisting both individuals and organizations so that they will accept more responsibility and be more active in matters affecting mental and physical health. Another predecessor of the definition was the 1979 Healthy People report of the Surgeon General of the United States, which noted that health promotion "seeks the development of community and individual measures which can help people to develop lifestyles that can maintain and enhance the state of well-being".
At least two publications led to a "broad empowerment/environmental" definition of health promotion in the mid-1980s.
In 1984 the world Health organization (WHO) Regional Office for Europe defined health promotion as "the process of enabling people to increase control over, and to improve, their health”. In addition to methods to change lifestyles, the WHO Regional Office advocated "legislation, fiscal measures, organizational change, community development and spontaneous local activities against health hazards" as health promotion methods.
In 1986, Jake Epp, Canadian Minister of National Health and welfare, released Achieving health for all: a framework for health promotion which also came to be known as the "Epp report”. This report defined the three "mechanisms" of health promotion as "self-care"; "mutual aid, or the actions people take to help each other cope"; and "healthy environments”.
The WHO, in collaboration with other organizations, has subsequently co-sponsored international conferences on health promotion as follows:
First International Conference on Health Promotion, Ottawa, 1986, which resulted in the “Ottawa charter for Health Promotion”. According to the Ottawa Charter, health promotion.
"is not just the responsibility of the health sector, but goes beyond healthy life-styles to well-being" "aims at making political, economic, social, cultural, environmental, behavioural and biological factors favourable through advocacy for health" "focuses on achieving equity in health" "demands coordinated action by all concerned: by governments, by health and other social and economic sectors, by nongovernmental and voluntary organization, by local authorities, by industry and by the media" "should be adapted to the local needs and possibilities of individual countries and regions to take into account differing social, cultural and economic systems"
In addition, the Ottawa Charter conceptualized "health promotion action" as "Build Healthy Public Policy," "Create Supportive Environments," "Strengthen Community Actions," "Develop Personal Skills," "Reorient Health Services" (i.e., "beyond its responsibility for providing clinical and curative services"), and "Moving into the Future."
2nd International Conference on Health Promotion, Adelaide, 1988, which resulted in the "Adelaide Recommendations on Healthy Public Policy”.
3rd International Conference on Health Promotion, Sundsvall, 1991, which resulted in the "Sundsvall Statement on Supportive Environments for Health”.
4th International Conference on Health Promotion, Jakarta, 1997, which resulted in the “Jakarta Declaration on Leading Health Promotion into the 21st century”. 5th Global Conference on Health Promotion, Mexico City, 2000, which resulted in the "Mexico Ministerial Statement for the Promotion of Health”
6th Global Conference on Health Promotion, Bangkok, 2005, which resulted in the “Bangkok Charter for health promotion in Globalized world”.
Altogether, the documents produced by conference attendees emphasized "investing in health promotion beyond an individual, disease-oriented, behaviour-change model”.
Objective
To overview the history of health promotion in world.
Methodology
The study carried out will be a descriptive study. It will be prepared with the help of secondary data extracted from various internet sites, journals, documents and books. Different reports and magazines related to history of health promotion will also be studied.
2.1 Study Design
The study will descriptive type done with the help of secondary sources.
2.2 Study Area
The study will be global.
2.3 Data collection Methods
Various Internet sites, journals, books and reports.
2.4 Study time
The time duration of the study was started from January, 2009.
2.6 Limitations of study
The study will only be based in the secondary data, it may not reflect complete scenario.

Findings
Origin of health promotion
Henry Sigerist is the first person to use the term “health promotion” with anything like its modern meaning. In 1946, Sigerist described the four major tasks of medicine as the promotion of health, the prevention of illness, the restoration of the sick, and rehabilitation. No one would disagree with that today. In an earlier work, Sigerist had defined health along similar lines to those later used by the World Health Organization (WHO), which said in its Constitution: “Health is a state of complete physical, mental, and social well-being and not merely the absence of disease or infirmity.” Sigerist’s historical analysis of health and its relevance for human welfare, had led him to consider health in a social sense, and he wrote:

A healthy individual is a man who is well balanced bodily and mentally, and well adjusted to his physical and social environment. He is in full control of his physical and mental faculties, can adapt to environmental changes, so long as they do not exceed normal limits, and contributes to the welfare of society according to his ability. Health therefore is not simply the absence of disease; it is something positive, a joyful attitude towards life, and a cheerful acceptance of the responsibilities that life puts upon the individual.

Obviously, there have been numerous attempts to define the kind of health that should be promoted and preserved, and almost all have been rooted in a concept of wholeness or integrity. It is particularly intrigued by Fritjof Capra’s perception of that same wholeness in the systems approach to life in general and in the origin of this concept with respect to health, in contrast with the reductionist approach that has dominated Western thinking for 300 years. He writes:
Although everybody knows what it feels like to be healthy, it is impossible to give a precise definition; health is a subjective experience whose quality can be known intuitively, but can never be exhaustively described or quantified. Nevertheless, we may begin our definition by saying that health is a state of well-being that arises when the organism functions in a certain way.

To Capra, “a certain way” means that the various systems are in “a dynamic balance that involves the physical and psychological aspects of the organism, as well as its interactions with its natural and social environment.”
Definitions such as those given by Sigerist, WHO, and perhaps Capra have been criticized as not being useful, because they approximate a utopian state of eternal happiness to which all humankind will probably aspire, but give little basis for quantification and are difficult to promote. I have always firmly held, however, that one of the great challenges for us mortals is to grasp those things that we know intuitively to be real and vital for our wholeness, but that we cannot see or touch or measure. I am often cheered by the anecdote that Einstein had a sign in his office that read, “not everything that counts can be counted and not everything that can be counted counts.” A more useful approach would be to examine the proposals that can be made to improve what we know to be deficient, knowing that we have to be incremental in the major changes to be made.
Beyond the aspect of definitional precision, we accept that there is some intrinsic value to health itself, and that health is also valued for making it possible to work and to enjoy leisure. Let me refer again to Sigerist, who, in a lecture on health that was part of a series on “Religion in the Light of Sci- ence and Philosophy,” examined the background to the notion of health as something valuable for itself and to be promoted, taking us back to classical Greek society. The health of individuals—free ones, at any rate—was one of the centerpieces of the Greeks’ existence, and represented the condition of perfect equilibrium. The attention they paid to their diet and exercise to maintain perfect health seems almost narcissistic to us today. But then came the Roman domination of the Hellenic culture, and this engendered a more utilitarian and pragmatic approach. Subsequently, Christian understanding and practice in health were founded more on hygiene and were certainly more catholic, as opposed to the aristocratic focus of the Greeks.
A plausible thesis might be that this catholic approach to health waxed and waned, but found its crescendo in the great movements of the eighteenth and nineteenth centuries, which saw men like Allison, Villerme, Virchow, and Chadwick emphasize the social origins of the poor hygiene that caused the illnesses of the underprivileged. The means of preventing ill health were to be found in social and sanitary engineering. It has been said that the growth of the germ theory of disease and the impressive advances in medical science and technology led to a decline in interest in the sanitary and social measures that are necessary for the people’s health, and there has been a virtual hijacking of care for the public’s health by an increasingly medicalized system.5 This may well be so.
However, one of the most significant events of modern times that emphasized very much the social among the other dimensions of health was the landmark publication of the Lalonde report—A New Perspective on the Health of Canadians—in 1974.6 This has rightly been hailed as a watershed in our thinking about the public’s health, as the report focused on population health and those factors that influence it. It elaborated the “health field” concept with four components: biology, environment, lifestyle, and health care organization. These have been modified subsequently, but the basic concept remains: there are factors that influence or determine health beyond the capability of the health care services.7 It is interesting that in putting forward the notion of health promotion, the report grounded the major strategy in the changing of lifestyles, and clearly focused this more on the individual.
The timing of this approach and its geographical origin are of interest. I wish to pose here a long historical sweep in which the world—at least the Western world—has moved from an aristocratic approach of the promotion of the health of the few, through the prevention of the disease of the many, to a stage in which we now advocate for the complementarity between the prevention of the disease of the many and the promotion of the health of the many. It is a matter of speculation whether this growth of interest in applying health promotion to the many would ever have taken place if there had not already existed a sizable portion of the world’s population that could afford to be less preoccupied with the prevention of diseases, although these still constituted a scourge for much of the world’s poor and socially marginalized. And it is perhaps not accidental that the impetus for the focus on health promotion for the many should have arisen in Canada, which is often credited with maintaining a more egalitarian approach in all health matters. The current force driving us to see the relevance of both approaches is undoubtedly the increasing interconnectedness that is characterized as globalization.
It is not uncommon to propose that the State be assigned the responsibility for health promotion as an integral function of public health. This view is not new, and Virchow, in his crusade for medical reform in 1848, wrote:
[The State] must help everyone to live a healthy life. This simply follows from the conception of the state as the moral unity of all individuals composing it, and from the obligation of universal solidarity.

But today, even The State’s competence to deal with those areas that are traditionally recognized as the very bread and butter of public health has been put in question. Laurie Garrett, in her book Betrayal of Trust, points out with gripping detail that the occurrence of recent epidemics and the possibility of even many others occurring are frightening proof that the nations of the world have betrayed the trust placed in them by their people, and that there has been a collapse of global public health. There is inherent trust to protect the public, especially from the threat and reality of infectious disease.
She writes:
The only way to cope with the developing world’s overwhelming problems is to build effective public health systems. Such services monitor the health and wellbeing of its citizens, identify problems in the environment
and among the members of its community, and establish public health practices to address these problems, including the problem of whether proper health care is accessible to all.
Given the numerous gaps that exist in providing even basic surveillance of diseases—such as of plague, which has been with us from biblical times— and the feeling that somehow some of the more fundamental bases of public health are being ignored, it is a major challenge to demonstrate the relevance of health promotion as a concept grounded in principles that are equally valid for those who still feel pressed to do battle against preventable diseases. We have fortunately left behind us the stage in which there was a sterile polarization between the State’s attention to the health of the population versus the health of the individual. There is no doubt of the applicability of the strategies of health promotion to individual behavior. And while there is no negating that the State has the responsibility to make the social environment as favorable as possible for individual behavior, or that individual behavior is facilitated and reinforced by the group’s behavior, there is no avoiding the importance of individual volition and responsibility.
The Ottawa Charter still represents the essential formulation of what health promotion is about, and it says clearly that health promotion action means building healthy public policy, creating supportive environments, strengthening community action, developing personal skills, and reorienting the health services. I will not discuss these in detail, as, except perhaps for the first, they are relatively easy to understand. I have always been intrigued by the concept of healthy public policy, however, and the Second International Conference on Health Promotion, held in Adelaide, Australia, which dealt specifically with this, advanced our understanding considerably.

I understand public policy to mean the guide or framework for State action, and healthy public policy means for me those guides that seek to promote or restore health. One problem I face is that since the determinants of health are so expansive and touch almost all aspects of life, then healthy public policy would apply to almost all State policy. Indeed, the recommendations from the Adelaide Conference defined healthy public policy as one “characterized by an explicit concern for health and equity in all areas of policy and by accountability for health impact.”

We note the reference to all areas of policy. Therefore, if income inequality is associated with poor health outcomes, for example, then healthy public policy would entail measures for income redistribution. With the current movement towards a system of social organization that favors increasing income inequality, a public policy to address this possible cause of ill health obviously becomes problematic. The political implications of policy formulation over such a wide range of issues are numerous, and many of them would clearly lie outside the purview of the traditional health sector. In addition, the possibility of convincing other sectors to adopt policies intentionally because of their impact on health, poses difficulties in the majority of our political systems.
The matter becomes more complicated when State action is called for in areas that lie outside of what may be called traditional public health but that are still focused on communicable diseases. Communicable diseases un- doubtedly poses threats to the body public, and there is not likely to be any questioning of the State’s responsibility here, as there are clear population interests. But in those cases in which the externalities are minimal, it will be difficult to engage citizen interest, which is often one of the prerequisites for the generation of any public policy. Buchanan, in his theory of public choice, explains why individuals in their private capacity in economic terms seek to “maximize their utility function, but as voters acting in a political process have entirely different perceptions on what is appropriate.” Thus, many of those health policies that do not have obvious individual benefit are unlikely to generate popular enthusiasm. In general, we in health have very little concept about how these political processes move towards the formation of policies and how to influence them.
From the perspective of an organization like ours, one of the most important decisions we can make is to advocate for specificity in addressing healthy public policy. We cannot address all the policy aspects of all the possible determinants of health. Similarly, it is obvious that the principal strategies of health promotion can find application in almost all aspects of the work of a health organization, and throughout this report there will be numerous examples of the health promotion focus. Health promotion is applicable to the actions taken to prevent and control noncommunicable and communicable diseases, although much of the very early focus was on the noncommunicable diseases those that were supposed to be attributable to unhealthy lifestyles and practices. Health promotion finds application in the area of environmental health, as well, and some of the essential aspects of primary environmental care, for example, are grounded in the health promotion strategies. It was, therefore, a conscious decision to structure our Division of Health Promotion and Protection so that it would not have to deal with every application of the strategies of health promotion to every possible health problem. Our Division, in fact, is based on the logic that by concentrating on its three programmatic areas it could show most clearly the application of and results from the critical strategies.
Health promotion is very much here to stay. We have gone past much of the polemic that attended the characterization of any field of study and practice. It is for us to show that there is a practical application of the concepts embedded in health promotion and that, in the final analysis, the efforts in this field result not only in our populations enjoying health, but also in every citizen glorying in the health he or she enjoys. It may not be something new under the sun, but the sun may now be shining more brightly upon it.
Health promotion is the process of enabling people to increase control over, and improve their health. To reach a state of complete physical, mental and social well-being, an individual or group must be able to identify and to realize aspirations, to satisfy needs, and to change or cope with the environment. Health is, therefore, seen as a resource for everyday life, not the objective of living. Health is a positive concept emphasizing social and personal resources, as well as physical capacities. Therefore, health promotion is not just the responsibility of the health sector, but goes beyond healthy life-styles to well being." (World Health Organization (WHO) Ottawa, 21 November 1986)
"Any planned measure which promotes health or prevents disease, disability and premature death." (Tones 1987