Skip Headers
StorageTek Tape Analytics Administration Guide
Release 2.0
E39010-01
  Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
 
Next
Next
 

3 Database Services Administration

This chapter details the administration of various STA services. To initially configure these services, see the ”Configuring STA Services” chapter within the STA Installation and Configuration Guide.

3.1 STA Services Daemon

The STA Services daemon, staservd, is a continuously-running Linux service that manages and runs the STA Backup and STA Resource Monitor services. Both the STA Backup and the STA Resource Monitor services run as separate execution threads within the STA Services daemon.

The STA Services daemon starts when the STA server is booted up (with the STA start all command), and terminates when the server is shut down. You can also start, stop, and check the status of the STA Services daemon with the following commands:

  • To start the STA Services daemon:

    # STA start staservd
    Starting staservd Service...
    staservd service was successfully started
    
  • To stop the STA Services daemon:

    # STA stop staservd
    Stopping the staservd Service...
    Successfully stopped staservd service
    
  • To check the status of the STA Services daemon:

    # STA status staservd
    staservd service is running
    

For more information about the STA command, see Chapter 2, "Server Administration."


Note:

After installation of STA, the STA Services daemon starts the STA Backup and STA Resource Monitor services, but they are not activated until configured. To configure these services, see the "Configuring STA Services" chapter in the STA Installation and Configuration Guide.

3.2 STA Backup Service

The STA Backup Service is one of several services running within the STA Services Daemon. It performs an automatic full backup of the STA database and key configuration directories, writing these files to a specified location on the STA server or in compressed form to a remote server. Oracle recommends that you configure a remote backup server.

Before proceeding, check to ensure the STA Services Daemon is running. See "STA Services Daemon".

3.2.1 Configuration

The STA Backup Service is configured using its administration utility, staservadm, located in /Oracle/StorageTek_Tape_Analytics/common/bin. To configure the STA Backup service, see the ”Configuring STA Services” chapter within the STA Installation and Configuration Guide.

3.2.2 Full Backup Process

Once configured, the STA Backup service performs the following process once every 24 hours:

  1. Initiates a high-speed dump (also referred to as a ”hot backup”) of the following file types:

    • MySQL database dump file

    • MySQL binary log files

    • STA Services daemon and STA WebLogic configuration files

    • STA Services daemon and STA Backup service administration logs

  2. Transfers the dump file to the designated backup host

  3. Deletes the previous day's full dump files from the STA server

  4. Writes a copy of the current day's dump files to the /dbbackup/local directory on the STA server.

3.2.3 Display the Backup Service Preference Settings

Enter the following command to display the status of the current preference settings:

# ./staservadm -Q

If the "Configured" field says ”no,” then the Backup Service is running in an ”idle” mode and is not performing any backups. You will need to supply the proper configuration settings, as per the STA Installation and Configuration Guide.

Example output of a configured STA Backup Service:

# ./staservadm -Q
Contacting daemon...connected.
Querying Preferences.
 Current STA Backup Service Settings:
   Configured            [yes]
   File Transfer      -S [SCP]
   Full Backup        -T [11:00]
   Sleep Interval     -i [350 sec]
   Backup Hostname    -s [stabaksvr]
   Backup Username    -u [stabck]
   Backup Password    -p [*******]
   Backup Directory   -d [/home/stabck/STAbackups]
   Database Username  -U [stadba]
   Database Password  -P [*********]

3.2.4 Clear Preference Settings

Enter the following command to clear the current preference settings:

# ./staservadm -C

The backup service is no longer configured and will return to the ”idle” state. You can now provide new settings as per the StorageTek Tape Analytics Installation and Configuration Guide. For example:

# ./staservadm -C
Contacting daemon...connected.
Clearing Preferences.
Done.
 Current STA Backup Service Settings:
   Configured            [no]
   File Transfer      -S [SCP]
   Full Backup        -T [00:00]
   Sleep Interval     -i [300 sec]
   Backup Hostname    -s []
   Backup Username    -u []
   Backup Password    -p []
   Backup Directory   -d []
   Database Username  -U []
   Database Password  -P []

