SlideShare a Scribd company logo
DBA
Oracle Database
2016.09.12 - JPOUG in 15 minutes #1
Michitoshi Yoshida
(@miyosh0008)
• (@miyosh0008)
• Engineered Systems
Exadata, Exalogic, Exalytics, etc..
• 

etc..
DBA だってもっと効率化したい!〜最近の自動化事情とOracle Database〜
Oracle Database
DB
+ RAC
+ PDB
Oracle DB
DBA だってもっと効率化したい!〜最近の自動化事情とOracle Database〜
1.
2.
3.
4.
•
Chef
-
-
- Recipe Ruby
Puppet
- 2005
- Chef
- Puppet Enterprise
•
Ansible
- Python 2.4
- YAML
- 2015 RedHat
Itamae
- Chef
- Chef Ruby
-
• 

Serverspec
-
- RSpec Ruby
-
Testinfra
- Serverspec Python
- pytest Python
- Serverspec
• 

Infrataster
- Serverspec RSpec
-
: WEB URL HTTP
200 etc..
- Serverspec
1.
2.
Ansible Galaxy
→ Ansible
Python
SSH OK
3.
→ alter
ShellScript OK Ansible
#
: Hello,module! 15 Ansible Bash
4.
→ OS Serverspec 

SQL
SQL
Infrataster
→
Infrataster-plugin-oracledb
• 



• 

- 

- REDO 

- SQL
Infrataster-plugin-oracledb
• Infrataster Gem 

gem bundler 

# 

# m(_ _)m
DBA だってもっと効率化したい!〜最近の自動化事情とOracle Database〜
DBA だってもっと効率化したい!〜最近の自動化事情とOracle Database〜
# zip
$ unzip /tmp/instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/
oracle/instantclient/
$ unzip /tmp/instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/
oracle/instantclient/
#
$ cd /opt/oracle/instantclient/instantclient_12_1
$ ln -s libclntsh.so.12.1 libclntsh.so
$ ln -s libocci.so.12.1 libocci.so
$ echo "/opt/oracle/instantclient/instantclient_12_1" >/etc/
ld.so.conf.d/oracle.conf
# .bash_profile
export ORACLE_HOME=/opt/oracle/instantclient/instantclient_12_1
export LD_LIBRARY_PATH=$ORACLE_HOME
Step1: Oracle Instant Client
Basic SDK
#
$ mkdir oracle_test
$ cd oracle_test
# Gemfile
$ cat Gemfile
source 'https://rubygems.org'
gem 'infrataster'
gem ‘infrataster-plugin-oracledb'
#
# : ruby bundler
$ bundle install
$ bundle show | grep infrataster
* infrataster (0.3.2)
* infrataster-plugin-oracledb (0.1.0) # ← OK
Step2: infrataster infrataster-plugin-
oracledb
# spec
$ cp -r $(bundle show infrataster-plugin-oracledb)/spec ./
# spec_helper.rb
$ vi spec/spec_helper.rb
# spec_helper.rb
... ...
Infrataster::Server.define(
:orcl, # ←
‘192.168.56.101', # ←
oracledb: { user: 'system', password: 'oracle',
service_name: 'orcl'},
)
... ...
Step3:
# oracledb_query_spec.rb
$ vi spec/oracledb_query_spec.rb
# oracledb_query_spec.rb
# coding: utf-8
require 'spec_helper'
describe server(:orcl) do
describe oracledb_query('select name,display_value from v
$parameter') do
# check db_block_size
it "initialization parameter 'db_block_size' should equal 8192" do
row = results.find { |r| r['NAME'] == 'db_block_size' }
expect(row['DISPLAY_VALUE'].to_i).to eq 8192
end
end
end
Step4:
: db_block_size 8192
$ bundle exec rspec
Warning: NLS_LANG is not set. fallback to US7ASCII.
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
Randomized with seed 28464
.
Finished in 0.06133 seconds (files took 0.4652 seconds to load)
1 example, 0 failures
Randomized with seed 28464
Step5:
1 0
# .rspec
$ cat .rspec
--color
--format documentation
$ export NLS_LANG=JAPANESE_JAPAN.AL32UTF8
$ bundle exec rspec
... ...
server 'orcl'
oracledb_query 'select name,display_value from v$parameter'
initialization parameter 'db_block_size' should equal 8192
Finished in 0.0545 seconds (files took 0.41626 seconds to load)
1 example, 0 failures
... ...
Step6:
RSpec

More Related Content

PDF
監査ログをもっと身近に!〜統合監査のすすめ〜
PDF
MySQL Audit using Percona audit plugin and ELK
PPT
Oracle12c Pluggable Database Hands On - TROUG 2014
PPTX
MySQL Audit using Percona audit plugin and ELK
PDF
DB エンジニアのマイクロサービス入門〜Oracle Database と Docker ではじめる API サービス〜
PPTX
MySQL InnoDB Cluster 미리보기 (remote cluster test)
PPSX
Oracle Cloud As Services
PPTX
ProxySQL & PXC(Query routing and Failover Test)
監査ログをもっと身近に!〜統合監査のすすめ〜
MySQL Audit using Percona audit plugin and ELK
Oracle12c Pluggable Database Hands On - TROUG 2014
MySQL Audit using Percona audit plugin and ELK
DB エンジニアのマイクロサービス入門〜Oracle Database と Docker ではじめる API サービス〜
MySQL InnoDB Cluster 미리보기 (remote cluster test)
Oracle Cloud As Services
ProxySQL & PXC(Query routing and Failover Test)

What's hot (20)

PDF
Introduction to MySQL InnoDB Cluster
PPTX
Query logging with proxysql
PPTX
My sql failover test using orchestrator
PDF
Docker Monitoring Webinar
DOC
Schema replication using oracle golden gate 12c
PDF
Spider Setup with AWS/sandbox
PDF
glance replicator
PDF
How to Run Solr on Docker and Why
PPT
Managing Oracle Enterprise Manager Cloud Control 12c with Oracle Clusterware
PDF
Percona Live 2012PPT: introduction-to-mysql-replication
PDF
NoSQL атакует: JSON функции в MySQL сервере.
PDF
MySQL Document Store
PDF
Phd tutorial hawq_v0.1
PPT
Intro to ASH
PDF
Elasticsearch for Logs & Metrics - a deep dive
PDF
Survey of Percona Toolkit
PDF
How to Avoid Pitfalls in Schema Upgrade with Galera
PPT
Ash masters : advanced ash analytics on Oracle
PDF
MySQL Performance Schema in 20 Minutes
PPTX
Stacki - The1600+ Server Journey
Introduction to MySQL InnoDB Cluster
Query logging with proxysql
My sql failover test using orchestrator
Docker Monitoring Webinar
Schema replication using oracle golden gate 12c
Spider Setup with AWS/sandbox
glance replicator
How to Run Solr on Docker and Why
Managing Oracle Enterprise Manager Cloud Control 12c with Oracle Clusterware
Percona Live 2012PPT: introduction-to-mysql-replication
NoSQL атакует: JSON функции в MySQL сервере.
MySQL Document Store
Phd tutorial hawq_v0.1
Intro to ASH
Elasticsearch for Logs & Metrics - a deep dive
Survey of Percona Toolkit
How to Avoid Pitfalls in Schema Upgrade with Galera
Ash masters : advanced ash analytics on Oracle
MySQL Performance Schema in 20 Minutes
Stacki - The1600+ Server Journey
Ad

Viewers also liked (20)

PPTX
進化したのはサーバだけじゃない!〜DBA の毎日をもっと豊かにするユーティリティのすすめ〜
PDF
Oracle Database Connect 2017 / JPOUG#1
PDF
Oracle how-to-audit-backup
PDF
SQL Developerって必要ですか? 株式会社コーソル 河野 敏彦
PDF
Oracle Database Standard Editionでの運用いろいろ
PDF
簡単!AWRをEXCELピボットグラフで分析しよう♪
PDF
バックアップと障害復旧から考えるOracle Database, MySQL, PostgreSQLの違い - Database Lounge Tokyo #2
PDF
Standard Edition 2でも使えるOracle Database 12c Release 2オススメ新機能
PDF
バックアップと障害復旧から考えるOracle Database, MySQL, PostgreSQLの違い
PDF
Enterprise day 2015 - Continuous delivery at Klarna (Klarna)
PDF
MySQL 監査システムを作った話 #mysqlcasual
PDF
[A33] [特濃jpoug statspack on pdb oracle database 12c] 20131115 補足・続報付き
PDF
SQLチューニング総合診療Oracle CloudWorld出張所
PDF
Meetup! jpoug oracle cloud world - なーんでだ1
PDF
Dbts2013 特濃jpoug log_file_sync
PDF
db tech showcase Tokyo 2013 - A35 特濃JPOUG:潮溜まりでジャブジャブ、SQLチューニング
PDF
Analyzing Oracle Database hang issues using various diagnostics.
PPTX
Oracle In-database-archiving ~Oracleでの論理削除~
PDF
Oracle cloudworld な〜んでだ?#3
PPTX
Tuning Tips
進化したのはサーバだけじゃない!〜DBA の毎日をもっと豊かにするユーティリティのすすめ〜
Oracle Database Connect 2017 / JPOUG#1
Oracle how-to-audit-backup
SQL Developerって必要ですか? 株式会社コーソル 河野 敏彦
Oracle Database Standard Editionでの運用いろいろ
簡単!AWRをEXCELピボットグラフで分析しよう♪
バックアップと障害復旧から考えるOracle Database, MySQL, PostgreSQLの違い - Database Lounge Tokyo #2
Standard Edition 2でも使えるOracle Database 12c Release 2オススメ新機能
バックアップと障害復旧から考えるOracle Database, MySQL, PostgreSQLの違い
Enterprise day 2015 - Continuous delivery at Klarna (Klarna)
MySQL 監査システムを作った話 #mysqlcasual
[A33] [特濃jpoug statspack on pdb oracle database 12c] 20131115 補足・続報付き
SQLチューニング総合診療Oracle CloudWorld出張所
Meetup! jpoug oracle cloud world - なーんでだ1
Dbts2013 特濃jpoug log_file_sync
db tech showcase Tokyo 2013 - A35 特濃JPOUG:潮溜まりでジャブジャブ、SQLチューニング
Analyzing Oracle Database hang issues using various diagnostics.
Oracle In-database-archiving ~Oracleでの論理削除~
Oracle cloudworld な〜んでだ?#3
Tuning Tips
Ad

Similar to DBA だってもっと効率化したい!〜最近の自動化事情とOracle Database〜 (20)

PDF
Rails Performance
KEY
Introduction to cloudforecast
PDF
MySQL 5.7 in a Nutshell
PDF
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
PDF
Scaling mysql with python (and Docker).
PDF
Icinga 2009 at OSMC
PDF
PDF
The Architecture of PicCollage Server
PDF
Oracle 11g R2 RAC setup on rhel 5.0
PDF
Curso de MySQL 5.7
PPTX
Relational Database Access with Python ‘sans’ ORM
PDF
介绍 Percona 服务器 XtraDB 和 Xtrabackup
ZIP
mtl_rubykaigi
PDF
Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, ...
PDF
Oracle applications r12.2.0 installation on linux
PDF
Bye bye $GLOBALS['TYPO3_DB']
PDF
MySQL 8.0 InnoDB Cluster demo
KEY
Wider than rails
PDF
MySQL 5.6 - Operations and Diagnostics Improvements
PDF
MySQL Utilities -- PyTexas 2015
Rails Performance
Introduction to cloudforecast
MySQL 5.7 in a Nutshell
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
Scaling mysql with python (and Docker).
Icinga 2009 at OSMC
The Architecture of PicCollage Server
Oracle 11g R2 RAC setup on rhel 5.0
Curso de MySQL 5.7
Relational Database Access with Python ‘sans’ ORM
介绍 Percona 服务器 XtraDB 和 Xtrabackup
mtl_rubykaigi
Hotsos 2011: Mining the AWR repository for Capacity Planning, Visualization, ...
Oracle applications r12.2.0 installation on linux
Bye bye $GLOBALS['TYPO3_DB']
MySQL 8.0 InnoDB Cluster demo
Wider than rails
MySQL 5.6 - Operations and Diagnostics Improvements
MySQL Utilities -- PyTexas 2015

Recently uploaded (20)

PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPT
Teaching material agriculture food technology
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Machine Learning_overview_presentation.pptx
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
August Patch Tuesday
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Tartificialntelligence_presentation.pptx
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
cloud_computing_Infrastucture_as_cloud_p
Programs and apps: productivity, graphics, security and other tools
Machine learning based COVID-19 study performance prediction
Digital-Transformation-Roadmap-for-Companies.pptx
Assigned Numbers - 2025 - Bluetooth® Document
OMC Textile Division Presentation 2021.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Encapsulation_ Review paper, used for researhc scholars
NewMind AI Weekly Chronicles - August'25-Week II
Teaching material agriculture food technology
TLE Review Electricity (Electricity).pptx
Spectroscopy.pptx food analysis technology
Machine Learning_overview_presentation.pptx
A comparative study of natural language inference in Swahili using monolingua...
August Patch Tuesday
Mobile App Security Testing_ A Comprehensive Guide.pdf
1. Introduction to Computer Programming.pptx
Tartificialntelligence_presentation.pptx
SOPHOS-XG Firewall Administrator PPT.pptx

DBA だってもっと効率化したい!〜最近の自動化事情とOracle Database〜

  • 1. DBA Oracle Database 2016.09.12 - JPOUG in 15 minutes #1 Michitoshi Yoshida (@miyosh0008)
  • 2. • (@miyosh0008) • Engineered Systems Exadata, Exalogic, Exalytics, etc.. • 
 etc..
  • 9. • Chef - - - Recipe Ruby Puppet - 2005 - Chef - Puppet Enterprise
  • 10. • Ansible - Python 2.4 - YAML - 2015 RedHat Itamae - Chef - Chef Ruby -
  • 11. • 
 Serverspec - - RSpec Ruby - Testinfra - Serverspec Python - pytest Python - Serverspec
  • 12. • 
 Infrataster - Serverspec RSpec - : WEB URL HTTP 200 etc.. - Serverspec
  • 14. 3. → alter ShellScript OK Ansible # : Hello,module! 15 Ansible Bash
  • 15. 4. → OS Serverspec 
 SQL SQL Infrataster →
  • 17. Infrataster-plugin-oracledb • Infrataster Gem 
 gem bundler 
 # 
 # m(_ _)m
  • 20. # zip $ unzip /tmp/instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/ oracle/instantclient/ $ unzip /tmp/instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/ oracle/instantclient/ # $ cd /opt/oracle/instantclient/instantclient_12_1 $ ln -s libclntsh.so.12.1 libclntsh.so $ ln -s libocci.so.12.1 libocci.so $ echo "/opt/oracle/instantclient/instantclient_12_1" >/etc/ ld.so.conf.d/oracle.conf # .bash_profile export ORACLE_HOME=/opt/oracle/instantclient/instantclient_12_1 export LD_LIBRARY_PATH=$ORACLE_HOME Step1: Oracle Instant Client Basic SDK
  • 21. # $ mkdir oracle_test $ cd oracle_test # Gemfile $ cat Gemfile source 'https://rubygems.org' gem 'infrataster' gem ‘infrataster-plugin-oracledb' # # : ruby bundler $ bundle install $ bundle show | grep infrataster * infrataster (0.3.2) * infrataster-plugin-oracledb (0.1.0) # ← OK Step2: infrataster infrataster-plugin- oracledb
  • 22. # spec $ cp -r $(bundle show infrataster-plugin-oracledb)/spec ./ # spec_helper.rb $ vi spec/spec_helper.rb # spec_helper.rb ... ... Infrataster::Server.define( :orcl, # ← ‘192.168.56.101', # ← oracledb: { user: 'system', password: 'oracle', service_name: 'orcl'}, ) ... ... Step3:
  • 23. # oracledb_query_spec.rb $ vi spec/oracledb_query_spec.rb # oracledb_query_spec.rb # coding: utf-8 require 'spec_helper' describe server(:orcl) do describe oracledb_query('select name,display_value from v $parameter') do # check db_block_size it "initialization parameter 'db_block_size' should equal 8192" do row = results.find { |r| r['NAME'] == 'db_block_size' } expect(row['DISPLAY_VALUE'].to_i).to eq 8192 end end end Step4: : db_block_size 8192
  • 24. $ bundle exec rspec Warning: NLS_LANG is not set. fallback to US7ASCII. Run options: include {:focus=>true} All examples were filtered out; ignoring {:focus=>true} Randomized with seed 28464 . Finished in 0.06133 seconds (files took 0.4652 seconds to load) 1 example, 0 failures Randomized with seed 28464 Step5: 1 0
  • 25. # .rspec $ cat .rspec --color --format documentation $ export NLS_LANG=JAPANESE_JAPAN.AL32UTF8 $ bundle exec rspec ... ... server 'orcl' oracledb_query 'select name,display_value from v$parameter' initialization parameter 'db_block_size' should equal 8192 Finished in 0.0545 seconds (files took 0.41626 seconds to load) 1 example, 0 failures ... ... Step6: RSpec