1:创建临时表空间

create temporary tablespace user_temp(临时表空间名)  
tempfile 'Q:\oracle\product\10.2.0\oradata\Test\xyrj_temp.dbf' 
size 50m  
autoextend on  
next 50m maxsize 20480m  
extent management local; 

2:创建数据表空间

create tablespace user_data(数据表名)  
logging  
datafile 'Q:\oracle\product\10.2.0\oradata\Test\xyrj_data.dbf' 
size 50m  
autoextend on  
next 50m maxsize 20480m  
extent management local;  

3:创建用户并指定表空间

create user username(用户名) identified by  password(用户密码)
default tablespace user_data  (绑定数据表)
temporary tablespace user_temp; (绑定临时表空间名)

4:给用户授予权限

grant connect,resource,dba to username;(用户名)
Oracle数据库查询本地数据库id:select sys_context('userenv','ip_address') from dual;