Oracle Video Server Administrator's Guide: UNIX
Release 2.1.7.3
A42271_4

Library

Product

Contents

Index


Prev Next

Chapter 5
Oracle Media Data Store Tasks and Procedures

Topics covered in this chapter are:

About the Oracle Media Data Store

The Oracle Media Data Store (MDS) is an optimized filesystem designed to store multimedia data and deliver it in real time to multiple clients. Access to the MDS is controlled by mdsdirsrv (MDS directory server) and the MDS configuration is defined by the voltab configuration file.

For information about the MDS and how it works, refer to the Oracle Video Server System Tour. For information on the mdsdirsrv server process or the voltab configuration file, refer to the Chapter 7, "Oracle Video Server Components Reference."

Setting the MDS_CWD Environment Variable

When you use either the MDS or stream service utilities, you may enter a full pathname to refer to any MDS file. You may find it easier, however, to set the path in the MDS_CWD environment variable, and omit the volume path in the command itself. The MDS_CWD environment variable prepends MDS path information to a filename that is specified without a path.

Examples

These examples use vstagprint to print the tag information in the tag file oracle1.mpi from the MDS volume video.

First, use mdsdir to show all available MDS volumes and files on the server:

% mdsdir

Volume /mds/movies (rw): 2 matches

cover.mpg          cover.mpi 
Volume /mds/video (rw): 2 matches

oracle1.mpg         oracle1.mpi 

Example 1

This example uses MDS_CWD as the path name to find the tag file oracle1.mpi:

% setenv MDS_CWD /mds/video

% vstagprint oracle1.mpi

Tag file version: 3.4 

Current code is version 3.4, back-compatible to version 3.4 


Example 2

In this example, MDS_CWD is pointing to the wrong volume (named movies), therefore the tag file oracle1.mpi is not found:

% setenv MDS_CWD /mds/movies

% vstagprint oracle1.mpi

mkctPrintTagFile: cannot open tag file oracle1.mpi

error while attempting to print tag file

error occurred in vstagprint, exiting

Example 3

In this example, MDS_CWD is set to the volume video, but the user specifies the volume movies. If you provide an explicit MDS volume path it will override MDS_CWD:

setenv MDS_CWD /mds/video

% vstagprint /mds/movies/oracle1.mpi

Tag file version: 3.4 

Current code is version 3.4, back-compatible to version 3.4 


Example 4

In this example, MDS_CWD is not set and the MDS path is not specified. This produces the following error message:

% unsetenv MDS_CWD

% vstagprint oracle1.mpi

mkctPrintTagFile: cannot open tag file oracle1.mpi

error while attempting to print tag file

error occurred in vstagprint, exiting

Assigning Read-Write Modes

You can mount MDS volumes in the following read-write modes:

Read-write mode

A volume mounted in read-write mode allows mdsdirsrv to both read and write to the volume. To perform administrative tasks involving an MDS volume-such as loading content-it must be mounted in read-write mode.

Read-Only and Inconsistent Read-Only Mode

A volume mounted in read-only or inconsistent read-only mode allows mdsdirsrv to read but not write to an MDS volume.

Multiple mdsdirsrv processes can mount an MDS volume in inconsistent read-only or read-only mode. If you are running multiple mdsdirsrv processes, only one mdsdirsrv process can mount an MDS volume in read-write mode.

Inconsistent Read-Only Mode

A volume mounted in inconsistent read-only mode allows mdsdirsrv to read a volume that is being modified by a read-write mode mdsdirsrv process from a different server. The inconsistent read-only mdsdirsrv process will receive periodic updates about the volume changes made by the read-write mdsdirsrv process, however, at times the inconsistent read-only mdsdirsrv process will not see the correct volume image. When this happens the inconsistent read-only mdsdirsrv process may allow its clients to open up files that do not actually exist and whose contents are indeterminate. In addition, it may not know about files that have been recently created.

Note

In general, you should not have more then one mdsdirsrv process accessing an MDS volume unless you are debugging the OVS.

Examples

The following examples show the syntax used by mdsdirsrv to mount MDS volumes using varying read-write modes.

Example 1

