Loading TOC...

info:database-create

info:database-create(
   $database-name as xs:string,
   [$forests-per-host as xs:positiveInteger?],
   [$group as xs:string?],
   [$data-directory as xs:string?],
   [$security-db as xs:string?],
   [$schemas-db as xs:string?],
   [$triggers-db as xs:string?]
) as xs:unsignedLong

Summary

[DEPRECATED] This function creates a database with attached forests. Forests are named sequentially using the pattern of databasename-1, databasename-2 and so on. The API checks for database and forest name conflicts, throwing an INFO-DUPLICATENAME error if any name conflicts are encountered. The database is created with default index settings. If $forests-per-host is an empty sequence or omitted, only one forest (regardless of number of hosts) is created. If database creation succeeds, the database id is returned.

Parameters
database-name Name of this database.
forests-per-host The number of forests to create per host in the group. Defaults to one forest for the database if not provided.
group The name of the group to which to add forests. The API determines which hosts are in the group and creates the specified number of forests for each host in the group. If not provided, the Default group is used.
data-directory A public data directory to use for forest creation. Default is none, resulting in a private data directory (server default).
security-db The name of the security database to use for database creation. Defaults to Security if not provided.
schemas-db The name of the schema database to use for database creation. Defaults to Schemas if not provided.
triggers-db The name of the triggers database to use for database creation. Defaults to Triggers if not provided.

Example

  xquery version "1.0-ml"; 

  import module namespace info = "http://marklogic.com/appservices/infostudio"  
      at "/MarkLogic/appservices/infostudio/info.xqy";

  info:database-create(
	"newDB",
	2,
	"Default",
	"/foobar",
	"Security",
	"Schemas",
	"Triggers")

  (: Creates a new database, named "newDB," and attaches to it two forests. :)
     

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.