我想在脚本文件中创建一个带有 oracle 变量的 oracle 用户,而不是 PL/SQL 客户端。
像这样的东西:
define var DBUSERNAME = 'AAA';
CREATE USER '&DBUSERNAME' PROFILE "DEFAULT" IDENTIFIED BY "pwd123" DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" ACCOUNT UNLOCK
BEGIN
DBMS_WM.GrantSystemPriv('ACCESS_ANY_WORKSPACE', '&DBUSERNAME', 'NO');
END;
GRANT ADMINISTER ANY SQL TUNING SET TO '&DBUSERNAME'
GRANT ADMINISTER DATABASE TRIGGER TO '&DBUSERNAME'
BEGIN
dbms_resource_manager_privs.grant_system_privilege(privilege_name=>'ADMINISTER_RESOURCE_MANAGER', grantee_name=>'&DBUSERNAME', admin_option=>FALSE);
END;
GRANT ADMINISTER SQL TUNING SET TO '&DBUSERNAME'
GRANT ADVISOR TO '&DBUSERNAME'
...