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 capture 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_privilege procedure.
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. (See Installing and Configuring Oracle GoldenGate for Oracle Database for more information about classic capture.) 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 shown in Table 1-17.
Table 1-17 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]
}
SOURCEDB data_sourceSOURCEDB specifies a data source name. This option is required to identify one of the following:
The source or target login database for Sybase, MySQL, and databases that use ODBC
The source or target SQL/MX catalog
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.
USERIDSupplies a database login credential, if required. Can be used if an Oracle GoldenGate credential store is not in use. (See the USERIDALIAS option.) Input varies, depending on the database, as follows:
useridSpecifies 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 userid as a connect string, such as OGGUSER@FINANCE. To log into the root container, specify userid as a common user, including the C## prefix, such as C##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_PREFIX initialization parameter. For more information, see the USERID | NOUSERID parameter.
PASSWORD passwordUse when authentication is required to specify the password for the database user. If the password was encrypted by means of the ENCRYPT PASSWORD command, supply the encrypted password; otherwise, supply the clear-text password. If the password is case-sensitive, type it that way.
If the PASSWORD clause is omitted, you are prompted for a password, and the password is not echoed.
algorithmIf the password was encrypted with the ENCRYPT PASSWORD command, specify the encryption algorithm that was used:
AES128
AES192
AES256
BLOWFISH
ENCRYPTKEY {keyname | DEFAULT}Specifies the encryption key that was specified with the ENCRYPT PASSWORD command. Use one of the following:
ENCRYPTKEY keynameSpecifies the logical name of a user-created encryption key in the ENCKEYS lookup file. Use if ENCRYPT PASSWORD was used with the KEYNAME keyname option.
ENCRYPTKEY DEFAULTDirects Oracle GoldenGate to generate a Blowfish key. Use if the ENCRYPT PASSWORD command was used with the KEYNAME DEFAULT option.
USERIDALIAS alias [DOMAIN domain]Supplies a database login credential, if required. Can be used instead of the USERID option if there is a local Oracle GoldenGate credential store that contains a credential with the required privileges for this DBLOGIN command. For more information about using a credential store, see Administering Oracle GoldenGate for Windows and UNIX.
aliasSpecifies 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 as C##GGADMIN@FINANCE. For more information about configuring Oracle GoldenGate for a CDB, see Installing and Configuring Oracle GoldenGate for Oracle Database.
DOMAIN domainSpecifies 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 for USERID and USERIDALIAS.
SQLID sqlid(DB2 on z/OS) Issues the SQL command SET CURRENT SQLID = 'sqlid' after the USERID login (with PASSWORD, if applicable) is completed. If the SET command fails, the entire DBLOGIN command fails as a unit.
SESSIONCHARSET character_set(Sybase, 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 SESSIONCHARSET that is specified in the GLOBALS file.
(Sybase) To display the language information in the process report file when using this option for a Sybase database, make certain that locale.dat is set properly in the Sybase installation directory. If the character set is not found in the supported Sybase database character set, then it is validated against the Oracle GoldenGate supported character set list. The character-set information is displayed with the LOCALE INFORMATION entry in the report output. When issuing the DBLOGIN command, the Sybase environment variable is examined to see if the language (LANG) is set. If the language is not set, Oracle GoldenGate automatically sets it to US English.
Examples
DBLOGIN USERIDALIAS alias1
DBLOGIN USERIDALIAS alias1 DOMAIN domain1
DBLOGIN USERID ogguser@pdb1 SYSDBA password AACAAAAAAAAAAAJAUEUGODSCVGJEEIUGKJDJTFNDKEJFFFTC AES128, ENCRYPTKEY securekey1
DBLOGIN SOURCEDB mysqldb@host1:3305, USERIDALIAS alias1
DBLOGIN SOURCEDB database USERIDALIAS alias1
DBLOGIN SOURCEDB USERID ogguser@remotedatabase PASSWORD password
DBLOGIN SOURCEDB systemdsn
DBLOGIN SOURCEDB systemdsn USERIDALIAS alias1