Skip to main content

Posts

Showing posts from April, 2018

Use command line emcli to delete Grid control targets

Our Oracle database oracle_home and instance_name have massive change and the targets need to be removed, I can remove the host but the EM admin said he has group rule setup and do not want to delete host, so I have to delete the target one-by-one, clicking in EM console is no fun, I logon to the EM repository database and run this query to generate the script to run on EM weblogic server. select 'emcli delete_target -name='||TARGET_NAME||' -type="'||TARGET_TYPE||'"' from sysman.mgmt_targets where upper(host_name) like 'HOSTNAME%' and target_type like 'rac_database'; It generate command like below: $emcli delete_target -name=blablabla -type="rac_database" I need to run the emcli login first before run delete target... emcli login -username=sysman -password=thepassword

Convert RAC database to RACOneNode

It's three nodes RAC, db name is TEST, instance name is TEST1|2|3, the goal is to convert from RAC to RACOneNode and make it run on node2. srvctl stop instance -d TEST -i TEST1 srvctl stop instance -d TEST -i TEST3 srvctl remove instance -d TEST -i TEST1 srvctl remove instance -d TEST -i TEST3 srvctl add service -s TEST_svc -d TEST -r TEST2 srvctl convert database -d TEST -dbtype RACONENODE -i TEST srvctl modify database -d TEST -e node2 srvctl stop database -d TEST srvctl start database -d TEST srvctl status database -d TEST srvctl config database -d TEST