Top Description Fields Constructors Methods
liquibase.database.core

public Class OracleDatabase

extends AbstractJdbcDatabase
Class Inheritance
Imports
liquibase.CatalogAndSchema, .GlobalConfiguration, .Scope, liquibase.database.AbstractJdbcDatabase, .DatabaseConnection, .OfflineConnection, liquibase.database.jvm.JdbcConnection, liquibase.exception.DatabaseException, .UnexpectedLiquibaseException, .ValidationErrors, liquibase.executor.ExecutorService, liquibase.statement.DatabaseFunction, .SequenceCurrentValueFunction, .SequenceNextValueFunction, liquibase.statement.core.RawCallStatement, .RawSqlStatement, liquibase.structure.DatabaseObject, liquibase.structure.core.Catalog, .Index, .PrimaryKey, .Schema, liquibase.util.JdbcUtil, .StringUtil, java.lang.reflect.Method, java.sql.*, java.util.*, java.util.regex.Matcher, .Pattern

Encapsulates Oracle database support.

Field Summary

Modifier and TypeField and Description
private Boolean
private static final ResourceBundle
private Integer
private Integer
protected final int
public static final int
public static final int
public static final String
public static final Pattern
private static final String
private final Set<String>
private Map<String, String>
protected final int
private Set<String>
private static final Pattern
private static final String
Inherited from liquibase.database.AbstractJdbcDatabase:
caseSensitivecurrentDateTimeFunctiondateFunctionsdefaultAutoIncrementBydefaultAutoIncrementStartWithdefaultCatalogNamedefaultSchemaNamequotingStrategysequenceCurrentValueFunctionsequenceNextValueFunctionunmodifiableDataTypesunquotedObjectsAreUppercased

Constructor Summary

AccessConstructor and Description
public
OracleDatabase()

Default constructor for an object that represents the Oracle Database DBMS.

Method Summary

Modifier and TypeMethod and Description
public boolean
public String
generateDatabaseFunctionValue(DatabaseFunction
database function to check.
databaseFunction
)

Overrides liquibase.database.AbstractJdbcDatabase.generateDatabaseFunctionValue.

Implements liquibase.database.Database.generateDatabaseFunctionValue.

Some function names are placeholders that need to be replaced with the specific database value.

public String
protected String
getAutoIncrementClause(final String generationType, final Boolean defaultOnNull)

Overrides liquibase.database.AbstractJdbcDatabase.getAutoIncrementClause.

Default implementation.

protected String
public int
public int
public int
public String
getDateLiteral(String isoDate)

Overrides liquibase.database.AbstractJdbcDatabase.getDateLiteral.

Implements liquibase.database.Database.getDateLiteral.

Returns an Oracle date literal with the same value as a string formatted using ISO 8601.

public String
public String
protected String
public String
getDefaultDriver(String url)

Implements liquibase.database.Database.getDefaultDriver.

If this database understands the given url, return the default driver class name.

public Integer
public int

Returns:

the maximum length of an object identifier, in bytes
getIdentifierMaximumLength
()

Returns the maximum number of bytes (NOT: characters) for an identifier.

public String
public String
public int
public String
getShortName()

Implements liquibase.database.Database.getShortName.

Returns an all-lower-case short name of the product.

public String
public Set<String>
public boolean
isCorrectDatabaseImplementation(DatabaseConnection conn)

Implements liquibase.database.Database.isCorrectDatabaseImplementation.

Is this AbstractDatabase subclass the correct one to use for the given connection.

public boolean
public boolean
public boolean
isValidOracleIdentifier(String identifier, Class<? extends DatabaseObject> type)

Tests if the given String would be a valid identifier in Oracle DBMS.

public boolean
public void
public boolean
public boolean
supportsInitiallyDeferrableColumns()

Implements liquibase.database.Database.supportsInitiallyDeferrableColumns.

Returns whether this database support initially deferrable columns.

public boolean
supportsNotNullConstraintNames()

