Oracle创建表 创建库 数据恢复
--建用户
CREATE USER szs IDENTIFIED BY szs DEFAULT TABLESPACE NN_DATA01 TEMPORARY TABLESPACE temp;
--用户赋权
GRANT connect,dba to szs;
GRANT CREATE SYNONYM,CREATE PROCEDURE,
CREATE SEQUENCE,CREATE SESSION,CREATE TABLE,CREATE TRIGGER,CREATE VIEW to szs
--删除用户
--drop user tt0907 cascade;
--导表
--imp szs/szs@orcl file=F:\szs_nn\2015010650dmp.dmp full=y ignore=y log=E:\imp.log buffer=1024000
--imp szs/szs@orcl file=F:\szs_nn\2015010650dmp.dmp full=y ignore=y log=F:\log buffer=4096000
--exp TLY0917/1@orcl file=F:\nc611.dmp owner=TLY0917 log=F:\exp.log
--exp TLY0917/1@orcl_192.168.0.2 file=D:\20121215.dmp owner=TLYHFTP0917 log=F:\exp.log
-- 11G数据泵 恢复语句
create directory szs1 as 'F:\szs_nn\20140905adms\';
--查看目录
select * from dba_directories;
--赋权限
grant read,write on directory szs1 to szs;
grant all on directory szs to public;
-- 在本地建立目录d:\bak,并将需要还原的数据文件放到该目录下 原schema nc 导入dzbank
impdp szs/szs@ora11g directory=szs dumpfile=20140915adms.dmp remap_schema=szs:nc50 full=y logfile=orcl.log show=y
--11G exp导出表时设置空表导出
--注意:该值设置后对以前导入的空表不产生作用,仍不能导出,只能对后面新增的表产生作用
alter system set deferred_segment_creation=false scope=both;
--11G 导出语句
expdp n6/1@orcl dumpfile=n6.dmp directory=dpath logfile=n6.log version=10.2.0.0
--11G 设置表空间默认大小 文件32G以上大文件(建立表空间之前设置)
alter database set default bigfile tablespace;
--建表空间
create tablespace NNC_DATA01 logging datafile 'NNC_DATA01.dbf' size 300m autoextend on next 50m maxsize unlimited;
create tablespace NNC_DATA02 logging datafile 'NNC_DATA02.dbf' size 100m autoextend on next 50m maxsize unlimited;
create tablespace NNC_DATA03 logging datafile 'NNC_DATA03.dbf' size 100m autoextend on next 50m maxsize unlimited;
create tablespace NNC_INDEX01 logging datafile 'NNC_INDEX01.dbf' size 300m autoextend on next 50m maxsize unlimited;
create tablespace NNC_INDEX02 logging datafile 'NNC_INDEX02.dbf' size 100m autoextend on next 50m maxsize unlimited;
create tablespace NNC_INDEX03 logging datafile 'NNC_INDEX03.dbf' size 100m autoextend on next 50m maxsize unlimited;