oracle导出dmp文件教程
启动&关闭oracle教程
医院内网服务器导出dmp文件只要进行下面1、2、4的操作
1、切换到oralce用户
su oracle
2、使环境变量生效
source ~/.bash_profile
3、登录sql命令行界面
sqlplus sys/123456# as sysdba
[root@localhost ~]# su oracle
[oracle@localhost root]$ source ~/.bash_profile
[oracle@localhost root]$ sqlplus sys/123456# as sysdba
(1)创建dmp导出位置
create or replace directory data_dir as '/home/dmp';
(2)授权
Grant read,write on directory data_dir to sys;
grant exp_full_database,imp_full_database to sys;
4、导出dmp文件
(1)输入导出命令
expdp sys/123456#@192.168.137.2/testid schemas=JSRCD_GQKH,JSRCD_GQKHWS dumpfile=gkb_v1.dmp directory=data_dir logfile=gkb_v1.log
命令含义:
expdp 用户名/密码@ip/sid schemas=用户1,用户2,… dumpfile=自定义dmp名称.dmp directory=导出位置变量名 logfile=自定义日志名称.log
(2)输入上面命令后会出现如下的界面,Username和Password都输入admin
oracle导入dmp文件教程
mpdp sys/123456#@192.168.137.2/testid DIRECTORY=data_dir DUMPFILE=jsrcxxg_210427_%U.dmp table_exists_action=replace FULL=y;
impdp sys/123456#@192.168.137.2/testid DIRECTORY=data_dir DUMPFILE=expdp_jsrcxxg_210118.dmp table_exists_action=replace FULL=y;
imp sys/123456# file=/home/dmp/rsrcgqkhjd.dmp full=y ignore=n
imp sys/123456#@192.168.137.2:1521/testid file=C:\Users\diamond\Desktop\GC81.dmp fromuser=JSRCD_GQKH touser=JSRCD_GQKH constraints=N ignore=y
https://jingyan.baidu.com/article/11c17a2cd07ccdf446e39df6.html
启动ORACLE
1、su - oracle
2、source ~/.bash_profile
3、[oracle@oracle ~]$ lsnrctl start
4、[oracle@localhost /]$ sqlplus sys/123456# as sysdba
5、SQL> startup