Dayalan Punniyamoorthy Blog

Friday, May 31, 2024

All about During daily maintenance!!!

All about During daily maintenance!!!



During daily maintenance in Oracle EPM Cloud, the system creates a maintenance snapshot, applies patches, adjusts configurations, and analyzes activities to generate an Activity Report. The environment is then rebooted, with initial access limited to Service Administrators. Certain operations are restricted during this period, especially for processes like Planning and Financial Consolidation. Maintenance usually starts between 10:00 p.m. and 1:00 a.m. local time and a 15-minute notice is given before maintenance begins. The process typically takes less than an hour.


During the daily maintenance of Oracle Enterprise Performance Management (EPM) Cloud, the following tasks are performed:

1.    Creation of a maintenance snapshot named "Artifact Snapshot" of existing artifacts and data.

2.    Application of any required patches.

3.    Configuration adjustments, such as cache updates.

4.    Analysis of the previous day's activities and logs, resulting in an Activity Report.

The environment is then rebooted, and initial access is restricted to Service Administrators. Certain operations are limited or unavailable during this period to ensure maintenance tasks are completed effectively.

 

During the daily maintenance of Oracle EPM Cloud, the following functionalities are 

Unavailable for Planning:

·       Clear Cube

·       Compact Outline

·       Data Integration

·       Export Data

·       Export Metadata

·       Import Data

·       Import Metadata

·       Merge Data Slices

·       Optimize Aggregation

·       Refresh Database

·       Restructure Cube

 

These restrictions ensure that the maintenance tasks are completed without interference and help maintain the integrity and performance of the system.

Enterprise Profitability and Cost Management - Operations Not Available

  • Clear Cube
  • Compact Outline
  • Data Integration
  • Export Data
  • Export Metadata
  • Import Data
  • Import Metadata
  • Merge Data Slices
  • Optimize Aggregation
  • Refresh Database

 

Financial Consolidation and Close - Operations Not Available         

  • Data Integration
  • Export Data
  • Export Metadata
  • Import Data
  • Import Metadata
  • Refresh Database
  • Restructure Cube

 

Default Maintenance Start Time

Since environments are unavailable to users during the maintenance window, the Service Administrator should select a one-hour period when the service is not in use. Any connected users will be logged off, and any unsaved data will be lost.

The default maintenance start time is between 10:00 p.m. and 1:00 a.m. local time of the data center hosting your environment. If you do not change the default start time, Oracle will randomize it to start within this window. Once you choose a maintenance start time, Oracle will adhere to your selection. For more details, refer to the section on Setting the Maintenance Start Time for an Environment.

Some services might need additional maintenance operations. For example, Planning Modules, Account Reconciliation, and Financial Consolidation and Close may require extra maintenance time for content upgrades.

Additionally, due to planned daily maintenance, the environment status in the My Services console is always displayed as Planned Maintenance (in yellow), even if no other maintenance is scheduled for that day.

Groovy Script to Inform Users of Daily Maintenance Completion 

This script is designed to notify users upon completion of daily maintenance for an Oracle EPM environment. It logs in to the EPM service, retrieves the maintenance start time, and sleeps until that time. The script then attempts to log in repeatedly until maintenance is complete. Once completed, it sends a notification email to the specified addresses. Finally, it logs out of the EPM service.

 // Daily Maintenance Completed Notification script

// Update the following parameters

// -------------------------------

String username=dayalan@onlyhyperion.com

String password="Password"

String url=https://epm-test-epm.us-phoenix-1.ocs.oraclecloud.com

String emailaddresses=dayalan@onlyhyperion.com

// -------------------------------

 

// Function to log messages with a timestamp

def LogMessage(String message) {

    def date = new Date()

    def sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")

    println('[' + sdf.format(date) + '] ' + message);

}

 

// Function to log the status of an EPM Automate operation

def LogOperationStatus(EpmAutomateStatus opstatus) {

    def returncode = opstatus.getStatus()

    if (returncode != 0){

        LogMessage(opstatus.getOutput())

    }

    LogMessage('return code: ' + returncode)

}

 

// Function to get the daily maintenance start time

