lock table  online database

Chapter 1: Commands

mount

Description

Use the mount command to attach a database to a destination or secondary Adaptive Server. The mount command decodes the information in the manifest file and makes the set of databases available. The mount command differs from other copying procedures such as the bcp bulk copy utility in that all required supporting activities are executed, including adding database devices, if necessary, and activating them, creating the catalog entries for the new databases, and recovering them.

NoteYou cannot execute mount without first performing unmount on your database.

Before mounting the databases, use mount with listonly and modify the device path names at the destination Adaptive Server. Then use mount to actually mount the databases.

You cannot include more than eight databases in a single mount command.

WARNING!  For every login that is allowed access to a database on the original Adaptive Server, a corresponding login for the same suid must exist at the destination Adaptive Server.

For permissions to remain unchanged, the login maps at the destination Adaptive Server must be identical to that on the source Adaptive Server. For more information on login maps, see Chapter 15, “Managing Remote Servers” in System Administration Guide, Volume 1.

Syntax

mount database all from <manifest_file> [with listonly]

Parameters

manifest_file

The manifest file is the binary file that describes the databases that are present on a set of database devices.

Operations that can perform character translations of the file contents (such as ftp) corrupt the manifest file unless performed in binary mode.

Examples

Example 1

Finds the path names listed on the manifest file from the source Adaptive Server:

mount database all from "/data/sybase2/mfile1" with listonly
go
"/data/sybase1/d0.dbs" = "1dev1"
"/data/sybase2/d14.dbs" = "1dev13"

When you have the path names, verify or modify them to meet your criteria at the destination Adaptive Server.

Example 2

When the database is loaded to the secondary Adaptive Server, you then mount it.

mount database all from "/data/sybase2/mfile1" using     "/data/sybase2/d0.dbs" = "1dev1", 
    "/data/sybase2/d14.dbs" = "1dev13"

When the mount process has completed, the database is still offline. Use the online database command to bring the database online. You need not restart the server.

Usage


Destination changes

Once databases are mounted on the destination Adaptive Server, certain settings are cleared on the mounted database:


System considerations


Performance considerations

When you mount databases onto an Adaptive Server:


Renaming devices

The manifest file contains the device paths known to the source Adaptive Server that created the manifest file. If the destination Adaptive Server accesses the devices with a different path, you can specify the new path to the mount command.

  1. Use the mount command with listonly to display the old path:

    mount database all from "/work2/Mpubs_file" with listonly
    go
    
    "/work2/Devices/pubsdat.dat" = "pubs2dat"
    
  2. If the new path for the device pubs2dat is /work2/Devices/pubsdevice.dat (the devices path in Windows), specify the new device in the mount command:

    mount database all from "/work2/Mpubs_file" using "/work2/datadevices/pubsdevice.dat" = "pubs2dat"
    

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

mount requires an sa or dba role.

Auditing

Values in event and extrainfo columns of sysaudits are:

Event

Audit option

Command or access audited

Information in extrainfo

101

mount

mount database

  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – NULL

  • Proxy information – Original login name, if a set proxy is in effect

See also

Commands unmount, quiesce database

Documentation Chapter 7, “Database Mount and Unmount,” in System Administration Guide Volume 2





Copyright © 2005. Sybase Inc. All rights reserved. online database

View this book as PDF