Cool Solutions

How to Migrate the ZENworks Oracle Database to a New Oracle Database Server

Ravish G

By:

February 25, 2016 1:15 pm

Reads:3,057

Comments:0

Score:Unrated

Print/PDF

This document explains how to migrate a ZENworks Oracle database to a new installation of the Oracle database server.

Scenario

You might want to migrate to another Oracle database server in the following scenarios:

  • A higher capacity server is required for better performance due to the increase in the database load.
  • A newer version of Oracle is available.

Overview

This Migration is a two step process:

  • Migrating the ZCM Database from the existing Oracle database to the new Oracle database system
  • Configuring the ZENworks Server to point to the new Oracle database

Migrating the ZENworks database from the existing Oracle database to the new Oracle database system

Steps to be performed on the existing database system:

  1. Create a directory named backup by running the mkdir c:\backup
  2. Connect to the source database as a system user through SQL*Plus and execute the following command:

Create directory BACKUP as ‘c:\backup’;

         Grant all on directory BACKUP to <<PARTICULAR USER/PUBLIC>>;

  1. Run the following command to identify users:

select * from all_users order by 3;

   4. To identify the table space names, log into the database as a ZENworks user and        then as a ZENworks Audit user and run the following command:

   select tablespace_name from user_tablespaces

5. At the command prompt execute the following commands :

If source is 11g.x.x:                                                                                                                      expdp  system/password[@sid] SCHEMAS=ZENUSER DIRECTORY= BACKUP LOGFILE=ZENUSER.log DUMPFILE=ZENUSER.DMP            

                 expdp  system/password[@sid] SCHEMAS=ZENAUDUSER DIRECTORY= BACKUP LOGFILE=ZENAUDUSER.log DUMPFILE=ZENAUDUSER.DMP

If source is 12c and above:                                                                                            expdp system/password@//localhost:port /pluggable_database_service_name SCHEMAS=ZENUSER DIRECTORY= BACKUP LOGFILE=ZENUSER.log DUMPFILE=ZENUSER.DMP                                                                                     expdp system/password@//localhost:port /pluggable_database_service_name SCHEMAS=ZENAUDUSER DIRECTORY= BACKUP LOGFILE=ZENAUDUSER.log DUMPFILE=ZENAUDUSER.DMP

6. Copy the ZENUSER.DMP and the ZENAUDUSER.DMP dump files to the        destination system. Example: c:\backup.

Steps to be performed on the destination database system:

  1. Connect to the new database as a system user.
  2. (Applicable only for Oracle 12c) After the server is restarted, execute the following commands to mount the pluggable database [to open the pluggable database automatically whenever System/service is restarted]

create or replace trigger Sys. After_Startup
after startup on database
begin
execute immediate ‘alter pluggable database all open’;
end;
 /

  1. Connect to the database with the net service name as pluggable_database_service_name and run the following commands:

GRANT ALL ON DBMS_REDEFINITION to system WITH GRANT OPTION;
GRANT ALL ON DBMS_DDL to system WITH GRANT OPTION;

  1. Connect to the PLUGGABLE DATABASE using SQL*Plus as system and run the following command to point to the backup folder that was copied from the source database system (Example: c:\backup):

Create directory BACKUP as ‘C:\backup’;

          Grant all on directory BACKUP to <<PARTICULAR USER/PUBLIC>>;

  1. Create the table space names that were noted from the source database. Example: ZENTABTS, ZENINDTS, AUDTABTS, and AUDINDTS.                                                 Note:   Create table spaces with sufficient disk space according to your setup. Each data file can extend up to a size of 32 GB with the default data block size. To calculate the number of data files:   Number of data files = Size of the existing database / 32GB. Make sure to add these data files in each table space for current and future use.
  1. Consider a scenario where you need 8 data files and by default each data file consumes 5MB initially and eventually grows up to 256GB. To achieve this, create a directory named c:\database and run the following commands:
CREATE TABLESPACE ZENTABTS DATAFILE
 'c:\database\ZENTABTS01.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENTABTS02.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENTABTS03.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENTABTS04.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENTABTS05.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENTABTS06.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENTABTS07.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENTABTS08.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M
 LOGGING ONLINE PERMANENT BLOCKSIZE 8192
 EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT NOCOMPRESS  
SEGMENT SPACE   MANAGEMENT AUTO;
CREATE TABLESPACE ZENINDTS DATAFILE
 'c:\database\ZENINDTS01.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENINDTS02.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENINDTS03.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENINDTS04.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENINDTS05.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENINDTS06.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENINDTS07.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\ZENINDTS08.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M
 LOGGING ONLINE PERMANENT BLOCKSIZE 8192
 EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT NOCOMPRESS  
SEGMENT SPACE MANAGEMENT AUTO;
CREATE TABLESPACE AUDTABTS DATAFILE
 'c:\database\AUDTABTS01.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\AUDTABTS02.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\AUDTABTS03.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\AUDTABTS04.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\AUDTABTS05.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\AUDTABTS06.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M
 LOGGING ONLINE PERMANENT BLOCKSIZE 8192
 EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT NOCOMPRESS  
SEGMENT SPACE MANAGEMENT AUTO;
CREATE TABLESPACE AUDINDTS DATAFILE
 'c:\database\AUDINDTS01.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\AUDINDTS02.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\AUDINDTS03.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\AUDINDTS04.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\AUDINDTS05.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M,
 'c:\database\AUDINDTS06.DBF' SIZE 5242880
 AUTOEXTEND ON NEXT 10485760 MAXSIZE 32767M
 LOGGING ONLINE PERMANENT BLOCKSIZE 8192
 EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT NOCOMPRESS  
SEGMENT SPACE MANAGEMENT AUTO;

8.   To restore data from the backup, run the following commands:

impdp system/password@//localhost:port /pluggable_database_service_name SCHEMAS=ZENUSER DIRECTORY= BACKUP LOGFILE=ZENUSER.log DUMPFILE=ZENUSER.DMP transform=segment_attributes:n

impdp system/password@//localhost:port /pluggable_database_service_name SCHEMAS=ZENAUDUSER DIRECTORY= BACKUP LOGFILE=ZENAUDUSER.log DUMPFILE=ZENAUDUSER.DMP transform=segment_attributes:n

 The new database server is ready with the imported data.

Configuring the ZENworks Server to Point to the New Oracle Database

  1. Edit the zdm.xml and the zenaudit.xml files (located in ZENworks_installation_path\conf\datamodel on Windows and in /etc/opt/novell/ zenworks/datamodel on Linux).
  • Ensure that the value of the Port Entry key is the port number on which the Oracle database is running.
  • Set the value of the Server Entry key to the IP address of the new device.
  • Set the value of the Database Entry key to the net service name of the Oracle database installed on the new device.
  1. Restart the ZENworks services:
  • For ZENworks Primary Servers running on Microsoft Windows restart the Novell ZENworks Loader and Novell ZENworks Server using the following commands:

net stop “Novell ZENworks Server” /Y

net start “Novell ZENworks Server”

net restart “Novell ZENworks Loader”

net restart “Novell ZENworks Agent Service”

  • For ZENworks Primary Servers running on Linux, restart the novell-zenloader and the novell­zenserver services using the following commands:

/etc/init.d/novell-zenloader restart

/etc/init.d/novell-zenserver restart

 

 

 

 

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.
Loading...

Tags: , ,
Categories: Technical, Unified Endpoint Management, ZENworks

0

Disclaimer: This content is not supported by Micro Focus. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

Comment

RSS