3.2.5 Verify Files Have Been Sent to the Target Server

To verify that files have been sent successfully:

  • Check the logs on the STA server.

  • Log on to the target backup server and list the contents of the backup directory.

3.2.5.1 Check the Server Logs and Target Backup Server

The staservd.log.0 file registers the activities of the Backup Services configuration utility.

  1. Change the working directory to the STA backup log directory.

    # cd /var/log/tbi/db/backups
    
  2. Search the staservd.log.0 file for the string ”INFO: done. Database dump completed.”

    # grep "INFO: done. Database dump completed" staservd.log.0
    INFO: done. Database dump completed, file located at
    /dbbackup/local/20130721_133755.stafullbackup.sql
    INFO: done. Database dump completed, file located at
    /dbbackup/local/20130722_133755.stafullbackup.sql
    INFO: done. Database dump completed, file located at
    /dbbackup/local/20130723_133755.stafullbackup.sql
    INFO: done. Database dump completed, file located at
    /dbbackup/local/20130724_133755.stafullbackup.sql
    
  3. Log on to the target backup server.

  4. List the files. In this example, the directory /backups/tbivb01 has previously been set up to receive the backup files from the STA server ”tbivb01”.

    # ls -1 /backups/tbivb01
    0.stadb-bin.000023.gz
    0.stadb-bin.000024.gz
    0.stadb-bin.000026.gz
    0.stadb-bin.000027.gz
    20130723_133755.stadb-bin.000023.gz
    20130723_133755.conf.zip.gz
    20130723_133755.fmwconfig.zip.gz
    20130723_133755.stadb-bin.000025.gz
    20130723_133755.stadb-bin.000026.gz
    20130723_133755.stafullbackup.sql.gz
    

3.2.6 Verify a Local Copy of the Backup Files Appears on the Server

Verify that a copy of the most recent backup files has been saved locally on the STA server by listing the files in the /dbbackup/local directory:

# ls -l /dbbackup/local
20130721_133755.conf.zip
20130721_133755.fmwconfig.zip
20130721_133755.stafullbackup.zip

The listed files will have the format YYYYMMDD_HHMMSS.filename.zip.

3.2.7 Reset the STA Backup Service Password

See Chapter 4, "Password Administration".

3.3 STA Resource Monitor Service

The STA Resource Monitor service monitors and reports on STA server resources, including database tablespace and disk volume space, logging volume disk space, and physical memory usage.

You may set usage high watermarks (HWM) for each resource. A high watermark is a threshold at which an alert will be raised. When the threshold is reached or exceeded, an alert is recorded in the standard daily resource report and optionally emailed to one or more designated recipients.

For example, if you set the database tablespace HWM to 60%, when the STA Resource Monitor detects that the STA application has used 60% or more of the maximum allowable database tablespace, it turns on the tablespace alert and sends an email to the designated recipients. Additionally, if nag mode is turned on, the Resource Monitor continues to send an alert email each time it scans the system.

3.3.1 Configuration

The STA Resource Monitor service is configured using its administration utility, staresmonadm, located in /Oracle/StorageTek_Tape_Analytics/common/bin. To configure the STA Resource Monitor service, see the ”Configuring STA Services” chapter within the STA Installation and Configuration Guide.

3.3.2 Query the Current Resource Monitor Preference Settings

Enter the following command to query the current state of the preference settings:

# ./staresmonadm -Q

If the Configured field says ”no,” then the Resource Monitor Service is running in an ”idle” mode neither monitoring resources nor sending reports. You will need to configure the server as per the StorageTek Tape Analytics Installation and Configuration Guide.

Example output of a configured STA Resource Monitor Service:

