Learn how to extract useful things from the vast ocean; otherwise, you will be exhausted. To put it bluntly, we will start studying GoldenGate these days. Let's take a look at what Installation and Setup Guide says.
System requirements and instructions before installation
Oracle GoldenGate can move data between different Oracle versions or between Oracle and other types of databases. Oracle GoldenGate supports data filtering, ing, and conversion. Oracle can also copy DDL operations between similar Oracle databases. Note the following sentence: When DDL supports activation, Oracle GoldenGate does not support data filtering, ing, and conversion.
Supported Oracle database versions: DML and DDL are supported from 9.2. It supports almost all mainstream operating systems and can be queried from MOS (My Oracle Support. In terms of memory, the memory required by Oracle Golden Gate is related to the processes running at the same time. In the most basic cases, A master extraction process is required to capture the source data, a secondary Extraction Data Pump process to transmit data over the network, and a replication process to apply the copied data to the target end.
GoldenGate uses the GGSCI command interface. Each instance can support up to 300 concurrent extraction and replication processes. An Oracle GoldenGate process can be considered as a Manager process, which is the main control process. Each extraction and replication process requires about 25-55 MB of memory, or more, depending on the transaction size and concurrency.
The GoldenGate cache manager uses the memory management function of the operating system to ensure that the GoldenGate process works in a continuous and effective manner. In the cache, the modern virtual memory technology is used to achieve: efficient allocation and management of active buffer; if possible, the old buffer is recycled, instead of being paged to the disk; when necessary, the less used information is paged to the disk.
The actual memory used by the GoldenGate process is determined by the operating system, rather than the GoldenGate program.
The system needs to allocate sufficient swap space for the GoldenGate extraction or replication process. You can take the following steps to find the space: Start an extraction or replication process, run GGSC, view the report file, find this line of process vm avail from OS (min); Round up the obtained value to an integer GB, for example, round up 1.76GB to 2 GB; multiply this size by the number of extraction and replication processes to run, which is the maximum swap space that may be required.
The required free disk space is 50-150 MB, which is related to the specific database and platform. The binary file of each GoldenGate instance installed in the working directory and system requires about 40 MB space. For example, if you install GoldenGate in two independent directories, you need to allocate 80 MB space; in the cluster environment, you can install GoldenGate in the shared file system so that all nodes can access it. In addition, you need to allocate hard disk space for the GoldenGate trail file, which is related to the capacity of the data to be processed. The better starting point is 1 GB.
Storage of Oracle GoldenGate tracing files
To prevent the tracking file activity from interfering with business applications, you should put the tracking file in a separate disk or file system. These files store all the data captured by GoldenGate. The default file size is 10 MB, but may be changed during configuration. The trace file is accumulated gradually, but the rule can be cleared by specifying the PURGEOLDEXTRACTS parameter.
There should be enough space for tracing files on the source end to prevent network connection failures. In a typical configuration, the extracted sub-process (called a Data Pump) sends data from the local Tracing file to the target end over the network, and fails when the network fails. However, the extraction of the main process will continue to read the transaction log and write it to the local Tracing file. Therefore. You must have enough disk space to hold the accumulated data.
You can set the PURGEOLDEXTRACTS parameter to provide sufficient disk space for the target Tracing file. However, even if this parameter is used, it may continue to accumulate when the data transmission speed is higher than that applied to the target database.
You can use this formula to predict the size of the desired Tracing file [log volume in one hour] x [number of hours downtime] x. 4 = trail disk space 40% is used here, because GoldenGate only needs about 40% of the data in the transaction log.
By default, GoldenGate maintains data according to the files in the dirtmp subdirectory under the directory. You can use the CACHEDIRECTORY option of the CACHEMGR parameter to specify its path.
Oracle RAC
If GoldenGate is installed in the RAC environment, we recommend that you install it in shared storage so that you can start the GoldenGate process on any node, you can start it on another node without modifying the parameters because the processing checkpoint is kept in the installation directory.
All nodes in RAC that need to execute the GoldenGate process must synchronize the system time, because GoldenGate makes key decisions by comparing the local system time and the submitted time stamp.
TCP/IP
Use the host name or IP address to configure the network of the system where the GoldenGate process is located. GoldenGate requires the following non-reserved and unrestricted TCP/IP ports: one port is used for communication between the manager process and other GoldenGate processes; the other port is used for local GoldenGate communication, the default value is port 7840, which can also be customized. A maximum of 256 ports can be created.
Operating System Permissions
On Linux/Unix, The GoldenGate process requires that the files and subdirectories in the installation directory have the permission to read, write, and delete. The manager process also requires the permission to control the Oracle GoldenGate process. If you are using a Windows system, you must use the Administrator user to log on. The extraction process requires a user who can access log files (including online and archived logs. In UNIX systems, the user must be a member of the user group where the Oracle instance is located.
Requirements of the anteng Processor
If you install Oracle goldenexe on a Microsoft Apsara stack system, the runtime database vcredist_ia64.exe must be installed. You can download this package from the Microsoft website, which contains the VisualStudio dynamic link library required by GoldenGate to operate on the anteng platform.
In addition, Microsoft Visual C ++ 2005 SP1 is installed and configured before GoldenGate is installed on Windows.
Database Requirements
You must use the Complete Oracle Client instead of the Oracle Instant Client, so that the GoldenGate program can access the XDK database of Oracle.
For more information about the data types, operation types, and table types supported by GoldenGate, developers should note that it is too long and will not be referenced here. To put it simply, unsupported data types include ORDDICOM, ANYDATA, ANYDATASET, ANYTYPE, BFILE, MLSLABEL, TIMEZONE_ABBR, TIMEZONE_REGION, URITYPE, and UROWID. When a table has only one field, the field types are not supported: LOB, LONG, Nested table, User defined data type, VARRAY, and XML. Due to a known problem, you need to disable the Oracle recycle bin function. Otherwise, the DDL trigger of GoldenGate will become invalid.
Installation of GoldenGate
Download the GoldenGate software corresponding to your own platform. The edelivery official website provides download services. Unfortunately, it is not open to Mainland China. Please solve this problem by yourself...
Environment VariableFirst, you must set the relevant environment variables in the operating system. First ORACLE_HOMEAnd ORACLE_SIDIf you cannot set environment variables in the operating system, or there are multiple instances in the system that use GoldenGate to transmit data, in a UNIX system, you can set parameters in each extraction/replication process group in the following format: SETENV (ORACLE_HOME = "<path to Oracle home location> ")And SETENV (ORACLE_SID = "<SID> ")You also need to add the GoldenGate installation directory to the environment variables of the shared library, such: Export LD_LIBRARY_PATH =/ggs/10.0: $ LD_LIBRARY_PATHNote that the lib directory in ORACLE_HOME should also be added. You can use the ldd command to check whether the environment variable is set correctly. (The shared library environment variable is LIBPATH in AIX, LD_LIBRARY_PATH in Solaris and Linux, and SHLIB_PATH in HP-UX)
Install softwareInstalling the software is actually very simple. You can decompress the package in the directory to be installed. Then go to the directory and execute ggsci (you must execute it in the GoldenGate installation directory, so the Path variable can be set but not set). Execute the command in the ggsci command line to create the working directory: CREATE SUBDIRSIn Windows, you can add the Manager process to the service by running the install command. You can also configure GoldenGate to a system-level cluster to provide failover. If you are interested, please refer to the official documents.
Install DDL support
How to configure GoldenGate to capture and transmit ddl is described in the Oracle GoldenGate Windows and UNIX Administrator's Guide. The following table lists some objects used for ddl synchronization in GoldenGate.
Object |
Purpose |
Default name |
DDL mark table |
Stores DDL information. This table is only inserted. |
GGS_MARKER |
Mark the sequence in the table |
Used to fill a field in the marking table |
GGS_DDL_SEQ |
DDL History Table |
Stores object metadata history, receives insertion, update, and deletion |
GGS_DDL_HIST |
Object ID History Table |
Object ID that contains the configured OBJECT |
GGS_DDL_HIST_ALT |
DDL trigger |
Write operation information to the mark table box history table for DDL operations. |
GGS_DDL_TRIGGER_BEFORE |
DDL schema |
Schema containing the DDL synchronization object |
Must be specified in the GLOBALS file during installation |
User Role |
Create the role required to execute the DDL operation |
GGS_GGSUSER_ROLE |
Internal installation table |
Used only for internal tables |
GGS_SETUP |
Ddl_pin |
Fixed DDL tracking, DDL packages, and DDL triggers for performance improvement |
Ddl_pin |
Ddl_cleartrace. SQL |
Delete a ddl trail File |
Ddl_cleartrace. SQL |
Ddl_status. SQL |
Confirm that the GoldenGate DDL object has been installed. |
Ddl_status. SQL |
Marker_status. SQL |
Confirm that the tag table has been installed |
Marker_status. SQL |
Ddl_tracelevel. SQL |
Set the level of the DDL trail |
Ddl_tracelevel. SQL |
The following describes how to install DDL objects:
1. Select a schema for the DDL object
2. grant the following permissions to the schema:
Grant execute on UTL_FILE TO <schema>;
3. select a tablespace for these objects, and the remaining space of the tablespace must be able to bear the data growth of GGS_DDL_HIST and GGS_MARKER tables, especially GGS_DDL_HIST, which will increase proportionally according to the frequency of DDL operations. If there is not enough tablespace, the DDL operations in the database cannot be completed, and the business application will be suspended.
4. OpenGLOBALSFile, and configure the schema to the parameters:GGSCHEMA <schema_name>
5. Modify the name of the DDL object. This step is optional, and the default name is recommended for Oracle.
6. Go to the GoldenGate installation directory, disconnect all database sessions, and make sure there are no new session connections.
7. run SQL * Plus with sysdba. This permission is required to install the DDL trigger. The trigger will be installed in SYS schema.
8. RunMarker_setupScript to install the GoldenGate marker system required for DDL support. During script execution, enter the name of GoldenGate schema.
9. RunDdl_setupScript
10. RunRole_setupScript. This script deletes and creates the role required for DDL synchronization. It authorizes DML operations on the DDL object.
11. Assign the role to the GoldenGate extraction user. If these processes use different users, You need to authorize them separately.
12. RunDdl_enable. SQLScript to enable DDL triggers
To improve the performance of DDL triggers, you can use sysdba to execute the ddl_pin script SQL>@ Ddl_pin <DDL_user>The script will fix the PL/SQL package used by the DDL trigger to the memory. It depends on the dbms_shared_pool system package. Use ddl_pin to confirm that the package has been installed.