Overrides liquibase.database.AbstractJdbcDatabase.supportsNotNullConstraintNames.

Implements liquibase.database.Database.supportsNotNullConstraintNames.

Does this database treat NOT NULL as an own kind of CONSTRAINT (in addition of simply being a column property)?

public boolean
public boolean

Returns:

false
supportsSchemas
()

Overrides liquibase.database.AbstractJdbcDatabase.supportsSchemas.

Implements liquibase.database.Database.supportsSchemas.

Oracle supports catalogs in liquibase terms

public boolean
public boolean
private void
tryProxySession(final String url, final Connection con)

public ValidationErrors
Inherited from liquibase.database.AbstractJdbcDatabase:
addReservedWordscanCreateChangeLogTableclosecommitcorrectObjectNamecorrectSchemacorrectSchemacreatesIndexesForForeignKeysdataTypeIsNotModifiabledisableForeignKeyChecksdoesTagExistdropDatabaseObjectsenableForeignKeyChecksequalsescapeColumnNameescapeColumnNameescapeColumnNameListescapeConstraintNameescapeDataTypeNameescapeIndexNameescapeObjectNameescapeObjectNameescapeSequenceNameescapeStringForDatabaseescapeTableNameescapeViewNameexecuteexecuteRollbackStatementsexecuteRollbackStatementsexecuteStatementsfilterRollbackVisitorsgenerateAutoIncrementBygenerateAutoIncrementStartWithgetgetAutoCommitModegetAutoIncrementByClausegetAutoIncrementClausegetAutoIncrementClausegetAutoIncrementClosinggetAutoIncrementOpeninggetAutoIncrementStartWithClausegetConcatSqlgetConnectiongetConnectionSchemaNamegetConnectionSchemaNameCallStatementgetContainingObjectsgetCurrentDateTimeFunctiongetDatabaseChangeLogLockTableNamegetDatabaseChangeLogTableNamegetDatabaseProductNamegetDatabaseProductVersiongetDateFunctionsgetDateLiteralgetDateLiteralgetDateTimeLiteralgetDefaultFractionalDigitsForTimestampgetDefaultScaleForNativeDataTypegetDefaultSchemagetDefaultSchemaNamegetFetchSizegetJdbcCatalogNamegetJdbcSchemaNamegetLineCommentgetLiquibaseCatalogNamegetLiquibaseSchemaNamegetLiquibaseTablespaceNamegetMaxFractionalDigitsForTimestampgetNamegetObjectQuotingStrategygetOutputDefaultCataloggetOutputDefaultSchemagetQuotingEndCharactergetQuotingEndReplacementgetQuotingStartCharactergetRanChangeSetgetRanChangeSetListgetRanDategetRawDatabaseChangeLogLockTableNamegetRawDatabaseChangeLogTableNamegetRunStatusgetSchemaAndCatalogCasegetSchemaFromJdbcInfogetSystemSchemagetSystemTablesgetSystemViewsgetTimeLiteralgetViewDefinitionhashCodeisAutoCommitisCaseSensitiveisCatalogOrSchemaTypeisCurrentTimeFunctionisDateOnlyisDateTimeisDefaultCatalogisDefaultSchemaisFunctionisLiquibaseObjectisSafeToRunUpdateisSystemViewisTimeOnlyisTimestampmarkChangeSetExecStatusmustQuoteObjectNameparseDatequoteObjectremoveRanStatusrequiresExplicitNullForColumnsrequiresPasswordrequiresUsernameresetInternalStaterollbacksaveRollbackStatementsaveStatementssetsetAutoCommitsetCanCacheLiquibaseTableInfosetCaseSensitivesetCurrentDateTimeFunctionsetDatabaseChangeLogLockTableNamesetDatabaseChangeLogTableNamesetDefaultCatalogNamesetDefaultSchemaNamesetLiquibaseCatalogNamesetLiquibaseSchemaNamesetLiquibaseTablespaceNamesetObjectQuotingStrategysetOutputDefaultCatalogsetOutputDefaultSchemastartsWithNumericsupportsBatchUpdatessupportsCatalogInObjectNamesupportsCatalogssupportsDDLInTransactionsupportsDropTableCascadeConstraintssupportsForeignKeyDisablesupportsPrimaryKeyNamestagtoStringunescapeDataTypeNameunescapeDataTypeString

