{"id":288,"date":"2019-03-01T18:26:08","date_gmt":"2019-03-01T10:26:08","guid":{"rendered":"http:\/\/www.821121.com\/?p=288"},"modified":"2020-12-25T10:52:45","modified_gmt":"2020-12-25T02:52:45","slug":"%e6%96%b0%e7%89%b9%e6%80%a7%ef%bc%9acdb-pdb%e7%9a%84%e7%bb%b4%e6%8a%a4%e5%91%bd%e4%bb%a4%ef%bc%9acdb%e3%80%81pdb%e7%9a%84%e7%94%a8%e6%88%b7%e7%ae%a1%e7%90%86%ef%bc%883%ef%bc%89%e5%88%9b%e5%bb%ba","status":"publish","type":"post","link":"http:\/\/www.821121.com\/?p=288","title":{"rendered":"\u65b0\u7279\u6027\uff1aCDB\/PDB\u7684\u7ef4\u62a4\u547d\u4ee4\uff1aCDB\u3001PDB\u7684\u7528\u6237\u7ba1\u7406\uff083\uff09\u521b\u5efa\u89d2\u8272"},"content":{"rendered":"<h2>\u67e5\u770b\u6240\u6709CDB\u3001PDB\u7684\u89d2\u8272<\/h2>\n<pre><code class=\"language-sql\">SQL&gt; col role format a30\nSQL&gt; col role format a30\nSQL&gt; select role,common,con_id from cdb_roles;\n\nROLE                           COMMON        CON_ID\n------------------------------ --------- ----------\nCONNECT                        YES                1\nRESOURCE                       YES                1\nDBA                            YES                1\nPDB_DBA                        YES                1\nAUDIT_ADMIN                    YES                1\nAUDIT_VIEWER                   YES                1\nSELECT_CATALOG_ROLE            YES                1\nEXECUTE_CATALOG_ROLE           YES                1\nCAPTURE_ADMIN                  YES                1\n.\n.\n.\n\nROLE                           COMMON        CON_ID\n------------------------------ --------- ----------\nDV_REALM_RESOURCE              YES                1\nCONNECT                        YES                3\nRESOURCE                       YES                3\nDBA                            YES                3\nPDB_DBA                        YES                3\nAUDIT_ADMIN                    YES                3\nAUDIT_VIEWER                   YES                3\nSELECT_CATALOG_ROLE            YES                3\nEXECUTE_CATALOG_ROLE           YES                3\nCAPTURE_ADMIN                  YES                3\nEXP_FULL_DATABASE              YES                3\n.\n.\n.\nDV_GOLDENGATE_REDO_ACCESS      YES                5\nDV_AUDIT_CLEANUP               YES                5\n\nROLE                           COMMON        CON_ID\n------------------------------ --------- ----------\nDV_DATAPUMP_NETWORK_LINK       YES                5\nDV_POLICY_OWNER                YES                5\nDV_REALM_RESOURCE              YES                5\n\n267 rows selected.<\/code><\/pre>\n<h2>\u5728CDB\u521b\u5efa\u89d2\u8272<\/h2>\n<pre><code class=\"language-sql\">SQL&gt; create role c##role;\n\nRole created.\n\nSQL&gt;  create role c##role1 container=current;\n create role c##role1 container=current\n             *\nERROR at line 1:\nORA-65094: invalid local user or role name\n\nSQL&gt; create role c##role1 ;\n\nRole created.<\/code><\/pre>\n<p>\u5728CDB\u53ea\u80fd\u521b\u5efacontainer=all\u7684\u89d2\u8272\uff0c\u9ed8\u8ba4\u4e5f\u662fcontainer=all\uff0c\u521b\u5efacontainer=current\u7684\u89d2\u8272\u4f1a\u62a5\u9519\u3002<\/p>\n<h2>\u5728PDB\u521b\u5efa\u89d2\u8272<\/h2>\n<pre><code class=\"language-sql\">SQL&gt; alter session set container=PDB1_WHS;\n\nSession altered.\n\nSQL&gt; create role testrole;\n\nRole created.\n\nSQL&gt; create role testrole1 container=all;\ncreate role testrole1 container=all\n*\nERROR at line 1:\nORA-65050: Common DDLs only allowed in root.<\/code><\/pre>\n<p>\u5728CDB\u53ea\u80fd\u521b\u5efacontainer=current\u7684\u89d2\u8272\uff0c\u9ed8\u8ba4\u4e5f\u662fcontainer=current\uff0c\u521b\u5efacontainer=all\u7684\u89d2\u8272\u4f1a\u62a5\u9519\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u67e5\u770b\u6240\u6709CDB\u3001PDB\u7684\u89d2\u8272 SQL&gt; co<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-288","post","type-post","status-publish","format-standard","hentry","category-oracle-12c"],"_links":{"self":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288"}],"version-history":[{"count":1,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions"}],"predecessor-version":[{"id":289,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions\/289"}],"wp:attachment":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}