This example uses -W to mount all volumes listed in the voltab file in read-write mode:

% mdsdirsrv -W -f $ORACLE_HOME/vs21/admin/voltab

Example 2

This example mounts all volumes in read-write mode with -W except for the volume video3, specified with the -r option, which is mounted in read-only mode:

% mdsdirsrv -W -r video3 -f $ORACLE_HOME/vs21/admin/voltab

Example3

This example, mounts all volumes in read-only mode with -R, except for the volume video, specified with the -w option, which is mounted in read-write mode:

% mdsdirsrv -R -w video -f $ORACLE_HOME/vs21/admin/voltab

Example 4

In this example, the volume video, specified with the -i option, is mounted in inconsistent read-only mode. If a volume is mounted by two servers, only one server can mount the volume in read-write mode, while the other server must mount the volume in inconsistent-read-only mode. Note that if a volume is mounted by two servers, video cannot be streamed from that volume with real-time constraints as both OVS environments are unaware of each other and will compete for MDS bandwidth:

% mdsdirsrv -i video -f $ORACLE_HOME/vs21/admin/voltab

Caution

In general, do not use inconsistent read-only mode. This is a specialized feature for environments where multiple system administrators or testers need to co-exist.

Changing the Name of an MDS Volume

To change the name of an MDS volume, without destroying its contents, you must re-initialize the volume's specification with the mdsvolinit utility and retag all content with vstag. This example changes the MDS volume name from video (as shown below) to volume1:

  1. The current volume, as shown in the voltab entry below, is video.
  2. video maxbw=55,striped,width=32k,raidsize=4, \
    
    dev/rdsk/c{0-3}t{0-3}d0s{6} 
    
  3. Shut down the OVS using the ovsstop script located in $ORACLE_HOME/vs21/admin:
  4. % ./ovsstop
    
  5. Start OMN with the mnstart script located in
    $ORACLE_HOME/mn30/admin:
  6. % cd $ORACLE_HOME/mn30/admin
    
    % ./mnstart
    
  7. Make a backup copy of the voltab file.
  8. Edit the voltab entry and replace the name video with volume1 as shown below:
  9. volume1 maxbw=55,striped,width=32k,raidsize=4, \
    
    dev/rdsk/c{0-3}t{0-3}d0s{6} 
    
  10. Use mdsvolinit with only the -s and -f options to rename the MDS volume.

Caution

Do not use the -t option, which will overwrite the volume's table of contents and erase all content.

% mdsvolinit -s -f $ORACLE_HOME/vs21/admin/voltab volume1 

Do you really want to change attributes of volume 'volume1'? (yes, no) 

yes 

