当前位置:网站首页>EBS Oracle 11g 克隆步骤(单节点)
EBS Oracle 11g 克隆步骤(单节点)
2022-07-05 21:32:00 【无情白】
说明:本文档使用于单节点克隆、并且数据库和应用的是已有的环境,数据库利用备份方式进行恢复,应用利用拷贝的方式进行覆盖已有数据。
参考文档:https://blog.csdn.net/m0_49929446/article/details/124084310?spm=1001.2014.3001.5501 (ASM扩容)
本地磁盘容:https://blog.csdn.net/m0_49929446/article/details/124375949?spm=1001.2014.3001.5501
官方文档:406982.1
一、检查目标环境服务器内存
查看目标环境的内存是否够用,如果够用,等待时间到进行克隆, 如果不够用,需要进行扩容。
共享磁盘情况下检查内存命令
--asm.sql
column name format a20
column free_mb format 999,999,999
select name,to_char(sysdate,'YYYY-MM-DD HH24:MI') SYSTEM_DATETIME from v$database;
select (select name from v$database) db_name,name diskgroup_name,total_mb,free_mb,round(free_mb/total_mb*100,1) FREE_Uti_PCT from v$asm_diskgroup order by 4;
文件系统(本地磁盘)检查内存命令
df -h
如果内存不足,申请扩容,ASM扩容步骤在其它文章里已有详细步骤:https://blog.csdn.net/m0_49929446/article/details/124084310?spm=1001.2014.3001.5501
本地磁盘扩容:https://blog.csdn.net/m0_49929446/article/details/124375949?spm=1001.2014.3001.5501
二、停应用和数据库
停全部服务
adstpall.sh apps/passwd
停并发
adcmctl.sh stop apps/apps_934199
-- 查看进程是否结束
ps -ef |grep FNDLIBR
-- 进程没结束的情况下执行
ps -fu app sit| grep FND| awk '{print $2}' | xargs kill -9 或者
adcmctl.sh abort apps/passwd #生产不建议使用
停数据库
-- 单机情况下停数据库
sqlplus / as sysdba
shutdown immediate;
-- 集群方式停数据库,只需一个节点执行
srvctl stop database -db HCCDB
三、删除旧的数据库
ASM 盘步骤:
1.进入grid用户
su - grid
asmcmd
2.删除数据库文件
rm -rf CONTROLFILE/*
rm -rf DATAFILE/*
rm -rf PARAMETERFILE/*
rm -rf PASSWORD/*
rm -rf TEMPFILE/*
3.重新创建数据库目录
mkdir CONTROLFILE PARAMETERFILE PASSWORD TEMPFILE
本地磁盘:
1.找到data目录
cd /ebs/sit/db/apps_st/data/SIT
2.删除数据库文件
rm -rf archivelog datafile onlinelog
3.重新创建删除的文件目录
mkdir archivelog datafile onlinelog
四、恢复控制文件、数据文件
1.启动参数文件
参数文件:提前准备一份配置好的pfile参数文件(专门用来做克隆),根据参数文件的配置将内存空间及进程启动。
11g 标准参数文件配置:
启动数据库为nomount状态
sqlplus / as sysdba
startup nomount pfile='/home/orasit/forautodeploy/SIT/init.ora.clone';
2.恢复控制文件
如果是利用nbu进行备份的先查看备份的控制文件的路径
cd /usr/openv/netbackup/bin
./bplist -C ebshgdb1 -t 4 -l -R / |more
c-2379360884-20220520-22
3.修改恢复控制文件脚本
vi restore_controlfile.rcv
run { allocate channel ch00 type 'SBT_TAPE';
send 'NB_ORA_SERV=jtbackupvpra01,NB_ORA_CLIENT=erppprd01';restore controlfile from '/c-2379360884- 20220520-22';Release channel ch00;}
注意:NB_ORA_SERV 备份的服务器 NB_ORA_CLIENT:备份的客户端,c-2379360884- 20220520-22:需要恢复的控制文件(从备份服务器上查找到的)。
4.开始进行恢复控制文件
rman target / cmdfile=restore_controlfile.rcv #需要进入到脚本所在目录执行,或者写脚本绝对路径
5.修改数据文件
将数据库状态改为mount
sqlplus / as sysdba
alter database mount;
修改恢复脚本
vi recover_database.rcv
run{
allocate channel ch00 type 'sbt_tape';
allocate channel ch01 type 'sbt_tape';
allocate channel ch02 type 'sbt_tape';
allocate channel ch03 type 'sbt_tape';
allocate channel ch04 type 'sbt_tape';
send 'NB_ORA_SERV=jtbackupvpra01,NB_ORA_CLIENT=erppprd01';
set newname for database to '/ebs/sit/db/apps_st/data/SIT/datafile/%b';
set until time "to_date('20-05-2022 18:00:00','dd-mm-yyyy hh24:mi:ss')";
restore database;
switch datafile all;
switch tempfile all;
recover database;
release channel ch00;
release channel ch01;
release channel ch02;
release channel ch03;
release channel ch04;
}
注意:until time “to_date(‘20-05-2022 18:00:00’,‘dd-mm-yyyy hh24:mi:ss’)”; 这个时间一定要在恢复控制文件的时间之前,因为控制文件记录了日志和物理文件信息。
6.开始恢复数据文件
后台执行恢复,因为时间太久
cd /home/ora sit/forautodeploy/ SIT
nohup rman target / cmdfile=recover_database.rcv & log=/home/ora sit/forautodeploy/ SIT/recover_database_$(date +%F).log &
五、恢复完数据库的配置
1.修改在线日志文件
将查询到的sql执行
set lines 160 pages 9999
select 'alter database rename file '''||member||''' to '''||replace(member,'+EBSPRODDATA/ prod/onlinelog/','/ ebs/sit/db/apps_st/data/ SIT/onlinelog/')||''';' from v$logfile;SQL>
alter database rename file '+EBSPRODDATA/ prod/onlinelog/group_5.log' to '/ ebs/sit/db/apps_st/data/ SIT/onlinelog/group_5.log';
alter database rename file '+EBSPRODDATA/ prod/onlinelog/group_6.log' to '/ ebs/sit/db/apps_st/data/ SIT/onlinelog/group_6.log';
alter database rename file '+EBSPRODDATA/ prod/onlinelog/group_7.log' to '/ ebs/sit/db/apps_st/data/ SIT/onlinelog/group_7.log';
alter database rename file '+EBSPRODDATA/ prod/onlinelog/group_8.log' to '/ ebs/sit/db/apps_st/data/ SIT/onlinelog/group_8.log';
注意:+EBSPRODDATA/ prod/onlinelog/ 源系统日志文件路径 / ebs/sit/db/apps_st/data/ SIT/onlinelog/ 目标系统日志文件路径。
登录数据库检查日志文件是否修改成功
sqlplus / as sysdba
select * from v$logfile;#检查路径是否修改成功
2.把数据库切换成resetlogs
用resetlogs方法打开数据库,日志的序号用重新从1开始。
alter database disable block change tracking;# disable block
alter database set standby to maximize performance; 修改保护模式为maximize performance
alter database flashback off; 关闭flashback
alter database noarchivelog; 关闭归档模式
alter database open resetlogs; 重做日志
注意:一旦用备份的控制文件进行数据库恢复,就需要使用resetlogs的方法打开数据库,但是resetlogs通常意味着不完全恢复,而且更重要的是一旦用resetlogs方法打开数据库,日志的序号用重新从1开始。
alter database open resetlogs; resetlogs的方法打开数据库
3.重启数据库
shutdown immediate
startup mount pfile='/home/ora sit/forautodeploy/ SIT/init.ora.clone';
4.使用nid修改db_name
**说明:**官方文档: 224266.1 863800.1
nid target=sys/passwd dbname= SIT LOGFILE=nid_ SIT.log
启动数据库mount状态,重做日志文件
startup mount;
alter database open resetlogs;
5.执行客户化脚本
export NLS_LANG=American_America.ZHS16GBK
sqlplus apps/apps_password @cux_0_fnd_clone_setup_utl.pck
SQL> @cux_0_fnd_clone_setup_utl.pck
Package created.
begin
cux_0_fnd_clone_setup_utl.main( 'FZUAT', 'N');
end;
/
6.清理节点信息
注意:清除完节点之后,需要使用adconfig.sh脚本重新配置一遍数据库。
sqlplus /nolog
conn apps/apps_password;
exec fnd_conc_clone.setup_clean;
commit;
7.修改用户profile
用户的profile有关,通常是default的,而default的profile默认的 FAILED_LOGIN_ATTEMPTS值是10,也就是说尝试10次就会锁定该帐号。可以修改成无限制:
sqlplus / as sysdba
alter profile AD_PATCH_MONITOR_PROFILE limit failed_login_attempts unlimited;
alter profile default limit failed_login_attempts unlimited password_lock_time 1/1440;
alter user apps account unlock;
exit;
8.执行adconfig
ls -l $CONTEXT_FILE
cd $ORACLE_HOME/appsutil/bin
./adconfig.sh contextfile=$CONTEXT_FILE appspass=passwd
六、应用克隆
1.备份xml文件
创建备份目录
mkdir backupxml
进入备份文件目录、备份xml文件
cd backupxml/
cp $CONTEXT_FILE .
cp $IAS_ORACLE_HOME/j2ee/forms-c4ws/config/server.xml ias.server.xml
cp $ORA_CONFIG_HOME/10.1.3/j2ee/oacore/config/server.xml ora.server.xml
cp $ORA_CONFIG_HOME/10.1.3/j2ee/oacore/application-deployments/oacore/orion-application.xml
2.两种方式克隆
(1).adcfgclone.pl atTechStack
因为是以其它环境备份解压的方式覆盖的到目标环境,只需要需在目标应用节点克隆技术堆栈atTechStack
使用adcfgclone.pl appsTier进行克隆
删除并重新解压应用
cd /ebs/sit
rm -rf apps
mv inst inst_old
mkdir inst
nohup tar -xzvf VGPROD_apps_220314.tar.gz &
因为把apps目录删除了,需要执行adcfgclone.pl appsTier
cd /ebs/sit/apps/apps_st/comn/clone/bin
perl adcfgclone.pl appsTier /home/app sit/backupxml/ SIT_ erpvura01.xml
(2).adcfgclone.pl appsTier
全新的克隆,重新生成$CONTEXT_FILE
adcfgclone.pl atTechStack克隆
不删apps目录,直接解压即可
cd /ebs/sit/apps/apps_st/comn/clone/bin
perl adcfgclone.pl atTechStack $CONTEXT_FILE
3.FIX客户化链接
解压源系统拷贝的cux压缩包
cd $APPL_TOP
unlink cux
cd /ebs/sit/apps/apps_st/appl
tar -zxvf PROD_cux_220521.tar.gz
4.修改密码
改sys密码,常用在dg数据同步配置时,生成的密码文件拷贝到dg服务器
cd $ORACLE_HOME/dbs
orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=clone entries=5 force=y ignorecase=y
密码文件,是仅用来限制具有sysdba或者sysoper权限的用户以远程的方式连接数据库的密码校验文件。如果不存在密码文件或者密码文件丢失,那么以sysdba或者sysoper权限的用户将无法登陆并返回错误:
alter system set remote_login_passwordfile=exclusive scope=spfile sid='*';
FNDCPASS 修改密码sysadmin 、asadmin 、ALLORACLE
FNDCPASS apps/passwd 0 Y system/manager SYSTEM APPLSYS apps_934199
FNDCPASS apps/passwd 0 Y system/manager USER sysadmin clone_92184
FNDCPASS apps/passwd 0 Y system/manager USER asadmin asadmin
FNDCPASS apps/passwd 0 Y system/manager ALLORACLE clone_92184
其它用户密码
alter user CRCDATATXN identified by clone;
alter user CUXSYSMONITER identified by clone;
alter user intf identified by clone;
5.修改并发管理器的节点设置
FND_CONCURRENT_QUEUES,每个并发管理器(并发队列)的信息,包括客户自己定义的并发管理器
sqlplus apps/passwd
set sqlblanklines on
select distinct node_name,node_name2 from applsys.FND_CONCURRENT_QUEUES;
如果查出来的节点信息名字等于想要的不需要修改,否则使用下面sql进行修改
UPDATE FND_CONCURRENT_QUEUES a
SET a.node_name = replace(a.node_name, 'ERPVPRA', '');
6.修改输出并发管理器
将大于20的进程数修改为20
-- 修改输出并发管理器
update applsys.FND_CONCURRENT_QUEUES
set TARGET_PROCESSES=20
where TARGET_PROCESSES>20;
commit;
-- 查询
set lines 200 pages 50000
select concurrent_queue_name,max_processes,running_processes,target_processes from applsys.FND_CONCURRENT_QUEUES;
设置两个opp并发管理器
update applsys.FND_CONCURRENT_QUEUES
set TARGET_PROCESSES=2
where concurrent_queue_name like '%OPP%';
commit;
-- 查询
select concurrent_queue_name,max_processes,running_processes,target_processes from applsys.FND_CONCURRENT_QUEUES where concurrent_queue_name like '%OPP%';
7.执行adconfig
ls -l $CONTEXT_FILE
cd $AD_TOP/bin
./adconfig.sh contextfile=/ebs/sit/inst/apps/SIT_ erpvura01/appl/admin/SIT_ erpvura01.xml appspass=passwd
8.修改banner内容
FWK_HOMEPAGE_BRAND,修改banner内容
sqlplus apps/passwd
export NLS_LANG=American_America.ZHS16GBK
select v.FUNCTION_ID, t.user_function_name, v.FUNCTION_NAME from FND_FORM_FUNCTIONS_VL v, FND_FORM_FUNCTIONS f, FND_FORM_FUNCTIONS_tl t where v.FUNCTION_ID = f.function_id and v.FUNCTION_ID = t.function_id and v.FUNCTION_NAME = 'FWK_HOMEPAGE_BRAND';
update FND_FORM_FUNCTIONS_TL t set t.user_function_name = 'sit环境' where t.function_id = 20556;
或者登录网页修改
应用开发员 > 应用产品 > 功能
F11清理
输入 FWK_HOMEPAGE_BRAND
按Ctrl+F11搜索
登录口令大小写 9829
SIGNON_PASSWORD_FAILURE_LIMIT 登录口令失败限制次数 5792
SIGNON_PASSWORD_HARD_TO_GUESS 登录口令应难以猜测 3844
SIGNON_PASSWORD_LENGTH 登录口令长度 2027
SIGNON_PASSWORD_NO_REUSE 不得重新使用的登录口令 4524
delete from applsys.fnd_profile_option_values where profile_option_id in (5792,3844,2027,4524) and level_id=10004;
9.修改web user密码
declare
cursor cur_fnd_user is
select a.user_name
from fnd_user a
where a.user_id >= 1110
AND a.user_name like 'SETUP%'
order by a.user_id;
l_change_stat varchar2(400);
begin
for rec_fnd_user in cur_fnd_user loop
l_change_stat := fnd_web_sec.change_password(rec_fnd_user.user_name,
'clone');
if l_change_stat = 'N' then
dbms_output.put_line('USER:' || rec_fnd_user.user_name ||
'password not changed');
end if;
end loop;
end;
/
10.删除dblink
将查出来的进行删除
set lines 200 pages 50000
col object_name for a60
select owner,object_name from dba_objects where object_type='DATABASE LINK';
OWNER OBJECT_NAME
------------------------------------------------------------ ------------------------------------------------------------
SYS TO_INTERFACE.234.COM.CN
APPS TO_INTERFACE.234.COM.CN
APPS TO_EMDB.234.COM.CN
APPS TO_BMWMS.234.COM.CN
APPS SITTOODSTEST.CRC.COM.CN
APPS SITTOJTSIT.CRC.COM.CN
APPS EDW_APPS_TO_WH.234.COM.CN
APPS EDW_APPS_TO_WH
APPS APPS_TO_APPS.234.COM.CN
APPS APPS_TO_APPS
删除dblink 如:
drop DATABASE LINK "TO_INTERFACE.234.COM.CN";
drop DATABASE LINK "TO_EMDB.234.COM.CN";
drop DATABASE LINK "TO_EMDB.234.COM.CN";
再次检查
没有记录代表删除成功
select 'drop public database link ' ||dd.DB_LINK||';' from dba_db_links dd
where dd.owner = 'PUBLIC';
11.处理SOA Gateway
修改$ORA_CONFIG_HOME/10.1.3/j2ee/oafm/config/system-jazn-data.xml
将这个将其部分改为内容改为!asadmin
<user>
<name>ASADMIN</name>
<guid>AF15AD90E6D811EBBFAA8D4E3A337D36</guid>
<description>Used by SOAProvider for DB connection</description>
<credentials>{903}jVC6oqf5Ap0o4mxKMT204oqYYreRUyic</credentials>
</user>
12.启动应用
adstrtal.sh apps/passwd
13.部署soa
soa手工执行与部署
cd $FND_TOP/bin
./soadeploy.sh irepname=CUX_0_WS_SERVER_PRG target=undeploy
cd $FND_TOP/bin
./soagenerate.sh irepname=CUX_0_WS_SERVER_PRG
cd $FND_TOP/bin
./soadeploy.sh irepname=CUX_0_WS_SERVER_PRG target=deploy
或者网页部署
集成SOA网关 > 集成信息库> Custom Application > Custom Application
打开对应的接口 >>>重新生成WSDL
14.修改XMLP临时目录
系统路径:
System Administrator -> Oracle XML Publisher管理员 -> 主页 -> 管理
15.查看登录地址
cat $CONTEXT_FILE|grep login
边栏推荐
- Learning notes of statistical learning methods -- Chapter 1 Introduction to statistical learning methods
- The primary key is set after the table is created, but auto increment is not set
- Deployment of Jenkins under win7
- Clion-MinGW编译后的exe文件添加ico图标
- Ethereum ETH的奖励机制
- [daily training -- Tencent select 50] 89 Gray code (only after seeing the solution of the problem)
- Generics of TS
- 场景化面试:关于分布式锁的十问十答
- LeetCode_ Hash table_ Difficulties_ 149. Maximum number of points on the line
- Learning robots have no way to start? Let me show you the current hot research directions of robots
猜你喜欢
PVC 塑料片BS 476-6 火焰传播性能测定
Add ICO icon to clion MinGW compiled EXE file
Interviewer: will concurrent programming practice meet? (detailed explanation of thread control operation)
LeetCode_哈希表_困难_149. 直线上最多的点数
Simple interest mode - evil Chinese style
Deployment of Jenkins under win7
Comprehensive optimization of event R & D workflow | Erda version 2.2 comes as "7"
Five layer network protocol
MySQL InnoDB Architecture Principle
Access Zadig self-test environment outside the cluster based on ingress controller (best practice)
随机推荐
Wood board ISO 5660-1 heat release rate mapping test
递归查询多级菜单数据
Learning notes of statistical learning methods -- Chapter 1 Introduction to statistical learning methods
Problems encountered in office--
使用Aspect制作全局异常处理类
【日常训练】729. 我的日程安排表 I
Sorting out the problems encountered in MySQL built by pycharm connecting virtual machines
int GetMonth( ) const throw( );后面的throw( )什么意思?
水泥胶黏剂BS 476-4 不燃性测试
Making global exception handling classes with aspect
Alibaba cloud award winning experience: build a highly available system with polardb-x
Selenium gets the verification code image in DOM
How to prepare for the algorithm interview and answer the algorithm interview questions
selenium 查找b或p标签的内容
R语言【数据管理】
vant 源码解析之 utils/index.ts 工具函数
Utils/index TS tool function
MQ----activeMq
The transformation based on vertx web sstore redis to realize the distributed session of vertx HTTP application
Chap2 steps into the palace of R language