- install Centos on VirtualBox machine
vagrant init/centos7
In order to login to machine via putty with password authentication in Vagrantfile add:
"
config.ssh.username = 'vagrant'
config.ssh.password = 'vagrant'
config.ssh.insert_key = 'false'
"
vagrant up
- login to host and change in
/etc/ssh/sshd_config
PasswordAuthentication=yes
- restart sshd deamon
service sshd restart
- download Oracle components – as root
1.preinstaller curl -o oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
2.Oracle XE needs to be downloaded from here (you need to have oracle account)
https://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html
- installation as root
yum -y localinstall ./oracle-database18c
- configure Oracle as root – set up passwords for users sys/dba/root
/etc/init.d/oracle-xe-18c configure
Finally you get following output:
Database creation complete. For details check the logfiles at:
/opt/oracle/cfgtoollogs/dbca/XE.
Database Information:
Global Database Name:XE
System Identifier(SID):XE
Look at the log file "/opt/oracle/cfgtoollogs/dbca/XE/XE3.log" for further details.
Connect to Oracle Database using one of the connect strings:
Pluggable database: localhost.localdomain/XEPDB1
Multitenant container database: localhost.localdomain
Use https://localhost:5500/em to access Oracle Enterprise Manager for Oracle Database XE
- start Oracle listener and DB instance
/etc/init.d/oracle-xe-18c start
- connect to DB:
To fire up the SQL prompt for your user, you will have to make sure that $ORACLE_HOME is set and $ORACLE_HOME/bin in your $PATH. There is a utility script called oraenv, that will configure that and more for your. All you have to do is to call it for your local shell (note the . before the script name below) and pass on the $ORACLE_SID, which is XE:
$ . oraenv ORACLE_SID = [vagrant] ? XE ORACLE_BASE environment variable is not being set since this information is not available for the current user ID root. You can set ORACLE_BASE manually if it is required. Resetting ORACLE_BASE to its previous value or ORACLE_HOME The Oracle base has been set to /opt/oracle/product/18c/dbhomeXE
Once you have done that you can connect via the SQL prompt. The format for the connect string is: [user]/[password]@//[hostname]:[port]/[DB name] [AS [role]]
sqlplus sys/passwd//localhost:1521/XE as sysdba
More info: