Loaddbs.sql- commands to load database dumps Generate Dump Scripts. If you have no OpenAmeos installation on the Sybase server machine, set performdump to False. The script will in this case create the following required SQL script to dump and load the databases on the server: dumpdbs.log - commands to create database dumps. Create an index: If the dump order is not as important as the dump-and-load down time, create a small index on a tiny field. I have lived through situations where the time to create the index, build it then dump the data was still much faster than dumping with one of the existing indexes. If you can, run an idxcheck on the database in the.
Description
Creates a new database.
Syntax
Syntax for nonclustered environments:
Syntax for cluster environments:
Parameters
- temporary
- inmemory
- database_name
- on
- default
is the logical name of the device on which to locatethe database. A database can occupy different amounts of space oneach of several database devices. To add database devices to AdaptiveServer, use disk init.
- size
- log on
- with
- durability =
- compression
- lob_compression = off | compression_level
- inrow_lob_length = value
- dml_logging
- full | minimal
invokes a streamlined version of createdatabase that you can use only for loading a databasedump. See “Using the for load option”.
- for proxy_update
- global temporary
- system temporary
- temporary
![Imdb Database Dump And Load Imdb Database Dump And Load](/uploads/1/2/6/3/126339943/200365539.png)
- for instance instance_name
Examples
Example 1
Example 2
Example 3
Example 4
Example 5
Example 6
Example 7
Example 8
Example 9
Example 10
Example 11
Example 12
Example 13
Example 14
Example 15
Example 16
Example 17
Example 18
Example 19
Example 20
Example 21
Example 22
Usage
- Because Adaptive Server allocates space for databasesfor create database and alter database inchunks of 256 logical pages, these commands round the specifiedsize down to the nearest multiple of allocation units.
- If you do not include a unit specifier, AdaptiveServer interprets the size in terms of megabytes of disk space,and this number is converted to the logical page size the serveruses.
- Ifyou do not specify a location and size for a database, the defaultlocation is any default database devices indicated in master..sysdevices.The default size is the larger of the size of the model databaseor the defaultdatabase size parameterin sysconfigures.systemadministrators can increase the default size by using sp_configure tochange the value of default database size andrestarting Adaptive Server. The default database size parametermust be at least as large as the model database.If you increase the size of the model database,you must also increase the default size.If Adaptive Server cannot give you as much space as you wantwhere you have requested it, it comes as close as possible, on aper-device basis, and prints a message telling how muchspace was allocated and where it was allocated. The maximum sizeof a database is system-dependent.
- If you create a proxy database using:The presence of the device name is enough to bypass size calculation,and this command may fail if the default database size (the sizeof the model database) is not large enoughto contain all of the proxy tables.To allow CIS to estimate database size, do not include anydevice name or other option with this command:
Restrictions
- Eachtime you allocate space on a database device with createdatabase or alter database, that allocation representsa device fragment, and the allocation is entered as a row in sysusages.
- Themaximum number of named segments for a database is 32. Segments arenamed subsets of database devices available to a particular Adaptive Server.For more information about segments, see the System AdministrationGuide.
Temporary databases
- Ifyou create a database and fail to back up master,you may be able to recover the changes with disk reinit.
- The withoverride clause allows you to mix log and data segmentson a single device. However, for full recoverability, the deviceor devices specified in log on should be differentfrom the physical device that stores the data. In the event of ahard-disk failure, you can recover the database from databasedumps and transaction logs.You can create a small database on a single device that isused to store both the transaction log and the data, but you must relyon the dump database command for backups.
- The size of the devicerequired for the transaction log varies according to the amountof update activity and the frequency of transaction log dumps. Asa rule of thumb, allocate to the log device 10 – 25 percentof the space you allocate to the database itself. It is best tostart small, since space allocated to a transaction log device cannotbe reclaimed and cannot be used for storing data.
Using the for load option
Youcan use the for load option for recovering frommedia failure or for moving a database from one machine to another,if you have not added to the database with sp_addsegment.Use alter databasefor load tocreate a new database in the image of the database from which thedatabase dump to be loaded was made. For a discussion of duplicatingspace allocation when loading a dump into a new database, see the SystemAdministration Guide.
- Whenyou create a database using the for load option,you can run only the following commands in the new database beforeloading a database dump:
- alter database forload
After you load the database dump into the new database, youcan also use some dbcc diagnostic commandsin the databases. After you issue the online database command, there areno restrictions on the commands you can use. - Adatabase created with the for load option hasa status of “don’t recover” in sp_helpdb output.
Getting information about databases
Standards
Permissions
create database permission is not includedin the grantall command.
Auditing
Values in event and extrainfo columnsof sysaudits are:
Event | Audit option | Command or access audited | Informationin extrainfo |
---|---|---|---|
9 | create | create database |
|
See also
Commandsalter database, disk init, drop database, dump database, load database, online database
System proceduressp_changedbowner, sp_diskdefault, sp_helpdb, sp_logdevice, sp_renamedb, sp_spaceused
Copyright © 2011. Sybase Inc. All rights reserved. |
A database dump (also: SQL dump) contains a record of the table structure and/or the data from a database and is usually in the form of a list of SQL statements. A database dump is most often used for backing up a database so that its contents can be restored in the event of data loss. Corrupted databases can often be recovered by analysis of the dump. Database dumps are often published by free software and free content projects, to allow reuse or forking of the database.
See also[edit]
- SQLyog- MySQL GUI tool to generate Database dump
External links[edit]
- PostgreSQL dump backup methods, for PostgreSQL databases.
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Database_dump&oldid=934783700'