Package liquibase.database.core
Class OracleDatabase
java.lang.Object
liquibase.database.AbstractJdbcDatabase
liquibase.database.core.OracleDatabase
- All Implemented Interfaces:
AutoCloseable,Database,PrioritizedService
Encapsulates Oracle database support.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intstatic final intstatic final intstatic final Stringstatic final Patternprotected final intFields inherited from class liquibase.database.AbstractJdbcDatabase
caseSensitive, currentDateTimeFunction, dateFunctions, defaultAutoIncrementBy, defaultAutoIncrementStartWith, defaultCatalogName, defaultSchemaName, quotingStrategy, sequenceCurrentValueFunction, sequenceNextValueFunction, unmodifiableDataTypes, unquotedObjectsAreUppercasedFields inherited from interface liquibase.database.Database
COMPLETE_SQL_SCOPE_KEY, IGNORE_MISSING_REFERENCES_KEYFields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for an object that represents the Oracle Database DBMS. -
Method Summary
Modifier and TypeMethodDescriptionbooleancorrectObjectName(String objectName, Class<? extends DatabaseObject> objectType) Fix the object name to the format the database expects, handling changes in case, etc.generateDatabaseFunctionValue(DatabaseFunction databaseFunction) Some function names are placeholders that need to be replaced with the specific database value.generatePrimaryKeyName(String tableName) protected StringgetAutoIncrementClause(String generationType, Boolean defaultOnNull) Default implementation.protected StringintintintgetDataTypeMaxParameters(String dataTypeName) getDateLiteral(String isoDate) Returns an Oracle date literal with the same value as a string formatted using ISO 8601.protected StringgetDefaultDriver(String url) If this database understands the given url, return the default driver class name.intReturns the maximum number of bytes (NOT: characters) for an identifier.getJdbcCatalogName(CatalogAndSchema schema) getJdbcSchemaName(CatalogAndSchema schema) intReturns an all-lower-case short name of the product.getSystemTableWhereClause(String tableNameColumn) booleanIs this AbstractDatabase subclass the correct one to use for the given connection.booleanisReservedWord(String objectName) booleanisSystemObject(DatabaseObject example) booleanisValidOracleIdentifier(String identifier, Class<? extends DatabaseObject> type) Tests if the given String would be a valid identifier in Oracle DBMS.booleanvoidbooleansupports(Class<? extends DatabaseObject> object) Whether this database supports the specified object type.booleanbooleanDoes the particular database implementation support the database changelog history feature and associated table?booleanReturns whether this database support initially deferrable columns.booleanDoes this database treat NOT NULL as an own kind of CONSTRAINT (in addition of simply being a column property)?booleanbooleanOracle supports catalogs in liquibase termsbooleanDoes the database type support sequence.booleanvalidate()Methods inherited from class liquibase.database.AbstractJdbcDatabase
addReservedWords, canCreateChangeLogTable, close, commit, correctSchema, correctSchema, createsIndexesForForeignKeys, dataTypeIsNotModifiable, disableForeignKeyChecks, doesTagExist, dropDatabaseObjects, enableForeignKeyChecks, equals, escapeColumnName, escapeColumnName, escapeColumnNameList, escapeConstraintName, escapeDataTypeName, escapeIndexName, escapeObjectName, escapeObjectName, escapeSequenceName, escapeStringForDatabase, escapeTableName, escapeViewName, execute, executeRollbackStatements, executeRollbackStatements, executeStatements, filterRollbackVisitors, generateAutoIncrementBy, generateAutoIncrementStartWith, get, getAutoCommitMode, getAutoIncrementByClause, getAutoIncrementClause, getAutoIncrementClause, getAutoIncrementClosing, getAutoIncrementOpening, getAutoIncrementStartWithClause, getConcatSql, getConnection, getConnectionSchemaName, getConnectionSchemaNameCallStatement, getContainingObjects, getCurrentDateTimeFunction, getDatabaseChangeLogLockTableName, getDatabaseChangeLogTableName, getDatabaseProductName, getDatabaseProductVersion, getDateFunctions, getDateLiteral, getDateLiteral, getDateTimeLiteral, getDefaultFractionalDigitsForTimestamp, getDefaultScaleForNativeDataType, getDefaultSchema, getDefaultSchemaName, getFetchSize, getJdbcCatalogName, getJdbcSchemaName, getLineComment, getLiquibaseCatalogName, getLiquibaseSchemaName, getLiquibaseTablespaceName, getMaxFractionalDigitsForTimestamp, getName, getObjectQuotingStrategy, getOutputDefaultCatalog, getOutputDefaultSchema, getQuotingEndCharacter, getQuotingEndReplacement, getQuotingStartCharacter, getRanChangeSet, getRanChangeSetList, getRanDate, getRawDatabaseChangeLogLockTableName, getRawDatabaseChangeLogTableName, getRunStatus, getSchemaAndCatalogCase, getSchemaFromJdbcInfo, getSystemSchema, getSystemTables, getSystemViews, getTimeLiteral, getViewDefinition, hashCode, isAutoCommit, isCaseSensitive, isCatalogOrSchemaType, isCurrentTimeFunction, isDateOnly, isDateTime, isDefaultCatalog, isDefaultSchema, isFunction, isLiquibaseObject, isSafeToRunUpdate, isSystemView, isTimeOnly, isTimestamp, markChangeSetExecStatus, mustQuoteObjectName, parseDate, quoteObject, removeRanStatus, requiresExplicitNullForColumns, requiresPassword, requiresUsername, resetInternalState, rollback, saveRollbackStatement, saveStatements, set, setAutoCommit, setCanCacheLiquibaseTableInfo, setCaseSensitive, setCurrentDateTimeFunction, setDatabaseChangeLogLockTableName, setDatabaseChangeLogTableName, setDefaultCatalogName, setDefaultSchemaName, setLiquibaseCatalogName, setLiquibaseSchemaName, setLiquibaseTablespaceName, setObjectQuotingStrategy, setOutputDefaultCatalog, setOutputDefaultSchema, setPreviousAutoCommit, startsWithNumeric, supportsBatchUpdates, supportsCatalogInObjectName, supportsCatalogs, supportsDDLInTransaction, supportsDropTableCascadeConstraints, supportsForeignKeyDisable, supportsPrimaryKeyNames, tag, toString, unescapeDataTypeName, unescapeDataTypeStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface liquibase.database.Database
addCompleteSqlToScope, afterUpdate, checkDatabaseConnection, dropDatabaseObjects, escapeForLike, failOnDefferable, generateConnectCommandSuccessMessage, getDisplayName, supportsCreateIfNotExists, temporarilySetObjectQuotingStrategy
-
Field Details
-
PROXY_USER_PATTERN
-
PRODUCT_NAME
- See Also:
-
SHORT_IDENTIFIERS_LENGTH
protected final int SHORT_IDENTIFIERS_LENGTH- See Also:
-
LONG_IDENTIFIERS_LEGNTH
protected final int LONG_IDENTIFIERS_LEGNTH- See Also:
-
ORACLE_12C_MAJOR_VERSION
public static final int ORACLE_12C_MAJOR_VERSION- See Also:
-
ORACLE_23C_MAJOR_VERSION
public static final int ORACLE_23C_MAJOR_VERSION- See Also:
-
-
Constructor Details
-
OracleDatabase
public OracleDatabase()Default constructor for an object that represents the Oracle Database DBMS.
-
-
Method Details
-
getPriority
public int getPriority() -
setConnection
- Specified by:
setConnectionin interfaceDatabase- Overrides:
setConnectionin classAbstractJdbcDatabase
-
getShortName
Description copied from interface:DatabaseReturns an all-lower-case short name of the product. Used for end-user selecting of database type such as the DBMS precondition. -
getDefaultDatabaseProductName
- Specified by:
getDefaultDatabaseProductNamein classAbstractJdbcDatabase
-
getDatabaseMajorVersion
- Specified by:
getDatabaseMajorVersionin interfaceDatabase- Overrides:
getDatabaseMajorVersionin classAbstractJdbcDatabase- Throws:
DatabaseException
-
getDatabaseMinorVersion
- Specified by:
getDatabaseMinorVersionin interfaceDatabase- Overrides:
getDatabaseMinorVersionin classAbstractJdbcDatabase- Throws:
DatabaseException
-
getDefaultPort
-
getJdbcCatalogName
- Overrides:
getJdbcCatalogNamein classAbstractJdbcDatabase
-
getJdbcSchemaName
- Overrides:
getJdbcSchemaNamein classAbstractJdbcDatabase
-
getAutoIncrementClause
Description copied from class:AbstractJdbcDatabaseDefault implementation. Intended for override in database specific cases- Overrides:
getAutoIncrementClausein classAbstractJdbcDatabase
-
generatePrimaryKeyName
- Specified by:
generatePrimaryKeyNamein interfaceDatabase- Overrides:
generatePrimaryKeyNamein classAbstractJdbcDatabase
-
supportsInitiallyDeferrableColumns
public boolean supportsInitiallyDeferrableColumns()Description copied from interface:DatabaseReturns whether this database support initially deferrable columns. -
isReservedWord
- Specified by:
isReservedWordin interfaceDatabase- Overrides:
isReservedWordin classAbstractJdbcDatabase
-
supportsSequences
public boolean supportsSequences()Description copied from class:AbstractJdbcDatabaseDoes the database type support sequence.- Specified by:
supportsSequencesin interfaceDatabase- Overrides:
supportsSequencesin classAbstractJdbcDatabase
-
supports
Description copied from interface:DatabaseWhether this database supports the specified object type. It is invoking the deprecated methods to ensure that extensions are not broken, but once those are removed it will return only true- Parameters:
object- the object type to check- Returns:
- true if the database supports the object type, false otherwise
-
supportsSchemas
public boolean supportsSchemas()Oracle supports catalogs in liquibase terms- Specified by:
supportsSchemasin interfaceDatabase- Overrides:
supportsSchemasin classAbstractJdbcDatabase- Returns:
- false
-
getConnectionCatalogName
- Overrides:
getConnectionCatalogNamein classAbstractJdbcDatabase- Throws:
DatabaseException
-
isCorrectDatabaseImplementation
Description copied from interface:DatabaseIs this AbstractDatabase subclass the correct one to use for the given connection.- Throws:
DatabaseException
-
getDefaultDriver
Description copied from interface:DatabaseIf this database understands the given url, return the default driver class name. Otherwise return null. -
getDefaultCatalogName
- Specified by:
getDefaultCatalogNamein interfaceDatabase- Overrides:
getDefaultCatalogNamein classAbstractJdbcDatabase
-
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
- Specified by:
getDateLiteralin interfaceDatabase- Overrides:
getDateLiteralin classAbstractJdbcDatabase
-
isSystemObject
- Specified by:
isSystemObjectin interfaceDatabase- Overrides:
isSystemObjectin classAbstractJdbcDatabase
-
supportsTablespaces
public boolean supportsTablespaces() -
supportsAutoIncrement
public boolean supportsAutoIncrement()- Specified by:
supportsAutoIncrementin interfaceDatabase- Overrides:
supportsAutoIncrementin classAbstractJdbcDatabase
-
supportsRestrictForeignKeys
public boolean supportsRestrictForeignKeys()- Specified by:
supportsRestrictForeignKeysin interfaceDatabase- Overrides:
supportsRestrictForeignKeysin classAbstractJdbcDatabase
-
getDataTypeMaxParameters
- Specified by:
getDataTypeMaxParametersin interfaceDatabase- Overrides:
getDataTypeMaxParametersin classAbstractJdbcDatabase
-
getSystemTableWhereClause
-
jdbcCallsCatalogsSchemas
public boolean jdbcCallsCatalogsSchemas()- Overrides:
jdbcCallsCatalogsSchemasin classAbstractJdbcDatabase
-
getUserDefinedTypes
-
generateDatabaseFunctionValue
Description copied from interface:DatabaseSome 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- Specified by:
generateDatabaseFunctionValuein interfaceDatabase- Overrides:
generateDatabaseFunctionValuein classAbstractJdbcDatabase- Parameters:
databaseFunction- database function to check.- Returns:
- the string value to use for an update or generate
-
validate
- Specified by:
validatein interfaceDatabase- Overrides:
validatein classAbstractJdbcDatabase
-
getDbaRecycleBinWarning
-
canAccessDbaRecycleBin
public boolean canAccessDbaRecycleBin() -
supportsNotNullConstraintNames
public boolean supportsNotNullConstraintNames()Description copied from interface:DatabaseDoes 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.- Specified by:
supportsNotNullConstraintNamesin interfaceDatabase- Overrides:
supportsNotNullConstraintNamesin classAbstractJdbcDatabase- Returns:
- true if the database supports naming NOT NULL constraints, false if not.
-
isValidOracleIdentifier
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. -
getIdentifierMaximumLength
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:
- the maximum length of an object identifier, in bytes
-
supportsDatabaseChangeLogHistory
public boolean supportsDatabaseChangeLogHistory()Description copied from interface:DatabaseDoes the particular database implementation support the database changelog history feature and associated table?- Returns:
- true if supported, false otherwise
-
correctObjectName
Description copied from interface:DatabaseFix the object name to the format the database expects, handling changes in case, etc.- Specified by:
correctObjectNamein interfaceDatabase- Overrides:
correctObjectNamein classAbstractJdbcDatabase
-