# ./staresmonadm -Q
Contacting daemon...connected.
Querying Preferences.
 Current STA Resource Monitor Service Settings:
   Configured                        [yes]
   Send Reports                   -T [13:00]
   Sleep Interval                 -i [600 sec]
   Alert Nagging                  -n [on]
   DB Username                    -U [sta_dba]
   DB Password                    -P [*********]
   DB Tablespace hwm              -t [65%]
   DB Backup hwm   (/dbbackup)    -b [65%]
   DB Data hwm     (/dbdata)      -d [65%]
   Log Volume hwm  (/var/log/tbi) -l [65%]
   Root Volume hwm (/)            -z [70%]
   Tmp Volume hwm  (/tmp)         -x [80%]
   System Memory hwm              -m [75%]
   Email 'From:'                  -f [StaResMon@localhost]
   Email 'To:'                    -r [john.doe@company.com]
   Email 'Subject:'               -s [STA Resource Monitor Report]
   Output File                    -o [/var/log/tbi/db/staresmon.csv]

3.3.3 Clear the Resource Monitor Preference Settings

Enter the following command to clear the current preference settings:

# ./staresmonadm -C

The Resource Monitor service is no longer configured and will return to the ”idle” state. You can now provide new settings as per the StorageTek Tape Analytics Installation and Configuration Guide. For example:

# ./staresmonadm -C
Contacting daemon...connected.
Clearing Preferences.
Done.
 Current STA Resource Monitor Service Settings:
   Configured                        [no]
   Send Reports                   -T [00:00]
   Sleep Interval                 -i [300 sec]
   Alert Nagging                  -n [off]
   DB Username                    -U []
   DB Password                    -P []
   DB Tablespace hwm              -t [-1%]
   DB Backup hwm   (/dbbackup)    -b [-1%]
   DB Data hwm     (/dbdata)      -d [-1%]
   Log Volume hwm  (/var/log/tbi) -l [-1%]
   Root Volume hwm (/)            -z [-1%]
   Tmp Volume hwm  (/tmp)         -x [-1%]
   System Memory hwm              -m [-1%]
   Email 'From:'                  -f [StaResMon@localhost]
   Email 'To:'                    -r []
   Email 'Subject:'               -s [STA Resource Monitor Report]
   Output File                    -o [/var/log/tbi/db/staresmon.csv]

3.3.4 Reset the STA Resource Monitor Password

See Chapter 4, "Password Administration."

3.4 Resource Monitor Reports

Resource Monitor reports are configured using the STA Resource Monitor service administration utility, staresmonadm. To configure the STA Resource Monitor service, see the ”Configuring STA Services” chapter within the STA Installation and Configuration Guide.

The Resource Monitor can produce two different reports:

3.4.1 Resource Monitor Standard Report

A Resource Monitor Standard Report is sent once a day at approximately the time specified by the staresmonadm -T option. If you do not set a time, the report is sent at the first scan after midnight. The report is sent to the email recipients you specified when you configured this service.

The report provides data for the following server resources. If any of these resources exceeds a high watermark threshold, an alert appears in the report.

  • Database tablespace and volume

  • Logging, backup, and root volume

  • Temporary directory

  • System memory usage


Note:

Reported values rely on mount points. If multiple monitored items share the same mount point, the reported values for these items will be identical.

Example Standard Report (truncated)

STA RESOURCE MONITOR STANDARD REPORT
System: tbivb03
Scanned: 2013-10-24 11:30:14

Database Tablespace
  HWM            : 60.00%
  Used           : <0.1%
  MB Used        : 13
  MB Free        : 75763
  MB Total       : 75776
  Location       : /dbdata/mysql

Database Volume
  HWM            : 60.00%
  Used           : 6.80%
  MB Used        : 6855
  MB Free        : 93939
  MB Total       : 100794
  Directory      : /dbdata/mysql
...

3.4.2 Resource Depletion Alert Report

