GithubHelp home page GithubHelp logo

steveswinsburg / oracle12c-vagrant Goto Github PK

View Code? Open in Web Editor NEW
49.0 7.0 71.0 42 KB

A vagrant box that provisions Oracle 12c automatically.

License: Apache License 2.0

Shell 100.00%
oracle-12c vagrant database centos7 oracle

oracle12c-vagrant's Introduction

oracle12c-vagrant

A vagrant box that provisions Oracle 12c automatically, using only Vagrant and a shell script.

Getting started

  1. Clone this repository
  2. Download the Oracle Database 12c binaries linuxamd64_12102_database_1of2.zip and linuxamd64_12102_database_2of2.zip from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html and unzip to database/
  • Ensure you unzip into the same directory and they merge. There are some common directories in each. On the commandline, you can run unzip '*.zip' to do this for you.
  1. Install Virtualbox
  2. Install Vagrant
  3. Install VirtualBox plugin vagrant plugin install vagrant-vbguest
  4. Run vagrant up
  • The first time you run this it will provision everything and may take a while. Ensure you have a good internet connection!
  1. Connect to the database (see below).
  2. You can shutdown the box via the usual vagrant halt and the start it up again via vagrant up.

Connecting to Oracle

  • Hostname: localhost
  • Port: 1521
  • SID: orcl
  • All passwords are password.

Tablespaces

The folder oradata is mounted as a shared folder with permissions for Oracle to use it. If you have Oracle schemas that will consume a lot of space, create a tablespace for your schema in this directory instead of using the built in tablespaces. See tablespace.sql for an example of how to create a tablespace in this directory.

Other info

  • If you need to, you can connect to the machine via vagrant ssh.
  • You can sudo su - oracle to switch to the oracle user.
  • The Oracle installation path is /opt/oracle/
  • On the guest OS, the directory /vagrant is a shared folder and maps to wherever you have this file checked out.

Known issues

Repeated authentication failure message

On vagrant up if you experience this issue:

default: Error: Authentication failure. Retrying...
default: Error: Authentication failure. Retrying...
default: Error: Authentication failure. Retrying...
default: Error: Authentication failure. Retrying...
default: Error: Authentication failure. Retrying...

Then you may have hit a bug in vagrant 1.8.5. See http://stackoverflow.com/questions/22922891/vagrant-ssh-authentication-failure

The solution is to:

vagrant ssh
password: vagrant
chmod 0600 ~/.ssh/authorized_keys
exit

then vagrant reload.

Connection time after startup

Once Oracle and the listener starts up, it may take a few moments until you are able to connect to the DB, eg via SQL Developer.

Provisioning fails with "id: oracle: no such user"

Comment out line 35 in the Vagrant file. This mounts an additional folder however depending on how long it takes the machine to boot, the database might startup before that happens and things will complain.

oracle12c-vagrant's People

Contributors

aaron-kunde avatar pltanton avatar steveswinsburg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

oracle12c-vagrant's Issues

sqlplus: command not found

After cloning this git and unzip Oracle DBA 12c files into database/, I tried 'vagrant up' and 'vagrant ssh', but I could not launch SQL*PLUS as oracle user. Terminal says

[oracle@localhost ~]$ sqlplus
-bash: sqlplus: command not found

What's wrong with me?

Provisioning fails with "id: oracle: no such user"

Vagrant is attempting to mount "/vagrant/oradata" as user oracle before the user is created. This causes the provisioning to fail.

==> default: Mounting shared folders...
    default: /vagrant => /Users/jon/Documents/Projects/oracle12c-vagrant
    default: /vagrant/oradata => /Users/jon/Documents/Projects/oracle12c-vagrant/oradata
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:

id -u oracle

The error output from the command was:

id: oracle: no such user

Can't logon - bad user/password

I tried sysdba/password but it doesn't work.

Enter user-name: SYSDBA
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied

DB may not startup if synced folder is not mounted in time

Since the /vagrant folder is mounted after the server starts up, if this takes a while the Database may not startup. The workaround is to connect and open it:

sudo su - oracle
sqlplus "/ as sysdba"
SQL> select status from v$instance;

the result should be MOUNTED. If so:

SQL> alter database open;

To resolve this, the Oracle startup could wait for the folder to be mounted via:
http://razius.com/articles/launching-services-after-vagrant-mount/

Vagrant was unable to mount VirtualBox shared folders.

Hi There!

First off thanks for creating this vagrant config!

I am trying to get it working on my local Windows 10. I have Vagrant 1.8.7 and Virtual box 5.1.14r112924. But I am hitting an error - probably my fault, but hoped you may have some idea on the issue.

When I try and run vagrant up (after copying in Oracle 12c standard edition linux unziped files in the /database directory) I get the error:

Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:

mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant

The error output from the command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device

The full vagrant up log is:

DESKTOP-CT7F21O+ieuan@DESKTOP-CT7F21O ~/oracle12c-vagrant
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/centos-7.2'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: oracle12c-vagrant
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 1521 (guest) => 1521 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
[default] GuestAdditions versions on your host (5.1.14) and guest (5.1.10) do no                                                                                                                                                                                              t match.
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirror.ukhost4u.com
 * extras: mirrors.clouvider.net
 * updates: centos.serverspace.co.uk
No package kernel-devel-3.10.0-327.el7.x86_64 available.
Package bzip2-1.0.6-13.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package binutils.x86_64 0:2.23.52.0.1-55.el7 will be updated
---> Package binutils.x86_64 0:2.25.1-22.base.el7 will be an update
---> Package gcc.x86_64 0:4.8.5-11.el7 will be installed
--> Processing Dependency: libgomp = 4.8.5-11.el7 for package: gcc-4.8.5-11.el7.                                                                                                                                                                                              x86_64
--> Processing Dependency: cpp = 4.8.5-11.el7 for package: gcc-4.8.5-11.el7.x86_                                                                                                                                                                                              64
--> Processing Dependency: libgcc >= 4.8.5-11.el7 for package: gcc-4.8.5-11.el7.                                                                                                                                                                                              x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-11.el                                                                                                                                                                                              7.x86_64
---> Package make.x86_64 1:3.82-21.el7 will be updated
---> Package make.x86_64 1:3.82-23.el7 will be an update
---> Package perl.x86_64 4:5.16.3-286.el7 will be updated
---> Package perl.x86_64 4:5.16.3-291.el7 will be an update
--> Processing Dependency: perl-libs = 4:5.16.3-291.el7 for package: 4:perl-5.16                                                                                                                                                                                              .3-291.el7.x86_64
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-11.el7 will be installed
---> Package glibc-devel.x86_64 0:2.17-157.el7_3.1 will be installed
--> Processing Dependency: glibc-headers = 2.17-157.el7_3.1 for package: glibc-d                                                                                                                                                                                              evel-2.17-157.el7_3.1.x86_64
--> Processing Dependency: glibc = 2.17-157.el7_3.1 for package: glibc-devel-2.1                                                                                                                                                                                              7-157.el7_3.1.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-157.el7_3                                                                                                                                                                                              .1.x86_64
---> Package libgcc.x86_64 0:4.8.5-4.el7 will be updated
---> Package libgcc.x86_64 0:4.8.5-11.el7 will be an update
---> Package libgomp.x86_64 0:4.8.5-4.el7 will be updated
---> Package libgomp.x86_64 0:4.8.5-11.el7 will be an update
---> Package perl-libs.x86_64 4:5.16.3-286.el7 will be updated
---> Package perl-libs.x86_64 4:5.16.3-291.el7 will be an update
--> Running transaction check
---> Package glibc.x86_64 0:2.17-105.el7 will be updated
--> Processing Dependency: glibc = 2.17-105.el7 for package: glibc-common-2.17-1                                                                                                                                                                                              05.el7.x86_64
---> Package glibc.x86_64 0:2.17-157.el7_3.1 will be an update
---> Package glibc-headers.x86_64 0:2.17-157.el7_3.1 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.                                                                                                                                                                                              17-157.el7_3.1.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-157.el                                                                                                                                                                                              7_3.1.x86_64
--> Running transaction check
---> Package glibc-common.x86_64 0:2.17-105.el7 will be updated
---> Package glibc-common.x86_64 0:2.17-157.el7_3.1 will be an update
---> Package kernel-headers.x86_64 0:3.10.0-514.6.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch         Version                  Repository     Size
================================================================================
Installing:
 gcc                  x86_64       4.8.5-11.el7             base           16 M
