Previous Next JavaScript must be enabled to correctly display this content

## 7 Re-imaging Oracle Database Appliance

Bare metal operating system re-imaging installs Oracle Database Appliance operating system software on the local (boot) drive.

Bare Metal is a non-virtualized Oracle Database Appliance configuration. Oracle Database Appliance ships from the factory with a bare metal configuration, default ISO image and Appliance Manager installed. Use the OS ISO Image to restore the OS to the "shipped from factory" state. Use only when necessary. Reimaging does not patch the firmware or update the component versions; it only re-images the local system disk from an operating system perspective. After imaging is completed, provision the bare metal system.

- Uninstalling Oracle Database Appliance Components
  Use the Oracle Database Appliance cleanup deploy utility, `/opt/oracle/oak/onecmd/cleanup.pl` to uninstall Oracle Database Appliance components.
- Reimaging an Oracle Database Appliance Baremetal System
  Reimage Oracle Database Appliance to perform a bare metal restore of Oracle Database Appliance.
- Performing Secure Erase of Data on Storage Disks
  With this release, you can securely erase data from storage devices. Running the secure erase tool deletes the data on the storage disk permanently.
- Redeployment of Oracle Database Appliance
  Understand the process to redeploy Oracle Database Appliance.

Related Topics

- Errors when re-imaging Oracle Database Appliance

### Uninstalling Oracle Database Appliance Components

Use the Oracle Database Appliance cleanup deploy utility, `/opt/oracle/oak/onecmd/cleanup.pl` to uninstall Oracle Database Appliance components.

About the Cleanup Utility

Use the cleanup deploy utility to do the following:

- Uninstall Oracle Auto Service Request (Oracle ASR)

- Uninstall Oracle Trace File Analyzer (TFA)

- Uninstall Oracle ORAchk Health Check Tool

- Uninstall Oracle Grid Infrastructure and the Oracle stack

- Reset or delete the Oracle Linux udev rules

- Delete users and groups that were created when the appliance was created.

The script removes the firstnet config and the client access VLAN UNIX_DB, but does not delete any other VLANs. The script also resets any disabled CPU cores and enables all of the cores.

The cleanup utility runs in two modes: default and force mode. In the default mode, the commands used as part of cleanup do not use the force option. The Oracle ASM disk status is changed from MEMBER to FORMER, but ASM header on the disk is not erased. The default mode can be used only for cleaning up or re-provisioning of the same system.

Note:

For High-Availability systems, run the cleanup utility on both nodes sequentially. Ensure that the cleanup utility has completed on the first node, and then start the process on the second node.

Running the Cleanup Utility for a Baremetal Deployment

    # perl /opt/oracle/oak/onecmd/cleanup.pl [-griduser grid_user] [-dbuser db_user] [-groups comma separated list of groups] [-omausers dbuser1,dbuser2,dbuser3][-erasedata][-nodpr] [-nossh] [f]

When the grid_user and db_user are the same (`roleSeparation=false`), you must run the script for each user (`-gridUser` and `-dbUser`).

For example:

    cleanup.pl -griduser grid -dbuser oracle -omausers dbuser1,dbuser2,dbuser3

Table 7-1 Command Options for Cleanup Utility

Option | Description
--- | ---
`grid_user` | Describes the Oracle Grid Infrastructure user name. The default user is `grid`.
`db_user` | Describes the database user name. The default user is `oracle` Example with `grid` and `oracle` users:
    cleanup.pl -griduser grid -dbuser oracle
`groups` | Describes the comma-separated list of groups. The default groups are `oinstall,dba,dbaoper,asmadmin,asmoper,asmdba`.
`omausers` | Describes the comma-separated list of custom users created on a multi-user access enabled Oracle Database Appliance environment. All custom users created after provisioning a multi-user access enabled environment must be removed completely before you reprovision the appliance.
`erasedata` | Completely erases all disks on the Oracle Database system. It is mandatory to run this option if intention of cleanup is to reuse or move these disks on other systems. This option needs to be run on the first node when running on high-availability systems. Example of secure erase:
    cleanup.pl -erasedata
`cleanDefNet` | Cleans up the default public network.
`checkHeader` | Checks for `OAK/ASM` header on disks after successfully running the cleanup script. Use this to validate if the `OAK/ASM` header was erased by the cleanup script or not. Example of checking disk header:
    cleanup.pl -checkHeader
`nodpr` | Forces regular cleanup even if Data Preserving Reprovisioning environment is detected.Wipes out all data on Oracle ASM disks. You cannot run the command `odacli restore-node -g` after this operation. On Data Preserving Reprovisioning environments, the default cleanup mode is Data Preserving Reprovisioning mode which cleans the appliance without erasing Oracle SM disks to allow the command `odacli restore-node -g` to be reattempted. Using the `-nodpr` option allows you to override this behaviour and force regular cleanup. Example:
    cleanup.pl -nodpr
`nossh` | Does not attempt to set up SSH on high-availability deployments. Use this option in cases such as when the scripts using cleanup.pl are not updated to handle stopping the server, or if you have forgotten the SSH password, or if SSH is not set up on the system. Example:
    cleanup.pl -nossh
`f` | In the force mode, all commands use the force option. The ASM disk header is erased. The `oakd` header on the disk is erased in both default and force modes. Example of default mode:
    cleanup.pl
Example of force mode:
    cleanup.pl -f

Note:

The cleanup utility for bare metal deployments produces a log file. The utility tries to create the log file at `/opt/oracle/oak/log/hostname/cleanup/cleanup_timestamp.log`. If the log cannot be created in that location, then the log is created at `/tmp/cleanup_timestamp.log`.

Related Topics

- Deployment Checklist for Oracle Database Appliance Bare Metal Systems

Parent topic: Re-imaging Oracle Database Appliance

### Reimaging an Oracle Database Appliance Baremetal System

Reimage Oracle Database Appliance to perform a bare metal restore of Oracle Database Appliance.

Bare metal restore uses Oracle Integrated Lights Out Manager (Oracle ILOM) to reimage the Oracle Database Appliance node. The ILOM must be configured before performing a bare metal restore or reimage. Generally, the ILOM is configured as part of readying for deploying Oracle Database Appliance.

Download the Oracle Database Appliance Bare Metal ISO image to your local machine before you launch the Oracle ILOM console.

Follow these steps to reimage your appliance. For Oracle Database Appliance High-Availability deployment, follow these steps on both nodes.

1. Open a browser and connect to Oracle Integrated Lights Out Manager (ILOM) on Node 0 as root.
   https://ilom-ip-address
2. Launch the Remote Console.
   1. Expand Remote Control in the left navigation.
   2. Click the Redirection tab.
   3. Click Launch for the Remote Console in the Actions menu.
      The state of the system determines what appears on the Console page.
3. Add the image.
   1. Click the KVMS tab, then select Storage.
   2. Click Add.
   3. Browse to the Oracle Database Appliance Bare Metal ISO Image, highlight the image, then click Select.
   4. Click Connect.
      The mounting of the ISO image is successful when the Connect button changes to a Disconnect button.
   5. Click OK
      The CD-ROM icon in the top right corner is highlighted.
4. Configure the CD-ROM as the next boot device.
   1. Expand Host Management in the left menu of the ILOM Remote Console tab.
   2. Click Host Control.
   3. Select CDROM from the Next Boot Device menu, then click Save.
