Oracle Enterprise Manager Cloud Control 13.5 安裝失敗後重新安裝
如果由於各種原因導致的安裝過程中斷需要進行重新安裝的
①如果是虛擬機器,首推利用快照進行還原進行重新安裝
②如果不是虛擬機器或者沒有給虛擬機器打快照,就需要進行解除安裝,並對資料庫已經建立了的配置進行清空
解除安裝方法可參考oracle官方文件:https://docs.oracle.com/en/enterprise-manager/cloud-control/enterprise-manager-cloud-control/13.5/emadv/deinstalling-enterprise-manager-single-and-multi-oms-environments.html#
其中重要的內容如下:
cp <ORACLE_HOME>/sysman/install/EMDeinstall.pl <temporary_location>
For example,
cp /u01/software/em13c/oraclehome/sysman/install/EMDeinstall.pl /u01/tmp_deinstall
<ORACLE_HOME>/perl/bin/perl <temporary_location>/EMDeinstall.pl -mwHome <ORACLE_HOME> -stageLoc <temporary_location>
You will be prompted for database credentials (SYS and SYSMAN) and the WebLogic Domain credentials. Enter the credentials and proceed with the deinstallation.
For example,
/u01/software/em13c/oraclehome/perl/bin/perl /u01/tmp_deinstall/EMDeinstall.pl -mwHome /u01/software/em13c/oraclehome -stageLoc /u01/tmp_deinstall
嚴格按照該語句執行,會自動解除安裝掉已裝的OMS
3、將OMS配置所在資料庫進行清空
如果不清空進行安裝可能會有如下報錯
The referenced database doesn’t contain a valid Management Repository
該提示原因是:Doc ID 2183332.1
This issue occurs when a previous upgrade attempt had failed during the configuration phase, with partial repository updates, and the repository was restored to a pre-upgrade state.
The /gc_inst directory was deleted, but the EM 13c system software binaries had been retained from the previous software only install.
也就是說之前oms孫然解除安裝了,但是前一次安裝的資訊仍然存在資料庫中
Doc中給的方法如下:
The upgrade to 13c should be initiated from scratch to match the state of the restored EM 12.1.0.5 repository:
1) Deinstall the 13c OMS and remove the 13c installation directories.
2) Install an EM 13c Cloud Control system with the software-only method.
3) Upgrade the OMS to 13c using: <OMS Home>/sysman/install/ConfigureGC.sh
我按照這種方法操作後,仍然報該錯誤,後在別處查資料發現需要在OMS所配置的資料庫
1. Drop sysman related schemas. ---因為OMS會建sysman相關使用者,所以需要刪除上一次建立的sysman相關schema
DROP USER SYSMAN CASCADE;
DROP USER SYSMAN_OPSS CASCADE;
DROP USER SYSMAN_MDS CASCADE;
DROP USER SYSMAN_APM CASCADE;
DROP USER SYSMAN_RO CASCADE;
DROP USER SYSMAN_BIPLATFORM CASCADE;
DROP USER SYSMAN_STB CASCADE;
2. Remove Synonyms related to sysman accounts : ---刪除sysman相關SYNONYM
DECLARE
CURSOR l_syn_csr IS
SELECT 'DROP ' ||
CASE owner
WHEN 'PUBLIC'
THEN 'PUBLIC SYNONYM '
ELSE 'SYNONYM ' || owner || '.'
END ||
synonym_name AS cmd
FROM
dba_synonyms
WHERE
table_owner IN (
'SYSMAN',
'SYSMAN_MDS',
'MGMT_VIEW',
'SYSMAN_BIP',
'SYSMAN_APM',
'BIP',
'SYSMAN_OPSS',
'SYSMAN_RO'
);
BEGIN
FOR l_syn_rec IN l_syn_csr LOOP
BEGIN
EXECUTE IMMEDIATE l_syn_rec.cmd;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line( '===> ' || l_syn_rec.cmd );
dbms_output.put_line( sqlerrm );
END;
END LOOP;
END;
/
3. Removing remaining Objects and tablespaces : ---刪除相關表空間
DROP USER mgmt_view CASCADE;
DROP TABLESPACE mgmt_ecm_depot_ts INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;
DROP TABLESPACE mgmt_tablespace INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;
DROP TABLESPACE mgmt_ad4j_ts INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;
4. As proper database cleaning using RepManager dropall didn't happen, so we have to clean up the registry details : ---刪除相關schema registry資訊
DELETE
FROM
schema_version_registry
WHERE
(comp_name,owner) IN (
('Authorization Policy Manager','SYSMAN_APM'),
('Metadata Services','SYSMAN_MDS'),
('Oracle Platform Security Services','SYSMAN_OPSS')
);
commit;
5. Retry with the installation, it should complete successfully.
進行上述操作時可能會遇到 表或檢視不存在的情況,無需理會
刪除完成後再次安裝就不會再有報錯了