Oracle Database 23ai 创建新用户

1. 创建新用户

sqlplus sys@localhost:1521/orclpdb1 as sysdba

Create bigfile tablespace tbs100
Datafile 'bigtbs_f100.dbf' 
SIZE 1G AUTOEXTEND ON
next 32m maxsize unlimited
extent management local
segment space management auto;

CREATE UNDO TABLESPACE undots100
   DATAFILE 'undotbs_100a.dbf'
   SIZE 1G AUTOEXTEND ON
   RETENTION GUARANTEE;
 
CREATE TEMPORARY TABLESPACE temp_demo100
TEMPFILE 'temp100.dbf' SIZE 1G reuse AUTOEXTEND ON
next 32m maxsize unlimited extent management local uniform size 1m;

-- vector100

create user vector100 identified by vector100
default tablespace tbs100
quota unlimited on tbs100;

grant DB_DEVELOPER_ROLE, connect, ctxapp, unlimited tablespace, create credential, create procedure, create table to vector100;
grant execute on sys.dmutil_lib to vector100;
grant create mining model to vector100;

BEGIN
  DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
    host => '*',
    ace => xs$ace_type(privilege_list => xs$name_list('connect'),
                       principal_name => 'vector100',
                       principal_type => xs_acl.ptype_db));
END;
 / 

2. 配置 cohere 认证

awk '/^--/{ next } { printf "%s", $0 } END { printf "\n" }' <your_private_key_file_path> | tr -d '\n'
sqlplus vector100/vector100@localhost:1521/orclpdb1
-- 初回の実行では必要なし
-- exec dbms_vector.drop_credential('OCI_CRED');
declare
 jo json_object_t;
begin
 -- create an OCI credential
 jo := json_object_t();
 jo.put('user_ocid', 'user ocid value');
 jo.put('tenancy_ocid', 'tenancy ocid value');
 jo.put('compartment_ocid', 'compartment ocid value');
 jo.put('private_key', 'private key value');
 jo.put('fingerprint', 'fingerprint value');
 dbms_output.put_line(jo.to_string);
 dbms_vector.create_credential(
   credential_name => 'OCI_CRED',
   params          => json(jo.to_string));
end;
/

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部