A Resource Depletion Alert Report is sent after every scan if the staresmonadm alert nag mode (-n) option is set to ”on”. If nag mode is off, alerts are shown only in the Standard Report.

The interval between each scan is determined by the Sleep Interval (-i) attribute, and the report is sent to the email recipients you specified when you configured this service. Recommendations are provided within the report to help resolve the noted issue(s).

Example Resource Depletion Alert Report

STA RESOURCE DEPLETION REPORT
System: server01
Scanned: 2013-10-24 11:34:47
************************************************************
*                     A L E R T S                          *
************************************************************
==================================================
ALERT - Low System Physical Memory
==================================================
  Physical memory usage has exceeded threshold value!
  HWM             [1.00%]
  Used            [48.24%] (!)
  MB Used         [7757]
  MB Free         [8324]
  MB Total        [16080]
  Hostname        [server01]
  Recommendations:
  1) Shutdown unneeded processes.
  2) Under Linux, try releasing unused caches using commands:
       # free -m
       # sync
       # /sbin/sysctl -q vm.drop_caches=3
       # free -m
  3) Install additional memory.

3.5 File Types and Locations

The STA Services are comprised of executable scripts, java jar files containing server and client applications, configuration files, dump file, logging files, and a cumulative data file. This section describes their purposes and locations.

3.5.1 STA Services Daemon Startup/Shutdown Script

The STA Services daemon startup/shutdown script, staservd, and system run level symbolic links are located at:

/etc/init.d/staservd - Main startup/shutdown script

/etc/rc0.d/K04staservd - Symbolic link for system shutdown

/etc/rc1.d/K04staservd - Symbolic link for system shutdown

/etc/rc2.d/S96staservd - Symbolic link for system startup

/etc/rc3.d/S96staservd - Symbolic link for system startup

/etc/rc4.d/S96staservd - Symbolic link for system startup

/etc/rc5.d/S96staservd - Symbolic link for system startup

/etc/rc6.d/K04staservd - Symbolic link for system shutdown

The staservd init script and its associated symbolic links are created by the STA installer.

3.5.2 STA Administration Utilities

The STA Backup Service administration utility, staservadm, is a Perl script that calls a Java client application named ServerAdm that is contained in the oracle.tbi.serveradm.jar file. For more information, see "STA Backup Service".

The STA Resources Monitor administration utility, staresmonadm, is a Perl script that calls a Java client application named StaResMonAdm that is contained in the oracle.tbi.resmonadm.jar file. StaResMonAdm is an RMI client that communicates with the STA Services daemon to set and reset run-time preferences. For more information, see "STA Resource Monitor Service".

3.5.3 Executable Program Locations

Table 3-1 lists the executable programs and their locations.

Table 3-1 Executable Program Locations

Program Location

STA Services program jar file

$STAHOME/common/lib/oracle.tbi.server.jar

STA Backup Services Administration Utility Java application jar file

$STAHOME/common/lib/oracle.tbi.serveradm.jar

STA Backup Service Administration Utility user script file, staservadm

$STAHOME/common/bin/staservadm

STA ResMon Administration Utility Java application jar file

$STAHOME/common/lib/oracle.tbi.resmonadm.jar

STA ResMon Administration Utility Java user script file, staresmonadm

$STAHOME/common/bin/staresmonadm


Where:

$STAHOME =/Oracle/StorageTek_Tape_Analytics

3.5.4 Backup File Locations

These are the kinds of files involved in the backup operation:

3.5.4.1 STA Services Daemon and Backup Service Admin Logs

These log the activities of the STA Services Daemon Server, STAServer, and its Backup services configuration utility, ServerAdm. Admin logs are collections of up to 10 log files, each up to 1.0 MB in size. The log file names are of the format "*.log.N," where "N" is the number of the log (staservd.log.0, staservadm.log.0, staservd.log.1, and so forth).

