Skip to content

Instantly share code, notes, and snippets.

@wsargent
Created October 3, 2011 07:46
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wsargent/1258640 to your computer and use it in GitHub Desktop.
Save wsargent/1258640 to your computer and use it in GitHub Desktop.
Setting up a base vagrant box for Oracle
Install instructions for 10.2:
http://download.oracle.com/docs/cd/B19306_01/relnotes.102/b15666/toc.htm
http://download.oracle.com/docs/cd/B19306_01/install.102/b15667/toc.htm
[Required files]
10201_database_linux_x86_64.cpio.gz
10201_companion_linux_x86_64.cpio.gz
p6810189_10204_Linux-x86-64.zip
http://sourceforge.net/projects/oratoolkit/files/Current%20Releases/oratoolkit-1.0.2.1.5-1.noarch.rpm/download
[Setting up a base box (noting RHEL 5 64 is official, but CentOS 5 64 will also work)]
[Setting up memory / disk / port forwarding for Oracle VM Vagrantfile]
config.vm.share_folder "sparkred", "/mnt/sparkred", "/Volumes/EXTERNAL/sparkred"
config.vm.network "33.33.33.10"
config.vm.forward_port "orcl", 1521, 1521
config.vm.customize do |vm|
vm.memory_size = 2048
vm.cpu_count = 2
end
[Required packages for oraToolkit (chef recipe!)]
pkgs = value_for_platform(
"default" => [
"libaio-devel", # do libaio FIRST
"kernel-headers",
"glibc-headers",
"libstdc++-devel",
"sysstat",
"glibc-devel",
"glibc-devel.i386",
"gcc",
"gcc-c++",
"elfutils-libelf-devel-static",
"elfutils-libelf-devel",
"libtermcap-devel",
"readline-devel",
"unixODBC",
"unixODBC-devel",
"compat-gcc-34",
"compat-gcc-34-c++",
"gdb",
"libXp",
"compat-db",
"perl",
"ksh",
"libgnome",
"libgnomeui",
"control-center",
"compat-libstdc++-296",
"compat-libstdc++-33",
"unzip"
]
)
pkgs.each do |pkg|
package pkg do
action :install
end
end
[Installing oraToolkit (chef recipe)]
package "ksh" do
action :install
end
cookbook_file "/tmp/oratoolkit-1.0.2.1.5-1.noarch.rpm" do
source "oratoolkit-1.0.2.1.5-1.noarch.rpm"
mode "0644"
end
package "oratoolkit" do
action :install
source "/tmp/oratoolkit-1.0.2.1.5-1.noarch.rpm"
provider Chef::Provider::Package::Rpm
end
[oraToolkit walkthrough]
Note: dbSetup-prod.cfg" here as it starts on a non-standard port:
https://www.oratoolkit.ch/knowledge/howto/installation/seSrv-10g-R2-on-RHEL-5.6-x86_64.php
[Notes]
Need to edit /etc/hosts to have the host name point to IP address.
Need to explicitly start "lsnrctl start" from inside Oracle
lnsnrctl has 1531 for dbProd server which is odd…
oracle_10_2:oracle@vagrant-centos64-5dot6:sidNotSet$ sdiff -s dbSetup-prod.cfg sample/dbSetup-prod.cfg
ORACLE_HOME="$ORACLE_BASE/sesrv/10.2.0/db1" | ORACLE_HOME="$ORACLE_BASE/sesrv/11.1.0/db1"
LISTENER_PORT="1521" | LISTENER_PORT="1531"
MEMORY_TARGET=4G | MEMORY_TARGET=512M
MEMORY_MAX_TARGET=4G | MEMORY_MAX_TARGET=512M
vi /opt/oracle/network/listener.ora and fix it
same with /opt/oracle/network/tnsnames.ora
sqlplus / as sysdba
Set up automatic memory management:
http://oracleflash.com/8/Automatic-Shared-Memory-Management-in-Oracle-10g.html
10G:
alter system set sga_max_size=3096M scope=spfile;
alter system set sga_target=2048M scope=spfile;
11G:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/memory003.htm
ALTER SYSTEM SET MEMORY_TARGET = 4096M;
ALTER SYSTEM SET SGA_TARGET = 0;
ALTER SYSTEM SET PGA_AGGREGATE_TARGET = 0;
[Repackaging your own oracle instance as a base box]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment