Change the DNS-Server on a ODA as Day2-Action after the deployment of the Appliance is easy. Change the /etc/resolv.conf and the job is done. Really? No, not really, but almost.
The ILOM and the repository database of the ODA contains the settings of DNS-Server(s) too , so you have to adapt them too.
Change DNS-Server on Host
$> vi /etc/resolv.conf
search gabrielkeusen.com
nameserver 172.22.82.80
nameserver 172.22.80.80
$> vi /etc/sysconfig/networking/profiles/default/resolv.conf
search gabrielkeusen.com
nameserver 172.22.82.80
nameserver 172.22.80.80
$> nslookup ntp.gabrielkeusen.com
Server: 172.22.82.80
Address: 172.22.82.80#53
...
Name: ntp.gabrielkeusen.com
Address: xxx.xxx.xxx.xxx
Change DNS-Server in ILOM
The change can be made with the ipmitool tool or alternatively with the web-based GUI.
$> ipmitool sunoem cli
## Connected. Use ^D to exit.
## show current settings
-> show /SP/clients/dns
## /SP/clients/dns
## ...
## Properties:
## auto_dns = disabled
## nameserver = 172.22.80.115, 172.22.82.80
## retries = 1
## searchpath = gabrielkeusen.com
## timeout = 5
## ...
## change nameserver(s)
-> cd /SP/clients/dns
-> set nameserver=172.22.82.80,172.22.80.80
## verify new nameservers are applied
-> show /SP/clients/dns
## ...
## Properties:
## auto_dns = disabled
## nameserver = 172.22.82.80, 172.22.80.80
## retries = 1
## searchpath = gabrielkeusen.com
## timeout = 5
## ...
Change DNS-Server in the Repository Database (Apache Derby)
Update: The manual update of the Repository (Derby DB) is not needed. It can be enough to execute the odacli update-registry after editing the resolv.conf. ( Thank you Beat Ramseier for this hint! )
In my environment this worked not as expected – update-registry removed the NTP-Server, changed the Hostname (added a „-c“ at the end) and the TimeZone was with „-around the Name. I had to fix the NTP and Name manually. So test this approach on test-env first! Otherwise follow the tasks below (starting „Get Current Settings from Repo-DB“ )
$> odacli update-registry -n sysinstance -f
$> odacli list-jobs
$> odacli describe-system
## Appliance Information
## ----------------------------------------------------------------
## ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxabcdefgh
## Platform: X7-2M
## Data Disk Count: 2
## CPU Core Count: 36
## Created: October 8, 2019 8:28:02 AM CEST
##
## System Information
## ----------------------------------------------------------------
## Name: ODA01-c
## Domain Name: gabrielkeusen.com
## Time Zone: "Europe/Zurich"
## DB Edition: EE
## DNS Servers: 172.22.82.80 172.22.80.80
## NTP Servers:
##
## Disk Group Information
## ----------------------------------------------------------------
## DG Name Redundancy Percentage
## ------------------------- ------------------------- ------------
## Data Normal 80
## Reco Normal 20
Get Current Settings from Repo-DB
$> odacli describe-system
## Appliance Information
## ----------------------------------------------------------------
## ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxabcdefgh
## Platform: X7-2M
## Data Disk Count: 2
## CPU Core Count: 36
## Created: October 8, 2019 8:28:02 AM CEST
##
## System Information
## ----------------------------------------------------------------
## Name: ODA01
## Domain Name: gabrielkeusen.com
## Time Zone: Europe/Zurich
## DB Edition: EE
## DNS Servers: 172.22.80.115 172.22.82.80
## NTP Servers: ntp.gabrielkeusen.com
##
## Disk Group Information
## ----------------------------------------------------------------
## DG Name Redundancy Percentage
## ------------------------- ------------------------- ------------
## Data Normal 80
## Reco Normal 20
Download Binaries and copy them to /tmp
$> cd /tmp
$> wget --no-check-certificate https://downloads.apache.org/db/derby/db-derby-10.14.2.0/db-derby-10.14.2.0-bin.zip
$> unzip -d db-derby db-derby-10.14.2.0-bin.zip
Ensure there are no running jobs (stop here if there are running jobs!)
$> odacli list-jobs
Stop dcs agent
$> initctl status initdcsagent
$> initctl stop initdcsagent
Backup Derby database
$> mkdir /tmp/derby_bak_$(date +'%Y%m%d')_$$
$> cp -R /opt/oracle/dcs/repo /tmp/derby_bak_$(date +'%Y%m%d')_$$
$> ls -latr /tmp/derby_bak_$(date +'%Y%m%d')_$$
Connect and update Derby database
$> cd /opt/oracle/dcs/repo
$> java -cp /tmp/db-derby/db-derby-10.14.2.0-bin/lib/derby.jar:/tmp/db-derby/db-derby-10.14.2.0-bin/lib/derbytools.jar org.apache.derby.tools.ij
## connect
ij> connect 'jdbc:derby:node_0';
## desc table
ij> describe SYSINSTANCE_DNSSERVERS;
## Select the current contents from the SYSINSTANCE_DNSSERVERS table. Write down the SYSINSTANCE_ID (ID of ODA deployment)
ij> select * from SYSINSTANCE_DNSSERVERS;
##Delete the contents from the SYSINSTANCE_DNSSERVERS table (if any):
ij> delete from SYSINSTANCE_DNSSERVERS where SYSINSTANCE_ID='xxxxxxxx-xxxx-xxxx-xxxx-xxxxabcdefgh';
## Check table content again
ij> select * from SYSINSTANCE_DNSSERVERS;
## For each DNS Server IP Address, insert in to the SYSINSTANCE_DNSSERVERS table a new row with the corresponding values
Reuse the same SYSINSTANCE_ID as before
ij> insert into SYSINSTANCE_DNSSERVERS values ('xxxxxxxx-xxxx-xxxx-xxxx-xxxxabcdefgh','172.22.82.80');
ij> insert into SYSINSTANCE_DNSSERVERS values ('xxxxxxxx-xxxx-xxxx-xxxx-xxxxabcdefgh','172.22.80.80');
## Check table content again
ij> select * from SYSINSTANCE_DNSSERVERS;
## Save/commit the changes for the local Derby Database:
ij> commit;
ij> exit;
Start dcs agent and check new Settings from Repo-DB
$> initctl start initdcsagent; sleep 30; odacli describe-system
## Appliance Information
## ----------------------------------------------------------------
## ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxabcdefgh
## Platform: X7-2M
## Data Disk Count: 2
## CPU Core Count: 36
## Created: October 8, 2019 8:28:02 AM CEST
##
## System Information
## ----------------------------------------------------------------
## Name: ODA01
## Domain Name: gabrielkeusen.com
## Time Zone: Europe/Zurich
## DB Edition: EE
## DNS Servers: 172.22.82.80 172.22.80.80
## NTP Servers: ntp.gabrielkeusen.com
##
## Disk Group Information
## ----------------------------------------------------------------
## DG Name Redundancy Percentage
## ------------------------- ------------------------- ------------
## Data Normal 80
## Reco Normal 20