Skip to content

Instantly share code, notes, and snippets.

@jay16
Last active August 29, 2015 14:00
Show Gist options
  • Save jay16/11241072 to your computer and use it in GitHub Desktop.
Save jay16/11241072 to your computer and use it in GitHub Desktop.
备份:
备份整个数据库
exp 用户名/密码@连接的远程计算机 IP/ 要备份的远程数据库名称 file= 文件路径
exp hom/[email protected]/qa file=d:\aa1.dmp
备份指定数据库表
exp Intfocus/[email protected]/orcl file=d:\DOG_TOTAL_BI.DMP tables=(dog_totle_bi)
导入指定数据库表(若表结构已经存在只导入数据)
grant dba to jay; // 需要sqlplus 使用dba登陆给jay授权
imp userid=jay/my_pwd@orcl tables=(dog_totle_bi) file=d:\DOG_TOTAL_BI.DMP ignore=y
备份数所库表框架
exp Intfocus/[email protected]/orcl file=d:\DOG_TABLES_WITHOUT_DATA.DMP tables=(dog_totle_bi dog_totle_data dog_day_bi dog_day_data dog_day_data_temp dog_day_org) rows=n
导入数据表框架
imp userid=jay/my_pwd@orcl tables=(dog_totle_bi dog_totle_data dog_day_bi dog_day_data dog_day_data_temp dog_day_org) fil=d:\DOG_TABLES_WITHOUT_DATA.DMP rows=n
=====================================
恢复
imp 用户名 /密码@还原的数据库名称 file= 文件路径 + 件名称 fromuser= 导出数据库的用户名 touser= 导入数据库的用户名
imp hom1/[email protected]/qa file=D:\aa1.dmp fromuser=hom1 touser=hom
=====================================
其他
修改用户intfocus的密码为my-secret
connect intfocus/old-secret as sysdba;
alter user intfocus identified by "my-secret";
为用户intfocus解锁
alter user intfocus account unlock;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment