Skip to content

Commit

Permalink
Bump memory to 6Gb total, 4Gb for Oracle, 2 CPUs.
Browse files Browse the repository at this point in the history
Add a shared folder assigned with Oracle permissions so that tablespaces can be created in there instead.
  • Loading branch information
Steve Swinsburg committed Aug 11, 2017
1 parent b2b63e1 commit e60d06f
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vagrant/
database/
*.zip
vagrant/*.dbf
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@ from http://www.oracle.com/technetwork/database/enterprise-edition/downloads/ind
3. Install Virtualbox
4. Install Vagrant
5. Install VirtualBox plugin `vagrant plugin install vagrant-vbguest`
6. Run `vagrant up`
6. The first time you run this it will provision everything and may take a while. Ensure you have a good internet connection!
7. Connect to the database.
8. You can shutdown the box via the usual `vagrant halt` and the start it up again via `vagrant up`.
9. Note that on the next `vagrant up`, the box will automatically update the VirtualBox Guest Additions.
6. Install Disksize plugin `'`vagrant plugin install vagrant-disksize`
7. Run `vagrant up`
7. The first time you run this it will provision everything and may take a while. Ensure you have a good internet connection!
8. Connect to the database (see below).
9. 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](/scripts/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`.
Expand All @@ -45,8 +48,8 @@ http://stackoverflow.com/questions/22922891/vagrant-ssh-authentication-failure

The solution is to:
````
vagrant ssh
password: vagrant
vagrant ssh
password: vagrant
chmod 0600 ~/.ssh/authorized_keys
exit
````
Expand All @@ -55,4 +58,3 @@ 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.

17 changes: 13 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

config.vm.box = "bento/centos-7.2"
config.vm.box_check_update = false

#config.vm.box_check_update = true
config.vbguest.auto_update = false

#config.vbguest.auto_reboot = true

# workaround the vagrant 1.8.5 bug
config.ssh.insert_key = false

# change memory size
config.vm.provider "virtualbox" do |v|
v.memory = 4000
v.memory = 6000
v.cpus = 2
v.name = "oracle12c-vagrant"
v.customize ["modifyvm", :id, "--cableconnected1", "on"]
v.customize ["modifyvm", :id, "--ioapic", "on"]
v.customize ["modifyvm", :id, "--cpuexecutioncap", "100"]
end

# Oracle port forwarding
Expand All @@ -27,6 +31,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Provision everything on the first run
config.vm.provision "shell", path: "scripts/install.sh"

config.vm.synced_folder ".", "/vagrant"
config.vm.synced_folder "./oradata", "/vagrant/oradata", owner: "oracle", group: "oinstall"



# if Vagrant.has_plugin?("vagrant-proxyconf")
# config.proxy.http = "http://proxy.example.com/"
# config.proxy.https = "http://proxy.example.com/"
Expand Down
2 changes: 1 addition & 1 deletion ora-response/dbca.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ CHARACTERSET="AL32UTF8"
NATIONALCHARACTERSET= "AL16UTF16"
AUTOMATICMEMORYMANAGEMENT = "TRUE"
DATABASETYPE = "MULTIPURPOSE"
TOTALMEMORY = "2000"
TOTALMEMORY = "4000"
4 changes: 4 additions & 0 deletions oradata/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
2 changes: 0 additions & 2 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# Note that if you change the ORACLE_HOME or ORACLE_BASE in the response files
# then you will also need to update this script
# Note also that the VB Guest additions will be automatically installed on the NEXT vagrant up


echo 'INSTALLER: Starting up'

Expand Down
8 changes: 8 additions & 0 deletions scripts/tablespace.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- Create a tablespace in the host's filesystem so that we don't run out of space
CREATE TABLESPACE vagrant
DATAFILE
'/vagrant/oradata/vagrant.dbf' SIZE 1000M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
EXTENT MANAGEMENT
LOCAL UNIFORM SIZE 128K
SEGMENT SPACE MANAGEMENT
AUTO;

0 comments on commit e60d06f

Please sign in to comment.