How do I restore the primary main database in a redundant system?

Purpose

The following steps describe how to restore the primary main database in a redundant NFM-P system using a backup file set created on the same station. The station is called the primary database station in the procedure.

To regain main database redundancy after a database restore, you must reinstantiate the primary database on the standby database station. See How do I reinstantiate the main database from the client GUI? and How do I reinstantiate the main database from a CLI? for information.

You require the following:

  • a main database backup file set from the same NFM-P release

  • the original file path of the database backup

Note: You require the following user privileges:

  • main server — root, nsp

  • main database — root, Oracle management user

Note: The Oracle management user requires read and write permissions on the backup directory. The user and group names are specified during database installation; the default is ‘oracle’ in the ‘dba’ group.

Steps
 

If the database backup file set is on the primary database station, copy the file set to a different station for safekeeping.


Stop the standby main server.

  1. Log in to the standby main server station as the nsp user.

  2. Open a console window.

  3. Enter the following:

    bash$ cd /opt/nsp/nfmp/server/nms/bin ↵

  4. Enter the following:

    bash$ ./nmsserver.bash stop ↵

  5. Enter the following to display the server status:

    bash$ ./nmsserver.bash appserver_status ↵

    The server status is displayed; the server is fully stopped if the status is the following:

    Application Server is stopped

    If the server is not fully stopped, wait five minutes and then repeat this step. Do not perform the next step until the server is fully stopped.


Enter the following to switch to the root user:

bash$ su ↵


Enter the following to disable the automatic main server startup.

systemctl disable nfmp-main.service ↵


Stop the standby database:

  1. Log in to the standby database station as the root user.

  2. Open a console window.

  3. Enter the following to stop the Oracle proxy:

    systemctl stop nfmp-oracle-proxy.service ↵

  4. Enter the following to stop the database:

    systemctl stop nfmp-main-db.service ↵


Stop the primary main server.

  1. Log in to the primary main server station as the nsp user.

  2. Open a console window.

  3. Enter the following:

    bash$ cd /opt/nsp/nfmp/server/nms/bin ↵

  4. Enter the following:

    bash$ ./nmsserver.bash stop ↵

  5. Enter the following to display the server status:

    bash$ ./nmsserver.bash appserver_status ↵

    The server status is displayed; the server is fully stopped if the status is the following:

    Application Server is stopped

    If the server is not fully stopped, wait five minutes and then repeat this step. Do not perform the next step until the server is fully stopped.


Enter the following to switch to the root user:

bash$ su ↵


Enter the following to disable the automatic main server startup.

systemctl disable nfmp-main.service ↵


If you are restoring the database on a new station, for example, if the current primary database station is unusable, go to Step 15.


10 

Log in to the primary database station as the root user.


11 

Open a console window.


12 

Enter the following to uninstall the primary database:

dnf remove nsp-nfmp-main-db --setopt=clean_requirements_on_remove=false ↵

The dnf utility displays the following prompt:

Installed size: nn G 

Is this ok [y/N]: 


13 

Enter y. The following is displayed:

Downloading packages:

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

Uninstalling the NFM-P Database...

When the uninstallation is complete, the following is displayed:

Complete!


14 

When the uninstallation is complete, enter the following to reboot the primary database station:

systemctl reboot ↵

The station reboots.


15 

Log in as the root user on the primary database station.


16 

Open a console window.


17 

Remove any files in the /opt/nsp/nfmp/db/tablespace and /opt/nsp/nfmp/db/archivelog directories.


18 

Copy the database backup file set to the primary database station.

Note: The path to the backup file set must be the same as the path to the file set at creation time.


19 

If you are restoring the database on a new station, for example, if the current primary database station is unusable, download or copy the following files for the installed NFM-P release to an empty directory on the database station:

  • nsp-nfmp-jre-R.r.p-rel.v.rpm

  • nsp-nfmp-config-R.r.p-rel.v.rpm

  • nsp-nfmp-oracle-R.r.p-rel.v.rpm

  • nsp-nfmp-main-db-R.r.p-rel.v.rpm

  • OracleSw_PreInstall.sh

where

R.r.p is the NSP release identifier, in the form MAJOR.minor.patch

v is a version identifier


20 