Updating:
 binutils             x86_64       2.25.1-22.base.el7       base          5.4 M
 make                 x86_64       1:3.82-23.el7            base          420 k
 perl                 x86_64       4:5.16.3-291.el7         base          8.0 M
Installing for dependencies:
 cpp                  x86_64       4.8.5-11.el7             base          5.9 M
 glibc-devel          x86_64       2.17-157.el7_3.1         updates       1.1 M
 glibc-headers        x86_64       2.17-157.el7_3.1         updates       668 k
 kernel-headers       x86_64       3.10.0-514.6.1.el7       updates       4.8 M
Updating for dependencies:
 glibc                x86_64       2.17-157.el7_3.1         updates       3.6 M
 glibc-common         x86_64       2.17-157.el7_3.1         updates        11 M
 libgcc               x86_64       4.8.5-11.el7             base           97 k
 libgomp              x86_64       4.8.5-11.el7             base          152 k
 perl-libs            x86_64       4:5.16.3-291.el7         base          688 k

Transaction Summary
================================================================================
Install  1 Package  (+4 Dependent packages)
Upgrade  3 Packages (+5 Dependent packages)

Total download size: 58 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
Public key for binutils-2.25.1-22.base.el7.x86_64.rpm is not installed
warning: /var/cache/yum/x86_64/7/base/packages/binutils-2.25.1-22.base.el7.x86_6                                                                                                                                                                                              4.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for glibc-2.17-157.el7_3.1.x86_64.rpm is not installed
--------------------------------------------------------------------------------
Total                                               11 MB/s |  58 MB  00:05
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <[email protected]                                                                                                                                                                                              >"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-2.1511.el7.centos.2.10.x86_64 (@anaconda)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Updating   : libgcc-4.8.5-11.el7.x86_64                                  1/21
  Updating   : glibc-2.17-157.el7_3.1.x86_64                               2/21
