--删除用户
drop user syhis cascade;
--创建用户:
create user syhis identified by his default tablespace users temporary tablespace temp;
--授权:
grant connect,dba,resource to syhis;
--导出:
host exp userid=ecp/his@syhis file =f:\syhis.dmp LOG=f:\syhis.LOG;
--导入户:
host imp userid=eyhis/his@local file =d:\his0830.dmp LOG=d:\his0830.LOG fromuser=wxhisBA touser=eyhis; host imp userid=test/test@orcl file =e:\xshis2013-8-21.dmp full=y; host imp userid=sjhis/his@orcl file=d:\sjhis2013-9-24.dmp full=y;
--创建表空间
CREATE TABLESPACE "USERS" LOGGING DATAFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\LOCAL\USERS02.DBF' SIZE 1M AUTOEXTEND ON NEXT 1024K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
--查看表空间
select b.file_name 物理文件名, b.tablespace_name 表空间, b.bytes/1024/1024 大小M, (b.bytes-sum(nvl(a.bytes,0)))/1024/1024 已使用M, substr((b.bytes-sum(nvl(a.bytes,0)))/(b.bytes)*100,1,5) 利用率 from dba_free_space a,dba_data_files b where a.file_id=b.file_id group by b.tablespace_name,b.file_name,b.bytes order by b.tablespace_name
--表空间更名
ALTER TABLESPACE [USERS1] RENAME TO [USERS2];
--删除表空间
DROP TABLESPACE [USERS] INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS
--改变表空间大小
alter database datafile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\LOCAL\USERS04.DBF' resize 10M
备份
host exp userid=bhhis/his@bh file =E:\备份\bhhis0919.dmp LOG=E:\备份\bhhis0919.LOG;
发表评论(对文章涉及的知识点还有疑问,可以在这里留言,老高看到后会及时回复的。)