The logs are circularly rotated such that log file #1 will be reused when staservd.log.9 has been filled up. The active log file is always #0 (staservd.log.0). When log #0 fills up, it is renamed to log #1 and a new log #0 is started. By default the STAServer and ServerAdm logs are located at:

/var/log/tbi/db/backups

The location of and internal log format type (either simple ASCII text or XML markup) is controlled by the logging properties file staservd.log.props and staservadm.log.props located at:

$STAHOME/common/conf/staservd.log.props

$STAHOME/common/conf/staservadm.log.props

Where:

$STAHOME =/Oracle/StorageTek_Tape_Analytics

3.5.4.2 MYSQL Database Dump Files

The MySQL database dump file is a snapshot-in-time of the database schema and data contents. STA Backup service performs these actions:

  1. Initiates a high-speed dump (sometimes called a "hot backup") once every 24 hours of the file types discussed in this section

  2. Transfers the latest dump file to the designated backup host

  3. Deletes the previous day's full dump files from the local backup directory

  4. Writes a copy of the current days' dump file to the local backup directory.

    The STA Backup Service by default will place its local dump files and incremental binlog files into the /dbbackup/local directory with format YYYYMMDD_HHMMSS.filename.sql.

3.5.4.3 MySQL Binary Logs

The term incremental dumps refers to the MySQL binary logs (binlogs) that record all transactions that result in a change to a database. The STA Backup Service treats binlogs as incremental backups following the main database dump.

STA incremental dumps are comprised of all the binary logs that are produced since the last full dump. By replaying the binlogs, you can restore a database to its state up the last transaction recorded in the log. A restore consists of loading the latest dump file, and then replaying, in order, all the MySQL binlogs that were generated following the latest database dump.

Backing up the binlogs consists of making a list of all the binlogs created since the most recent full dump and then transmitting each of those logs (except the current one because it is still open) to the backup server.

The backup binary log naming format is YYYYMMDD_HHMMSS.stadb-bin.log_sequence_number.

The MySQL binary log location is defined in the MySQL settings file /etc/my.cnf. That is currently set to:

/var/log/tbi/db/

Local copies of the backup binlog files are located at:

/dbbackup/local

All but the most recent binlog successfully transferred to the backup server are purged using the MySQL command PURGE BINARY LOGS BEFORE NOW(). The current binlog and the current day's full backup file thus remain on the server.


Caution:

Never manually delete the binlog files.

3.5.4.4 STA Services Daemon and WebLogic Configuration Files

In addition to files necessary to recover the STA application database, the STA Backup Service also backs up STA's WebLogic configuration files as well as its own STA Services daemon configuration files. The backup is a recursive backup of all the files and directories in their respective configuration directories.

Configuration file backups are performed once every 24 hours when the full STA database dump is performed. The backup file names format is YYYYMMDD_HHMMSS.filename.zip.gz.

The source and target locations of these backups are shown in Table 3-2:

Table 3-2 Backup Source/Target Locations

Source Location Local Copy Remote Copy

