Attaches a database to a destination or secondary SAP ASE server.
mount decodes the information in the manifest file and makes the set of databases available. mount 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.
If you are using different device names at the destination SAP ASE server when mounting the databases, use mount with listonly and modify the device path names at the destination server, then use mount to actually mount the databases.
For permissions to remain unchanged, the login maps at the destination SAP ASE server must be identical to that on the source SAP ASE server. For more information on login maps, see Managing Remote Servers in System Administration Guide, Volume 1.
mount database all | database_mapping[, database_mapping, ...] from "manifest_file" [using device_mapping [, device_mapping...] [with listonly] database_mapping: origdbname as newdbname | newdbname = origdbname | origdbname | newdbname device_mapping logical_device_name as new_physical_name | new_physical_name = logical_device_name | original_physical_name | new_physical_name
Operations that can perform character translations of the file contents (such as ftp) corrupt the manifest file unless performed in binary mode.
mount database all from "/data/sybase2/mfile1" with listonly go
[database] mydb [device] "/data/sybase1/d0.dbs" = "1dev1" "/data/sybase2/d14.dbs" = "1dev13"
When you use the path names different from the source ones, verify or modify them to meet your criteria at the destination SAP ASE server.
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 databases are still offline. Use the online database command to bring them online. You need not restart the server.
Create an exact copy of database mydb in the same server:
1> quiesce database mydb_tag hold mydb for external dump to "/data/mydb.manifest" 2> go
Copy the OS file:
$ cp /data/sybase2/mydb.dbs /data/sybase2/mydb_copy.dbs
You can now mount it as a copy:
1> quiesce database mydb_tag release 2> go 1> mount database mydb as mydb_copy 2> from "/data/mydb.manifest" 3> using mydb_dev as "/data/sybase2/mydb_copy.dbs" 3> go
The physical device //data/sybase2/mydb_copy.dbs/ is automatically assigned a machine-generated logical name with the format Cccc$<mydb_dev> where:
C – is [A–Z]
c – is [A–Z, 0–9], and refers to the encoded logical device number
mydb_dev – contains up to 26 characters from the old logical device name.
Database IDs for the transported databases should not exist on the destination SAP ASE server. Because the database has been mounted on the same server, the database ID had to be changed. The allocation pages in the mounted device keep the original database ID, and that information is used by the disk refit command. Use the dbcc checkalloc command to reconcile the dbid after running mount database so that disk refit can work on the mounted devices. Run checkalloc if the database is not being mounted for temporary use.
The using clause allows you to define a mapping via the “=” sign or the “as” clause.
If there are more than one device, a mapping can be one using “=” and another using “as.”
You can map devices by name in both databases and devices, specifying both logical and physical, and by order. If a database is mapped by name, all databases must be mapped by name and vice versa. The same happens for devices.
You cannot mount a subset of a transported set of databases at the destination SAP ASE server; all databases and their devices in the manifest file must be mounted together.
The page size in the destination SAP ASE server must be equal to the page size in the source SAP ASE server.
There must be enough devices configured at the destination SAP ASE server to successfully add all the devices belonging to the mounted databases.
If the logical device you are mounting from the source SAP ASE server has the same name as the logical device on the destination SAP ASE server, these devices are automatically renamed unless you include an alias with the mount command.
If the physical device name already exists on the destination SAP ASE server, you must rename the physical device name on the source SAP ASE server at the operating system level and provide the new physical device name with the mount command.
The log version must be the same in the source and destination SAP ASE servers.
You cannot mount a database from an SAP ASE server with a higher major version number. For example, you cannot mount a 15.0 version database on a 12.5.x version of SAP ASE.
The platforms of the source and destination SAP ASE servers must be the same.
Differences in the sort order or character set are resolved by rules followed by load database. A database with a different character set can be mounted only if the sort order is binary.
mount database and unmount database are supported in the Cluster Edition. If an instance fails while one of these commands is in progress, the command may abort. In this case, the user must reissue mount database or unmount database when the instance failover recovery is complete.
Replication is turned off.
Audit settings are cleared and turned off.
CIS options, default remote location, and type are cleared.
Cache bindings are dropped for both the mounted databases and their objects.
Recovery order is dropped for the mounted databases and becomes the default dbid order.
You cannot use the mount command in a transaction.
You cannot mount a database on server configured for high availability.
When you mount databases onto an SAP ASE server, if you change the dbid of the database you are mounting, all procedures are marked for recompilation in the database. This increases the time it takes to recover the database at the destination, and delays the first execution of the procedure.
Use the mount command with listonly to display the old path:
mount database all from "/work2/Mpubs_file" with listonly go
[database] mydb [device] "/work2/Devices/pubsdat.dat" = "pubs2dat"
mount database all from "/work2/Mpubs_file" using "/work2/datadevices/pubsdevice.dat" = "pubs2dat"
If the logical device names exist in the destination server, they are renamed using an automatically generated unique name.
See also Database Mount and Unmount in System Administration Guide: Volume 2.
ANSI SQL – Compliance level: Transact-SQL extension.
The permission checks for mount differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be a user with mount any database privilege. |
Disabled | With granular permissions disabled, you must be a user with sa_role or oper_role. |
Values in event and extrainfo columns of sysaudits are:
Information | Values |
---|---|
Event | 101 |
Audit option | mount |
Command or access audited | mount database |
Information in extrainfo |
|