Thursday, May 22, 2014

How to install and execute latest Exacheck


Step1 : Download the latest exacheck from this node "Oracle Exadata Database Machine exachk or HealthCheck (Doc ID 1070954.1)"


Step 2: Create the directory on the server which you want to use as Exacheck directory and copy the downloaded file there. 
 i use naming convention like exachk_224, exchk_225_beta


Step 3: Unzip the bundle
==> unzip exachk_225_BETA_bundle.zip
Archive:  exachk_225_BETA_bundle.zip
  inflating: exachk.zip
  inflating: ExachkBestPracticeChecks_v225_BETA.pdf
  inflating: ExachkFeatureFixHistory_v225_BETA.pdf
  inflating: ExachkUserGuide_v225_BETA.pdf
  inflating: exachk_dbm_maa_public.html
  inflating: exachk_dbm_post-upgrade_public.html
  inflating: exachk_dbm_pre-upgrade_public.html
  inflating: exachk_diff_sample_report_public.html
  inflating: exachk_profile_sysadmin_sample_public.html

  inflating: md5sums.txt

Step 4:Unzip the exachk.zip
==> unzip exachk.zip
Archive:  exachk.zip
   creating: .cgrep/
  inflating: .cgrep/auto_upgrade_check.pl
  inflating: .cgrep/ggdiscovery.sh
  inflating: .cgrep/create_version.pl
  inflating: .cgrep/scgrepx86
  inflating: .cgrep/scgrep
  inflating: .cgrep/checkDiskFGMapping.sh
  inflating: .cgrep/exalogic_zfs_checks.aksh
  inflating: .cgrep/auto_upgrade.pl
  inflating: .cgrep/asrexacheck
  inflating: .cgrep/utlusts.sql
  inflating: .cgrep/utlu112i.sql
  inflating: .cgrep/oracle-upstarttmpl.conf
  inflating: .cgrep/lcgrep3
  inflating: .cgrep/init.tmpl
   creating: .cgrep/profiles/
  inflating: .cgrep/profiles/F6AFECA37F177C3FE04313C0E50A56BF.prf
  inflating: .cgrep/profiles/D49B218473787400E0431EC0E50A0BB9.prf
  inflating: .cgrep/profiles/DF65D0F7FB6F1014E04312C0E50A7808.prf
  inflating: .cgrep/profiles/D49C0AB26A6D45A8E0431EC0E50ADE06.prf
  inflating: .cgrep/profiles/D49C4F9F48735396E0431EC0E50A9A0B.prf
  inflating: .cgrep/profiles/DFE9C207A8F2428CE04313C0E50A6B0A.prf
  inflating: .cgrep/profiles/D49BDC2EC9E624AEE0431EC0E50A3E12.prf
  inflating: .cgrep/profiles/DF65D6117CB41054E04312C0E50A69D1.prf
  inflating: .cgrep/profiles/D8367AD6754763FEE04312C0E50A6FCB.prf
  inflating: .cgrep/profiles/DA94919CD0DE0913E04312C0E50A7996.prf
  inflating: .cgrep/profiles/D49C0FBF8FBF4B1AE0431EC0E50A0F24.prf
 extracting: .cgrep/profiles/F13E11974A282AB3E04312C0E50ABCBF.prf
  inflating: .cgrep/profiles/EF6C016813C51366E04313C0E50AE11F.prf
  inflating: .cgrep/profiles/F32F44CE0BCD662FE04312C0E50AB058.prf
  inflating: .cgrep/profiles/E2E972DDE1E14493E04312C0E50A1AB1.prf
  inflating: .cgrep/profiles/D49AD88F8EE75CD8E0431EC0E50A0BC3.prf
  inflating: .cgrep/profiles/E8DF76E07DD82E0DE04313C0E50AA55D.prf
  inflating: .cgrep/profiles/EA5EE324E7E05128E04313C0E50A4B2A.prf
  inflating: .cgrep/profiles/E1BF012E8F210839E04313C0E50A7B68.prf
  inflating: .cgrep/profiles/D462A6F7E9C340FDE0431EC0E50ABE12.prf
  inflating: .cgrep/pxhcdr.sql
  inflating: .cgrep/diff_collections.pl
  inflating: .cgrep/utluppkg.sql
  inflating: .cgrep/versions.dat
  inflating: .cgrep/profiles.dat
  inflating: .cgrep/rack_comparison.py
  inflating: .cgrep/raw_data_browser.pl
  inflating: .cgrep/lcgrep6
  inflating: .cgrep/check_reblance_free_space.sql
  inflating: .cgrep/psqlplus
  inflating: .cgrep/show_file_in_html.pl
  inflating: .cgrep/reset_crshome.pl
  inflating: .cgrep/CollectionManager_App.sql
  inflating: .cgrep/preupgrd.sql
  inflating: .cgrep/ogghc_11203.sql
  inflating: .cgrep/merge_collections.pl
  inflating: .cgrep/scnhealthcheck.sql
  inflating: .cgrep/ogghc_11204.sql
  inflating: .cgrep/lcgrep5
  inflating: .cgrep/ogghc_12101.sql
  inflating: exachk
  inflating: UserGuide.txt
  inflating: readme.txt
  inflating: CollectionManager_App.sql
  inflating: rules.dat

  inflating: collections.dat