Field Detail

canAccessDbaRecycleBinback to summary
private Boolean canAccessDbaRecycleBin
coreBundleback to summary
private static final ResourceBundle coreBundle
databaseMajorVersionback to summary
private Integer databaseMajorVersion
databaseMinorVersionback to summary
private Integer databaseMinorVersion
LONG_IDENTIFIERS_LEGNTHback to summary
protected final int LONG_IDENTIFIERS_LEGNTH
ORACLE_12C_MAJOR_VERSIONback to summary
public static final int ORACLE_12C_MAJOR_VERSION
ORACLE_23C_MAJOR_VERSIONback to summary
public static final int ORACLE_23C_MAJOR_VERSION
PRODUCT_NAMEback to summary
public static final String PRODUCT_NAME
PROXY_USER_PATTERNback to summary
public static final Pattern PROXY_USER_PATTERN
PROXY_USER_REGEXback to summary
private static final String PROXY_USER_REGEX
reservedWordsback to summary
private final Set<String> reservedWords

Hides liquibase.database.AbstractJdbcDatabase.reservedWords.

savedSessionNlsSettingsback to summary
private Map<String, String> savedSessionNlsSettings
SHORT_IDENTIFIERS_LENGTHback to summary
protected final int SHORT_IDENTIFIERS_LENGTH
userDefinedTypesback to summary
private Set<String> userDefinedTypes
VERSION_PATTERNback to summary
private static final Pattern VERSION_PATTERN
VERSION_REGEXback to summary
private static final String VERSION_REGEX

Constructor Detail

OracleDatabaseback to summary
public OracleDatabase()

Default constructor for an object that represents the Oracle Database DBMS.

Method Detail

canAccessDbaRecycleBinback to summary
public boolean canAccessDbaRecycleBin()
generateDatabaseFunctionValueback to summary
public String generateDatabaseFunctionValue(DatabaseFunction databaseFunction)

Overrides liquibase.database.AbstractJdbcDatabase.generateDatabaseFunctionValue.

Implements liquibase.database.Database.generateDatabaseFunctionValue.

Doc from liquibase.database.Database.generateDatabaseFunctionValue.

Some function names are placeholders that need to be replaced with the specific database value. e.g. nextSequenceValue(sequenceName) should be replaced with NEXT_VAL('sequenceName') for Postgresql

Parameters
databaseFunction:DatabaseFunction

database function to check.

Returns:String

the string value to use for an update or generate

Annotations
@Override
generatePrimaryKeyNameback to summary
public String generatePrimaryKeyName(String tableName)

Overrides liquibase.database.AbstractJdbcDatabase.generatePrimaryKeyName.

Implements liquibase.database.Database.generatePrimaryKeyName.

Annotations
@Override
getAutoIncrementClauseback to summary
protected String getAutoIncrementClause(final String generationType, final Boolean defaultOnNull)

Overrides liquibase.database.AbstractJdbcDatabase.getAutoIncrementClause.

Doc from liquibase.database.AbstractJdbcDatabase.getAutoIncrementClause.

Default implementation. Intended for override in database specific cases

Annotations
@Override
getConnectionCatalogNameback to summary
protected String getConnectionCatalogName() throws DatabaseException

Overrides liquibase.database.AbstractJdbcDatabase.getConnectionCatalogName.

Annotations
@Override
getDatabaseMajorVersionback to summary
public int getDatabaseMajorVersion() throws DatabaseException

Overrides liquibase.database.AbstractJdbcDatabase.getDatabaseMajorVersion.

Implements liquibase.database.Database.getDatabaseMajorVersion.

