Notebook solution utilizing dataproc templates for migrating databases from Oracle to Cloud Spanner. It contains step by step process for migrating Oracle database to Cloud Spanner.
Refer Setup Vertex AI - PySpark to setup new Jupyter notebook in vertexAI.
Once the setup is done navigate to /notebooks/oracle2spanner
folder and open
OracleToSpanner_notebook.
This notebook is built on top of:
- Vertex AI Jupyter Notebook
- Google Cloud's Dataproc Serverless
- Dataproc Templates which are maintained in this github project.
- Automatically discovers all the Oracle tables.
- Can automatically generates table schema in Cloud Spanner, corresponding to each table.
- Divides the migration into multiple batches and automatically computes metadata.
- Parallely migrates mutiple Oracle tables to Cloud Spanner.
- Simple, easy to use and customizable.
Below configurations are required before proceeding further.
PROJECT
: GCP project-idREGION
: GCP regionGCS_STAGING_LOCATION
: Cloud Storage staging location to be used for this notebook to store artifactsSUBNET
: VPC subnetJARS
: List of jars. For this notebook Oracle connector jar is required in addition with the Dataproc template jarsMAX_PARALLELISM
: Parameter for number of jobs to run in parallel default value is 5
ORACLE_HOST
: Oracle instance ip addressORACLE_PORT
: Oracle instance portORACLE_USERNAME
: Oracle usernameORACLE_PASSWORD
: Oracle passwordORACLE_DATABASE
: Name of database/service for Oracle connectionORACLE_TABLE_LIST
: List of tables you want to migrate eg: ['table1','table2'] else provide an empty list for migration whole database eg : []SPANNER_OUTPUT_MODE
: <Append | Overwrite>SPANNER_INSTANCE
: Cloud Spanner instance nameSPANNER_DATABASE
: Cloud Spanner database nameSPANNER_TABLE_PRIMARY_KEYS
: Provide dictionary of format {"table_name":"primary_key"} for tables which do not have primary key in Oracle
This notebook requires the Oracle connector jar. Installation information is present in the notebook
- Does not work with Cloud Spanner's Postgresql Interface