### Install ODP.NET via Oracle Universal Installer (OUI) - Setup Command Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This snippet demonstrates initiating the ODP.NET installation process using the Oracle Universal Installer (OUI) by executing the setup.exe file. ```text setup.exe ``` -------------------------------- ### ODP.NET Demo Program Output Example Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This is an example of the expected output when the ODP.NET demo program successfully executes. It shows test start/finish messages and sample data retrieved from the TimesTen database. ```text Start Test The employee who got the 10% pay raise was CLARK Employees in department #50: 7944, ITMGR, MANAGER, 7839, 10/08/2010 10:34:20 AM, 2500, , 50 7945, DVLPR1, DEVELOPER, 7944, 10/08/2010 12:00:00 AM, 2000, , 50 7946, DVLPR2, DEVELOPER, 7944, 10/08/2010 12:00:00 AM, 2000, , 50 7947, DVLPR3, DEVELOPER, 7944, 10/08/2010 12:00:00 AM, 2000, , 50 7948, DVLPR4, DEVELOPER, 7944, 10/08/2010 12:00:00 AM, 2000, , 50 7949, DVLPR5, DEVELOPER, 7944, 10/08/2010 12:00:00 AM, 2000, , 50 7950, DVLPR6, DEVELOPER, 7944, 10/08/2010 12:00:00 AM, 2000, , 50 7951, DVLPR7, DEVELOPER, 7944, 10/08/2010 12:00:00 AM, 2000, , 50 7952, DVLPR8, DEVELOPER, 7944, 10/08/2010 12:00:00 AM, 2000, , 50 7953, DVLPR9, DEVELOPER, 7944, 10/08/2010 12:00:00 AM, 2000, , 50 7954, DVLPR10, DEVELOPER, 7944, 10/08/2010 12:00:00 AM, 2000, , 50 Test finished ``` -------------------------------- ### Building ODP.NET Application with csc.exe Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This example demonstrates building an ODP.NET application using the C# compiler (csc.exe) from the command line. It specifies the output executable name, references the Oracle.DataAccess.dll assembly, and includes the application's source file. Ensure the Oracle.DataAccess.dll path is correctly set. ```csharp C:\Temp> csc /out:myapp.exe /reference:C:\app\mydir\path\Oracle.DataAccess.dll myapp.cs ``` -------------------------------- ### OracleDataReader Class Support Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Lists the supported properties and methods for the OracleDataReader class. ```APIDOC ## OracleDataReader Class Support ### Description Provides information on the supported properties and methods of the `OracleDataReader` class, noting specific limitations for TimesTen. ### Supported Properties - `Depth` (Yes) - `FetchSize` (Yes) - `FieldCount` (Yes) - `HasRows` (Yes) - `HiddenFieldCount` (Yes) - `IsClosed` (Yes) - `Item` (Yes) - `RowSize` (Yes) - `VisibleFieldCount` (Yes) ### Unsupported Properties - `InitialLOBFetchSize` (No) - Note: ODP.NET for TimesTen does not support changing this property's value; it defaults to 0. - `InitialLONGFetchSize` (No) - `RecordsAffected` (No) ### Supported Methods - `Close` (Yes) - `Dispose` (Yes) - `GetByte` (Yes) - `GetBytes` (Yes) - `GetChar` (Yes) - `GetChars` (Yes) - `GetDataTypeName` (Yes) - `GetDateTime` (Yes) - `GetDecimal` (Yes) - `GetDouble` (Yes) - `GetFieldType` (Yes) - `GetFloat` (Yes) - `GetInt16` (Yes) - `GetInt32` (Yes) - `GetInt64` (Yes) - `GetName` (Yes) - `GetOracleBinary` (Yes) - `GetOracleBlob` (Yes) - `GetOracleBlobForUpdate` (Yes) - `GetOracleClob` (Yes) - `GetOracleClobForUpdate` (Yes) - `GetOracleDate` (Yes) - `GetOracleDecimal` (Yes) - `GetOracleString` (Yes) - `GetOracleTimeStamp` (Yes) - `GetOracleValue` (Yes) - `GetOracleValues` (Yes) - `GetOrdinal` (Yes) - `GetProviderSpecificFieldType` (Yes) - `GetProviderSpecificValue` (Yes) - `GetProviderSpecificValues` (Yes) - `GetSchemaTable` (Yes) - `GetString` (Yes) - `GetValue` (Yes) - `GetValues` (Yes) - `IsDBNull` (Yes) - `Read` (Yes) ### Unsupported Methods - `GetBoolean` (No) - `GetData` (No) - `GetEnumerator` (No) - `GetGuid` (No) - `GetOracleBFile` (No) - `GetOracleIntervalDS` (No) - `GetOracleIntervalYM` (No) - `GetOracleRef` (No) - `GetOracleTimeStampLTZ` (No) - `GetOracleTimeStampTZ` (No) - `GetOracleXmlType` (No) - `GetTimeSpan` (No) - `GetXmlReader` (No) - `NextResult` (No) ``` -------------------------------- ### Sample tnsnames.ora Entry for Direct Connection Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc An example of a tnsnames.ora entry configured for a direct connection to a TimesTen database, using 'my_dsn' as the data source name. ```ora my_tnsname = (DESCRIPTION = (CONNECT_DATA = (SERVICE_NAME = my_dsn) (SERVER = timesten_direct))) ``` -------------------------------- ### OracleTransaction Class Support Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Lists the supported properties and methods for the OracleTransaction class. ```APIDOC ## OracleTransaction Class Support ### Description Details the supported properties and methods for the `OracleTransaction` class, including notes on TimesTen specific behavior. ### Supported Properties - `IsolationLevel` (Yes) - `Connection` (Yes) ### Supported Methods - `Commit` (Yes) - `Dispose` (Yes) ### Unsupported Methods - `Rollback` (string) (No) - Note: TimesTen does not support transaction savepoints. - `Save` (No) - Note: TimesTen does not support transaction savepoints. ``` -------------------------------- ### sqlnet.ora Configuration for Naming Methods Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc A sample sqlnet.ora file content that enables both the tnsnames and easy connect naming methods for ODP.NET connections to TimesTen. ```ora # To use ezconnect syntax or tnsnames, the following entries must be ``` -------------------------------- ### Install ODP.NET using ODAC XCopy Version (Batch Script) Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This snippet demonstrates how to install ODP.NET using the XCopy version of ODAC via a batch script. It allows for selective installation of .NET 2.0 or .NET 4 libraries, or all ODAC products. The parameters include the product(s) to install, the ODAC installation directory, and the Oracle home name. ```batch install.bat odp.net2 C:\oracle\odac odachome ``` ```batch install.bat odp.net4 C:\oracle\odac odachome ``` ```batch install.bat all C:\oracle\odac odachome ``` -------------------------------- ### ttSrcScan Utility Usage Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This provides an example of how to use the ttSrcScan command-line utility to scan application source code for TimesTen compatibility. It indicates specifying input files/directories and an output directory. ```bash ttSrcScan -input -output ``` -------------------------------- ### Execute ODP.NET Demo Program Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This command executes the compiled ODP.NET demo program, 'DemoODP', connecting to the TimesTen database 'sampledb_1122' with specified user credentials. Successful execution demonstrates a working ODP.NET and TimesTen integration. ```bash DemoODP -db sampledb_1122 -user appuser -passwd welcome1 ``` -------------------------------- ### ODP.NET Connection String using Easy Connect (OS Authentication) Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Demonstrates the ODP.NET connection string for a direct TimesTen connection via Easy Connect, using the current operating system user's credentials. ```csharp "User Id=/;Data Source=localhost/my_dsn:timesten_direct" ``` -------------------------------- ### Compile ODP.NET Demo Program using C# Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This C# compilation command builds the 'DemoODP.cs' program into an executable 'DemoODP.exe'. It references the Oracle.DataAccess.dll, which is necessary for ODP.NET functionality. ```csharp csc /out:DemoODP.exe /reference:C:\path\Oracle.DataAccess.dll DemoODP.cs ``` -------------------------------- ### OracleConnection Class Property Support Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Lists properties of the OracleConnection class and their support in ODP.NET. Supported properties include ConnectionString, ConnectionTimeout, DataSource, ServerVersion, State, and StatementCacheSize. ```text Property Name | Supported? --- `ActionName` | No `ClientId` | No `ClientInfo` | No `ConnectionString` | Yes `ConnectionTimeout` | Yes `Database` | No `DatabaseDomainName` | No `DatabaseName` | No `DataSource` | Yes `HostName` | No `InstanceName` | No `IsAvailable` (static property) | No `LogicalTransactionID` | No `ModuleName` | No `ServerVersion` | Yes `ServiceName` | No `State` | Yes `StatementCacheSize` | Yes ``` -------------------------------- ### OracleConnection Class Method Support Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Details the support for methods of the OracleConnection class in ODP.NET, including notes on TimesTen compatibility. Methods like BeginTransaction, ClearAllPools, Close, CreateCommand, GetSchema, and Open are supported. ```text Method Name | Supported? | Notes --- `BeginTransaction` | Yes | `ChangeDatabase` | No | `ClearAllPools` (static method) | Yes | `ClearPool` (static method) | Yes | `Clone` | Yes | `Close` | Yes | `CreateCommand` | Yes | `EnlistDistributedTransaction` | No | TimesTen does not support distributed transactions through OCI. Therefore, an ODP.NET application cannot use distributed transactions in a TimesTen connection. `EnlistTransaction` | No | See `EnlistDistributedTransaction`. `FlushCache` | No | `GetLogicalTransactionStatus` | No | `GetSchema` | Yes | Returns metadata collections of tables, columns, users, and other objects that allow application developers to discover and enumerate database information. This information is specific to TimesTen and may differ from corresponding metadata collections returned from Oracle Database. For example, TimesTen does not support the `JavaClasses` and `XMLSchemas` metadata collections because these object types are not supported by TimesTen. `GetSessionInfo` | Yes | `Open` | Yes | `OpenWithNewPassword` | No | `PurgeStatementCache` | Yes | `SetSessionInfo` | No | ``` -------------------------------- ### ODP.NET Connection String using Easy Connect (User Authentication) Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Shows the ODP.NET connection string for a direct connection to TimesTen using the Easy Connect syntax, authenticating as 'scott' with password 'tiger'. ```csharp "User Id=scott;Password=tiger;Data Source=localhost/my_dsn:timesten_direct" ``` -------------------------------- ### ODP.NET Installation and Configuration Overview Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/extensions Provides an overview of the installation and configuration process for Oracle Data Provider for .NET, covering system requirements, driver installation, and general configuration guidelines. ```text Installing and Configuring
Oracle Data Provider for .NET ``` -------------------------------- ### Example: Startup Oracle Database (C#) Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/OracleDatabaseClass This C# example demonstrates how to use the OracleDatabase class to start up an Oracle database instance if it is not already running. It includes error handling for Oracle exceptions and proper disposal of connection and database objects. ```csharp using System; using Oracle.DataAccess.Client; namespace Startup { class Test { static void Main() { OracleConnection con = null; OracleDatabase db = null; string constring = "dba privilege=sysdba;user id=scott;password=tiger;data source=oracle"; try { // Open a connection to see if the DB is up con = new OracleConnection(constring); con.Open(); Console.WriteLine("The Oracle database is already up."); } catch (OracleException ex) { // If the database is down, start up the DB if (ex.Number == 1034) { Console.WriteLine("The Oracle database is down."); // Create an instance of an OracleDatbase object db = new OracleDatabase(constring); // Start up the database db.Startup(); Console.WriteLine("The Oracle database is now up."); // Executing Startup() is the same as the following: // db.Startup(OracleDBStartupMode.NoRestriction, null, true); // which is also the same as: // db.Startup(OracleDBStartupMode.NoRestriction, null, false); // db.ExecuteNonQuery("ALTER DATABASE MOUNT"); // db.ExecuteNonQuery("ALTER DATABASE OPEN"); // Dispose the OracleDatabase object db.Dispose(); } else { Console.WriteLine("Error: " + ex.Message); } } finally { // Dispose the OracleConnetion object con.Dispose(); } } } } ``` -------------------------------- ### ODP.NET Connection String using tnsnames (OS Authentication) Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Illustrates the ODP.NET connection string for connecting to a TimesTen database using the current operating system user's credentials, referencing a tnsnames entry. ```csharp "User Id=/;Data Source=my_tnsname" ``` -------------------------------- ### Oracle.DataAccess.Types Namespace Support Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Details support for structures, exceptions, classes, interfaces, and enumerations within the Oracle.DataAccess.Types namespace. ```APIDOC ## Oracle.DataAccess.Types Namespace Support ### Description This section outlines the support status for various types, exceptions, classes, interfaces, and enumerations within the `Oracle.DataAccess.Types` namespace. ### Supported Structures - `OracleBinary` (Yes) - `OracleDate` (Yes) - `OracleDecimal` (Yes) - `OracleString` (Yes) - `OracleTimeStamp` (Yes) ### Unsupported Structures - `OracleBoolean` (No) - `OracleIntervalDS` (No) - `OracleIntervalYM` (No) - `OracleTimeStampLTZ` (No) - `OracleTimeStampTZ` (No) ### Supported Exceptions - `OracleTypeException` (Yes) - `OracleNullValueException` (Yes) - `OracleTruncateException` (Yes) ### Supported Classes - `OracleBlob` (Yes) - `OracleClob` (Yes) - `OracleRefCursor` (Yes) ### Unsupported Classes - `OracleArrayMappingAttribute` (No) - `OracleBFile` (No) - `OracleCustomTypeMappingAttribute` (No) - `OracleObjectMappingAttribute` (No) - `OracleRef` (No) - `OracleUdt` (No) - `OracleXmlStream` (No) - `OracleXmlType` (No) ### Supported Interfaces - `INullable` (Yes) ### Unsupported Interfaces - `IOracleArrayTypeFactory` (No) - `IOracleCustomType` (No) - `IOracleCustomTypeFactory` (No) ### Unsupported Enumerations - `OracleUdtFetchOption` (No) - `OracleUdtStatus` (No) ``` -------------------------------- ### ODP.NET Unmanaged Driver Installation Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/extensions Provides detailed instructions for installing the Oracle Data Provider for .NET Unmanaged Driver, covering the steps required to get the driver set up on a development or production machine. ```text Installing Oracle Data Provider for .NET, Unmanaged Driver ``` -------------------------------- ### TimesTen Easy Connect String Syntax Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Presents the format for TimesTen Easy Connect strings, enabling connections without a tnsnames.ora configuration. It includes host, service name, and server type. ```easyconnect host/service_name:server ``` -------------------------------- ### Set PATH for ODP.NET XCopy Installation Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This command updates the system's PATH environment variable to include the ODAC installation directory and its bin directory. This is crucial for ODP.NET to locate necessary libraries, especially in XCopy installations and TimesTen environments. The ODAC directories should precede other Oracle directories. ```batch set PATH=C:\oracle\odac;C:\oracle\odac\bin;%PATH% ``` -------------------------------- ### OracleConnection Class Event Support Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Indicates the support status for events of the OracleConnection class in ODP.NET. Only the StateChange event is supported. ```text Method Name | Supported? --- `Failover` | No `HAEvent` | No `InfoMessage` | No `StateChange` | Yes ``` -------------------------------- ### OracleCommand Class Method Support Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Details the support status for methods of the OracleCommand class in ODP.NET. Methods like Clone, CreateParameter, ExecuteNonQuery, ExecuteReader, and ExecuteScalar are supported, while others such as Cancel and ExecuteStream are not. ```text Method Name | Supported? --- `Cancel` | No `Clone` | Yes `CreateParameter` | Yes `ExecuteNonQuery` | Yes `ExecuteReader` | Yes `ExecuteScalar` | Yes `ExecuteStream` | No `ExecuteToStream` | No `ExecuteXmlReader` | No ``` -------------------------------- ### Configuring ODP.NET Connection for TimesTen (Easy Connect) Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This snippet shows how to configure the ODP.NET connection string using the Easy Connect naming method for TimesTen databases. It highlights the importance of setting the `service_name` and `server` attributes correctly. ```text Data Source=server_name:port/service_name; -- For TimesTen, server might be timesten_direct or timesten_client -- Example: Data Source=timesten_direct:5443/your_dsn_name ``` -------------------------------- ### Create TimesTen Database Script Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This batch script is used to create a TimesTen database named 'sampledb_1122' with necessary users and objects. It's a prerequisite for testing ODP.NET. ```batch tt_install_dir\quickstart\sample_scripts\createdb\build_sampledb.bat ``` -------------------------------- ### OracleCommand Constructors Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/featRAC This provides examples of different constructors available for the OracleCommand class, allowing for various ways to initialize and configure commands. ```csharp using Oracle.ManagedDataAccess.Client; // ... // Constructor with command text and connection OracleCommand cmd1 = new OracleCommand("SELECT * FROM Employees", connection); // Constructor with command text, connection, and transaction OracleCommand cmd2 = new OracleCommand("UPDATE Departments SET Location = :loc WHERE DeptID = :id", connection, transaction); cmd2.Parameters.Add("loc", OracleDbType.Varchar2).Value = "New York"; cmd2.Parameters.Add("id", OracleDbType.Int32).Value = 10; // Constructor with command text, connection, and command type OracleCommand cmd3 = new OracleCommand("AddEmployee", connection, CommandType.StoredProcedure); cmd3.Parameters.Add("p_name", OracleDbType.Varchar2).Value = "John Doe"; ``` -------------------------------- ### ODP.NET Connection String using tnsnames (User Authentication) Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Specifies the ODP.NET connection string for authenticating as a specific user ('scott') with a password ('tiger') to a TimesTen database using a tnsnames entry. ```csharp "User Id=scott;Password=tiger;Data Source=my_tnsname" ``` -------------------------------- ### oramtsctl Utility - Start Oracle MTS Recovery Service Source: https://docs.oracle.com/cd/E51173_01/win.122/e18595/install Instructions on how to start the Oracle MTS Recovery Service using the `oramtsctl -start` command. ```APIDOC ## POST /oramtsctl/start_service ### Description Starts the `Oracler1MTSRecoveryService`. ### Method POST ### Endpoint /oramtsctl ### Parameters #### Query Parameters - **-start** (boolean) - Required - Flag to indicate starting the service. ### Request Example ```json { "command": "oramtsctl -start" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the service has started. #### Response Example ```json { "message": "Oracle MTS Recovery Service started successfully." } ``` ``` -------------------------------- ### Configuration File Entry for Connection String Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/featConnecting An example of how a connection string can be defined within an application's configuration file using the 'add' element. ```xml ``` -------------------------------- ### Startup Database Instance Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/OracleDatabaseClass Methods to start a database instance using either the server-side parameter file or a client-side parameter file. ```APIDOC ## POST /api/database/startup ### Description Starts the Oracle database instance. ### Method POST ### Endpoint /api/database/startup ### Parameters #### Request Body - **startupMode** (OracleDBStartupMode) - Optional - The mode to start the database (e.g., ServerParamFile, ClientParamFile). - **paramFilePath** (string) - Optional - Path to the client-side parameter file if `startupMode` is `ClientParamFile`. - **useSPFile** (boolean) - Optional - True to use server-side parameter file, false to use pfile. ### Request Example ```json { "startupMode": "ClientParamFile", "paramFilePath": "/path/to/your/init.ora" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the startup operation was initiated successfully. #### Response Example ```json { "status": "Database startup initiated successfully." } ``` ``` -------------------------------- ### Example: Install Service on a Specific Port Source: https://docs.oracle.com/cd/E51173_01/win.122/e18595/install This example shows how to install an Oracle MTS Recovery Service and configure it to use a specific port, in this case, port 2032. ```shell oramtsctl -new -port 2032 ``` -------------------------------- ### Startup() - Basic Database Startup Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/OracleDatabaseClass Initiates the database startup process in normal mode using the server-side parameter file and automatically mounts and opens the database. ```APIDOC ## Startup() ### Description This method starts up the database in `OracleDbStartupMode.Normal` mode using the server-side parameter file (`spfile`). It automatically executes `ALTER DATABASE MOUNT` and `ALTER DATABASE OPEN` statements upon successful startup. ### Method `void Startup()` ### Parameters None ### Request Example ```csharp // Example usage: OracleDatabase db = new OracleDatabase(...); db.Startup(); ``` ### Response #### Success Response (200) Indicates successful startup, mount, and open operations. No specific return value. #### Response Example N/A (void method) ### Errors `OracleException` - Thrown if the database startup request fails. ``` -------------------------------- ### Uninstalling ODP.NET XCopy Installation Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This snippet shows how to uninstall ODP.NET when installed via the XCopy method. It involves executing the uninstall.bat script with the product name and Oracle home name as arguments. The script can uninstall specific products or all ODAC products. ```batch uninstall.bat odp.net2 odachome ``` ```batch uninstall.bat all odachome ``` -------------------------------- ### Startup(OracleDBStartupMode, string, bool) Method - C# Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/OracleDatabaseClass This C# method starts up the Oracle database with specified parameters. It allows control over the startup mode, the client-side parameter file location, and whether to mount and open the database. If 'bMountAndOpen' is true, it doesn't throw exceptions for already mounted/opened states. ```csharp public void Startup(OracleDbStartupMode startupMode, string pfile, bool bMountAndOpen); ``` -------------------------------- ### Startup(OracleDBStartupMode, string, bool) - Advanced Database Startup Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/OracleDatabaseClass Starts up the database with a specified mode, optionally using a client-side parameter file, and controls whether to mount and open the database. ```APIDOC ## Startup(OracleDBStartupMode, string, bool) ### Description This method starts up the database using a specified startup mode and an optional client-side parameter file. The `bMountAndOpen` parameter determines if the database should also be mounted and opened. ### Method `void Startup(OracleDbStartupMode startupMode, string pfile, bool bMountAndOpen)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **startupMode** (`OracleDBStartupMode`) - Required - An enumeration value specifying the startup mode (e.g., `Normal`, `NoRestriction`). - **pfile** (`string`) - Optional - The location and name of the client-side parameter file. If `null`, the server-side parameter file is used. - **bMountAndOpen** (`bool`) - Required - A boolean value. If `true`, the database is mounted and opened after startup. If `false`, the application must explicitly mount and open the database. ### Request Example ```csharp // Example usage to start with a specific pfile and mount/open: OracleDatabase db = new OracleDatabase(...); db.Startup(OracleDBStartupMode.Normal, "c:\\admin\\init.ora", true); // Example usage to start without mounting/opening (manual mount/open required): db.Startup(OracleDBStartupMode.NoRestriction, null, false); ``` ### Response #### Success Response (200) Indicates successful database startup. If `bMountAndOpen` is `true`, mount and open operations are also successful. No specific return value. #### Response Example N/A (void method) ### Errors `OracleException` - Thrown if the database startup request fails. ``` -------------------------------- ### Example: Install Service on Multiple Hosts with Uniform Port Source: https://docs.oracle.com/cd/E51173_01/win.122/e18595/install This example demonstrates installing an Oracle MTS Recovery Service on multiple specified hosts (`host1`, `host2.domain.com`, `host3`) using a uniform port (2033). ```shell oramtsctl -new -host host1 host2.domain.com host3 -port 2033 ``` -------------------------------- ### Set TimesTen Password in ODP.NET Connection String Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This example demonstrates setting a TimesTen password ('lion') for a user ('scott') and the Oracle Database password ('tiger') using the 'OraclePWD' attribute within the 'Password' field of an ODP.NET connection string. The entire 'Password' setting must be quoted due to the embedded semi-colons, and the quotes within must be escaped. ```text "Data Source=mysource;User Id=scott;Password=\"lion;OraclePwd=tiger\"" ``` -------------------------------- ### Call TimesTen Built-in Procedure with OUT Parameter (PL/SQL) Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Illustrates calling a TimesTen built-in procedure that returns a result set indirectly via an OUT parameter by invoking it from PL/SQL using an OracleCommand in C#. This example retrieves the 'passthrough' flag value. It requires defining an output parameter and clearing parameters after execution. Ensure the OracleConnection is established to TimesTen and dispose of the command afterward. ```csharp int passThruValue = -1; OracleCommand cmd = conn.CreateCommand(); cmd.CommandText = "declare v_name varchar2(255); begin execute immediate 'call ttOptGetFlag(\'passthrough\')' into v_name, :rc1; end;"; cmd.Parameters.Add("rc1", OracleDbType.Int32, -1, ParameterDirection.Output); cmd.ExecuteNonQuery(); passThruValue = Convert.ToInt32(cmd.Parameters[0].Value.ToString()); cmd.Parameters.Clear(); cmd.Dispose(); ``` -------------------------------- ### Set TimesTen Attributes in ODP.NET Connection String Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This example illustrates setting multiple TimesTen connection attributes, including the TimesTen password, Oracle Database password ('OraclePWD'), Oracle Net Service Name ('OracleNetServiceName'), and passthrough level, within the 'Password' field of an ODP.NET connection string. Proper quoting and escaping are crucial for handling multiple attributes delimited by semi-colons. ```text "Data Source=mysource;User ID=scott;Password=\"lion;OraclePwd=tiger; OracleNetServiceName=mytest-pc.example.com;passthrough=1\"" ``` -------------------------------- ### OracleConnectionType Enumeration in C# Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Demonstrates the OracleConnectionType enumeration used with the OracleConnection class in C#. This enumeration helps determine the type of connection associated with an OracleConnection object. ```csharp public enum OracleConnectionType { Undefined, // No connection is associated with the OracleConnection object Oracle, // The OracleConnection object is associated with an Oracle database TimesTen // The OracleConnection object is associated with a TimesTen database } public OracleConnectionType ConnectionType { get; } ``` -------------------------------- ### Oracle Transparent Application Failover (TAF) Setup Example Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/OracleFailoverEventArgsClass A C# example demonstrating how to set up Transparent Application Failover (TAF) using Oracle.DataAccess.Client. This includes registering an event handler for the OracleConnection.Failover event and handling different failover events. ```csharp using System; using System.Threading; using Oracle.DataAccess.Client; using Oracle.DataAccess.Types; class FailoverSample { static void Main(string[] args) { string constr = "User Id=scott;Password=tiger;Data Source=oracle"; OracleConnection con = new OracleConnection(constr); con.Open(); // Register the event handler OnFailover con.Failover += new OracleFailoverEventHandler(OnFailover); Console.WriteLine("Wait for a failover for 5 seconds"); Thread.Sleep(5000); con.Close(); con.Dispose(); } // TAF callback function static FailoverReturnCode OnFailover(object sender, OracleFailoverEventArgs eventArgs) { switch (eventArgs.FailoverEvent) { case FailoverEvent.Begin: { Console.WriteLine("FailoverEvent.Begin - Failover is starting"); Console.WriteLine("FailoverType = " + eventArgs.FailoverType); break; } case FailoverEvent.End: { Console.WriteLine("FailoverEvent.End - Failover was successful"); break; } case FailoverEvent.Reauth: { Console.WriteLine("FailoverEvent.Reauth - User reauthenticated"); break; } case FailoverEvent.Error: { Console.WriteLine("FailoverEvent.Error - Failover was unsuccessful"); // Sleep for 3 sec and Retry Thread.Sleep(3000); return FailoverReturnCode.Retry; } case FailoverEvent.Abort: { Console.WriteLine("FailoverEvent.Abort - Failover was unsuccessful"); break; } default: { Console.WriteLine("Invalid FailoverEvent : " + eventArgs.FailoverEvent); break; } } return FailoverReturnCode.Success; } } ``` -------------------------------- ### C# OracleConnection Connection and Query Example Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/OracleConnectionClass This C# example demonstrates how to establish an Oracle database connection using OracleConnection, create and execute an OracleCommand, and read data using OracleDataReader. It emphasizes the importance of proper resource disposal. ```csharp using System; using System.Data; using Oracle.DataAccess.Client; class OracleConnectionSample { static void Main() { // Connect string constr = "User Id=scott;Password=tiger;Data Source=oracle"; OracleConnection con = new OracleConnection(constr); con.Open(); // Execute a SQL SELECT OracleCommand cmd = con.CreateCommand(); cmd.CommandText = "select * from emp"; OracleDataReader reader = cmd.ExecuteReader(); // Print all employee numbers while (reader.Read()) Console.WriteLine(reader.GetInt32(0)); // Clean up reader.Dispose(); cmd.Dispose(); con.Dispose(); } } ``` -------------------------------- ### Initialize Method Source: https://docs.oracle.com/cd/E51173_01/win.122/e17733/OracleSiteMapProviderClass Initializes the OracleSiteMapProvider instance using configuration settings from the web.config file. ```APIDOC ## Initialize ### Description This method initializes the `OracleSiteMapProvider` instance with the property values specified in the ASP.NET application configuration file (`web.config`). ### Method `Public override void Initialize(string name, NameValueCollection config);` ### Parameters - **name** (string) - The name of the `OracleSiteMapProvider` instance to initialize. - **config** (NameValueCollection) - A `Systems.Collections.Specialized.NameValueCollection` object containing configuration options. ### Exceptions - `ArgumentNullException`: The `config` parameter is null. - `InvalidOperationException`: A `SiteMapProvider` is already initialized. - `ProviderException`: Issues with `connectionStringName`, connection string, unrecognized attributes, or general initialization errors. ``` -------------------------------- ### Set TNS_ADMIN Environment Variable Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This command sets the TNS_ADMIN environment variable to the directory containing the tnsnames.ora file. This allows ODP.NET to find the network configuration for TimesTen. ```batch >set TNS_ADMIN=c:\mytnsdir\sqlnet ``` -------------------------------- ### Example OraOLEDB Connection String Source: https://docs.oracle.com/cd/E51173_01/win.122/e18594/using Demonstrates setting multiple OraOLEDB-specific connection string attributes like FetchSize, CacheType, OSAuthent, PLSQLRSet, and StmtCacheSize. ```text FetchSize=100;CacheType=Memory;OSAuthent=0;PLSQLRSet=1;StmtCacheSize=10; ``` -------------------------------- ### OracleDBStartupMode Enumeration Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/intro Defines the startup modes for Oracle databases. ```APIDOC ## OracleDBStartupMode Enumeration ### Description Defines the various modes for starting up an Oracle database. ``` -------------------------------- ### OracleCommand Class Property Support Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Lists properties of the OracleCommand class and their support status in ODP.NET. Some properties like AddRowid are not supported, while others like CommandText and Parameters are supported. ```text Property Name | Supported? --- `AddRowid` | No `AddToStatementCache` | Yes `ArrayBindCount` | Yes `ArrayBindRowsAffected` | No `BindByName` | No `CommandText` | Yes `CommandTimeout` | No `CommandType` | Yes `Connection` | Yes `DesignTimeVisible` | No `FetchSize` | Yes `ImpliedRefCursors` | Yes (see note) `InitialLOBFetchSize` | No (see note) `InitialLONGFetchSize` | No `Notification` | No `NotificationAutoEnlist` | No `Parameters` | Yes `RowSize` | Yes `Transaction` | Yes `UpdatedRowSource` | Yes `XmlCommandType` | No `XmlQueryProperties` | No `XmlSaveProperties` | No ``` -------------------------------- ### Configure TNSNames for TimesTen Connection Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This configuration defines the connection details for the TimesTen database 'SAMPLEDB_1122' using the 'timesten_direct' server. This file is essential for ODP.NET to locate and connect to the TimesTen instance. ```ora SAMPLEDB_1122 =(DESCRIPTION=(CONNECT_DATA = (SERVICE_NAME = SAMPLEDB_1122)(SERVER = timesten_direct))) ``` -------------------------------- ### TimesTen tnsnames.ora Entry Syntax Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc Defines the structure for a TimesTen entry within a tnsnames.ora file. It specifies the connection details like SERVICE_NAME and the type of server connection (direct or client). ```ora tns_entry = (DESCRIPTION = (CONNECT_DATA = (SERVICE_NAME = dsn) (SERVER = timesten_direct | timesten_client))) ``` -------------------------------- ### OracleBFile Usage Example Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/OracleBFileClass Demonstrates how to use the OracleBFile class to interact with BFILE data, including opening, reading, searching, and closing. ```APIDOC ## OracleBFile Example ### Database Setup ```sql -- Log on as DBA (SYS or SYSTEM) that has CREATE ANY DIRECTORY privilege. CREATE OR REPLACE DIRECTORY MYDIR AS 'C:\TEMP'; ``` ### C# Example ```csharp using System; using Oracle.DataAccess.Client; using Oracle.DataAccess.Types; class OracleBFileSample { static void Main() { // Create MYDIR directory object as indicated previously and create a file // MyFile.txt with the text ABCDABC under C:\TEMP directory. // Note that the byte representation of the ABCDABC is 65666768656667 string constr = "User Id=scott;Password=tiger;Data Source=oracle"; OracleConnection con = new OracleConnection(constr); con.Open(); OracleBFile bFile = new OracleBFile(con, "MYDIR", "MyFile.txt"); // Open the OracleBFile bFile.OpenFile(); // Read 7 bytes into readBuffer, starting at buffer offset 0 byte[] readBuffer = new byte[7]; int bytesRead = bFile.Read(readBuffer, 0, 7); // Prints "bytesRead = 7" Console.WriteLine("bytesRead = " + bytesRead); // Prints "readBuffer = 65666768656667" Console.Write("readBuffer = "); for(int index = 0; index < readBuffer.Length; index++) { Console.Write(readBuffer[index]); } Console.WriteLine(); // Search for the 2nd occurrence of a byte pattern {66,67} // starting from byte offset 1 in the OracleBFile byte[] pattern = new byte[2] {66, 67}; long posFound = bFile.Search(pattern, 1, 2); // Prints "posFound = 6" Console.WriteLine("posFound = " + posFound); // Close the OracleBFile bFile.CloseFile(); bFile.Close(); bFile.Dispose(); con.Close(); con.Dispose(); } } ``` ``` -------------------------------- ### Sample Listener.ora Configuration for Oracle .NET Source: https://docs.oracle.com/cd/E51173_01/win.122/e18596/install This is a sample configuration for the listener.ora file, specifying settings for both PLSExtProc and CLRExtProc, including the program executable and environment variables for DLL loading. It defines the listener's address. ```sql SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = C:\oracle\database_1) (PROGRAM = extproc) ) (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = C:\oracle\database_1) (PROGRAM = extproc) (ENVS="EXTPROC_DLLS=ONLY:C:\oracle\database_1\bin\oraclr12.dll") ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) ) ) ``` -------------------------------- ### Using ODP.NET Client Provider in a Simple Application Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/extensions Demonstrates how to integrate the ODP.NET Client Provider into a basic application to establish database connections and perform operations. This serves as an introductory example for developers. ```text Using ODP.NET Client Provider in a Simple Application ``` -------------------------------- ### OracleTimeStampLTZ Usage Example Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/OracleTimeStampLTZStructure This C# example demonstrates how to use the OracleTimeStampLTZ structure. It shows how to retrieve the local time zone name, get the current system date as an OracleTimeStampLTZ, and calculate the difference between two OracleTimeStampLTZ objects using OracleIntervalDS and AddNanoseconds methods. ```csharp using System; using Oracle.DataAccess.Types; using Oracle.DataAccess.Client; class OracleTimeStampLTZSample { static void Main() { // Illustrates usage of OracleTimeStampLTZ // Display Local Time Zone Name Console.WriteLine("Local Time Zone Name = " + OracleTimeStampLTZ.GetLocalTimeZoneName()); OracleTimeStampLTZ tsLocal1 = OracleTimeStampLTZ.GetSysDate(); OracleTimeStampLTZ tsLocal2 = DateTime.Now; // Calculate the difference between tsLocal1 and tsLocal2 OracleIntervalDS idsDiff = tsLocal2.GetDaysBetween(tsLocal1); // Calculate the difference using AddNanoseconds() int nanoDiff = 0; while (tsLocal2 > tsLocal1) { nanoDiff += 10; tsLocal1 = tsLocal1.AddNanoseconds(10); } Console.WriteLine("idsDiff.Nanoseconds = " + idsDiff.Nanoseconds); Console.WriteLine("nanoDiff = " + nanoDiff); } } ``` -------------------------------- ### OraProvCfg Utility - Display Help Source: https://docs.oracle.com/cd/E51173_01/win.122/e17733/IntroInstallation This command displays the help information for the OraProvCfg utility. This is useful for understanding the available options and parameters for configuring Oracle Providers for ASP.NET. ```bash OraProvCfg -help ``` -------------------------------- ### Enabling PL/SQL in TimesTen via ODBC Administrator Source: https://docs.oracle.com/cd/E51173_01/win.122/e38358/toc This describes the process of enabling PL/SQL for a TimesTen database when encountering the ORA-44818 exception. It involves modifying the PLSQL attribute in the ODBC Data Source Administrator. ```text [ODBC Data Sources] TimesTenDSN=TimesTen [TimesTen] Driver=TimesTen Driver Data Source=your_dsn_name PLSQL=1 ``` -------------------------------- ### OracleBFile Instance Methods Source: https://docs.oracle.com/cd/E51173_01/win.122/e17732/OracleBFileClass A list and description of the instance methods available for the OracleBFile class. ```APIDOC ## OracleBFile Instance Methods `OracleBFile` instance methods are listed below: ### Method List * **BeginRead**: Inherited from `System.IO.Stream` * **BeginWrite**: Not Supported * **Clone**: Creates a copy of an `OracleBFile` object * **Close**: Closes the current stream and releases any resources associated with the stream * **CloseFile**: Closes the `BFILE` referenced by the current `BFILE` instance * **Compare**: Compares data referenced by the two `OracleBFile`s * **CreateObjRef**: Inherited from `System.MarshalByRefObject` * **CopyTo**: Copies data as specified (Overloaded) * **Dispose**: Releases resources allocated by this object * **EndRead**: Inherited from `System.IO.Stream` * **EndWrite**: Not Supported * **Equals**: Inherited from `System.Object` (Overloaded) * **Flush**: Not Supported * **GetHashCode**: Inherited from `System.Object` * **GetLifetimeService**: Inherited from `System.MarshalByRefObject` * **GetType**: Inherited from `System.Object` * **InitializeLifetimeService**: Inherited from `System.MarshalByRefObject` * **IsEqual**: Compares the LOB references * **OpenFile**: Opens the `BFILE` specified by the `FileName` and `DirectoryName` * **Read**: Reads a specified amount of bytes from the `OracleBFile` instance and populates the `buffer` * **ReadByte**: Inherited from `System.IO.Stream` * **Search**: Searches for a binary pattern in the current instance of an `OracleBFile` * **Seek**: Sets the position on the current LOB stream * **SetLength**: Not Supported * **ToString**: Inherited from `System.Object` * **Write**: Not Supported * **WriteByte**: Not Supported ```