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_UAT3.解锁 alter user gwm_bl_uat account unlock &&select username,account_status from dba_users where username='GWM_BL_UAT';