def getDailyMaintenanceStartTime(EpmAutomate automate) {

    LogMessage("Operation: getDailyMaintenanceStartTime")

    EpmAutomateStatus amwtimestatus = automate.execute('getDailyMaintenanceStartTime')

    LogOperationStatus(amwtimestatus)

    def amwstring = (amwtimestatus.getOutput())

    def elements = amwstring.split(' ')

    def amwtime = elements[0]

    return amwtime

}

// Function to sleep until the daily maintenance start time

def goToSleep(String amw_time) {

    def date = new Date()

    def current_mdy = new SimpleDateFormat("MM/dd/yyyy")

    def current_date_time = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")

    float current_epoch = date.getTime() / 1000

    def pattern = "MM/dd/yyyy HH:mm:ss"

    def input = current_mdy.format(date) + " " + amw_time + ":00"

    def target_date_time = Date.parse(pattern, input)

    float target_epoch = target_date_time.getTime() / 1000

    int sleep_seconds = Math.round(target_epoch - current_epoch)

 

    // Today's AMW start time has already passed, so add 24 hours to sleep_seconds

    if (sleep_seconds < 0) {

        sleep_seconds = sleep_seconds + 86400

    }

 

    def sleep_milliseconds = sleep_seconds * 1000

    LogMessage("Current time is " + current_date_time.format(date) + ". Sleeping until daily maintenance start time of " + amw_time + ":00.")

    sleep(sleep_milliseconds)

}

 

// Function to attempt login repeatedly until daily maintenance is completed

def attemptLogin(EpmAutomate automate, String username, String password, String url) {

    def serverdown = 1

    while (true) {

        LogMessage("Operation: login " + username + " " + password + " " + url)

        EpmAutomateStatus status = automate.execute('login', username, password, url)

        def returncode = status.getStatus()

        if (returncode == 0) {

            if (serverdown == 0){

                LogMessage("Daily maintenance processing has completed ...")

                break

            } else {

                LogMessage("Daily maintenance processing has not yet started. Sleeping for 2 minutes before the next check ...")

                sleep(120000)

            }

        } else {

            if (serverdown == 0){

                LogMessage("Waiting for daily maintenance processing to complete. Sleeping for 2 minutes before the next check ...")

                sleep(120000)

            } else {

                LogMessage("Daily maintenance processing is now beginning. Sleeping for 2 minutes before the next check ...")

                sleep(120000)

                serverdown = 0

            }

        }

    }

}

 

// Function to send a notification email after maintenance is completed

def sendNotification(EpmAutomate automate, String url, String emailaddresses) {

    def servername = url.tokenize("/")[-1];

    def subject = "Daily maintenance processing has completed"

    def formattedmessage = "Daily maintenance processing has completed for server " + servername

    def emailaddressesformatted = emailaddresses.replaceAll(',', ';')

 

    LogMessage("Operation: sendmail " + emailaddressesformatted + " " + subject + " Body=" + formattedmessage)

    EpmAutomateStatus status = automate.execute('sendmail', emailaddressesformatted, subject, 'Body=' + formattedmessage)

    LogOperationStatus(status)

}

 

// Script starts here

LogMessage("Beginning daily maintenance completion notification script.")

 

// Get an instance of EpmAutomate

EpmAutomate automate = getEpmAutomate()

 

// Log in to the EPM service

LogMessage("Operation: login " + username + " " + password + " " + url)

EpmAutomateStatus status = automate.execute('login', username, password, url)

LogOperationStatus(status)

 

// Get the daily maintenance start time and sleep until that time

String amwtime = getDailyMaintenanceStartTime(automate)

goToSleep(amwtime)

 

// Attempt to log in repeatedly until maintenance is complete

attemptLogin(automate, username, password, url)

 

// Send a notification email after maintenance is complete

sendNotification(automate, url, emailaddresses)

 

// Log out from the EPM service

LogMessage("Operation: logout")

status = automate.execute('logout')

LogOperationStatus(status)

 

// Script processing has completed

LogMessage("Script processing has completed.") 

 


The Job is running and waits for the Maintenance to start.







Hope this helps, Happy days on the Cloud!

No comments:

Post a Comment