create tablespace fxq
datafile 'D:\ZY\sourceCode\fxq\fxq.dbf' size 500m autoextend on next 50m maxsize 20480m extent management local;
--创建用户
create user fxq identified by fxq default tablespace fxq;
--赋予权限
grant connect,resource,dba to fxq;
--删除表空间
drop tablespace user_data including contents and datafiles;
--删除用户
drop user fxq cascade;
--查询oracle表空间和用户名
select username,default_tablespace from dba_users;
select * from CUSTOMERIDVTEST
给数据库建立一个只读权限的用户 create user readonly identified by readonly; grant select any table to readonly; 给用户查询表权限 grant select any dictionary to readonly;给用户查询数据库字典权限 grant connect to readonly;给用户连接权限 grant create synonym to readonly;给用户建同义词权限 grant select any sequence to readonly;给用户查询sequence权限 给readonly用户赋予tpp_test用户下所有表的同义词权限,这样用readonly用户查询表可以直接用: select * from cust 而不用:select * from p2p.cust这么麻烦了: 首先在P2P用户下先执行以下语句: select 'create or replace synonym ' || table_name || ' for p2p_test.' || table_name ||';' from user_tables; 然后把执行的结果copy出来,在readonly下执行一下就行了 ------------------------- 删除同义词(readonly下): select 'drop SYNONYM '|| SYNONYM_NAME||';' from user_synonyms; ----------------------------------------------------
原文链接:https://www.f2er.com/oracle/211282.html