首页 > 学院 > 操作系统 > 正文

常用数据库备份还原命令

2024-06-28 13:23:52
字体:
来源:转载
供稿:网友
常用数据库备份还原命令

1. 显示当前目录pwd

2 远程复制scp ics20140902_0200.DMP Oracle@10.10.16.40:./hpdata

3 重启数据库lsnrctl stop;--监听服务停止shutdown immediate;startup;

4 进入Oraclesqlplus "/as sysdba"

5 删用户SQL>drop user hlj cascade;

6 建用户SQL>create user hlj identified by hlj default tablespace users;SQL>grant resource to hlj;SQL>grant connect to hlj;SQL>grant dba to hlj;

7 建目录SQL>create directory HLJDIR as '/home/oracle/hpdata';SQL>Grant read,write on directory DUMPDIR to lh;

--读取目录:select * from dba_directories;

8 导入库impdp hlj/hlj DIRECTORY=DUMPDIR DUMPFILE=ics20140912_1408.DMP remap_schema=ics:hlj FULL=Y IGNORE=Y --新建数据库impdp hlj2/hlj DIRECTORY=HLJDIR DUMPFILE=ics20140919_0820.DMP remap_schema=ics:hlj2 TABLE_EXISTS_ACTION=REPLACE --替换已存在数据库

9 导入表imp ics/ics file=hpdm20140829_6.DMP tables=FNTACCFRZINFO

10 导出库

expdp hlj/hlj dumpfile=hlj_141124.dmp full=n logfile=full.log directory=DUMPDIR job_name=my_job


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表