Oracle創建表空間、創建用戶以及授權
SQL*Plus: Release 11.2.0.1.0 Production on 星期二 11月 10 12:13:22 2020
Copyright (c) 1982, 2010, Oracle. All rights reserved.
請輸入用戶名: sys as sysdba
輸入口令:
連接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create temporary tablespace db_temp tempfile 'd:\app\Administrator\oradata\
db_temp.dbf' size 32m autoextend on next 32m maxsize unlimited extent management
local;
表空間已創建。
SQL> create tablespace db_data logging datafile 'd:\app\Administrator\oradata\db
_data.dbf' size 32m autoextend on next 32m maxsize unlimited extent management l
ocal;
表空間已創建。
SQL> create user zs identified by zs account unlock default tablespace db_data
temporary tablespace db_temp;
create zs identified by zs account unlock default tablespace db_data temp
orary tablespace db_temp
*
第 1 行出現錯誤:
ORA-01920: 用戶名 'ZS' 與另外一個用戶名或角色名發生沖突
SQL> drop user zs cascade;
用戶已刪除。
SQL> create user zs identified by zs account unlock default tablespace db_data
temporary tablespace db_temp;
用戶已創建。
SQL> grant connect,resource,dba to zs;
授權成功。
SQL> create user ls identified by ls ;
用戶已創建。
SQL> grant connect,resource,dba to ls;
授權成功。
SQL> 注意:oracle出現The Network Adapter could not establish the connection的問題
可能是監聽文件product\11.2.0\dbhome_1\NETWORK\ADMIN的listener.ora中的localhost沒有更改,
這里localhost改成你的數據庫安裝電腦的名字就可以了,修改過程中要先停止oracle的各個服務,之后修改,修改完成保存在重啟oracle服務即可