Oracle10gR2(三)-导入

一、环境

CentOS 6.10,Oracle 10g

二、修改字符集

su - oracle
vim /home/oracle/.bash_profile
//增加字符集,和服务器端保持一致
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

三、创建库

// 创建表空间
create bigfile  tablespace zbx datafile '/data/database/oracle/oradata/orcl/zbx.dbf' size 10G autoextend on next 2G MAXSIZE UNLIMITED NOLOGGING EXTENT MANAGEMENT LOCAL AUTOALLOCATE;
// 创建临时表空间
create temporary tablespace zbx_temp tempfile '/data/database/oracle/oradata/orcl/zbx_temp.tpf' size 1G;
alter database tempfile '/data/database/oracle/oradata/orcl/zbx_temp.tpf' autoextend on next 200m;
// 创建账号并赋权
create user zbx identified by OUIZAQ@WSXyxw default tablespace  zbx  temporary tablespace zbx_temp profile default;
grant connect,exp_full_database,imp_full_database,resource to zbx;

三、导入库

// 退出sqlplus后执行
nohup imp zbx/ZAQ!2wsxOUIxw@localhost:1521/ORCL file='/mnt/package/zbx_orc.dmp' full=y buffer=409600000 commit=y statistics=none ignore =y   log='/data/database/oracle/oraclelogs/zbximp20210522_1.log' >> /data/database/oracle/oraclelogs/nohup_zbx.out &

四、失败删除

// 删除用户
drop user zbx cascade;
// 删除表空间
drop tablespace zbx including contents and datafiles cascade constraints;
drop tablespace zbx_temp including contents and datafiles cascade constraints;

猜你喜欢

转载自blog.csdn.net/shijin741231/article/details/117162231
今日推荐