The SharePlex utilities help you configure, test, and manage the SharePlex environment.
The SharePlex utilities help you configure, test, and manage the SharePlex environment.
SharePlex provides the following scripts to automate the building of a configuration file to specify Oracle source objects.
Oracle to Oracle
The config.sql script enables you to build a configuration that lists all of the tables, and optionally all of the sequences, in all of the schemas of a database. This script saves time when establishing a high-availability replication strategy or other scenario where you want the entire database to be replicated to an identical secondary database.
Source and target table names must be the same.
To run config.sql:
Change directories to the config sub-directory of the SharePlex variable-data directory. The config.sql script puts configurations in the current working directory, and SharePlex configurations must reside in the config sub-directory.
cd /vardir/config
Run config.sql using the full path from the util sub-directory of the SharePlex product directory.
@ /proddir/util/config.sql
Refer to the following table when following the prompts:
Prompt | What to enter |
---|---|
Target machine | The name of the target machine, for example SystemB. |
Source database SID | The ORACLE_SID of the source (primary) Oracle instance, for example oraA. Do not include the o. keyword. The ORACLE_SID is case-sensitive. |
Target database SID | The ORACLE_SID of the target (destination) Oracle instance, for example oraB. Do not include the o. keyword. The ORACLE_SID is case-sensitive. |
Replicate sequences | Enter y to replicate sequences or n not to replicate sequences. |
SharePlex oracle username | The name of the SharePlex user in the source database. This entry prevents the SharePlex schema from being replicated, which would cause replication problems. If a valid name is not provided, the script fails. |
Note: The name assigned by SharePlex to the configuration is config.file. If you run the script again to create another configuration file, it overwrites the first file. To preserve the original file, rename it before you create the second one.
Next steps:
If any tables or owners are case-sensitive, open the configuration file with the edit config command in sp_ctrl, then use the text editor to enclose case-sensitive table and owner names within double-quote marks, for example “scott”.“emp”. The script does not add the quote marks required by Oracle to enforce case-sensitivity.
sp_ctrl> edit config filename
To ensure that the configuration is in the correct location, issue the list config command. If the name of the configuration is not shown, it was created in the wrong directory. Find the file and move it to the config sub-directory of the variable-data directory.
sp_ctrl> list config
The build_config.sql script enables you to build a configuration that contains multiple (or all) tables in a schema. It is an interactive script that prompts for each component of the configuration step by step. Instead of entering the information for each object and the routing individually, you can use a wildcard to select certain tables at once, or you can select all of the tables in the schema.
To run build_config.sql:
Change directories to the config sub-directory of the SharePlex variable-data directory. The build_config.sql script puts configurations in the current working directory, and SharePlex configurations must reside in the config sub-directory.
cd /vardir/config
Run build_config.sql using the full path from the util sub-directory of the SharePlex product directory.
@ /proddir/util/build_config.sql
Refer to the following table when following the prompts.
Prompt | What to enter |
---|---|
Target machine | The name of the target machine, for example SystemB. |
Source database SID | The ORACLE_SID of the source (primary) Oracle instance, for example oraA. Do not include the o. keyword. The ORACLE_SID is case-sensitive. |
Target database SID | The ORACLE_SID of the target (destination) Oracle instance, for example oraB. Do not include the o. keyword. The ORACLE_SID is case-sensitive. |
Owner of the source database tables | The owner of the source tables. |
Owner of the target database tables | The owner of the target tables. |
Table name to include (blank for all) |
Do one of the following:
|
Name of the output file to create | A name for the configuration. The script gives the file a .lst suffix, for example Scott_config.lst. |
Next steps:
If any tables or owners are case-sensitive, open the configuration with the edit config command in sp_ctrl, then use the text editor to enclose case-sensitive table and owner names within double-quote marks, for example “scott”.“emp”. The script does not add the quote marks required by Oracle to enforce case-sensitivity.
sp_ctrl> edit config filename
To ensure that the configuration is in the correct location, issue the list config command. If the name of the configuration is not shown, it was created in the wrong directory. Find the file and move it to the config sub-directory of the variable-data directory.
sp_ctrl> list config
SharePlex provides the following scripts to automate the building of a configuration file to specify on-prem PostgreSQL and PostgreSQL Database as a Service source objects.
PostgreSQL to PostgreSQL
The pg_config.sql script enables you to build a configuration that lists all of the tables, and optionally all of the sequences, in all of the schemas of a database. This script saves time when establishing a high-availability replication strategy or other scenario where you want the entire database to be replicated to an identical secondary database.
Source and target table names must be the same.
To run pg_config.sql:
Change directories to the config sub-directory of the SharePlex variable-data directory. The pg_config.sql script puts configurations in the current working directory, and SharePlex configurations must reside in the config sub-directory.
cd /vardir/config
Run pg_config.sql using the full path from the util sub-directory of the SharePlex product directory.
\i proddir/util/pg_config.sql
Refer to the following table when following the prompts:
Prompt | What to enter |
---|---|
Target machine | The name of the target machine, for example SystemB. |
Source database name | The database name of the source (primary) PostgreSQL instance, for example dbnameA. Do not include the r. keyword. The database name is case-sensitive. |
Target database name | The database name of the target (destination) PostgreSQL instance, for example dbnameB. Do not include the r. keyword. The database name is case-sensitive. |
SharePlex PostgreSQL user name | The name of the SharePlex user in the source database. This entry prevents the SharePlex schema from being replicated, which would cause replication problems. If a valid name is not provided, the script fails. |
Note: The name assigned by SharePlex to the configuration is pg_config.file. If you run the script again to create another configuration file, it overwrites the first file. To preserve the original file, rename it before you create the second one.
Next steps:
If any tables or schemas are case-sensitive, open the configuration file with the edit config command in sp_ctrl, then use the text editor to enclose case-sensitive table and schema names within double-quote marks, for example “SCOTT”.“EMP”. The script does not add the quote marks required by PostgreSQL to enforce case-sensitivity.
sp_ctrl> edit config filename
To ensure that the configuration is in the correct location, issue the list config command. If the name of the configuration is not shown, it was created in the wrong directory. Find the file and move it to the config sub-directory of the variable-data directory.
sp_ctrl> list config
The build_config.sql script enables you to build a configuration that contains multiple (or all) tables in a schema. It is an interactive script that prompts for each component of the configuration step by step. Instead of entering the information for each object and the routing individually, you can use a wildcard to select certain tables at once, or you can select all of the tables in the schema.
To run pg_build_config.sql:
Change directories to the config sub-directory of the SharePlex variable-data directory. The pg_build_config.sql script puts configurations in the current working directory, and SharePlex configurations must reside in the config sub-directory.
cd /vardir/config
Run pg_build_config.sql using the full path from the util sub-directory of the SharePlex product directory.
\i proddir/util/pg_build_config.sql
Refer to the following table when following the prompts.
Prompt | What to enter |
---|---|
Target machine | The name of the target machine, for example SystemB. |
Source database name | The database name of the source (primary) PostgreSQL instance, for example dbnameA. Do not include the r. keyword. The database name is case-sensitive. |
Target database name | The database name of the target (destination) PostgreSQL instance, for example dbnameB. Do not include the r. keyword. The database name is case-sensitive. |
Source database schema | Name of the source database schema. |
Target database schema | Name of the target database schema. |
Table name to include (blank for all) |
Do one of the following:
|
Name of the output file to create | A name for the configuration. |
Next steps:
If any tables or schemas are case-sensitive, open the configuration with the edit config command in sp_ctrl, then use the text editor to enclose case-sensitive table and schema names within double-quote marks, for example “SCOTT”.“EMP”. The script does not add the quote marks required by PostgreSQL to enforce case-sensitivity.
sp_ctrl> edit config filename
To ensure that the configuration is in the correct location, issue the list config command. If the name of the configuration is not shown, it was created in the wrong directory. Find the file and move it to the config sub-directory of the variable-data directory.
sp_ctrl> list config
Use the cleanup.sql script to truncate all of the SharePlex internal tables except the SHAREPLEX_PARTITION table (which contains partition schemes that might be needed again).
Note: The cleanup.sql script does not remove the SharePlex Oracle user, password, or demonstration objects from the SharePlex tables.
The cleanup.sql script preserves the replication data in the SharePlex variable-data directory. Other utilities provide related options:
Contact Quest Technical Support before running cleanup.sql for the first time. Unless a procedure in the SharePlex documentation requires running clean_vardir.sh, this utility rarely is appropriate in a production environment. It deactivates the configuration, and using it improperly can result in replication problems and the need to resynchronize the data. Usually, there is another alternative.
Oracle on Unix
To run cleanup.sql:
Log into Oracle as the SharePlex database user. The SharePlex tables belong to that user. On Unix and Linux, If you are running multiple instances of sp_cop with multiple variable-data directories, there is a SharePlex Oracle user for each one. Make certain to run this script as the correct one.
(Unix and Linux) Set the SP_SYS_VARDIR environment variable to point to the SharePlex variable-data directory.
ksh shell:
export SP_SYS_VARDIR=/full_path_of_variable-data_directory
csh shell:
setenv SP_SYS_VARDIR=/full_path_of_variable-data_directory
Run cleanup.sql as a SharePlex Administrator. The script is in the bin sub-directory of the SharePlex product directory. Use the following syntax, where Oracle_version is one of the SharePlex-supported Oracle versions.
SQL> @proddir/bin/cleanup.sql
© ALL RIGHTS RESERVED. Termini di utilizzo Privacy Cookie Preference Center