warning: /etc/nsswitch.conf created as /etc/nsswitch.conf.rpmnew
  Updating   : glibc-common-2.17-157.el7_3.1.x86_64                        3/21
  Updating   : binutils-2.25.1-22.base.el7.x86_64                          4/21
  Updating   : 4:perl-libs-5.16.3-291.el7.x86_64                           5/21
  Updating   : 4:perl-5.16.3-291.el7.x86_64                                6/21
  Installing : cpp-4.8.5-11.el7.x86_64                                     7/21
  Updating   : libgomp-4.8.5-11.el7.x86_64                                 8/21
  Installing : kernel-headers-3.10.0-514.6.1.el7.x86_64                    9/21
  Installing : glibc-headers-2.17-157.el7_3.1.x86_64                      10/21
  Installing : glibc-devel-2.17-157.el7_3.1.x86_64                        11/21
  Installing : gcc-4.8.5-11.el7.x86_64                                    12/21
  Updating   : 1:make-3.82-23.el7.x86_64                                  13/21
  Cleanup    : 4:perl-5.16.3-286.el7.x86_64                               14/21
  Cleanup    : 4:perl-libs-5.16.3-286.el7.x86_64                          15/21
  Cleanup    : libgomp-4.8.5-4.el7.x86_64                                 16/21
  Cleanup    : 1:make-3.82-21.el7.x86_64                                  17/21
  Cleanup    : binutils-2.23.52.0.1-55.el7.x86_64                         18/21
  Cleanup    : glibc-2.17-105.el7.x86_64                                  19/21
  Cleanup    : glibc-common-2.17-105.el7.x86_64                           20/21
  Cleanup    : libgcc-4.8.5-4.el7.x86_64                                  21/21
  Verifying  : glibc-headers-2.17-157.el7_3.1.x86_64                       1/21
  Verifying  : glibc-common-2.17-157.el7_3.1.x86_64                        2/21
  Verifying  : libgcc-4.8.5-11.el7.x86_64                                  3/21
  Verifying  : glibc-2.17-157.el7_3.1.x86_64                               4/21
  Verifying  : binutils-2.25.1-22.base.el7.x86_64                          5/21
  Verifying  : 4:perl-libs-5.16.3-291.el7.x86_64                           6/21
  Verifying  : kernel-headers-3.10.0-514.6.1.el7.x86_64                    7/21
  Verifying  : 1:make-3.82-23.el7.x86_64                                   8/21
  Verifying  : cpp-4.8.5-11.el7.x86_64                                     9/21
  Verifying  : libgomp-4.8.5-11.el7.x86_64                                10/21
  Verifying  : gcc-4.8.5-11.el7.x86_64                                    11/21
  Verifying  : 4:perl-5.16.3-291.el7.x86_64                               12/21
  Verifying  : glibc-devel-2.17-157.el7_3.1.x86_64                        13/21
  Verifying  : libgomp-4.8.5-4.el7.x86_64                                 14/21
  Verifying  : 4:perl-5.16.3-286.el7.x86_64                               15/21
  Verifying  : libgcc-4.8.5-4.el7.x86_64                                  16/21
  Verifying  : 1:make-3.82-21.el7.x86_64                                  17/21
  Verifying  : binutils-2.23.52.0.1-55.el7.x86_64                         18/21
  Verifying  : glibc-common-2.17-105.el7.x86_64                           19/21
  Verifying  : 4:perl-libs-5.16.3-286.el7.x86_64                          20/21
  Verifying  : glibc-2.17-105.el7.x86_64                                  21/21

Installed:
  gcc.x86_64 0:4.8.5-11.el7

Dependency Installed:
  cpp.x86_64 0:4.8.5-11.el7
  glibc-devel.x86_64 0:2.17-157.el7_3.1
  glibc-headers.x86_64 0:2.17-157.el7_3.1
  kernel-headers.x86_64 0:3.10.0-514.6.1.el7

Updated:
  binutils.x86_64 0:2.25.1-22.base.el7         make.x86_64 1:3.82-23.el7
  perl.x86_64 4:5.16.3-291.el7

Dependency Updated:
  glibc.x86_64 0:2.17-157.el7_3.1      glibc-common.x86_64 0:2.17-157.el7_3.1
  libgcc.x86_64 0:4.8.5-11.el7         libgomp.x86_64 0:4.8.5-11.el7
  perl-libs.x86_64 4:5.16.3-291.el7

Complete!
Copy iso file C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso into the                                                                                                                                                                                               box /tmp/VBoxGuestAdditions.iso
mount: /dev/loop0 is write-protected, mounting read-only
Installing Virtualbox Guest Additions 5.1.14 - guest version is 5.1.10
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.1.14 Guest Additions for Linux...........
VirtualBox Guest Additions installer
Removing installed version 5.1.10 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
vboxadd.sh: Building Guest Additions kernel modules.
Failed to set up service vboxadd, please check the log file
/var/log/VBoxGuestAdditions.log for details.

==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => C:/Tools/cygwin/home/ieuan/oracle12c-vagrant
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:

mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant

The error output from the command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.