Database

This property sets the database Oracle Cloud ID (OCID).

Declaration

// C#
public string Database { get; set; }

Exceptions

An InvalidOperationException will be raised if the application tries to modify an ociTokenAuthenticationConfiguration object by setting this property once a connection has opened using that configuration object.

Remarks

This parameter is applicable to the OCI API key, OCI interactive, OCI instance principal, and OCI delegation token authentication flows only and is optional.

There is no default value for this parameter. If it is not set, ODP.NET requests access to all the compartment's databases specified by the OciCompartment property. If OciCompartment property is also not set, then ODP.NET requests access to all the databases within the OCI IAM user's tenancy.

Sample Code

OracleConnection conn = new OracleConnection(constr);
conn.TokenAuthentication = OracleTokenAuth.OciDelegationToken;
OciTokenAuthentication tokenconfig = new OciTokenAuthentication{
	Compartment = "<COMPARTMENT OCID>",
	Database = "<DATABASE OCID>"
}
conn.UseOciTokenAuthentication(tokenConfig);
conn.Open();
conn.Close();