2.准备一点数据
2.1 新建一个表空间
create tablespace tsp_hr datafile 'D:\ORACLE\ORADATA\ORCL\TSP_HR01.DBF' size 10m;
2.2 新建用户
create user hr1 identified by hr1
default tablespace tsp_hr
quota unlimited on tsp_hr;
grant connect,resource to hr1;
grant create tablespace to hr1;
2.3 准备验证数据
SQL> conn hr1/hr1
已连接。
SQL> select * from tabs;
未选定行
SQL> create table bigtab tablespace tsp_hr as select * from all_tables;
表已创建。
SQL> create sequence seq_bigtab ;
序列已创建。
3.创建导出目录
create directory tts as 'd:\oracle';
4.设置除系统外的表空间只读
SQL> alter tablespace example read only;
SQL> alter tablespace users read only;
SQL> alter tablespace tsp_hr read only;
SQL> select tablespace_name ,status from dba_tablespaces;
TABLESPACE_NAME STATUS
------------------------------------------------------------ ------------------
SYSTEM ONLINE
SYSAUX ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
USERS READ ONLY
EXAMPLE READ ONLY
TSP_HR READ ONLY