{"id":75,"date":"2014-01-02T23:00:43","date_gmt":"2014-01-02T15:00:43","guid":{"rendered":"http:\/\/suherman.asia\/w2\/?p=75"},"modified":"2014-02-20T23:39:17","modified_gmt":"2014-02-20T15:39:17","slug":"how-to-create-contained-database","status":"publish","type":"post","link":"http:\/\/suherman.asia\/w2\/how-to-create-contained-database.html","title":{"rendered":"How to Create Contained Database"},"content":{"rendered":"<p>Melanjutkan artikel saya tentang <a title=\"SQL Server 2012 New Feature ; Contained database\" href=\"http:\/\/suherman.asia\/w2\/sql-server-2012-new-feature-contained-database.html\" target=\"_blank\">Contained Database<\/a> beberapa hari lalu. saya coba lanjutkan dengan cara membuat Contained Database di sebuah Instance. Fitur Contained Database di SQL Server 2012 secara default adalah dalam posisi disabled. Oleh sebab itu kita harus meng-enabled kannya terlebih dahulu.<\/p>\n<pre class=\"csharpcode\"><span class=\"kwrd\">EXEC<\/span> SP_CONFIGURE <span class=\"str\">'show advanced options'<\/span>,1\r\n<span class=\"kwrd\">GO<\/span>\r\n\r\n<span class=\"kwrd\">RECONFIGURE<\/span>\r\n<span class=\"kwrd\">GO<\/span>\r\n\r\n<span class=\"kwrd\">EXEC<\/span> SP_CONFIGURE <span class=\"str\">'contained database authentication'<\/span>,1\r\n<span class=\"kwrd\">GO<\/span>\r\n\r\n<span class=\"kwrd\">RECONFIGURE<\/span>\r\nGO<\/pre>\n<p>Setelah itu barulah kita dapat membuat Contained Database nya, berikut ini saya coba membuat database sederhana yang namanya CDB2<\/p>\n<pre class=\"csharpcode\"><span class=\"kwrd\">USE<\/span> [master]\r\n<span class=\"kwrd\">GO<\/span>\r\n\r\n<span class=\"kwrd\">CREATE<\/span> <span class=\"kwrd\">DATABASE<\/span> [CDB2] CONTAINMENT = PARTIAL<\/pre>\n<p>Selanjutnya kita akan coba bagaimana membuat user untuk database CDB2 ini.<\/p>\n<pre class=\"csharpcode\"><span class=\"kwrd\">USE<\/span> [CDB2]\r\n<span class=\"kwrd\">GO<\/span>\r\n\r\n<span class=\"kwrd\">CREATE<\/span> <span class=\"kwrd\">USER<\/span> [MugiBJM] <span class=\"kwrd\">WITH<\/span> PASSWORD=N<span class=\"str\">'P@ssw0rd'<\/span>\r\n<span class=\"kwrd\">GO<\/span>\r\n\r\n<span class=\"kwrd\">USE<\/span> [CDB2]\r\n<span class=\"kwrd\">GO<\/span>\r\n\r\n<span class=\"kwrd\">ALTER<\/span> <span class=\"kwrd\">ROLE<\/span> [db_datareader] <span class=\"kwrd\">ADD<\/span> MEMBER [MugiBJM]\r\nGO<\/pre>\n<p>Jika anda check keberadaan User MugiBJM di Level Instance pada folder Security \u2013&gt; Logins, maka anda tidak akan pernah menemukannya. Namun user tersebut terdaftar pada security level Database. Mari kita coba melakukan login ke dalam database CDB2 dengan menggunakan user MugiBJM <a href=\"\/cfs-file.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/suherman\/image_5F00_46C3AFB6.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" alt=\"image\" src=\"http:\/\/mugi.or.id\/cfs-file.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/suherman\/image_5F00_thumb_5F00_07A27F5B.png\" width=\"430\" height=\"325\" border=\"0\" \/><\/a><\/p>\n<style type=\"text\/css\"><\/style>\n<p>Jangan langsung tekan tombol Connect, tapi tekan lebih dahulu tombol options&gt;&gt; lalu ketik secara manual nama database yang hendak diakses pada isian \u2018Connect to Database\u2019 <a href=\"\/cfs-file.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/suherman\/image_5F00_245BF470.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" alt=\"image\" src=\"http:\/\/mugi.or.id\/cfs-file.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/suherman\/image_5F00_thumb_5F00_0792598E.png\" width=\"407\" height=\"478\" border=\"0\" \/><\/a> Lalu tekan tombol Connect, dan walah anda berhasil login kedalam database CDB2 <a href=\"\/cfs-file.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/suherman\/image_5F00_5A6D46F2.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;\" title=\"image\" alt=\"image\" src=\"http:\/\/mugi.or.id\/cfs-file.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/suherman\/image_5F00_thumb_5F00_46DFE751.png\" width=\"403\" height=\"270\" border=\"0\" \/><\/a> Demikian semoga bermanfaat.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Melanjutkan artikel saya tentang Contained Database beberapa hari lalu. saya coba lanjutkan dengan cara membuat Contained Database di sebuah Instance. Fitur Contained Database di SQL Server 2012 secara default adalah dalam posisi disabled. Oleh sebab itu kita harus meng-enabled kannya terlebih dahulu. EXEC SP_CONFIGURE &#8216;show advanced options&#8217;,1 GO RECONFIGURE GO \u2026<\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"http:\/\/suherman.asia\/w2\/how-to-create-contained-database.html\">Continue reading<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":112,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[25],"class_list":["post-75","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql-server","tag-contained-database"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Create Contained Database - Suherman Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create Contained Database - Suherman Blog\" \/>\n<meta property=\"og:description\" content=\"Melanjutkan artikel saya tentang Contained Database beberapa hari lalu. saya coba lanjutkan dengan cara membuat Contained Database di sebuah Instance. Fitur Contained Database di SQL Server 2012 secara default adalah dalam posisi disabled. Oleh sebab itu kita harus meng-enabled kannya terlebih dahulu. EXEC SP_CONFIGURE &#039;show advanced options&#039;,1 GO RECONFIGURE GO \u2026 Continue reading\" \/>\n<meta property=\"og:url\" content=\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html\" \/>\n<meta property=\"og:site_name\" content=\"Suherman Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/emantin34\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/emantin34\" \/>\n<meta property=\"article:published_time\" content=\"2014-01-02T15:00:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-02-20T15:39:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/w3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"394\" \/>\n\t<meta property=\"og:image:height\" content=\"262\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#article\",\"isPartOf\":{\"@id\":\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html\"},\"author\":{\"name\":\"admin\",\"@id\":\"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc\"},\"headline\":\"How to Create Contained Database\",\"datePublished\":\"2014-01-02T15:00:43+00:00\",\"dateModified\":\"2014-02-20T15:39:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html\"},\"wordCount\":159,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc\"},\"image\":{\"@id\":\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#primaryimage\"},\"thumbnailUrl\":\"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/w3.png\",\"keywords\":[\"Contained database\"],\"articleSection\":[\"SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html\",\"url\":\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html\",\"name\":\"How to Create Contained Database - Suherman Blog\",\"isPartOf\":{\"@id\":\"http:\/\/suherman.asia\/w2\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#primaryimage\"},\"image\":{\"@id\":\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#primaryimage\"},\"thumbnailUrl\":\"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/w3.png\",\"datePublished\":\"2014-01-02T15:00:43+00:00\",\"dateModified\":\"2014-02-20T15:39:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#primaryimage\",\"url\":\"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/w3.png\",\"contentUrl\":\"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/w3.png\",\"width\":394,\"height\":262},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/suherman.asia\/w2\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create Contained Database\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/suherman.asia\/w2\/#website\",\"url\":\"http:\/\/suherman.asia\/w2\/\",\"name\":\"Suherman Blog\",\"description\":\"Just Another Geek Site\",\"publisher\":{\"@id\":\"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/suherman.asia\/w2\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/suherman.asia\/w2\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/eed6f889b4c2af2a8c18cb3bf63de6a4?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/eed6f889b4c2af2a8c18cb3bf63de6a4?s=96&d=retro&r=g\",\"caption\":\"admin\"},\"logo\":{\"@id\":\"http:\/\/suherman.asia\/w2\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/suherman.asia\",\"https:\/\/www.facebook.com\/emantin34\",\"https:\/\/x.com\/emantin34\"],\"url\":\"http:\/\/suherman.asia\/w2\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create Contained Database - Suherman Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html","og_locale":"en_US","og_type":"article","og_title":"How to Create Contained Database - Suherman Blog","og_description":"Melanjutkan artikel saya tentang Contained Database beberapa hari lalu. saya coba lanjutkan dengan cara membuat Contained Database di sebuah Instance. Fitur Contained Database di SQL Server 2012 secara default adalah dalam posisi disabled. Oleh sebab itu kita harus meng-enabled kannya terlebih dahulu. EXEC SP_CONFIGURE 'show advanced options',1 GO RECONFIGURE GO \u2026 Continue reading","og_url":"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html","og_site_name":"Suherman Blog","article_publisher":"https:\/\/www.facebook.com\/emantin34","article_author":"https:\/\/www.facebook.com\/emantin34","article_published_time":"2014-01-02T15:00:43+00:00","article_modified_time":"2014-02-20T15:39:17+00:00","og_image":[{"width":394,"height":262,"url":"https:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/w3.png","type":"image\/png"}],"author":"admin","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#article","isPartOf":{"@id":"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html"},"author":{"name":"admin","@id":"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc"},"headline":"How to Create Contained Database","datePublished":"2014-01-02T15:00:43+00:00","dateModified":"2014-02-20T15:39:17+00:00","mainEntityOfPage":{"@id":"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html"},"wordCount":159,"commentCount":0,"publisher":{"@id":"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc"},"image":{"@id":"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#primaryimage"},"thumbnailUrl":"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/w3.png","keywords":["Contained database"],"articleSection":["SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html","url":"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html","name":"How to Create Contained Database - Suherman Blog","isPartOf":{"@id":"http:\/\/suherman.asia\/w2\/#website"},"primaryImageOfPage":{"@id":"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#primaryimage"},"image":{"@id":"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#primaryimage"},"thumbnailUrl":"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/w3.png","datePublished":"2014-01-02T15:00:43+00:00","dateModified":"2014-02-20T15:39:17+00:00","breadcrumb":{"@id":"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#primaryimage","url":"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/w3.png","contentUrl":"http:\/\/suherman.asia\/w2\/wp-content\/uploads\/2014\/01\/w3.png","width":394,"height":262},{"@type":"BreadcrumbList","@id":"https:\/\/suherman.asia\/w2\/how-to-create-contained-database.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/suherman.asia\/w2"},{"@type":"ListItem","position":2,"name":"How to Create Contained Database"}]},{"@type":"WebSite","@id":"http:\/\/suherman.asia\/w2\/#website","url":"http:\/\/suherman.asia\/w2\/","name":"Suherman Blog","description":"Just Another Geek Site","publisher":{"@id":"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/suherman.asia\/w2\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"http:\/\/suherman.asia\/w2\/#\/schema\/person\/63654a129ee88012961c1a00415967dc","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/suherman.asia\/w2\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/eed6f889b4c2af2a8c18cb3bf63de6a4?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/eed6f889b4c2af2a8c18cb3bf63de6a4?s=96&d=retro&r=g","caption":"admin"},"logo":{"@id":"http:\/\/suherman.asia\/w2\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/suherman.asia","https:\/\/www.facebook.com\/emantin34","https:\/\/x.com\/emantin34"],"url":"http:\/\/suherman.asia\/w2\/author\/admin"}]}},"_links":{"self":[{"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/posts\/75","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/comments?post=75"}],"version-history":[{"count":3,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/posts\/75\/revisions"}],"predecessor-version":[{"id":208,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/posts\/75\/revisions\/208"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/media?parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/categories?post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/suherman.asia\/w2\/wp-json\/wp\/v2\/tags?post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}