Questo contenuto non è disponibile nella lingua selezionata.
13.8.7. Migrating from an External Oracle Database to an External PostgreSQL Database
The requirements to migrate from an External Oracle Database to an External PostgreSQL database:
- A complete installation of Red Hat Satellite server (
satellite.example.com) using an External Oracle Database (oracledb.example.com). - A system hosting a running instance of PostgreSQL (
postgresql.example.com), See Section 4.3.1.1, “PostgreSQL Database Requirements” for configuration details.
Procedure 13.8. Migrating to an External Database from Oracle Database
- Shut down all services on the Red Hat Satellite server:
rhn-satellite stop
[root@satellite ~]# rhn-satellite stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Make sure your External Oracle Database is still running.
- Remove the
rhn-upgradeif it exists on your server:yum remove rhn-upgrade
[root@satellite ~]# yum remove rhn-upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Update the External Oracle Database to the latest schema version:
yum update satellite-schema spacewalk-schema-upgrade
[root@satellite ~]# yum update satellite-schema [root@satellite ~]# spacewalk-schema-upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow This ensures that your database version matches the latest version for the External Database. - Create a directory to hold your database snapshot.
mkdir ~/dbbackup cd ~/dbbackup
[root@satellite ~]# mkdir ~/dbbackup [root@satellite ~]# cd ~/dbbackupCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Export the database using
spacewalk-dump-schema:spacewalk-dump-schema --to=postgresql > migrate-to-postgresql.sql
[root@satellite dbbackup]# spacewalk-dump-schema --to=postgresql > migrate-to-postgresql.sqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Stop the External Oracle Database. It is no longer required.
- Exchange the Oracle drivers and configuration scripts with the PostgreSQL drivers and configuration scripts on the Satellite server:
yum remove -y spacewalk-oracle yum install -y spacewalk-postgresql yum remove -y spacewalk-java-oracle spacewalk-backend-sql-oracle
[root@satellite dbbackup]# yum remove -y spacewalk-oracle [root@satellite dbbackup]# yum install -y spacewalk-postgresql [root@satellite dbbackup]# yum remove -y spacewalk-java-oracle spacewalk-backend-sql-oracleCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Use
spacewalk-setupto populate the External Database:spacewalk-setup --db-only --external-postgresql
[root@satellite dbbackup]# spacewalk-setup --db-only --external-postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow The script asks for your database details so Satellite can connect and populate the database. Enter your External PostgreSQL Database details:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - When the script completes database population, restore the database schema
spacewalk-sql -i < migrate-to-postgresql.sql
[root@satellite dbbackup]# spacewalk-sql -i < migrate-to-postgresql.sqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Start Red Hat Satellite.
rhn-satellite start
[root@satellite ~]# rhn-satellite startCopy to Clipboard Copied! Toggle word wrap Toggle overflow
The database is now migrated from an External Oracle Database to an External PostgreSQL Database.