Attributes of volume 'volume1' recorded.

  • Shut down OMN with the mnstop script located in
    $ORACLE_HOME/mn30/admin: % cd $ORACLE_HOME/mn30/admin
    % ./mnstop
  • Start the OVS with the ovsstart script located in
    $ORACLE_HOME/vs21/admin: % cd $ORACLE_HOME/vs21/admin
    % ./ovsstart
  • Using vstag, retag all the content to point to the new MDS volume. % vstag -E mpi /mds/volume1/oracle1.mpg
    now Tagging /mds/volume1/oracle1.mpg into /mds/volume1/oracle1.mpi.
    Program Exiting Normally
  • Alternatively, you can use vstagpatch to modify the tag files to point to the new location of the MPEG files. This will save time if the content files are very large.

    % vstagpatch -c -n /mds/volume1/oracle1.mpg /mds/volume1/oracle1.mpi
    

    Creating Additional MDS Volumes

    Invariably, you will need to add additional storage capacity to the OVS as your video library grows. Since you cannot add disks to an MDS volume without erasing the data it contains, you will need to create additional volumes. Follow these steps to add volumes to an existing MDS system:

    1. Determine the amount of storage capacity and bandwidth requirements for the volume you plan to create. For information on this, refer to Chapter 2, "System Planning for the Oracle Video Server."
    2. Once you have determined the storage and bandwidth requirements, and have assembled the MDS disk system, stop the OVS with the ovsstop script located in $ORACLE_HOME/vs21/admin:
    3. % cd $ORACLE_HOME/vs21/admin
      
      % ./ovsstop
      
    4. Edit the voltab file to include the new volume definition. The example below adds the volume video2 to the voltab file:
    5. video maxbw=55,striped,width=32k,raidsize=4, \
      
      dev/rdsk/c{0-3}t{0-3}d0s{6}
      
      video2 striped,width=32k,raidsize=4, \
      
      dev/rdsk/c{4-7}t{0-3}d0s{6}
      

    For information on the voltab file and its syntax, refer to the voltab section of Chapter 7, "Oracle Video Server Components Reference" of this guide.

    Caution

    The above example shows a voltab entry divided across two lines. When editing a voltab entry it should all be on one line. The only division of lines should occur when your text editor wraps from one line to the next. Do not place a hard return in a voltab entry.

      1. Start OMN with the mnstart script located in
      $ORACLE_HOME/mn30/admin:
      % cd $ORACLE_HOME/mn30/admin
      
      % ./mnstart
      

    OMN allows communication to take place among the OVS components so that mdsvolinit can write to the new volume.

      2. Initialize the new volume using mdsvolinit. The example below initializes the volume video2:
      % mdsvolinit -s -t -f $ORACLE_HOME/vs21/admin/voltab video2
      

    mdsvolinit writes information from the voltab file to the disks used by the volume video2. Note that the -s and -t options used in this example should only be used to initialize a new MDS volume. Using this combination of options erases all data contained by the disks.

      3. Stop OMN with the script mnstop located in $ORACLE_HOME/mn30/admin:
      % ./mnstop
      
      4. Start the OVS with the ovsstart script located in $ORACLE_HOME/vs21/admin:
      % cd $ORACLE_HOME/vs21/admin
      
      % ./ovsstart
      
      5. Use mdsdir with the -f option to verify that you can contact the new volume. This lists the free space available in the volume:
      % mdsdir -f /mds/video2
      
      Volume /mds/video2 (rw): 1 match
      
      2400 MB's of free space in 1 fragment(s)
      
      largest free block is 2400 MB's
      

    The volume created is a non-real-time volume since no maxbw (maximum bandwidth) value is specified in the voltab entry. You may wish to load video content into the new volume at this time. Loading content into a non-real-time volume gives more bandwidth to the utilities used to copy and tag video content. To create a real-time volume, which is designed to stream video, continue with the next section.

    Creating a Real-Time Volume

    To create a real-time MDS volume, where access to the volume is limited to a predefined maximum to ensure quality of service, you must obtain the maxbw value. maxbw specifies the maximum rate at which all OVS server processes and clients can together read and/or write to an MDS volume.

    Follow these steps to obtain the correct maxbw value for your MDS volume and mount the MDS volume in real-time mode.

      1. If the OVS server processes are not yet running, start them with the ovsstart script, located in the directory $ORACLE_HOME/vs21/admin:
      % cd $ORACLE_HOME/vs21/admin
      
      % ./ovsstart
      
      2. Use mdsvstat with the -a option to determine the maxbw of the MDS volume. Use the -f option to locate the voltab file used to define MDS volume being queried, followed by the name of the MDS volume you wish to query. This example queries the volume video2 for its maxbw value:
      % mdsvstat -a -f $ORACLE_HOME/vs21/admin/voltab video2
      
      Recommended maxbw setting for volume video2 is: 55 Mbps
      

    For more information on mdsvstat refer to the "Media Data Store Utilities" chapter of the Oracle Video Server Utilties User's
    Guide
    (online only).

      3. Make a copy of the voltab file located in the directory
      $ORACLE_HOME/vs21/admin and name it voltab_nonrealtime.
      % cp voltab voltab_nonrealtime
      

    This gives you volume definitions for both a real-time and a non-real-time MDS volume. When you are operating the OVS for strictly administrative functions (such as loading and tagging video content) you should use the non-real-time file. This will allocate more bandwidth to utilities such as mdscopy and vstag.

      4. Execute the script ovsstop located in the directory
      $ORACLE_HOME/vs21/admin:
      % ./ovsstop
      
      5. Edit the voltab file to include the maxbw value.
      video2 maxbw=55,striped,width=32k,raidsize=4, \
      
      dev/rdsk/c{4-7}t{0-3}d0s{6}
      

    Caution

    The above example shows the voltab entry divided across two lines. When editing a voltab entry it should all be on one line. The only division of lines should occur when your text editor wraps from one line to the next. Do not place a hard return in a voltab entry.

    You can now start the OVS with the ovsstart script using the modified voltab file (see step 1). The MDS volume will be mounted in real-time mode.

      6. Verify that the MDS volume is mounted in real-time mode using the mdsdir utility with the -v option. This will display the total available bandwidth of the volume.
      % mdsdir -v /mds/video2
      
      Volume name:                   video2
      
      Creation time:                 Jan 13 10:40:35
      
      Free TOC entries:              507
      
      Total bandwidth in Mbps:       55
      
          available                    55
      
          allocated:                   0
      
          RT denials:                  0
      
          Non-RT denials:              0
      

    Defragmenting the MDS

    Performing file operations on the Oracle Media Data Store (MDS), especially removing and truncating files, can leave gaps between files in your MDS volume. Although the Media Data Store process (mdsdirsrv) stores other files in these gaps if they fit, this fragmentation results in wasted disk space. You can defragment MDS volumes by running mdsdirsrv in a special mode with the defragmentor enabled. Because the performance of the MDS is not affected by disk fragmentation, defragmenting the MDS only reduces potentially wasted disk space; it does not improve performance.

    Use the mdsdirsrv command to start the defragmentation process. When the defragmenting is complete, all files in the defragmented volumes are stored contiguously. The mdsdirsrv process then exits.

    You cannot read from or write to a volume while defragmenting it:

    The defragmentor operates on one file at a time and writes a message to the screen for each file. If the defragmentor fails or is abnormally terminated, only one file can potentially be left corrupted. You can identify this file from the messages or with mdsdir. You can then remove it with mdsdelete and reload it with mdscopy or mdstar. For information on these utilities, see the Oracle Video Server Utilities User's Guide (online only).

    Syntax

    To defragment an MDS volume, first ensure that the OMS_BIN environment variable is set:

    % setenv OMS_BIN $ORACLE_HOME/bin
    

    Start mdsdirsrv with the defragmentor with this syntax:

    mdsdirsrv -W -d -f $ORACLE_HOME/vs21/admin/voltab
    

    where:

    -W

    mounts all volumes specified in the voltab file in read-write mode, except those volumes specified by -i or -r. See the section mdsdirsrv in Chapter 7, "Oracle Video Server Components Reference" of this guide for more information on mdsdirsrv.

    -d

    runs the defragmentor component of mdsdirsrv.

    -f

    identifies the voltab file that specifies the MDS volumes to be defragmented.

    Example

    The following command starts mdsdirsrv with the defragmentor:

    % mdsdirsrv -W -d -f $ORACLE_HOME/vs21/admin/voltab
    

    The mdsdirsrv process defragments the volumes specified in the voltab file in the directory $ORACLE_HOME/vs21/admin on the server.

    Replacing a Failed Disk with a Spare

    By checking the OVS log files, as described in Chapter 6 "Monitoring the Oracle Video Server," you might learn that a hard disk has failed. Disk sparing allows you to replace a failed hard disk without removing the OVS from service. To use disk sparing you must allow for a spare disk during the MDS configuration process. The spare disk for a volume is specified in the voltab file. For informastion on creating a voltab file with a spare disk definition, refer to the voltab section of Chapter 7, "Oracle Video Server Components Reference."

    Substituting the Spare Disk for a Failed Disk

    Follow these steps to transfer the data from a failed disk to a spare:

    1. Place the spare disk in rebuild mode using the mdsdiskmode utility with the -s option. This command redirects all read-write operations from the failed disk to the spare disk, and prepares the spare for rebuilding:
    2. mdsdiskmode -f $ORACLE_HOME/vs21/admin/voltab -s spare-disk \
      
      failed-disk
      
    3. Rebuild the data from the failed disk to the spare disk with the mdsrebuild utility:
    4. mdsrebuild -f $ORACLE_HOME/vs21/admin/voltab failed-disk
      

    Note that you specify the name of the failed disk when rebuilding data to the spare. Using mdsdiskmode causes the spare to be recognized in place of the failed disk by mdsdirsrv.

    The spare disk now takes the place of the failed disk until administrative downtime can be arranged to install a new disk.

    Example

    The following example shows how to use a spare disk in the event of a disk failure.

    Assume the voltab file defines the volume video with 12 disks in 3 RAID sets of 4 disks each, and one spare.

    Note

    The disk naming conventions used in this example may differ from your server platform's. Refer to your Oracle Video Server Installation Guide for disk naming conventions for your server platform.

    video maxbw=2048,striped,width=32k,raidsize=4, \
    
    spares=/dev/rdsk/c3t3d0s6 /dev/rdsk/c{0-3}t{0-2}d0s6
    
    
    

    Figure 5-1: MDS volume with spare disk.

    Suppose you receive a message that the second disk in the first SCSI chain has failed. This disk is identified as /dev/rdsk/c0t1d0s6 (Disk 5). The spare disk is identified as /dev/rdsk/c3t3d0s6 (spare). This disk is on the fourth SCSI chain of the volume video.

    To enable the spare disk and transfer data from the remaining disks to the spare, follow these steps:

    1. Place the failed disk /dev/rdsk/c0t1d0s06 (Disk 5) in rebuild mode using the mdsdiskmode with the -s option, which redirects all read-write operations to the spare disk dev/rdsk/c3t3d0s6, and prepares the spare for rebuilding.
    2. % mdsdiskmode -f $ORACLE_HOME/vs21/admin/voltab -s \
      
      /dev/rdsk/c3t3d0s6 /dev/rdsk/c0t1d0s6
      
    3. Rebuild the data from the failed disk /dev/rdsk/c0t1d0s6 (Disk 5) to the spare disk /dev/rdsk/c3t3d0s6 with mdsrebuild. Note that the voltab file you specify with -f is used to write the volume information to the disk:
    4. % mdsrebuild -f $ORACLE_HOME/vs21/admin/voltab
      
      /dev/rdsk/c0t1d0s6 /dev/rdsk/c3t3d0s6
      

    mdsrebuild reads the remaining disks in the RAID set to obtain their parity information. This information is used to reconstruct the data stored on the failed disk and write it to the spare.

    Replacing the Failed Disk

    When administrative downtime can be arranged, swap the failed disk with the rebuilt spare and replace the spare disk with a new unit. This saves you from having to reconstruct the data on the replacement disk.

    1. Shutdown the OVS with the ovsstop script located in
      $ORACLE_HOME/vs21/admin.
    2. % ./ovsstop
      
    3. Physically replace the failed disk (Disk 5) with the spare disk so you do not need to rebuild the data to the replacement unit. Replace the spare disk with a new unit so the volume can withstand another disk failure.
    4. When you bring the system back up, use the script mnstart. This will start the OMN processes and allow you to unspare the failed disk.
    5. % ./mnstart
      
    6. Unspare the failed disk /dev/rdsk/c0t1d0s6 (Disk 5) with the mdsdiskmode utility using the -u switch:
    7. % mdsdiskmode -f $ORACLE_HOME/vs21/admin/voltab \
      
      -u /dev/rdsk/c0t1d0s6
      

    You must unspare a disk so that mdsdirsrv reads and writes to the correct disk, which is /dev/rdsk/c0t1d0s6 (Disk 5) and not the replacement spare disk /dev/rdsk/c3t3d0s6.

    Warning

    Make sure to unspare the disk before starting mdsdirsrv. If you do not unspare the disk, it will not be recognized by mdsdirsrv as a usable disk.

    1. Stop OMN with the mnstop script.
    2. % ./mnstop
      
    3. Start the OVS with the ovsstart script.
    4. % ./ovsstart
      




    Prev

    Next
    Oracle
    Copyright © 1997 Oracle Corporation.
    All Rights Reserved.

    Library

    Product

    Contents

    Index