Oracle换库及备份库步骤教程
oracle换库
1. 停掉涉及的应用中间件/给oracle用户上锁alter user gwm_bl_uat account lock
查看select username,account_status from dba_users where username='gwm_bl_uat';
2. 用plsql工具-会话kill掉所有连接着的该用户 (如果kill不掉,可以将用户密码修改任意,shutdown abort强制关闭 然后在startup启动,就可以执行那个dorp user了)
3. 拷贝备份到指定路径并解压(oracle用户)
4. 删除用户drop user user_name cascade;
5. 倒入impdp system/密码 directory=data_pump_dir (该路径在oracle语句中执行 create directory data_pump_dirname as "路径"可以创建新的文件路径) dumpfile= logfile= schemas= transform=oid:y 保持原有对象类型/transform=oid:n 和新有对象一致(保证能被编译)
6. 修改用户密码alter user (名字) identified by 密码(也可以保持默认)account unlock 解锁
备份库:
1. 停掉涉及的应用中间件/给oracle用户上锁alter user gwm_bl_uat account lock
查看select username,account_status from dba_users where username='gwm_bl_uat';
2.导出 expdp system/oracle456 directory=data_pump_dir dumpfile=yingnanbk.dmp logfile=yingnanbk.log schemas=gwm_bl_uat
3.解锁 alter user gwm_bl_uat account unlock &&select username,account_status from dba_users where username='gwm_bl_uat';