5. Power cycle the node.
   1. Click Power Control in the Host Management menu.
   2. Select Power Cycle , then click Save.

   When the node comes back after the power cycle, re-imaging starts automatically. The Oracle Linux page appears, followed by the Running Post-Install scripts page.

   The Running Post-Install scripts page is a static page and might give the impression that the reimaging process is not progressing. The post-install process during re-imaging will wait until the synchronization between the partitions of the two mirrored local hard disks is complete, which can take 15 to 20 minutes to complete.

   To check the progress of re-synchronization, press the ALT-F2 key combination to open a second console and enter the following command:

       # cat /proc/mdstat

   When the re-synchronization is complete, re-imaging is completed and the machine restarts.

After the machine restarts, the system is ready for you to deploy the Oracle software on the appliance to create an Oracle Database Appliance bare metal platform.

Related Topics

- Creating the Appliance

Plumbing the Network
Installing Oracle Database Appliance Software

Parent topic: Re-imaging Oracle Database Appliance

### Performing Secure Erase of Data on Storage Disks

With this release, you can securely erase data from storage devices. Running the secure erase tool deletes the data on the storage disk permanently.

You may want to consolidate storage disks between appliances. For example, you can use X7-2 disks on X6-2 models, and may want to consolidate all X6-2 disks on one system, and use all new X7-2 storage disks on another system. In such cases, use secure erase to erase headers from disks before re-imaging the disks, since the storage disks across the appliances may have different partition ratios.

Note:

The secure erase tool conforms to the NIST 800-88 standard, also called NIST Special Publication 800-88 (NIST SP 800-88), Guidelines for Media Sanitization.

Running the secure erase tool removes data from storage disks permanently. If you have any data on the disk, then take a backup of your storage disk before running the secure erase tool.

Follow the steps to run the secure erase tool:

1. Stop `oakd` and the database and Oracle Grid Infrastructure before running the secure erase tool.
   On bare metal systems, run the command:

       # odaadmcli stop oak

   On Virtualized Platforms:

       # oakcli stop oak

   To stop Oracle Clusterware resources:

       # crsctl stop crs -f

2. Run the secure erase tool:

       # /opt/oracle/oak/bin/odaeraser.py

3. You can also run the secure erase tool when running the cleanup tool:

       # /opt/oracle/oak/onecmd/cleanup.pl -erasedata

Example 7-1 Options for the Secure Erase Tool

Option | Description
--- | ---
`-a`, `--all` | Erases all disks. For example:
    # /opt/oracle/oak/bin/odaeraser.py --all
`--disk disk1,disk2` | Erases specified disks. For example:
    # /opt/oracle/oak/bin/odaeraser.py --disk e0_pd_00,e0_pd_01
`--dryrun` | Runs the tool in the test mode
`--type HDD|SSD|NVMe` | Erases the type of disk specified
`-v`, `--verbose` | Displays verbose output
`-h`, `--help` | Displays all CLI options for the tool

Parent topic: Re-imaging Oracle Database Appliance

### Redeployment of Oracle Database Appliance

Understand the process to redeploy Oracle Database Appliance.

After cleaning up the system and erasing the header, you can continue deployment of Oracle Database Appliance as follows:

1. Download Oracle Database Appliance software.
2. Install Oracle Database Appliance software.
3. Create the appliance.

For the above steps, run the procedures as described in this guide.

Reprovisioning Oracle Database Appliance without reimaging

You can re-provision Oracle Database Appliance without re-imaging the appliance.

1. Run the following command from the Oracle ILOM console:

       /opt/oracle/oak/onecmd/cleanup.pl -erasedata

   Or, run the following command to clean up Oracle ASM header on the storage:

       /opt/oracle/oak/onecmd/cleanup.pl -f

2. To re-provision the appliance, confirm that the Oracle ASM header is UNKNOWN:

       /opt/oracle/oak/onecmd/cleanup.pl -checkHeader

3. Continue with the provisioning steps such as configuring firstnet from the Oracle ILOM console as described in the topic Provisioning Oracle Database Appliance Bare Metal System.

Plumbing the Network
Installing Oracle Database Appliance Software

Parent topic: Re-imaging Oracle Database Appliance