common

package
v0.0.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PositionSnapshotStarted = PositionType("Snapshot")
	PositionReplication     = PositionType("Replication")
)
View Source
const (
	EmbeddedLogTrackerTableName = "data_transfer_tracker"
	CLOBToBLOBFunctionName      = "clob_to_blob"
)

Variables

View Source
var (
	// From Oracle 11, 12, 19, 21
	// Oracle 11 - https://docs.oracle.com/cd/E11882_01/install.112/e47798/startrdb.htm#g1016156
	// Oracle 12 - https://docs.oracle.com/en/database/oracle/oracle-database/12.2/hpdbi/oracle-database-system-privileges-accounts-and-passwords.html
	// Oracle 19 - https://docs.oracle.com/en/database/oracle/oracle-database/19/ntdbi/oracle-database-system-privileges-accounts-and-passwords.html#GUID-7513171C-1055-48BB-8C79-B27EECC9B7E9
	// Oracle 21 - https://docs.oracle.com/en/database/oracle/oracle-database/21/dbseg/managing-security-for-oracle-database-users.html#GUID-D3770171-8E64-461C-92A4-045248EE42E1
	BannedUsers = []string{
		"ANONYMOUS",
		"APEX_040000",
		"APEX_050000",
		"APEX_PUBLIC_USER",
		"APPQOSSYS",
		"AUDSYS",
		"CTXSYS",
		"DBSFWUSER",
		"DBSNMP",
		"DBSNMP",
		"DGPDB_INT",
		"DIP",
		"DVF",
		"DVSYS",
		"EXFSYS",
		"FLOWS_040100",
		"FLOWS_FILES",
		"GGSYS",
		"GSMADMIN_INTERNAL",
		"GSMCATUSER",
		"GSMUSER",
		"LBACSYS",
		"MDDATA",
		"MDSYS",
		"MGMT_VIEW",
		"OLAPSYS",
		"ORACLE_OCM",
		"ORDDATA",
		"ORDPLUGINS",
		"ORDSYS",
		"OUTLN",
		"OWBSYS",
		"REMOTE_SCHEDULER_AGENT",
		"SI_INFORMTN_SCHEMA",
		"SPATIAL_CSW_ADMIN_USR",
		"SPATIAL_WFS_ADMIN_USR",
		"SYS",
		"SYS$UMF",
		"SYSBACKUP",
		"SYSDG",
		"SYSKM",
		"SYSMAN",
		"SYSMAN",
		"SYSRAC",
		"SYSTEM",
		"UNKNOWN",
		"WK_TEST",
		"WKPROXY",
		"WKSYS",
		"WMSYS",
		"XDB",
		"XS$NULL",
		"OJVMSYS",
	}
	BannedTables = []string{
		strings.ToUpper(EmbeddedLogTrackerTableName),
	}
)

Functions

func CDBQuery

func CDBQuery(sqlxDB *sqlx.DB, ctx context.Context, cdb bool, query QueryFunc) error

func CDBQueryGlobal

func CDBQueryGlobal(config *oracle.OracleSource, sqlxDB *sqlx.DB, ctx context.Context, query QueryFunc) error

func ConvertOracleName

func ConvertOracleName(oracleName string) string

func CreateSQLName

func CreateSQLName(parts ...string) string

func GetBannedTablesCondition

func GetBannedTablesCondition(tableColumnName string) (string, error)

func GetBannedTablesInContent

func GetBannedTablesInContent() (string, error)

func GetBannedUsersCondition

func GetBannedUsersCondition(userColumnName string) (string, error)

func GetBannedUsersInContent

func GetBannedUsersInContent() (string, error)

func GetConnectionString

func GetConnectionString(config *oracle.OracleSource) (string, error)

func GetTablesCondition

func GetTablesCondition(schemaColumnName string, tableColumnName string, tableIDs []*TableID, in bool) (string, error)

func IsNullString

func IsNullString(oracleString *string) bool

func PDBQuery

func PDBQuery(sqlxDB *sqlx.DB, ctx context.Context, cdb bool, container string, query QueryFunc) error

func PDBQueryGlobal

func PDBQueryGlobal(config *oracle.OracleSource, sqlxDB *sqlx.DB, ctx context.Context, query QueryFunc) error

Types

type LogPosition

type LogPosition struct {
	// contains filtered or unexported fields
}

func NewLogPosition

func NewLogPosition(scn uint64, rsID *string, ssn *uint64, typ PositionType, timestamp time.Time) (*LogPosition, error)

func (*LogPosition) Compare

func (position *LogPosition) Compare(otherPosition base.LogPosition) (int, error)

func (*LogPosition) Equals

func (position *LogPosition) Equals(otherPosition base.LogPosition) bool

func (*LogPosition) OnlySCN

func (position *LogPosition) OnlySCN() bool

func (*LogPosition) RSID

func (position *LogPosition) RSID() *string

func (*LogPosition) SCN

func (position *LogPosition) SCN() uint64

func (*LogPosition) SSN

func (position *LogPosition) SSN() *uint64

func (*LogPosition) String

func (position *LogPosition) String() string

func (*LogPosition) Timestamp

func (position *LogPosition) Timestamp() time.Time

func (*LogPosition) ToOldCommitTime

func (position *LogPosition) ToOldCommitTime() (uint64, error)

func (*LogPosition) ToOldLSN

func (position *LogPosition) ToOldLSN() (uint64, error)

func (*LogPosition) Type

func (position *LogPosition) Type() PositionType

type PositionType

type PositionType string

type QueryFunc

type QueryFunc func(ctx context.Context, connection *sqlx.Conn) error

type TableID

type TableID struct {
	// contains filtered or unexported fields
}

func NewTableID

func NewTableID(schemaName string, tableName string) *TableID

func NewTableIDFromOracleSQLName

func NewTableIDFromOracleSQLName(oracleSQL string, user string) (*TableID, error)

func NewTableIDsFromOracleSQLNames

func NewTableIDsFromOracleSQLNames(sqlNames []string, user string) ([]*TableID, error)

func (*TableID) Equals

func (table *TableID) Equals(otherTableID *TableID) bool

func (*TableID) FullName

func (table *TableID) FullName() string

func (*TableID) OracleSQLName

func (table *TableID) OracleSQLName() string

func (*TableID) OracleSchemaName

func (table *TableID) OracleSchemaName() string

func (*TableID) OracleTableName

func (table *TableID) OracleTableName() string

func (*TableID) SchemaName

func (table *TableID) SchemaName() string

func (*TableID) TableName

func (table *TableID) TableName() string

func (*TableID) ToOldTableID

func (table *TableID) ToOldTableID() (*abstract.TableID, error)

type TransactionInfo

type TransactionInfo struct {
	// contains filtered or unexported fields
}

func NewTransactionInfo

func NewTransactionInfo(id string, begin *LogPosition, end *LogPosition) *TransactionInfo

func (*TransactionInfo) BeginPosition

func (info *TransactionInfo) BeginPosition() base.LogPosition

func (*TransactionInfo) EndPosition

func (info *TransactionInfo) EndPosition() base.LogPosition

func (*TransactionInfo) Equals

func (info *TransactionInfo) Equals(otherTransaction base.Transaction) bool

func (*TransactionInfo) ID

func (info *TransactionInfo) ID() string

func (*TransactionInfo) OracleBeginPosition

func (info *TransactionInfo) OracleBeginPosition() *LogPosition

func (*TransactionInfo) OracleEndPosition

func (info *TransactionInfo) OracleEndPosition() *LogPosition

func (*TransactionInfo) String

func (info *TransactionInfo) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL