Arquivo mensal: março 2015

Download Livro – Oracle Query Tunning: tips for DBA and Developers

Ola Pessoal,

Estou colocando mais um link para download gratuito do um livro sobre tunning de query em banco de dados Oracle.  Este livro foi diponibilizado pela Oracle Press em parceria com a SolarWinds.

Segue aqui o link para download, antes dever ser feito um cadastro no site da Mc Graw Hill.

um abraço a todos

Orachk – Um utilitário para checar a saúde do Oracle – Parte 1

Neste post estarei falando sobre o utilitário da Oracle chamado orachk.  O utilitário ORAchk (Oracle Check) era anteriormente conhecido RACchk.

O Orachk é projetado para verificar as configurações do banco de dados Oracle, seja bancos de dados single instance, bem como bancos de dados em RAC.
Ele também inclui verificações para o Oracle Clusterware, Oracle Automatic Storage Management (Oracle ASM) e Oracle Grid Infrastructure.  Além de bancos oracle e RAC, o orachk também pode ser usado para verificar sistemas em  exadata e EBS.

O utilitário ORAchk pode ser baixado a partir de Nota 1268927.2 do MOS (My Oracle Support).

Características do ORAchk:

  • Proativamente verifica para os problemas conhecidos de maior impacto para o sistema.
  • Simplifica e agiliza como investigar e analisar quais problemas conhecidos representam um risco ao administrador
  • Ferramenta é leve executado dentro de seu ambiente; os dados não serão enviados para o Oracle
  • Relatórios de alto nível mostrar seus riscos para a saúde do sistema com a capacidade de aprofundar em problemas específicos e  compreender as suas resoluções
  • Pode ser configurado para enviar notificações por e-mail quando detecta problemas

Plataformas suportadas

  • Linux x86-64 * (Enterprise Linux, Red Hat e SuSE 9, SuSE 10 & SuSE 11)
  • Oracle Solaris SPARC (Solaris 10 e 11)
  • Oracle Solaris x86-64 (Solaris 10 e 11)
  • AIX **
  • HPUX **

* não é suportado em Plataformas de 32 bits, sem suporte planejado para Itanium Linux
** Requer BASH Shell 3.2 ou superior para ser instalado

Versões de  Oracle suportadas pelo orachk

  • 10gR2
  • 11gR1
  • 11gR2
  • 12cR1

OBS: Suporte New ORAchk para Windows

ORAchk agora é suportado no Windows quando executado dentro de um ambiente Cygwin.   As instruções para configurar Cygwin pode ser encontrado a partir de documentos 1268927.2 do MOS (My Oracle Support) .

Download

O download é um arquivo zip simples. Depois de baixar o arquivo, use o utilitário de descompactação OS para extrair  seu conteúdo. A instalação é concluída depois de descompactar o arquivo.

Quando Executar ORAchk?

  • Após a implantação inicial do Oracle RAC
  • Antes e Após a manutenção planejada do sistema
  • Pelo menos uma vez a cada três meses

Não importa qual o componente Oracle está sendo examinada (database, grid, etc), o ORAchk está verificando a configuração procurando problemas.  Ele fornece um relatório mostrando os riscos à saúde do produto.  Recomenda-se que o administrado  execute e examine os relatórios antes e após as alterações de configuração de software para entender se essas mudanças podem causar problemas futuros.

Executando o ORAchk em Single Instance

para a demonstração, testaremos o orachk em um database 12c em linux

1 – Configuração do Produto

Após o download do produto, o mesmo devera ser descompatado em um local especifico.

$ unzip orachk1.zip
Archive:  orachk1.zip
inflating: CollectionManager_App.sql
inflating: UserGuide.txt
inflating: orachk
creating: .cgrep/
inflating: .cgrep/init.tmpl
inflating: .cgrep/checkDiskFGMapping.sh
inflating: .cgrep/exalogic_zfs_checks_el_extensive.aksh
inflating: .cgrep/scnhealthcheck.sql
inflating: .cgrep/merge_collections.pl
inflating: .cgrep/lcgrep4
inflating: .cgrep/cgrepwin61
inflating: .cgrep/reset_crshome.pl
inflating: .cgrep/utlusts.sql
inflating: .cgrep/asrexacheck
inflating: .cgrep/pxhcdr.sql
inflating: .cgrep/create_version.pl
inflating: .cgrep/lcgreps10
inflating: .cgrep/raw_data_browser.pl
inflating: .cgrep/utlu112i.sql
inflating: .cgrep/zlcgrep6
inflating: .cgrep/show_file_in_html.pl
inflating: .cgrep/switch_multirack.sh
inflating: .cgrep/utluppkg.sql
inflating: .cgrep/profile_only.dat
inflating: .cgrep/check_reblance_free_space.sql
inflating: .cgrep/scgrepx86
inflating: .cgrep/oracle-upstarttmpl.conf
inflating: .cgrep/profiles.dat
inflating: .cgrep/acgrep
creating: .cgrep/profiles/
inflating: .cgrep/profiles/E1BF012E8F210839E04313C0E50A7B68.prf
inflating: .cgrep/profiles/D462A6F7E9C340FDE0431EC0E50ABE12.prf
inflating: .cgrep/profiles/EA5EE324E7E05128E04313C0E50A4B2A.prf
inflating: .cgrep/profiles/069273EAA9873FD1E05312C0E50A8953.prf
inflating: .cgrep/profiles/E8DF76E07DD82E0DE04313C0E50AA55D.prf
inflating: .cgrep/profiles/D49AD88F8EE75CD8E0431EC0E50A0BC3.prf
inflating: .cgrep/profiles/F32F44CE0BCD662FE04312C0E50AB058.prf
inflating: .cgrep/profiles/E2E972DDE1E14493E04312C0E50A1AB1.prf
extracting: .cgrep/profiles/F13E11974A282AB3E04312C0E50ABCBF.prf
inflating: .cgrep/profiles/EF6C016813C51366E04313C0E50AE11F.prf
inflating: .cgrep/profiles/DA94919CD0DE0913E04312C0E50A7996.prf
inflating: .cgrep/profiles/D49C0FBF8FBF4B1AE0431EC0E50A0F24.prf
inflating: .cgrep/profiles/06889D8BB65E575CE05313C0E50ADFD3.prf
inflating: .cgrep/profiles/D8367AD6754763FEE04312C0E50A6FCB.prf
inflating: .cgrep/profiles/DF65D6117CB41054E04312C0E50A69D1.prf
inflating: .cgrep/profiles/06702DE980726771E05313C0E50ACF83.prf
inflating: .cgrep/profiles/D49BDC2EC9E624AEE0431EC0E50A3E12.prf
inflating: .cgrep/profiles/D49C0AB26A6D45A8E0431EC0E50ADE06.prf
inflating: .cgrep/profiles/D49C4F9F48735396E0431EC0E50A9A0B.prf
inflating: .cgrep/profiles/DFE9C207A8F2428CE04313C0E50A6B0A.prf
inflating: .cgrep/profiles/DF65D0F7FB6F1014E04312C0E50A7808.prf
inflating: .cgrep/profiles/D49B218473787400E0431EC0E50A0BB9.prf
inflating: .cgrep/profiles/0A82EA8BF9646097E05313C0E50A26D6.prf
inflating: .cgrep/profiles/F6AFECA37F177C3FE04313C0E50A56BF.prf
inflating: .cgrep/profiles/F9ED0179CCD8256BE04312C0E50A5399.prf
inflating: .cgrep/profiles/09DC8AC7C7974BDDE05313C0E50A2339.prf
inflating: .cgrep/auto_upgrade.pl
inflating: .cgrep/versions.dat
inflating: .cgrep/rack_comparison.py
inflating: .cgrep/psqlplus
inflating: .cgrep/lcgreps11
inflating: .cgrep/ogghc_11204.sql
inflating: .cgrep/checkDiskScheduler.sh
inflating: .cgrep/lcgrep5
inflating: .cgrep/ggdiscovery.sh
inflating: .cgrep/ogghc_11203.sql
inflating: .cgrep/hiacgrep
inflating: .cgrep/ogghc_12101.sql
inflating: .cgrep/checkFlashCache.sh
inflating: .cgrep/checkvg.sh
inflating: .cgrep/exalogic_zfs_checks.aksh
inflating: .cgrep/isc_summary.pl
inflating: .cgrep/lcgreps9
inflating: .cgrep/lcgrep6
inflating: .cgrep/cgrepwin63
inflating: .cgrep/readreg.pl
inflating: .cgrep/preupgrd.sql
inflating: .cgrep/scgrep
inflating: .cgrep/OVMMCheckChannels.py
inflating: .cgrep/diff_collections.pl
inflating: .cgrep/diff_checks.pl
inflating: readme.txt
inflating: rules.dat
inflating: collections.dat
inflating: raccheck

2 – Verificar as permissões e executar o orachk

Após verificada as permissoes executar o o utilitário orachk e responder as perguntas abaixo:

[oracle@db12cvm1 ~]$ ./orachk

List of running databases
1. cdb1
2. None of above

Select databases from list for checking best practices. For multiple databases, select 1 for All or comma separated number like 1,2 etc [1-2][1].
. .

2.1 – Abaixo a ferramenta informa um status resumido do ambiente:

Checking Status of Oracle Software Stack – Clusterware, ASM, RDBMS
. . . . . . . . . . . . . . .
——————————————————————————————————-
Oracle Stack Status
——————————————————————————————————-
Host Name  CRS Installed  ASM HOME       RDBMS Installed  CRS UP    ASM UP    RDBMS UP  DB Instance Name
——————————————————————————————————-
db12cvm1    No              No              Yes             No         No       Yes      cdb1
——————————————————————————————————-

Neste caso o ambiente é single instance  com file system e não possui ASM instalado e configurado

Copying plug-ins

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . .

2.2 – Verificação e Recomendação das Melhores Práticas

Nesta Etapa a ferramenta faz um check do ambiente e gera um relatório com as Melhores práticas para cada recomendação o status de saida é  PASS/WARNING/FAIL.

*** Checking Best Practice Recommendations (PASS/WARNING/FAIL) ***

Collections and audit checks log file is /home/oracle/orachk_db12cvm1_cdb1_031215_063404/log/orachk.log

Checking for prompts in /home/oracle/.bash_profile on db12cvm1 for oracle user…

=============================================================
Node name – db12cvm1
=============================================================

Collecting – Database Parameters for cdb1 database
Collecting – Database Undocumented Parameters for cdb1 database
Collecting – RDBMS Feature Usage for cdb1 database
Collecting – CPU Information
Collecting – DiskMount Information
Collecting – Kernel parameters
Collecting – Maximum number of semaphore sets on system
Collecting – Maximum number of semaphores on system
Collecting – Maximum number of semaphores per semaphore set
Collecting – Memory Information
Collecting – OS Packages
Collecting – Operating system release information and kernel version
Collecting – Patches for RDBMS Home
Collecting – Table of file system defaults
Collecting – number of semaphore operations per semop system call

Data collections completed. Checking best practices on db12cvm1.
————————————————————————————–

WARNING => DBRM is not configured. for cdb1
INFO =>    Oracle Data Pump Best practices.
FAIL =>    Bash is vulnerable to code injection (CVE-2014-6271)
WARNING => Linux Swap Configuration does NOT meet Recommendation
WARNING => physical memory is not sufficient
INFO =>    Important Storage Minimum Requirements for Grid & Database Homes
FAIL =>    DB_UNIQUE_NAME on primary has not been modified from the default, confirm that database name is unique across your Oracle enterprise. for cdb1
INFO =>    user_dump_dest has trace files older than 30 days for cdb1
INFO =>    At some times checkpoints are not being completed for cdb1
WARNING => OSWatcher is not running as is recommended.
FAIL =>    Database parameter DB_LOST_WRITE_PROTECT is NOT set to recommended value on cdb1 instance
WARNING => Database parameter DB_BLOCK_CHECKING on PRIMARY is NOT set to the recommended value. for cdb1
INFO =>    Operational Best Practices
INFO =>    Database Consolidation Best Practices
INFO =>    Computer failure prevention best practices
INFO =>    Data corruption prevention best practices
INFO =>    Logical corruption prevention best practices
INFO =>    Database/Cluster/Site failure prevention best practices
INFO =>    Client failover operational best practices
WARNING => One or More Registry Components were found to be Invalid for cdb1
WARNING => Duplicate objects were found in the SYS and SYSTEM schemas for cdb1
WARNING => Redo log file size should be sized to switch every 20 minutes during peak redo generation for cdb1
FAIL =>    Database parameter LOG_BUFFER is NOT set to recommended value on cdb1 instance
WARNING => Oracle clusterware is not being used
WARNING => RAC Application Cluster is not being used for database high availability on cdb1 instance
WARNING => “DISK_ASYNCH_IO is NOT set to recommended value for cdb1
FAIL =>    Flashback on PRIMARY is not configured for cdb1
INFO =>    Database failure prevention best practices
WARNING => fast_start_mttr_target has NOT been changed from default on cdb1 instance
WARNING => Database Archivelog Mode should be set to ARCHIVELOG for cdb1
FAIL =>    Primary database is NOT protected with Data Guard (standby database) for real-time data protection and availability for cdb1
FAIL =>    Active Data Guard is not configured for cdb1
INFO =>    Oracle recovery manager(rman) best practices
INFO =>    Consider increasing the COREDUMPSIZE size
WARNING => Consider increasing the value of the session_cached_cursors database parameter for cdb1
INFO =>    Consider investigating the frequency of SGA resize operations and take corrective action for cdb1

Best Practice checking completed.Checking recommended patches on db12cvm1.
———————————————————————————

2.3 – Verificação do Inventário

A ferramenta também verifica quais sao os patches aplicados no banco de dados e faz as recomendações

Collecting patch inventory on ORACLE_HOME /u01/app/oracle/product/12.1.0.1/db_1
———————————————————————————

———————————————————————————
1 Recommended RDBMS patches for 121010 from /u01/app/oracle/product/12.1.0.1/db_1 on db12cvm1
———————————————————————————
Patch#   RDBMS    ASM     type                Patch-Description
———————————————————————————
19769486  no             merge               DATABASE PATCH SET UPDATE 12.1.0.1.6 (JAN2015)
———————————————————————————

———————————————————————————
RDBMS homes patches summary report
———————————————————————————
Total patches  Applied on RDBMS Applied on ASM ORACLE_HOME
———————————————————————————
1              0              0                /u01/app/oracle/product/12.1.0.1/db_1
———————————————————————————

2.4 – Relatório

No final da execução, a ferramenta exibe o local aonde estao os relatórios gerados pela execução e o mesmo relatório em formato .ZIP para download
Detailed report (html) – /home/oracle/orachk_db12cvm1_cdb1_031215_063404/orachk_db12cvm1_cdb1_031215_063404.html

UPLOAD(if required) – /home/oracle/orachk_db12cvm1_cdb1_031215_063404.zip

 
No proximo Post, estarei demostrando a execução do orachk em ambiente Oracle RAC.

Um abraço a todos