Annotations
@Override
getDatabaseMinorVersionback to summary
public int getDatabaseMinorVersion() throws DatabaseException

Overrides liquibase.database.AbstractJdbcDatabase.getDatabaseMinorVersion.

Implements liquibase.database.Database.getDatabaseMinorVersion.

Annotations
@Override
getDataTypeMaxParametersback to summary
public int getDataTypeMaxParameters(String dataTypeName)

Overrides liquibase.database.AbstractJdbcDatabase.getDataTypeMaxParameters.

Implements liquibase.database.Database.getDataTypeMaxParameters.

Annotations
@Override
getDateLiteralback to summary
public String getDateLiteral(String isoDate)

Overrides liquibase.database.AbstractJdbcDatabase.getDateLiteral.

Implements liquibase.database.Database.getDateLiteral.

Returns an Oracle date literal with the same value as a string formatted using ISO 8601.

Convert an ISO8601 date string to one of the following results: to_date('1995-05-23', 'YYYY-MM-DD') to_date('1995-05-23 09:23:59', 'YYYY-MM-DD HH24:MI:SS')

Implementation restriction:
Currently, only the following subsets of ISO8601 are supported:

  • YYYY-MM-DD
  • YYYY-MM-DDThh:mm:ss
Annotations
@Override
getDbaRecycleBinWarningback to summary
public String getDbaRecycleBinWarning()
getDefaultCatalogNameback to summary
public String getDefaultCatalogName()

Overrides liquibase.database.AbstractJdbcDatabase.getDefaultCatalogName.

Implements liquibase.database.Database.getDefaultCatalogName.

Annotations
@Override
getDefaultDatabaseProductNameback to summary
protected String getDefaultDatabaseProductName()

Implements abstract liquibase.database.AbstractJdbcDatabase.getDefaultDatabaseProductName.

Annotations
@Override
getDefaultDriverback to summary
public String getDefaultDriver(String url)

Implements liquibase.database.Database.getDefaultDriver.

Doc from liquibase.database.Database.getDefaultDriver.

If this database understands the given url, return the default driver class name. Otherwise return null.

Annotations
@Override
getDefaultPortback to summary
public Integer getDefaultPort()

Implements liquibase.database.Database.getDefaultPort.

Annotations
@Override
getIdentifierMaximumLengthback to summary
public int getIdentifierMaximumLength()

Returns the maximum number of bytes (NOT: characters) for an identifier. For Oracle <=12c Release 20, this is 30 bytes, and starting from 12cR2, up to 128 (except for tablespaces, PDB names and some other rather rare object types).

Returns:int

the maximum length of an object identifier, in bytes

getJdbcCatalogNameback to summary
public String getJdbcCatalogName(CatalogAndSchema schema)

Overrides liquibase.database.AbstractJdbcDatabase.getJdbcCatalogName.

Annotations
@Override
getJdbcSchemaNameback to summary
public String getJdbcSchemaName(CatalogAndSchema schema)

Overrides liquibase.database.AbstractJdbcDatabase.getJdbcSchemaName.

Annotations
@Override
getPriorityback to summary
public int getPriority()

Implements liquibase.servicelocator.PrioritizedService.getPriority.

Annotations
@Override
getShortNameback to summary
public String getShortName()

Implements liquibase.database.Database.getShortName.

Doc from liquibase.database.Database.getShortName.

Returns an all-lower-case short name of the product. Used for end-user selecting of database type such as the DBMS precondition.

Annotations
@Override
getSystemTableWhereClauseback to summary
public String getSystemTableWhereClause(String tableNameColumn)
getUserDefinedTypesback to summary
public Set<String> getUserDefinedTypes()
isCorrectDatabaseImplementationback to summary
public boolean isCorrectDatabaseImplementation(DatabaseConnection conn) throws DatabaseException

Implements liquibase.database.Database.isCorrectDatabaseImplementation.

