SODA権限を持つ全シャード・ユーザーの作成

分散データベースにスキーマ・オブジェクトを作成する権限を持ち、DBMS_SODA PL/SQLパッケージに対して必要なexecute権限も持つユーザーをシャード・カタログに作成します。

このドキュメントにおいては、ユーザーはSharding/SODAユーザーと呼ばれ、例でのユーザー名はapp_schemaです。

Sharding/SODAユーザーを作成するには、次のようにします。

  1. シャード・カタログ・データベースに(たとえば、SYSDBAとして)接続します。
  2. SHARD DDLを有効にします。
  3. CREATE USERコマンドを実行して、次の例に示す権限を付与します。

    Sharding/SODAユーザーは、CDBではなくPDBに作成されます。

Sharding/SODAユーザー作成スクリプトの例を次に示します。

-- Set the container and create the sharded user
alter session set container=SDBPDB;
alter session enable shard ddl;
create user app_schema identified by password;
 
-- Grant basic privileges
grant connect, resource, alter session to app_schema;
grant execute on dbms_crypto to app_schema;

-- All privileges below are required. User can also be granted all privileges
grant create table, create procedure, create tablespace, create
materialized view to app_schema;
grant unlimited tablespace to app_schema;
grant select_catalog_role to app_schema;

-- Grant soda_app for this user
grant soda_app to app_schema;

-- Specific grants on shard plsql
grant execute on exec_shard_plsql to app_schema;
grant gsmadmin_role to app_schema;
grant gsm_pooladmin_role to app_schema;

標準のデータベース・スキーマ権限と、ユーザーに付与された標準のSODA権限を書き留めます。exec_shard_plsql付与は、Sharding/SODAユーザーに必要なシャーディング固有の権限で、これにより、ユーザーは分散データベースでPL/SQLプロシージャを実行できるようになります。

シャーディング・ユーザーの作成やPL/SQLの実行など、Oracle Globally Distributed Databaseのスキーマ設計の詳細は、Oracle Globally Distributed Databaseスキーマ設計を参照してください。