創建Oracle用戶和授權的過程分為以下幾個步驟:
sqlplus sys as sysdba
輸入密碼后,進入SQL*Plus命令行環境。
your_username
和your_password
替換為實際的用戶名和密碼):CREATE USER your_username IDENTIFIED BY your_password;
例如:
CREATE USER myuser IDENTIFIED BY mypassword;
GRANT CREATE SESSION, CREATE TABLE, CREATE VIEW, CREATE PROCEDURE, CREATE SEQUENCE, CREATE TRIGGER TO your_username;
other_schema
替換為實際的模式名):GRANT SELECT, INSERT, UPDATE, DELETE ON other_schema.* TO your_username;
GRANT DBA TO your_username;
ALTER USER your_username DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
EXIT;
現在,新創建的用戶已經具有相應的權限,可以登錄并訪問Oracle數據庫。