$STAHOME/common/conf/*

$BACKUPS/YYYYMMDD_HHMMSS.conf.zip

$RHOST:$RDIR/YYYYMMDD_HHMMSS.conf.zip.gz

$WLHOME/config/fmconfig/*

$BACKUPS/YYYYMMDD_HHMMSS.fmconfig.zip

$RHOST:$RDIR/YYYYMMDD_HHMMSS.fmconfig.zip.gz


Where:

$STAHOME =/Oracle/StorageTek_Tape_Analytics

$WLHOME =/Oracle/Middleware/user_projects/domains/TBI

$BACKUPS =/dbdata/mysql/backups

$RHOST = Backup server IP address or name

$RDIR = Directory on backup server

3.5.5 Resource Monitor File Locations

There are two kinds of files involved in the monitoring operations:

3.5.5.1 STA Services Daemon and ResMonAdm Logs

These log the activities of the STA Services daemon and the Resource Monitor Administration utility, staresmonadm. These logs are collections of up to 10 log files, each up to 1.0 MB in size. The log file names are of the format "*.log.N," where "N" is the number of the log (staservd.log.0, staresmonadm.log.0, staservd.log.1, and so forth).

The logs are circularly rotated such that log file #1 will be reused when staservd.log.9 has been filled up. The active log file is always #0 (staservd.log.0). When log #0 fills up, it is renamed to log #1 and a new log #0 is started. By default, the STA Services, STA ResMon, and STA ResMonAdm logs are all located at:

/var/log/tbi/db/backups

The location and log format (either simple ASCII text or XML markup) are controlled by the logging properties file, staservd.log.props, and staresmonadm.log.props located at:

$STAHOME/common/conf/staservd.log.props

$STAHOME/common/conf/staresmonadm.log.props

Where:

$STAHOME =/Oracle/StorageTek_Tape_Analytics

3.5.5.2 STA Resource Monitor CSV File

Each time ResMon scans the system, it writes the gathered values out to a comma-separated-value (CSV) file located, by default, at:

/var/log/tbi/db/staresmon.csv

Programs such as Excel and MySQL can load this data file and perform various analytic and graphing functions with time-based values (for example, analysis of resource depletion trends).


Note:

The ResMon CSV file is neither purged, rolled, nor backed up by the STA Backup Service.

Each record in staresmon.csv represents a scan of the system. The format of the 21 column record is shown in Table 3-3.

Table 3-3 Resource Monitor CSV File Format

Col Header Description Format

1

TIMESTAMP

Date and time of the scan

"YYYY-MM-DD

HH:MM:SS"

2

TS_MB_MAX

Maximum tablespace

123

3

TS_MB_USED

Total database space used

123

4

TS_MB_AVAIL

Database space remaining

123

5

TS_PCT_USED

Database tablespace used as a percentage of the max

12.34%

6

TS_PCT_HWM

Database tablespace high water mark as a percentage of the max

12.34%

7

DBVOL_MB_MAX

Maximum available space on the volume containing the database

123

8

DBVOL_MB_USED

Total database disk volume space used

123

9

DBVOL_MB_AVAIL

Database volume disk space remaining

123

10

DBVOL_PCT_USED

Database volume disk space used as a percentage of the max

12.34%

11

DBVOL_PCT_HWM

Database volume high water mark as a percentage of the max

12.34%

12

LOGVOL_MB_MAX

Maximum available space on the volume containing the logs

123

13

LOGVOL_MB_USED

Total logging disk volume space used

123

14

LOGVOL_MB_AVAIL

Logging volume disk space remaining

123

15

LOGVOL_PCT_USED

Logging volume disk space used as a percentage of the max

12.34%

16

LOGVOL_PCT_HWM

Logging volume high water mark as a percentage of the max

12.34%

17

MEM_MB_MAX

Maximum installed physical RAM

123

18

MEM_MB_USED

Total physical memory used

123

19

MEM_MB_AVAIL

Physical memory space remaining

123

20

MEM_PCT_USED

Physical memory space used as a percentage of the max

12.34%

21

MEM_PCT_HWM

Physical memory high water mark as a percentage of the max

12.34%


3.6 Logging Configuration Files

Logging for the STA Services daemon, the Backup Service, Backup Service Administration Utility, and STA Resource Monitor Utility is controlled by logging configuration files located at:

$STAHOME/common/conf/staservd.log.props

$STAHOME/common/conf/staservadm.log.props

$STAHOME/common/conf/staresmonadm.log.props

Where:

$STAHOME =/Oracle/StorageTek_Tape_Analytics

The logging file contents and format are initialized and controlled by the Java Log Manager configuration properties. These properties are read from the logging properties files noted above. The following information can be found at:

http://download.oracle.com/javase/1.4.2/docs/api/java/util/logging/FileHandler.html.

Table 3-4 Logging File Contents

Property Description StorageTek Tape Analytics Setting

java.util.logging.FileHandler.append

Specifies whether the FileHandler should append onto any existing files (defaults to false)

true

java.util.logging.FileHandler.count

Specifies how many output files to cycle through (defaults to 1).

10

java.util.logging.FileHandler.formatter

Specifies the name of a Formatter class to use (defaults to java.util.logging.XMLFormatter)

Java.util.logging.SimpleFormatter for human readability. The java.util.loggin.XMLFormatter is commented out and available

java.util.logging.FileHandler.level

Specifies the default level for the Handler (defaults to Level. ALL).

CONFIG

java.util.logging.FileHandler.limit

Specifies an approximate maximum amount to write (in bytes) to any one file. If this is zero, then there is no limit. (Defaults to no limit).

1000000 (1MB)

java.util.logging.FileHandler.pattern

Specifies a pattern for generating the output file name. See below for details. (Defaults to "%h/java%u.log").

/var/log/tbi/db/backups/staservd.log.%g

/var/log/tbi/db/backups/staservadm.log.%g


Table 3-5 STA Services Daemon Properties

Property Description StorageTek Tape Analytics Setting

oracle.tbi.server.level

oracle.tbi.serveradm.level

oracle.tbi.resmonadm.level

Specifies the log level for the server, server admin functions, or the resource monitor admin functions.

CONFIG

CONFIG


3.7 STA Database Restoration

The STA Restore procedure consists of loading the most recent full dump and then replaying all the binary logs immediately following that dump.

There are distinct sets of backup files on the backup server directory. For example:

# cd /data/stabackups
# ls -1
20130721_133755.conf.zip.gz
20130721_133755.fmwconfig.zip.gz
20130721_133755.stadb-bin.000024.gz
20130721_133755.stafullbackup.sql.gz
20130722_133755.conf.zip.gz
20130722_133755.fmwconfig.zip.gz
20130722_133755.stadb-bin.000024.gz
20130722_133755.stafullbackup.sql.gz
20130723_133755.conf.zip.gz
20130723_133755.fmwconfig.zip.gz
20130723_133755.stadb-bin.000021.gz
20130723_133755.stadb-bin.000022.gz
20130723_133755.stadb-bin.000023.gz
20130723_133755.stadb-bin.000024.gz
20130723_133755.stafullbackup.sql.gz

The file name time stamp format is YYYYMMDD_HHMMSS. All the binary logs having the same date tag will be replayed into the database after the full dump is loaded.

The following administration tasks are discussed here:

3.7.1 Copy Backup Files to the Server

To copy backup files to the server:

  1. Copy the whole set of one day's files back to the STA server.

    Oracle recommends copying everything to the /tmp directory. For example, assuming that STA is installed on the server sta.server.com and you are currently logged onto the backup server.

    # scp 20130723*.* sta.server.com:/tmp/.
    Password:
    
  2. Log on as root to the STA server and ungzip the *.gz files. For example:

    # cd /tmp
    # gunzip 20130723*.*.gz
    

3.7.2 Restore the Configuration Directory Files

To restore the configuration directory files:

  1. Stop all STA processes. Then, restart only the MySQL server.

    # STA stop all
    # STA start mysql
    
  2. Unzip the STAServer and STA Services Daemon configuration directories.

    The zip files have been created with the full directory paths to allow you to restore and/or overwrite existing files. The zip command allows you to re-crown the root of the restore path with the -d option. Additional options allow more control, such as selective replace.

    For a clean restoration, you should completely replace the existing configuration directory; however, back up the original first. For example:

    # cd $WLSHOME
    # zip -vr fmwconfig.orig.zip fmwconfig
    # rm -rf fmwconfig
    # cd /tmp
    # unzip -X -d/ 20130723_133755.fmwconfig.zip
    # cd $STAHOME/common
    # zip -vr conf.orig.zip conf
    # rm -rf conf
    # cd /tmp
    # unzip -X -d/ 20130723_133755.conf.zip
    

Where:

$WLSHOME =/Oracle/Middleware/user_projects/domains/TBI/config

$STAHOME =/Oracle/StorageTek_Tape_Analytics

3.7.3 Restore the Database

Perform the following commands as the MySQL root user:

3.7.3.1 Reload the Database

To reload the database:

  1. Clean out any residual stadb database if it exists. For example:

    # mysql -uroot -p -e 'drop database stadb;'
    Password:
    
  2. Load the latest full dump. This creates the schema and installs all the data. For example:

    # mysql -uroot -p -e 'source 20130723_133755.stafullbackup.sql;'
    Password:
    

3.7.3.2 Replay the Binlogs

To replay the binlogs:

  1. Run each of the incremental dumps (binlogs) from youngest to oldest.

    If you have more than one binary log to execute on the MySQL server, the safest method is to process them all using a single connection to the server and a single mysql process to execute the contents of all of the binary logs.

    For example:

    # mysqlbinlog 20130723_133755.sta-binlog.000021 \
    > 20130723_133755.sta-binlog.000022 \
    > 20130723_133755.sta-binlog.000023 \
    > 20130723_133755.sta-binlog.000024 |mysql -u root -p
    

    Another approach is to concatenate all the logs to a single file and then process the file:

    # mysqlbinlog 20130723_133755.sta-binlog.000021 > /tmp/recoversta.sql
    # mysqlbinlog 20130723_133755.sta-binlog.000022 >> /tmp/recoversta.sql
    # mysqlbinlog 20130723_133755.sta-binlog.000023 >> /tmp/recoversta.sql
    # mysqlbinlog 20130723_133755.sta-binlog.000024 >> /tmp/recoversta.sql
    # mysql -u root -p -e 'source /tmp/recoversta.sql'
    

Note:

If you do not supply a password on the command line, MySQL prompts you for it before proceeding.

3.7.3.2.1 Avoid Multiple Connections to the Server

Processing binary logs as shown in the example below may create multiple connections to the server. Multiple connections cause problems if the first log file contains a CREATE TEMPORARY TABLE statement, and the second log contains a statement that uses that temporary table. When the first mysql process terminates, the server drops the temporary table. When the second mysql process attempts to use that table, the server reports ”unknown table.”

# mysqlbinlog binlog.000001 |mysql -u root -p #<=== DANGER!!
# mysqlbinlog binlog.000002 |mysql -u root -p #<=== DANGER!!

3.7.3.3 Restart All Services

As the Linux system root user, enter the following command:

# STA start all

3.7.4 Point-in-Time Restorations

Another restoration method is "point-in-time," where binary logs can be replayed from a specific start point to a specific end point in time.

For example, after examining the contents of a binary log, you discover that an erroneous operation resulted in dropping several tables immediately following log entry #6817916. After restoring the database from the full dump occurring the day before, and before restarting all the STA services, you can replay the most recent binary log from its initial log entry number "176" through entry number "6817916" with the commands shown in this procedure.

3.7.4.1 Restore from a Range of Log Numbers

To restore from a range of log numbers:

  1. Make sure all the STA processes are shut down and only the MySQL server is running:

    # STA stop all
    # STA start mysql 
    
  2. As the MySQL root user, extract the valid operations. For example:

    # mysqlbinlog --start-position=176 --stop-position=6817916
    /var/log/tbi/db/stadb-bin.000007 > ./recover.sql
    
  3. Apply them to the database. For example:

    # mysql -uroot -p -e 'source ./recover.sql'
    Password:
    
  4. As the Linux system root user, restart the STA application and STA Services Daemon:

    # STA start all
    

For more information on point-in-time or incremental recovery operations refer to the MySQL Manual:

http://dev.mysql.com/doc/refman/5.5/en/point-in-time-recovery.html