How to execute sqlplus by root using sudo in linux?
Not an Oracle error.

Sure you can put the above variables in .bash_profile of oracle, but when you use sudo like above, that will not be executed.

[root@o71 ~]# tail -3 /home/oracle/.bash_profile
export ORACLE_HOME=/u01/app/oracle/product/dbhome_1
export ORACLE_SID=ETALON
export PATH=$ORACLE_HOME/bin:$PATH
[root@o71 ~]# sudo -u oracle sqlplus / as sysdba
sudo: sqlplus: command not found


One of the many ways to work around this:

[root@o71 ~]# sudo -u oracle bash -c '. ~/.bash_profile; sqlplus / as sysdba'

SQL*Plus: Release 18.0.0.0.0 - Production on Sun Oct 28 10:52:43 2018
Version 18.4.0.0.0

Copyright (c) 1982, 2018, Oracle.  All rights reserved.


Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.4.0.0.0

SQL&gt; 


I am not a fan of using .bash_profile for setting the Oracle environment, I suggest using oraenv or a custom script that is not executed automatically.