Search

13.8.3. Migrating from an Embedded Database to an External Oracle Database

download PDF
The requirements to migrate from Embedded to an External Oracle Database:
  • A complete installation of Red Hat Satellite server with an Embedded Database (satellite.example.com)
  • A system hosting a running instance of Oracle Database (oracledb.example.com). See Section 4.3.1, “External Database Requirements” for configuration details.

Procedure 13.4. Migrating to an External Oracle Database

  1. Shut down all services on the Red Hat Satellite server, but start the Embedded Database with db-control:
    [root@satellite ~]# rhn-satellite stop
    [root@satellite ~]# db-control start
    
  2. Remove the rhn-upgrade if it exists on your server:
    [root@satellite ~]# yum remove rhn-upgrade
    
  3. Update your database to the latest schema version:
    [root@satellite ~]# yum update satellite-schema
    [root@satellite ~]# spacewalk-schema-upgrade
    
    This ensures that your database version matches the latest version on the External Oracle Database.
  4. Create a directory to hold your database snapshot.
    [root@satellite ~]# mkdir ~/dbbackup
    [root@satellite ~]# cd ~/dbbackup
    
  5. Export the database using spacewalk-dump-schema:
    [root@satellite dbbackup]# spacewalk-dump-schema --to=oracle > migrate-to-oracle.sql
    
  6. Stop the Embedded Database:
    [root@satellite dbbackup]# db-control stop
    
  7. Exchange the PostgreSQL drivers and configuration scripts with the Oracle drivers and configuration scripts on the Satellite server:
    [root@satellite dbbackup]# yum remove -y spacewalk-postgresql
    [root@satellite dbbackup]# yum install -y spacewalk-oracle
    [root@satellite dbbackup]# yum remove -y spacewalk-java-postgresql spacewalk-backend-sql-postgresql
    
  8. Use spacewalk-setup to populate the External Oracle Database:
    [root@satellite dbbackup]# spacewalk-setup --db-only --external-oracle
    
    The script asks for your database details so Satellite can connect and populate the database. Enter your External Oracle Database details:
    ** Database: Setting up database connection for Oracle backend.
    Database service name (SID)? oracledb
    Database hostname [localhost]? oracledb.example.com
    Database (listener) port [1521]?
    
    The script populates the database.

    Important

    Use the default Oracle Database port (1521) for the Red Hat Satellite database. Using an alternative port can cause SELinux errors.
  9. When the script completes database population, restore the database schema
    [root@satellite dbbackup]# spacewalk-sql -i < migrate-to-oracle.sql
    

    Important

    You might need to change SELinux context of the migration script before loading it into Oracle Database:
    [root@satellite dbbackup]# semanage fcontext -a -t oracle_sqlplus_exec_t /root/dbbackup/migrate-to-oracle.sql
    [root@satellite dbbackup]# restorecon -v /root/dbbackup/migrate-to-oracle.sql
    
    Similarly, you might need to change SELinux context of dumped tables:
    [root@satellite dbbackup]# semanage fcontext -a -t oracle_tmp_t "/tmp/dumped-tables(/.*)?"
    [root@satellite dbbackup]# restorecon -R -v /tmp/dumped-tables/
    
  10. Remove the postgresql92-server and spacewalk-dobby packages from the Satellite server.
    [root@satellite ~]# yum remove postgresql92-server spacewalk-dobby
    
  11. Start Red Hat Satellite.
    [root@satellite ~]# rhn-satellite start
    
The database is now migrated from an Embedded Database to an External Oracle Database.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.