Doc from liquibase.database.Database.isCorrectDatabaseImplementation.

Is this AbstractDatabase subclass the correct one to use for the given connection.

Annotations
@Override
isReservedWordback to summary
public boolean isReservedWord(String objectName)

Overrides liquibase.database.AbstractJdbcDatabase.isReservedWord.

Implements liquibase.database.Database.isReservedWord.

Annotations
@Override
isSystemObjectback to summary
public boolean isSystemObject(DatabaseObject example)

Overrides liquibase.database.AbstractJdbcDatabase.isSystemObject.

Implements liquibase.database.Database.isSystemObject.

Annotations
@Override
isValidOracleIdentifierback to summary
public boolean isValidOracleIdentifier(String identifier, Class<? extends DatabaseObject> type)

Tests if the given String would be a valid identifier in Oracle DBMS. In Oracle, a valid identifier has the following form (case-insensitive comparison): 1st character: A-Z 2..n characters: A-Z0-9$_# The maximum length of an identifier differs by Oracle version and object type.

jdbcCallsCatalogsSchemasback to summary
public boolean jdbcCallsCatalogsSchemas()

Overrides liquibase.database.AbstractJdbcDatabase.jdbcCallsCatalogsSchemas.

Annotations
@Override
setConnectionback to summary
public void setConnection(DatabaseConnection conn)

Overrides liquibase.database.AbstractJdbcDatabase.setConnection.

Implements liquibase.database.Database.setConnection.

Annotations
@Override
supportsAutoIncrementback to summary
public boolean supportsAutoIncrement()

Overrides liquibase.database.AbstractJdbcDatabase.supportsAutoIncrement.

Implements liquibase.database.Database.supportsAutoIncrement.

Annotations
@Override
supportsInitiallyDeferrableColumnsback to summary
public boolean supportsInitiallyDeferrableColumns()

Implements liquibase.database.Database.supportsInitiallyDeferrableColumns.

Doc from liquibase.database.Database.supportsInitiallyDeferrableColumns.

Returns whether this database support initially deferrable columns.

Annotations
@Override
supportsNotNullConstraintNamesback to summary
public boolean supportsNotNullConstraintNames()

Overrides liquibase.database.AbstractJdbcDatabase.supportsNotNullConstraintNames.

Implements liquibase.database.Database.supportsNotNullConstraintNames.

Doc from liquibase.database.Database.supportsNotNullConstraintNames.

Does this database treat NOT NULL as an own kind of CONSTRAINT (in addition of simply being a column property)? This will affect the CONSTRAINT clause SQL generators.

Returns:boolean

true if the database supports naming NOT NULL constraints, false if not.

Annotations
@Override
supportsRestrictForeignKeysback to summary
public boolean supportsRestrictForeignKeys()

Overrides liquibase.database.AbstractJdbcDatabase.supportsRestrictForeignKeys.

Implements liquibase.database.Database.supportsRestrictForeignKeys.

Annotations
@Override
supportsSchemasback to summary
public boolean supportsSchemas()

Overrides liquibase.database.AbstractJdbcDatabase.supportsSchemas.

Implements liquibase.database.Database.supportsSchemas.

Oracle supports catalogs in liquibase terms

Returns:boolean

false

Annotations
@Override
supportsSequencesback to summary
public boolean supportsSequences()

Overrides liquibase.database.AbstractJdbcDatabase.supportsSequences.

Implements liquibase.database.Database.supportsSequences.

Doc from liquibase.database.AbstractJdbcDatabase.supportsSequences.

Does the database type support sequence.

Annotations
@Override
supportsTablespacesback to summary
public boolean supportsTablespaces()

Implements liquibase.database.Database.supportsTablespaces.

Annotations
@Override
tryProxySessionback to summary
private void tryProxySession(final String url, final Connection con)
validateback to summary
public ValidationErrors validate()

Overrides liquibase.database.AbstractJdbcDatabase.validate.

Implements liquibase.database.Database.validate.

Annotations
@Override