@@ -10,4 +10,137 @@ Configure Migration Prerequisites for Oracle
1010 :depth: 1
1111 :class: singlecol
1212
13- Oracle.
13+ To run sync jobs from an Oracle source database, the database may require
14+ some configuration changes. If Relational Migrator determines the
15+ database needs configuration changes, it automatically generates a
16+ SQL script with the required changes. It is recommended to have a
17+ Database Administrator (DBA) review the commands in this script and
18+ perform their execution on the database server. The
19+ Oracle configurations depend on the type of sync job:
20+
21+ .. include:: /includes/fact-short-sync-job-desc.rst
22+
23+ For details on supported versions of Oracle, see
24+ :ref:`supported-databases`.
25+
26+ About this Task
27+ ---------------
28+
29+ - If your migrating from an Oracle 12c instance, you must run commands as
30+ the SYSDBA role.
31+ - In Oracle 12c the concept of a pluggable database was introduced. Some
32+ of these commands can be run on PDB(plugable database) while commands
33+ such as enabling ``ARCHIVELOG`` must be run on the
34+ CDB(container/master database). For details on each architecture,
35+ see `Overview of Container Databases and Pluggable Databases
36+ <https://oracle-base.com/articles/12c/multitenant-overview-container-database-cdb-12cr1>`__.
37+ - Supplemental logging is not allowed in Oracle Express editions.
38+
39+ Steps
40+ -----
41+
42+ .. tabs::
43+
44+ .. tab:: Snapshot Jobs
45+ :tabid: enable-snapshot-jobs
46+
47+ .. procedure::
48+ :style: normal
49+
50+ .. step:: Set up user permissions
51+
52+ .. include:: /includes/fact-data-prep-oracle-step1.rst
53+
54+ .. tab:: Continuous Jobs
55+ :tabid: enable-continuous-jobs
56+
57+ .. procedure::
58+ :style: normal
59+
60+ .. step:: Set up user permissions
61+
62+ .. include:: /includes/fact-data-prep-oracle-step1.rst
63+
64+ c. Grant additional permissions to the service account
65+ to run continuous sync jobs:
66+
67+ .. code-block:: sql
68+ :copyable: true
69+
70+ GRANT SET CONTAINER TO <user>;
71+ GRANT EXECUTE_CATALOG_ROLE TO <user>;
72+ GRANT SELECT ANY TRANSACTION TO <user>;
73+ GRANT LOGMINING TO <user>;
74+ GRANT CREATE TABLE TO <user>;
75+ GRANT LOCK <table> TO <user>;
76+ GRANT CREATE SEQUENCE TO <user>;
77+ GRANT SELECT ON DBA_TABLESPACES TO <user>;
78+ GRANT EXECUTE ON DBMS_LOGMNR TO <user>;
79+ GRANT EXECUTE ON DBMS_LOGMNR_D TO <user>;
80+ GRANT SELECT ON V_$LOG TO <user>;
81+ GRANT SELECT ON V_$LOG_HISTORY TO <user>;
82+ GRANT SELECT ON V_$LOGMNR_LOGS TO <user>;
83+ GRANT SELECT ON V_$LOGMNR_CONTENTS TO <user>;
84+ GRANT SELECT ON V_$LOGMNR_PARAMETERS TO <user>;
85+ GRANT SELECT ON V_$LOGFILE TO <user>;
86+ GRANT SELECT ON V_$ARCHIVED_LOG TO <user>;
87+ GRANT SELECT ON V_$ARCHIVE_DEST_STATUS TO <user>;
88+ GRANT SELECT ON V_$TRANSACTION TO <user>;
89+
90+ .. step:: Turn on ``LogMiner`` at the database level
91+
92+ To run continous jobs against Oracle, you must enable
93+ ``LogMiner`` at the database level. The following code-block
94+ is an example of automatically-generated code, which you
95+ can run manually by substituting your database name:
96+
97+ .. code-block:: sql
98+ :copyable: true
99+
100+ ALTER SYSTEM SET db_recovery_file_dest_size = 10G;
101+ ALTER SYSTEM SET db_recovery_file_dest = '/opt/oracle/oradata/recovery_area' SCOPE=spfile;
102+ SHUTDOWN IMMEDIATE;
103+ STARTUP MOUNT
104+ ALTER DATABASE ARCHIVELOG;
105+ ALTER DATABASE OPEN;
106+
107+ .. tip::
108+
109+ To check if ``LogMiner`` is already enabled, run the
110+ following query:
111+
112+ .. code-block:: sql
113+ :copyable: true
114+
115+ SELECT LOG_MODE FROM V_$DATABASE;
116+
117+ .. step:: Enable supplemental logging
118+
119+ a. To run continuous sync jobs against Oracle, you must
120+ enable supplemental logging at the database level:
121+
122+ .. code-block:: sql
123+ :copyable: true
124+
125+ ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
126+
127+ #. You must also enable supplemental logging for every
128+ table in the migration:
129+
130+ .. code-block:: sql
131+ :copyable: true
132+
133+ ALTER TABLE schemaName.tableName ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;
134+ /* Additional ALTER TABLE STATEMENTS... */
135+
136+ Learn More
137+ ----------
138+
139+ - Relational Migrator relies on the open-source Debezium connector to
140+ capture row-level changes. For more details, see `Debezium Oracle
141+ <https://debezium.io/documentation/reference/stable/connectors/oracle.html#_preparing_the_databas>`__
142+ - For details on enabling archive logging, see `Managing Archived Redo Logs
143+ <https://docs.oracle.com/cd/B19306_01/server.102/b14231/archredo.htm>`__.
144+ - For additional troubleshooting and debugging information, see the
145+ `Debezium Oracle help blog post
146+ <https://debezium.io/blog/2022/09/30/debezium-oracle-series-part-1/#configure-oracle-users>`__.
0 commit comments