{"id":1074,"date":"2013-03-08T14:03:21","date_gmt":"2013-03-08T13:03:21","guid":{"rendered":"http:\/\/www.bussink.ch\/?p=1074"},"modified":"2018-05-23T17:57:19","modified_gmt":"2018-05-23T15:57:19","slug":"vcenter-srm-5-1-database-creation-using-transact-sql","status":"publish","type":"post","link":"https:\/\/www.bussink.ch\/?p=1074","title":{"rendered":"vCenter SRM 5.1 database creation using Transact-SQL"},"content":{"rendered":"<p>I&#8217;ve created a simple Microsft SQL Server Transact-SQL script to configure the database for vCenter Site Recovery Manager (SRM) 5.1 . This allows you to quickly create the database on the primary site and the recovery site.<\/p>\n<p>I&#8217;m not too impressed by the description in the <a href=\"http:\/\/www.vmware.com\/support\/pubs\/srm_pubs.html\" target=\"_blank\">Site Recovery Manager 5.1 Installation and Configuration<\/a> documentation on page 20 as seen below&#8230;<\/p>\n<p>[box] This information provides the general steps that you must perform to configure an SQL Server database for SRM to use. For specific instructions, see the SQL Server documentation.<\/p>\n<p><strong>Procedure<\/strong><\/p>\n<p>1 Select an authentication mode when you create the database instance.<\/p>\n<p>Option &amp; Description<\/p>\n<p>Windows authentication. The database user account must be the same user account that you use to run the SRM service.<\/p>\n<p>SQL Authentication. Leave the default local system user.<\/p>\n<p>2 If SQL Server is installed on the same host as SRM Server, you might need to deselect the Shared Memory network setting on the database server.<\/p>\n<p>3 Create the SRM database user account.<\/p>\n<p>4 Grant the SRM database user account the bulk insert, connect, and create table permissions.<\/p>\n<p>5 Create the database schema. The SRM database schema must have the same name as the database user account.<\/p>\n<p>6 Set the SRM database user as the owner of the SRM database schema. 7 Set the SRM database schema as the default schema for the SRM database user.[\/box]<\/p>\n<p>&nbsp;<\/p>\n<p>My general rule when I create a SQL Server database is to have my user database on a separate disk from the operating system. This disk is formatted with 64K block size. SQL Server works with two specific IO request size 8K and 64K in general, so having 64K block size is optimum for SQL Server databases (See <a title=\"Disk Partition Alignment Best Practices for SQL Server\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd758814(v=sql.100).aspx\" target=\"_blank\">Disk partition alignment Best Practice for SQL Server<\/a> ). I usually create a directory path for my SQL database D:\\Microsoft SQL Server in which I will create the directories for the vCenter databases, vcenter-sso, vcenter-server, vcenter-update-manager and vcenter-srm.<\/p>\n<div id=\"attachment_1079\" style=\"width: 537px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.bussink.ch\/wp-content\/uploads\/\/2013\/03\/File_directories.jpg\"><img aria-describedby=\"caption-attachment-1079\" loading=\"lazy\" class=\" wp-image-1079    \" alt=\"Microsoft SQL Server directory structure for User Databases\" src=\"http:\/\/www.bussink.ch\/wp-content\/uploads\/\/2013\/03\/File_directories.jpg\" width=\"527\" height=\"239\" srcset=\"https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/File_directories.jpg 844w, https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/File_directories-300x135.jpg 300w\" sizes=\"(max-width: 527px) 100vw, 527px\" \/><\/a><p id=\"caption-attachment-1079\" class=\"wp-caption-text\">Microsoft SQL Server directory structure for User Databases<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>Now let&#8217;s insert the Transact-SQL script to create the vcenter-srm database. My database settings limits the database to grow past 2GB, and increases the database as it grows by blocks of 64MB. The initial size starts at 64MB.<br \/>\nI recommend that you cut &amp; paste the following Transact-SQL script into the SQL Server Management Studio and then select the sections to execute them one after another.<br \/>\n<code><\/code><\/p>\n<p>&nbsp;<\/p>\n<div>\n<div align=\"left\">[code]<\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">&#8212;\u00a0 Transact-SQL script to simplify the creation of the vCenter SRM 5.1 database<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">&#8212; this script as been created to run with a SQL Server 2008 R2 SP2 (10.50.4000)<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">&#8212;\u00a0 it should run without much changes on SQL Server 2012<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">&#8212;\u00a0<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">&#8212;\u00a0 Erik Bussink, Date created 08\/03\/2013<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">&#8212;\u00a0 Twitter @ErikBussink<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">&#8212;<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">\u00a0<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">&#8212; Let&#8217;s create the vcenter-srm database in the D:\\Microsoft SQL Server\\vcenter-srm\\<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">\u00a0<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">USE<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[master]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">CREATE<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">DATABASE<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[vcenter-srm]<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">on<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">PRIMARY<\/span><\/div>\n<div align=\"left\"><span style=\"color: #808080; font-family: Courier New; font-size: small;\">(<\/span><span style=\"color: #010101; font-family: Courier New; font-size: small;\">NAME<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #ff0000; font-family: Courier New; font-size: small;\">N&#8217;vcenter-srm&#8217;<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">FILENAME<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #ff0000; font-family: Courier New; font-size: small;\">N&#8217;D:\\Microsoft SQL Server\\vcenter-srm\\vcenter-srm.mdf&#8217;<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">SIZE<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">64MB<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">MAXSIZE<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">2048MB<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">FILEGROWTH<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">64MB<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">)<\/span><\/div>\n<div align=\"left\"><span style=\"color: #ff00ff; font-family: Courier New; font-size: small;\">LOG<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">ON<\/span><\/div>\n<div align=\"left\"><span style=\"color: #808080; font-family: Courier New; font-size: small;\">(<\/span><span style=\"color: #010101; font-family: Courier New; font-size: small;\">NAME<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #ff0000; font-family: Courier New; font-size: small;\">N&#8217;vcenter-srm_log&#8217;<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">FILENAME<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #ff0000; font-family: Courier New; font-size: small;\">N&#8217;D:\\Microsoft SQL Server\\vcenter-srm\\vcenter-srm.ldf&#8217;<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">SIZE<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">32MB<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">MAXSIZE<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">1024MB<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">FILEGROWTH<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">32MB<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">)<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">COLLATE<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">SQL_Latin1_General_CP1_CI_AS<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">\u00a0<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">&#8212; Let&#8217;s change some default settings for the [vcenter-srm] database<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">\u00a0<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">USE<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[vcenter-srm]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">ALTER<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">DATABASE<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[vcenter-srm]<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">SET<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">RECOVERY<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">SIMPLE<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">;<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">\u00a0<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">&#8212; Let&#8217;s create the vCenter SRM database account<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">\u00a0<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">USE<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[vcenter-srm]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">CREATE<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">LOGIN<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">WITH<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">PASSWORD<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #ff0000; font-family: Courier New; font-size: small;\">&#8216;password&#8217;<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">DEFAULT_DATABASE<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[vcenter-srm]<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">DEFAULT_LANGUAGE<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span><span style=\"color: #010101; font-family: Courier New; font-size: small;\">[us_english]<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">CHECK_POLICY<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">OFF<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">CREATE<\/span>\u00a0<span style=\"color: #ff00ff; font-family: Courier New; font-size: small;\">USER<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">for<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">LOGIN<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">WITH<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">DEFAULT_SCHEMA<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[dbo]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">CREATE<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">SCHEMA<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">AUTHORIZATION<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">ALTER<\/span>\u00a0<span style=\"color: #ff00ff; font-family: Courier New; font-size: small;\">USER<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">WITH<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">DEFAULT_SCHEMA<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span><span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">\u00a0<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">&#8212;\u00a0 Lets modify the [srmdb] account to have the required server right and user rights<\/span><\/div>\n<div align=\"left\"><span style=\"color: #008000; font-family: Courier New; font-size: small;\">\u00a0<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">USE<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[vcenter-srm]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">EXEC<\/span>\u00a0<span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">master<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">..<\/span><span style=\"color: #800000; font-family: Courier New; font-size: small;\">sp_addsrvrolemember<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">@loginame<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #ff0000; font-family: Courier New; font-size: small;\">N&#8217;srmdb&#8217;<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">@rolename<\/span>\u00a0<span style=\"color: #808080; font-family: Courier New; font-size: small;\">=<\/span>\u00a0<span style=\"color: #ff0000; font-family: Courier New; font-size: small;\">N&#8217;bulkadmin&#8217;<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #800000; font-family: Courier New; font-size: small;\">sp_addrolemember<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[db_accessadmin]<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #800000; font-family: Courier New; font-size: small;\">sp_addrolemember<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[db_backupoperator]<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #800000; font-family: Courier New; font-size: small;\">sp_addrolemember<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[db_datareader]<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #800000; font-family: Courier New; font-size: small;\">sp_addrolemember<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[db_datawriter]<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #800000; font-family: Courier New; font-size: small;\">sp_addrolemember<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[db_ddladmin]<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #800000; font-family: Courier New; font-size: small;\">sp_addrolemember<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[db_owner]<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<div align=\"left\"><span style=\"color: #800000; font-family: Courier New; font-size: small;\">sp_addrolemember<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[db_securityadmin]<\/span><span style=\"color: #808080; font-family: Courier New; font-size: small;\">,<\/span>\u00a0<span style=\"color: #010101; font-family: Courier New; font-size: small;\">[srmdb]<\/span><\/div>\n<div align=\"left\"><span style=\"color: #0000ff; font-family: Courier New; font-size: small;\">GO<\/span><\/div>\n<p>[\/code]<\/p>\n<p>Once you have uploaded the script you can execute the script step by step, by selecting the paragraph you want to run, then executing just the selected code.<\/p>\n<\/div>\n<p>Create the vcenter-srm database<\/p>\n<div id=\"attachment_1080\" style=\"width: 565px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.bussink.ch\/wp-content\/uploads\/\/2013\/03\/Create-the-vcenter-srm-database.jpg\"><img aria-describedby=\"caption-attachment-1080\" loading=\"lazy\" class=\" wp-image-1080     \" alt=\"Create the vcenter-srm database\" src=\"http:\/\/www.bussink.ch\/wp-content\/uploads\/\/2013\/03\/Create-the-vcenter-srm-database.jpg\" width=\"555\" height=\"223\" srcset=\"https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Create-the-vcenter-srm-database.jpg 1586w, https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Create-the-vcenter-srm-database-300x120.jpg 300w, https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Create-the-vcenter-srm-database-1024x411.jpg 1024w\" sizes=\"(max-width: 555px) 100vw, 555px\" \/><\/a><p id=\"caption-attachment-1080\" class=\"wp-caption-text\">Create the vcenter-srm database<\/p><\/div>\n<p>Modify the vcenter-srm database to put it in Single Recover mode<\/p>\n<div id=\"attachment_1081\" style=\"width: 564px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.bussink.ch\/wp-content\/uploads\/\/2013\/03\/Configure-vcenter-srm-database.jpg\"><img aria-describedby=\"caption-attachment-1081\" loading=\"lazy\" class=\" wp-image-1081   \" alt=\"Configure vcenter-srm database\" src=\"http:\/\/www.bussink.ch\/wp-content\/uploads\/\/2013\/03\/Configure-vcenter-srm-database.jpg\" width=\"554\" height=\"164\" srcset=\"https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Configure-vcenter-srm-database.jpg 977w, https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Configure-vcenter-srm-database-300x88.jpg 300w\" sizes=\"(max-width: 554px) 100vw, 554px\" \/><\/a><p id=\"caption-attachment-1081\" class=\"wp-caption-text\">Configure vcenter-srm database<\/p><\/div>\n<p>Create the srmdb user account &amp; schema &amp; change schema owner<\/p>\n<div id=\"attachment_1082\" style=\"width: 525px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.bussink.ch\/wp-content\/uploads\/\/2013\/03\/Create-srmdb-user.jpg\"><img aria-describedby=\"caption-attachment-1082\" loading=\"lazy\" class=\" wp-image-1082     \" alt=\"Create srmdb user\" src=\"http:\/\/www.bussink.ch\/wp-content\/uploads\/\/2013\/03\/Create-srmdb-user.jpg\" width=\"515\" height=\"175\" srcset=\"https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Create-srmdb-user.jpg 1472w, https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Create-srmdb-user-300x101.jpg 300w, https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Create-srmdb-user-1024x347.jpg 1024w\" sizes=\"(max-width: 515px) 100vw, 515px\" \/><\/a><p id=\"caption-attachment-1082\" class=\"wp-caption-text\">Create srmdb user<\/p><\/div>\n<p>Modify the srmdb user account with rights and<\/p>\n<div id=\"attachment_1083\" style=\"width: 533px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.bussink.ch\/wp-content\/uploads\/\/2013\/03\/Modify-srmdb-user.jpg\"><img aria-describedby=\"caption-attachment-1083\" loading=\"lazy\" class=\" wp-image-1083     \" alt=\"Modify srmdb user\" src=\"http:\/\/www.bussink.ch\/wp-content\/uploads\/\/2013\/03\/Modify-srmdb-user.jpg\" width=\"523\" height=\"251\" srcset=\"https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Modify-srmdb-user.jpg 1099w, https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Modify-srmdb-user-300x143.jpg 300w, https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Modify-srmdb-user-1024x490.jpg 1024w\" sizes=\"(max-width: 523px) 100vw, 523px\" \/><\/a><p id=\"caption-attachment-1083\" class=\"wp-caption-text\">Modify srmdb user<\/p><\/div>\n<p>And now we can check the user account with the proper rights.<\/p>\n<div id=\"attachment_1084\" style=\"width: 531px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.bussink.ch\/wp-content\/uploads\/\/2013\/03\/Validate-srmdb-user-rights.jpg\"><img aria-describedby=\"caption-attachment-1084\" loading=\"lazy\" class=\" wp-image-1084     \" alt=\"Validate srmdb user rights\" src=\"http:\/\/www.bussink.ch\/wp-content\/uploads\/\/2013\/03\/Validate-srmdb-user-rights.jpg\" width=\"521\" height=\"300\" srcset=\"https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Validate-srmdb-user-rights.jpg 1115w, https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Validate-srmdb-user-rights-300x172.jpg 300w, https:\/\/www.bussink.ch\/wp-content\/uploads\/2013\/03\/Validate-srmdb-user-rights-1024x589.jpg 1024w\" sizes=\"(max-width: 521px) 100vw, 521px\" \/><\/a><p id=\"caption-attachment-1084\" class=\"wp-caption-text\">Validate srmdb user rights<\/p><\/div>\n<p>I hope that you can now see how a simple well written Transact-SQL script can save you time &amp; errors when creating the Primary and Recovery site&#8217;s databases.<\/p>\n<p>I&#8217;ve created similar scripts to <a title=\"Create vCenter database quickly with Transact-SQL\" href=\"http:\/\/www.bussink.ch\/?p=317\" target=\"_blank\">Create vCenter Server databases with Transact-SQL<\/a>, and <a title=\"vCloud Director database creation using Transact-SQL\" href=\"http:\/\/www.bussink.ch\/?p=200\" target=\"_blank\">Create vCloud Director database with Transact-SQL<\/a> .<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve created a simple Microsft SQL Server Transact-SQL script to configure the database for vCenter Site Recovery Manager (SRM) 5.1 . This allows you to quickly create the database on the primary site and the recovery site. I&#8217;m not too impressed by the description in the Site Recovery Manager 5.1 Installation and Configuration documentation on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1103,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[18,81,19,82],"_links":{"self":[{"href":"https:\/\/www.bussink.ch\/index.php?rest_route=\/wp\/v2\/posts\/1074"}],"collection":[{"href":"https:\/\/www.bussink.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bussink.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bussink.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bussink.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1074"}],"version-history":[{"count":26,"href":"https:\/\/www.bussink.ch\/index.php?rest_route=\/wp\/v2\/posts\/1074\/revisions"}],"predecessor-version":[{"id":1938,"href":"https:\/\/www.bussink.ch\/index.php?rest_route=\/wp\/v2\/posts\/1074\/revisions\/1938"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bussink.ch\/index.php?rest_route=\/wp\/v2\/media\/1103"}],"wp:attachment":[{"href":"https:\/\/www.bussink.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bussink.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bussink.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}