oracle重启及impdb导入
oracle重启
停止Oracle服务
sqlplus / as sysdba
shutdown immediate;
停止Oracle监听器
lsnrctl stop;
从Oracle安装用户开启
sqlplus / as sysdba
startup
exit
启动监听器
$ORACLE_HOME/bin/lsnrctl start
impdb导入
创建逻辑目录
sqlplus / as sysdba
create directory dmp_dir as '/root/oracle';
grant read,write on directory dmp_dir to public;
show user;
host
删除目录语句:SQL> DROP DIRECTORY dmp_dir;dmp_dir为虚拟目录,实际不可见
将dmp文件导入/root/oracle文件夹
命令导入
impdp user2/pass2@IP:1521/ehrpdb table_exists_action=replace directory=dmp_dir dumpfile=TestDemo.dmp REMAP_SCHEMA=user1:user2 remap_tablespace=ehrpdb(之前库):ehrpdb(目前库) EXCLUDE=USER
table_exists_action:覆盖或追加数据;REMAP_SCHEMA 用户转换;remap_tablespace:库转换
XFS