Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
0.2.0 - April 9, 2016
----------------------

* Fix (by default faulty) job BSLN_MAINTAIN_STATS_JOB


0.1.1 - April 28, 2014
----------------------

Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@ Include the default recipe in your run list after setting the URL attribute.
* `node['oracle-xe']['http-port']` - The port where you want the HTTP interface to be listening.
* `node['oracle-xe']['tnslsnr-port']` - The port where you want the TNS listener to be listening.
* `node['oracle-xe']['oracle-password']` - The password for the SYS and SYSTEM accounts.
* `node['oracle-xe']['start-lsnr-on-boot']` - Whether to start the TNS listener on bootup.
* `node['oracle-xe']['start-lsnr-on-boot']` - Whether to start the TNS listener on bootup (true | false).
* `node['oracle-xe']['password-lifetime-default']` - Password lifetime for users created with the default profile (int | "UNLIMITED"; default 180)
* `node['oracle-xe']['processes']` - Number of processes to use (default: 100)
* `node['oracle-xe']['session']` - Number of session to use (default: 172)
* `node['oracle-xe']['transactions']` - Number of transactions to use (default: 189)

# Recipes

The default recipe installs Oracle 11g Express Edition.
* `default` - The default recipe installs Oracle 11g Express Edition.
* `password-lifetime-default` - Changes the lifetime of passwords for accounts created with the default profile
* `processes-sessions-transactions` - Changes the max. number of processes, sessions, and transactions to allow a higher number of concurrent connections


Roadmap and Bugs
================
Expand Down
4 changes: 4 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@
default['oracle-xe']['tnslsnr-port'] = 1521
default['oracle-xe']['oracle-password'] = 'password'
default['oracle-xe']['start-lsnr-on-boot'] = true
default['oracle-xe']['password-lifetime-default'] = 180
default['oracle-xe']['processes'] = 100
default['oracle-xe']['sessions'] = 172
default['oracle-xe']['transactions'] = 189
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'Apache 2.0'
description 'Installs Oracle 11g Express Edition'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'
version '0.2.1'

%w(redhat centos scientific oracle).each do |p|
supports p
Expand Down
14 changes: 14 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,17 @@
group 'dba' # required
action :nothing
end

fix_job_sql = File.join(Chef::Config[:file_cache_path], 'fix-job-BSLN_MAINTAIN_STATS_JOB.sql')

template fix_job_sql do
action :create
notifies :run, 'execute[fix-job-BSLN_MAINTAIN_STATS_JOB]', :immediately
end

execute 'fix-job-BSLN_MAINTAIN_STATS_JOB' do
command "source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh && cd $ORACLE_HOME/rdbms/admin && sqlplus / as sysdba @#{fix_job_sql}"
user 'oracle'
group 'dba' # required
action :nothing
end
34 changes: 34 additions & 0 deletions recipes/password-lifetime-default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Cookbook Name:: oracle-xe
# Recipe:: password-lifetime-default
# Author:: Christoph Jahn (<[email protected]>)
#
# Copyright (C) 2016 Christoph Jahn
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


password_lifetime_default_sql = File.join(Chef::Config[:file_cache_path], 'set-password-lifetime-default.sql')

template password_lifetime_default_sql do
action :create
notifies :run, 'execute[set-password-lifetime-default]', :immediately
end

execute 'set-password-lifetime-default' do
command "source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh && sqlplus / as sysdba @#{password_lifetime_default_sql}"
user 'oracle'
group 'dba' # required
action :nothing
end
34 changes: 34 additions & 0 deletions recipes/processes-sessions-transactions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Cookbook Name:: oracle-xe
# Recipe:: processes-sessions-transactions
# Author:: Christoph Jahn (<[email protected]>)
#
# Copyright (C) 2016 Christoph Jahn
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


procs_sess_tx_sql = File.join(Chef::Config[:file_cache_path], 'set-processes-sessions-transactions.sql')

template procs_sess_tx_sql do
action :create
notifies :run, 'execute[set-processes-sessions-transactions]', :immediately
end

execute 'set-processes-sessions-transactions' do
command "source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh && sqlplus / as sysdba @#{procs_sess_tx_sql}"
user 'oracle'
group 'dba' # required
action :nothing
end
10 changes: 10 additions & 0 deletions templates/default/fix-job-BSLN_MAINTAIN_STATS_JOB.sql.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@catnsnmp
@catsnmp
shutdown immediate;
startup;

-- Execute job again to remove FAILED entry
exec dbms_scheduler.run_job('BSLN_MAINTAIN_STATS_JOB',false);

exit;
-- NOW I CAN STOP SHOUTING
3 changes: 3 additions & 0 deletions templates/default/set-password-lifetime-default.sql.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Alter profile DEFAULT limit password_life_time <%= node['oracle-xe']['password-lifetime-default'] %>;
EXIT;
-- NOW I CAN STOP SHOUTING
7 changes: 7 additions & 0 deletions templates/default/set-processes-sessions-transactions.sql.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Alter system set processes = <%= node['oracle-xe']['processes'] %> scope = spfile;
Alter system set sessions = <%= node['oracle-xe']['sessions'] %> scope = spfile;
Alter system set transactions = <%= node['oracle-xe']['transactions'] %> scope = spfile;
shutdown immediate;
startup;
EXIT;
-- NOW I CAN STOP SHOUTING