Navigate to the directory that contains the NFM-P installation files.


21 

Enter the following:

chmod +x * ↵


22 

Enter the following:

./OracleSw_PreInstall.sh ↵

Note: The default values displayed by the script are shown as [default]. To accept a default value, press ↵.

The following prompt is displayed:

This script will prepare the system for a new install/restore of an NFM-P Version R.r Rn database.

Do you want to continue? [Yes/No]:


23 

Enter Yes. The following prompt is displayed:

Enter the Oracle dba group name [group]:


24 

Enter a group name and press ↵.

Note: To reduce the complexity of subsequent software upgrades and technical support activities, it is recommended that you accept the default.

The following message is displayed:

Creating group group if it does not exist...

If you specify a new group, the following message is displayed:

done


25 

If you specify an existing group, the following prompt is displayed:

WARNING: Group group already exists locally.

Do you want to use the existing group? [Yes/No]:

Perform one of the following.

  1. Enter Yes ↵.

  2. Enter No ↵. Go to Step 24 .


26 

If the default user exists in the specified group, the following prompt is displayed:

The user [username] for the group [group] already exists locally.

Do you want to use the existing user? [Yes/No]:


27 

Perform one of the following.

  1. Enter Yes ↵; the following messages are displayed:

    Checking or Creating the Oracle user home directory /opt/nsp/nfmp/oracle19...

    Checking user username...

    WARNING: Oracle user with the specified name already exists locally.

    Redefining the primary group and home directory of user username ... usermod: no changes

    Changing ownership of the directory /opt/nsp/nfmp/oracle19 to username:group.

    About to unlock the UNIX user [username]

    Unlocking password for user username

    passwd: Success

    Unlocking the UNIX user [username] completed

  2. Enter No ↵. The following prompt is displayed:

    Enter the Oracle user name:

    Type a username and press ↵.

    The following messages and prompt are displayed:

    Oracle user [username] new home directory will be [/opt/nsp/nfmp/oracle19].

    Checking or Creating the Oracle user home directory /opt/nsp/nfmp/oracle19..

    Checking user username...

    Adding username...

    Changing ownership of the directory /opt/nsp/nfmp/oracle19 to username:group.

    About to unlock the UNIX user [username]

    Unlocking password for user username.

    passwd: Success

    Unlocking the UNIX user [username] completed

    Please assign a password to the UNIX user username ..

    New Password:


28 

Perform one of the following.

  1. If you specify a new user in Step 27 , the following prompt is displayed:

    Please assign a password to the UNIX user username ..

    New Password:

    Perform the following steps.

    1. Type a password and press ↵. The following prompt is displayed:

      Re-enter new Password:

    2. Retype the password and press ↵. The following message is displayed if the password update is successful:

      passwd: password successfully changed for username

  2. If you specify an existing user in Step 27 , the following prompt is displayed:

    Do you want to change the password for the UNIX user username? [Yes/No]:

    Type No ↵.


29 

The following prompt is displayed:

Specify whether an NFM-P server will be installed on this workstation.

The database memory requirements will be adjusted to account for the additional load.

Will the database co-exist with an NFM-P server on this workstation [Yes/No]:

Enter Yes or No, as required, and press ↵.

Messages like the following are displayed as the script execution completes:

INFO: About to set kernel parameters in /etc/sysctl.conf...

INFO: Completed setting kernel parameters in /etc/sysctl.conf...

INFO: About to change the current values of the kernel parameters

INFO: Completed changing the current values of the kernel parameters

INFO: About to set ulimit parameters in /etc/security/limits.conf...

INFO: Completed setting ulimit parameters in /etc/security/limits.conf...

INFO: Completed running Oracle Pre-Install Tasks


30 

When the script execution is complete, enter the following to reboot the database station:

systemctl reboot ↵

The station reboots.


31 

When the reboot is complete, log in as the root user on the primary database station.


32 

Navigate to the directory that contains the NFM-P installation files.


33 

Perform one of the following:

  1. If you are restoring the database on the same station, enter the following:

    dnf install nsp-nfmp-main-db* ↵

  2. If you are restoring the database on a new station, enter the following:

    dnf install *.rpm ↵

The dnf utility resolves any package dependencies, and displays the following prompt:

Total size: nn G

Installed size: nn G 

Is this ok [y/d/N]: 


34 

Enter y. The following and the installation status are displayed as each package is installed:

Downloading packages:

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

The package installation is complete when the following is displayed:

Complete!


35 

If the backup set is compressed as a tar file, you can obtain the absolute path of the database backup file set from the BACKUP_SUMMARY.INFO file. Perform the following to extract the BACKUP_SUMMARY.INFO file from the tar file:

tar -xvf path BACKUP_SUMMARY.INFO

where path is the absolute path of the compressed database backup file


36 

Perform one of the following.

  1. If you are restoring the primary database on the same station, enter the following:

    samrestoreDb path

    where path is the absolute path of the directory that contains the database backup file set

  2. If you are restoring the database on a new primary database station, enter the following:

    samrestoreDb path -standbyinstance instance -standbyip IP_address

where

path is the absolute path of the directory that contains the database backup file set

instance is the standby database instance name

IP_address is the standby database IP address

The database restore begins.

If the backup file set has been created using file compression, messages like the following are displayed.

About to uncompress backup files under path

Completed uncompressing backup files under path

Messages like the following are displayed as the restore progresses.

Restore log is /opt/nsp/nfmp/db/install/NFM-P_Main_Database.restore.yyyy.mm.dd-hh.mm.ss.stdout.txt

<date time> working..

<date time> Performing Step 1 of 7 - Initializing ..

<date time> Executing StartupDB.sql ...

<date time> Performing Step 2 of 7 - Extracting backup files .....

<date time> Performing Step 3 of 7 - Restoring archive log files ..

<date time> Performing Step 4 of 7 - Executing restore.rcv ..........

<date time> Performing Step 5 of 7 - Restoring Accounting tablespaces .......

<date time> Performing Step 6 of 7 - Opening database .....

<date time> working....

<date time> Executing ConfigRestoreDB.sql ....................

<date time> working...............

<date time> Performing Step 7 of 7 - Configuring SAM Server settings ...

The following is displayed when the restore is complete:

<date time> Database restore was successful

DONE


37 

When the database restore is complete, close the console window.


38 

Log in to the primary main server station as the root user.


39 

Enter the following to enable the automatic main server startup:

systemctl enable nfmp-main.service ↵


40 

Start the primary main server.

  1. Enter the following to switch to the nsp user

    su - nsp ↵

  2. Enter the following:

    bash$ cd /opt/nsp/nfmp/server/nms/bin ↵

  3. Enter the following:

    bash$ ./nmsserver.bash start ↵

  4. Enter the following to display the server status:

    bash$ ./nmsserver.bash appserver_status ↵

    The server status is displayed; the server is fully initialized if the status is the following:

    Application Server process is running.  See nms_status for more detail.

    If the server is not fully initialized, wait five minutes and then repeat this step. Do not perform the next step until the server is fully initialized.


41 

Perform a full resynchronization of the network to discover the interim changes in the managed network.


42 

Start the standby database.

  1. Log in to the standby main database station as the root user.

  2. Enter the following to start the Oracle proxy:

    systemctl start nfmp-oracle-proxy.service ↵

  3. Enter the following to start the database:

    systemctl start nfmp-main-db.service ↵


43 

Log in to the standby main server station as the root user.


44 

Enter the following to enable the automatic main server startup:

systemctl enable nfmp-main.service ↵


45 

Start the standby main server.

  1. Enter the following to switch to the nsp user

    su - nsp ↵

  2. Enter the following:

    bash$ cd /opt/nsp/nfmp/server/nms/bin ↵

  3. Enter the following:

    bash$ ./nmsserver.bash start ↵

  4. Enter the following to display the server status:

    bash$ ./nmsserver.bash appserver_status ↵

    The server status is displayed; the server is fully initialized if the status is the following:

    Application Server process is running.  See nms_status for more detail.

    If the server is not fully initialized, wait five minutes and then repeat this step. Do not perform the next step until the server is fully initialized.


46 

To restore the database redundancy, reinstantiate the primary database on the standby database station, as described in How do I reinstantiate the main database from the client GUI? or   How do I reinstantiate the main database from a CLI?.

End of steps