Step 5: Execute the script ./exachk


==> ./exachk

CRS stack is running and CRS_HOME is not set. Do you want to set CRS_HOME to /u01/app/11.2.0/grid?[y/n][y]y


Checking ssh user equivalency settings on all nodes in cluster


It will check all the database running and and then ask for ROOT  password for compute node and cell node
once it finishes execution


It comes back with detailed HTML report and zipped files. 











how to install oracle apex




























SQL> @apxldimg.sql /opt/app/apex

PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.

. Loading images directory: /opt/app/apex/apex/images

Directory created.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.


Commit complete.


Directory dropped.

timing for: Load Images
Elapsed: 00:00:31.67

Thursday, May 15, 2014

VI , sed and Awk command for DBA

1.Remove lines with SQL> from a file

sed --in-place '/SQL> select/d' test.sql

for f in *.sql;
do
sed --in-place '/SQL>/d' "$f";
done




2.remove empty lines from a files

sed -i '/^\s*$/d' file 

Export Import Script Reference

expdp directory=EXPORTDP dumpfile=tables_periodcode_hkgrf3_exp.dmp logfile=tables_periodcode_dbas_exp.log tables=RRS.RA_ASI_DISTANCE,RRS.RA_ASTI_DETAIL,RRS.RA_AUDITSTORE,RRS.RA_BANDEDPACKITEM,RRS.RA_CONVERT_VOLUME,RRS.RA_INJCTSCDAT,RRS.RA_MPROJ_STATUS,RRS.RA_QC_PANEL,RRS.RA_SCHEDULE,RRS.RA_SG_MPIBD_STATUS,RRS.RA_SG_MP_STATUS,RRS.RA_SG_STORE_STATUS,RRS.RA_SHOP_TREND,RRS.RA_SQSTATUS,RRS.RA_STORE_ACV,RRS.RA_SUSTATUS,RRS.RA_SW_GENFACTOR_STATUS2 query=\"where periodcode in \(\'20101406\',\'20101407\',\'20101408\',\'20101409\',\'20101410\',\'20101411\',\'20101412\',\'20111401\',\'20111402\',\'20111403\',\'20111404\',\'20111405\',\'20111406\',\'20111407\',\'20111408\',\'20111409\',\'20111410\',\'20111411\',\'20111412\',\'20111601\',\'20111602\',\'20111603\',\'20111604\',\'20111605\',\'20111606\',\'20121401\',\'20121402\',\'20121403\',\'20121404\',\'20121405\',\'20121406\',\'20121407\',\'20121408\',\'20121409\',\'20121410\',\'20121411\',\'20121412\',\'20121606\',\'20131401\',\'20131402\',\'20131403\',\'20131404\',\'20131405\'\)\"

Export Partitions like (this works only in 11g)

expdp directory=EXPDP1 dumpfile=CA_RAW_2013.dmp logfile=CA_RAW_2013.log TABLES=RRS.CA_RAW:P2013%


select 'exec rrs.p_create_partition.create_partition('||replace (substr(partition_name,2,instr(partition_name,'_',-1)-2),'2011','2012')||','||substr(partition_name,instr(partition_name,'_',-1)+1)||','||''''||table_name||''''||');' from dba_tab_partitions where table_owner='RRS' and table_name='SC_RAW' and partition_name like '%20111412%' and partition_name like '%\_%' ESCAPE '\';