4.2 DBLOGIN
Use DBLOGIN to establish a database connection through
GGSCI in preparation to issue other Oracle GoldenGate commands that affect the database.
The user who issues DBLOGIN should have the appropriate database
privileges to perform the functions that are enacted by those commands. Any other
special privileges that are required for a GGSCI command are listed with the reference
documentation for that command.
Requirements When Configuring Extract or Replicat in Integrated Mode (Oracle)
If using DBLOGIN to issue ADD EXTRACT,
ALTER EXTRACT, or REGISTER EXTRACT to initiate
integrated Extract or ADD REPLICAT, ALTER REPLICAT, or
REGISTER REPLICAT to initiate integrated Replicat against an Oracle
database, the user who issues DBLOGIN must:
-
Have privileges granted through the Oracle
dbms_goldengate_auth.grant_admin_privilegeprocedure. -
Not be changed while Extract or Replicat is in integrated mode.
Special Database Privileges to Use Log Retention in Classic Capture Mode
When in classic capture mode for an Oracle database, Extract supports the
log-retention feature, whereby the database retains the logs that Extract needs. To
enable the log-retention feature, DBLOGIN must be issued with special
privileges before using REGISTER EXTRACT with the
LOGRETENTION option. For simplicity, you can log in as the Extract
database user if the correct privileges were granted to that user when Oracle GoldenGate
was installed. Otherwise, log in as a user with the privileges.
Table 4-1 Oracle Privileges for Log Retention
| Oracle EE version | How to Grant Privileges |
|---|---|
|
11.1 and 11.2.0.1 |
|
|
11.2.0.2 and later |
Run package to grant Oracle GoldenGate admin privilege. exec dbms_goldengate_auth.grant_admin_privilege('user')
|
Syntax
DBLOGIN {
[SOURCEDB data_source] |
[, database@host:port] |
USERID {/ | userid}[, PASSWORD password]
[algorithm ENCRYPTKEY {keyname | DEFAULT}] |
USERIDALIAS alias [DOMAIN domain] |
[SYSDBA | SQLID sqlid]
[SESSIONCHARSET character_set]
}
-
SOURCEDBdata_source -
SOURCEDBspecifies a data source name. This option is required to identify one of the following:-
The source or target login database for SQL Server, MySQL, and databases that use ODBC
-
-
database@host:port -
(MySQL) Specifies a connection string that contains the database name, host name, and database port number. Can be used to specify a port other than the default that is specified in the database configuration.
-
USERID -
Supplies a database login credential, if required. Can be used if an Oracle GoldenGate credential store is not in use. Input varies, depending on the database, as follows:
-
userid -
Specifies the name of a database user or a schema, depending on the database configuration. For Oracle, a SQL*Net connect string can be used. To log into a pluggable database in an Oracle multitenant container database, specify
useridas a connect string, such asOGGUSER@FINANCE. To log into the root container, specifyuseridas a common user, including the C## prefix, such asC##GGADMIN@FINANCE. -
/ -
(Oracle) Directs Oracle GoldenGate to use an operating-system login for Oracle, not a database user login. Use this argument only if the database allows authentication at the operating-system level. To use this option, the correct user name must exist in the database, in relation to the value of the Oracle
OS_AUTHENT_PREFIXinitialization parameter. For more information, see theUSERID | NOUSERIDparameter. -
PASSWORDpassword -
Use when authentication is required to specify the password for the database user. If the password was encrypted by means of the
ENCRYPT PASSWORDcommand, supply the encrypted password; otherwise, supply the clear-text password. If the password is case-sensitive, type it that way.If the
PASSWORDclause is omitted, you are prompted for a password, and the password is not echoed. -
algorithm -
If the password was encrypted with the
ENCRYPT PASSWORDcommand, specify the encryption algorithm that was used:AES128AES192AES256BLOWFISH -
ENCRYPTKEY {keyname| DEFAULT} -
Specifies the encryption key that was specified with
the ENCRYPT PASSWORD command. Use one of the following:-
ENCRYPTKEYkeyname -
Specifies the logical name of a user-created encryption key in the
ENCKEYSlookup file. Use ifENCRYPT PASSWORDwas used with theKEYNAMEkeynameoption. -
ENCRYPTKEY DEFAULT -
Directs Oracle GoldenGate to generate a Blowfish key. Use if the
ENCRYPT PASSWORDcommand was used with theKEYNAME DEFAULToption.
-
-
-
USERIDALIASalias[DOMAINdomain] -
Supplies a database login credential, if required. Can be used instead of the
USERIDoption if there is a local Oracle GoldenGate credential store that contains a credential with the required privileges for thisDBLOGINcommand.-
alias -
Specifies the alias of a database user credential that is stored in the Oracle GoldenGate credential store. To log into a pluggable database in an Oracle multitenant container database, the user must be stored as a connect string, such as
OGGUSER@FINANCE. To log into the root container, the user must be stored as a common user, including the C## prefix, such asC##GGADMIN@FINANCE. -
DOMAINdomain -
Specifies the credential store domain for the specified alias. A valid domain entry must exist in the credential store for the specified alias.
-
-
SYSDBA -
(Oracle) Specifies that the user logs in as
sysdba. This option can be used forUSERIDandUSERIDALIAS. -
SQLIDsqlid -
(DB2 on z/OS) Issues the SQL command
SET CURRENT SQLID = 'sqlid'after theUSERIDlogin (withPASSWORD, if applicable) is completed. If theSETcommand fails, the entireDBLOGINcommand fails as a unit. -
SESSIONCHARSETcharacter_set -
(Teradata and MySQL) Sets a database session character set for the GGSCI connection to the database. All subsequent commands will use the specified session character set. This command option overrides any
SESSIONCHARSETthat is specified in theGLOBALSfile.
Examples
- (Oracle)
-
DBLOGIN USERIDALIAS alias1
- (Oracle with non-default domain)
-
DBLOGIN USERIDALIAS alias1 DOMAIN domain1
- (Oracle with SYSDBA)
-
DBLOGIN USERID ogguser@pdb1 SYSDBA password AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC AES128, ENCRYPTKEY securekey1
- (MySQL)
-
DBLOGIN SOURCEDB mysqldb@host1:3305, USERIDALIAS alias1
- (MySQL)
-
DBLOGIN SOURCEDB database USERIDALIAS alias1
- (SQL Server with Integrated Windows authentication)
-
DBLOGIN SOURCEDB systemdsn
- (SQL Server with SQL Server authentication)
-
DBLOGIN SOURCEDB systemdsn USERIDALIAS alias1
Parent topic: GGSCI Command Line Interface Commands