用sys或具有dba权限的用户登录sqlplus:
创建用户并分配表空间
CREATE USER XDFWEBIDENTIFIED BY XDFWEB
DEFAULT TABLESPACE "XDF"
TEMPORARY TABLESPACE "TEMP"
QUOTA UNLIMITED ON "XDF";
授予权限,并清除角色
GRANT CONNECT TO XDFWEB;
ALTER USER XDFWEB DEFAULT ROLE NONE;
GRANT CREATE SESSION TO XDFWEB;
授予用户XDFWEB查询某几个视图或表的权限
GRANT SELECT ON XDF.V_WEB_CFS_STUFFWORK TOXDFWEB;
GRANT SELECT ON XDF.V_WEB_CNTE TO XDFWEB;
GRANT SELECT ON XDF.V_WEB_CNTR_WORK_DETAILTO XDFWEB;
GRANT SELECT ON XDF.V_WEB_OMS_STUFF TOXDFWEB;
GRANT SELECT ON XDF.V_WEB_OMS_STUFFCNTR TOXDFWEB;
GRANT SELECT ON XDF.V_WEB_OMS_STUFFDETAILTO XDFWEB;
GRANT SELECT ON XDF.V_WEB_SHIPQUERY TOXDFWEB;
GRANT SELECT ON XDF.V_WEB_STUFF_CNTR TOXDFWEB;
GRANT SELECT ON XDF.V_WEB_SYS_VOYAGE TOXDFWEB;
GRANT SELECT ON XDF.V_WEB_VOYAGE_MANAGE TOXDFWEB;
GRANT SELECT ON XDF.V_WEB_VOYAGE_NAME1 TOXDFWEB;
GRANT SELECT ON XDF.V_WEB_VOYAGE TO XDFWEB;
GRANTSELECTONXDF.T_WEB_USER_INFOR TO XDFWEB;
创建同义词
CREATE PUBLIC SYNONYM V_WEB_CFS_STUFFWORKFOR XDF.V_WEB_CFS_STUFFWORK;
CREATE PUBLIC SYNONYM V_WEB_CNTE FORXDF.V_WEB_CNTE;
CREATE PUBLIC SYNONYMV_WEB_CNTR_WORK_DETAIL FOR XDF.V_WEB_CNTR_WORK_DETAIL;
CREATE PUBLIC SYNONYM V_WEB_OMS_STUFF FORXDF.V_WEB_OMS_STUFF;
CREATE PUBLIC SYNONYM V_WEB_OMS_STUFFCNTRFOR XDF.V_WEB_OMS_STUFFCNTR;
CREATE PUBLIC SYNONYM V_WEB_OMS_STUFFDETAILFOR XDF.V_WEB_OMS_STUFFDETAIL;
CREATE PUBLIC SYNONYM V_WEB_SHIPQUERY FORXDF.V_WEB_SHIPQUERY;
CREATE PUBLIC SYNONYM V_WEB_STUFF_CNTR FORXDF.V_WEB_STUFF_CNTR;
CREATE PUBLIC SYNONYM V_WEB_SYS_VOYAGE FORXDF.V_WEB_SYS_VOYAGE;
CREATE PUBLIC SYNONYM V_WEB_VOYAGE_MANAGEFOR XDF.V_WEB_VOYAGE_MANAGE;
CREATE PUBLIC SYNONYM V_WEB_VOYAGE_NAME1FOR XDF.V_WEB_VOYAGE_NAME1;
CREATE PUBLIC SYNONYM V_WEB_VOYAGE FORXDF.V_WEB_VOYAGE;
CREATEPUBLICSYNONYM T_WEB_USER_INFOR FORXDF.T_WEB_USER_INFOR;