Thursday 19 December 2013

Oracle 12c installation

# cd /etc/yum.repos.d # wget http://public-yum.oracle.com/public-yum-el5.repo # wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle # gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle # yum install oracle-validated

Wednesday 5 June 2013

Last Analyzed - clean format

Last Analyzed set pagesize 100 select * from ( select t.owner, to_char(t.last_analyzed, 'DD-MON-YYYY') LAST_ANALYZED, count(*) COUNT, RANK() OVER (PARTITION BY owner ORDER BY count(*) desc) "rank" from dba_tables t where owner not in ('SYS','SYSTEM','SYSMAN','OUTLN','CTXSYS','MDSYS','TSMSYS','DMSYS','EXFSYS','DBSNMP','XDB','ORDSYS','WMSYS','ORDPLUGINS','ANONYMOUS','ORACLE_OCM','DIP','XS\$NULL','APEX_PUBLIC_USER','MGMT_VIEW','SMTYPES','ORDDATA','SPATIAL_WFS_ADMIN_USR','MDDATA','SI_INFORMTN_SCHEMA','DATAADMIN','APEX_030200','OWBSYS_AUDIT','OLAPSYS','SPATIAL_CSW_ADMIN_USR','OWBSYS','APPQOSSYS','AVAIL','FLOWS_FILES') group by t.owner, to_char(t.last_analyzed, 'DD-MON-YYYY') order by t.owner, COUNT desc, LAST_ANALYZED ) where "rank" = 1;

Thursday 23 May 2013

Tomcat with tnsname

Oracle Thin JDBC connection to a TNS alias (tnsname)

1. Log in as user that owns tomcat

2. Shutdown tomcat if running

3. export this env
export JAVA_OPTS="-Doracle.net.tns_admin=/u01/oracle/product/10.2.0/network/admin"

5. Make sure tomcat owner is able to read file sin the above TNS directory

4. Startup tomcat

5. DB connection using tns should work

Note:
  • Above worked for me on 10.2.0.1.0 database with, tomcat-5.5.20 (Linux) and jdk1.6.0_12 (May 2013)

  • Above worked for me on 11g database with, tomcat-7.0.40 (Win) and 1.7.0_21 (May 2013)

  • Similar to normal thin connection ("jdbc:oracle:thin:@nidevdb", username, password)
  • Some docs / sites also say you can use below, instead (i could not get it to work).

System.setProperty("oracle.net.tns_admin", "/u01/oracle/product/10.2.0/network/admin");


more info, see book:
Book: Oracle® Database JDBC Developer's Guide (11g Release 2 (11.2))
Chapter: 8 Data Sources and URLs

Thursday 16 May 2013

Data Pump option

Simple Datapump create directory dump_dir as '/u11/oracle/exp_cust'; create directory log_dir as '/u11/oracle/exp_cust/logs'; grant read,write on directory dump_dir to CUST_DUMMY_STAGE; grant read,write on directory log_dir to CUST_DUMMY_STAGE; -- Export expdp CUST_DUMMY_STAGE/nidb schemas=CUST_DUMMY_STAGE dumpfile=dump_dir:expdp_09FEB2013_CUST_DUMMY_STAGE_%U.dmp logfile=log_dir:full1.log_09FEB2013_expdp_CUST_DUMMY_STAGE.log parallel=4 filesize=10G -- Import impdp system schemas=CUST_DUMMY_STAGE dumpfile=dump_dir:expdp_09FEB2013_CUST_DUMMY_STAGE_*.dmp logfile=log_dir:full1.log_09FEB2013_impdp_CUST_DUMMY_STAGE.log parallel=4 -- with remap / fromuser-touser impdp system schemas=CUST_DUMMY_PROD remap_schema=CUST_DUMMY_PROD:CUST_DUMMY_STAGE dumpfile=dump_dir:cust_dummy_prod_201305182300_01.dp logfile=dump_dir:log_imp_cust_dummy_prod_201305182300_.log parallel=4

Friday 19 April 2013

asmcmd tips

To get size of all the archive logs asmcmd ls DG_BIN | while read; do printf 'DG_BIN/%s\n' "$REPLY"; asmcmd du "DG_BIN/$REPLY"; done

Wednesday 20 February 2013

Remove Latin or special char

To remove Latin or special char sed -e 's/[Ā]/A/g;s/[àâā]/a/g;s/[ọõ]/o/g;s/[íìī]/i/g;s/[êệ]/e/g;s/[ḥ]/h/g;s/[Ḥ]/H/g;s/[şṣ]/s/g;s/[ū]/u/g;s/[ʿ]//g;s/[Ṣ]/S/g;s/[Ṭ]/T/g;s/[ṭ]/t/g;s/[Ḍ]/D/g;s/[ḍ]/d/g' a.txt

Thursday 7 February 2013

Zen cart change number of zones from 3

(Zone by continent)

By default, the module comes with support for 3 zones. This can be easily altered with a coding change by editing the Zones Shipping Module file (If you make this change and your Zones module is already installed/active, you'll need to record your settings, then click Remove, then click Install, and re-enter all your settings. Otherwise your change will have peculiar visual side-effects).
/includes/ modules/ shipping/ zones.php // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED $this->num_zones = 3; }
Next, you will want to activate the module by going to the Admin, point your cursor at Modules, then clicking on Shipping. A list of all shipping modules should appear. Click on Zone Shipping. Click on the install button.

Notes
1: Great Britain
2: Austria, Belgium, , France, Germany, Greenland, Iceland, Ireland, Italy, Norway, Holland/Netherlands, Denmark, Poland, Spain, Sweden, Switzerland, Finland, Portugal, Israel, Greece
3: USA, Canada
4: Japan, Australia, New Zealand, Singapore, Taiwan, China, Hong Kong
5: (Other, inc India, UAE)

When you enter these country lists, enter them into the Zone X Countries fields, where "X" is the number of the zone. They should be entered as two character ISO country codes in all capital letters. They should be separated by commas with no spaces or other punctuation. For example:
1: GB 3: AT,BE,FR,DE,GL,IS,IE,IT,NO,NL,DK,PL,ES,SE,CH,FI,PT,IL,GR 2: US,CA 4: JP,AU,NZ,SG,TW,CN,HK 5: 00

Sunday 3 February 2013

OpenBravo Tips

openbravopos.properties config file lives in '/home/' in Linux or 'C:\Document and Settings\' in Windows For example to test the printer is properly connected to the first serial port type: in Windows type test > COM1: in Linux echo test > /dev/ttyS0 See: http://wiki.openbravo.com/wiki/Projects:POS/Hardware_Installation_Guide If a serial connection is chosen, the configuration must be: bauds: 9600, data bits 8, stop bits 1 and parity none.

Friday 1 February 2013

Ubuntu 12.04 fixes

DNS fix for myself to go old school =================================== /etc/resolv.conf nameserver 192.168.1.254 nameserver 172.16.1.1 nameserver 208.67.222.222 nameserver 208.67.220.220 To turn off dnsmasq in Network Manager, you need to edit /etc/NetworkManager/NetworkManager.conf # Comment the 'dns=dnsmasq' line (put a # in front of it) then restart sudo restart network-manager # See: http://www.stgraber.org/2012/02/24/dns-in-ubuntu-12-04/ List pakages dpkg --get-selections | grep java Removeing apt-get remove java-common To install latest java add-apt-repository ppa:webupd8team/java apt-get update apt-get install oracle-java7-installer Security checks http://www.thefanclub.co.za/how-to/how-secure-ubuntu-1204-lts-server-part-1-basics eposn drinver http://download.epson-biz.com/modules/pos/index.php?page=prod&pcat=3&scat=32&pid=30

Thursday 31 January 2013

RedHat Lamp install

on Fedora: yum -y install httpd php php-common php-mysql mysql installed java with: yum install java Java on Ubuntu 12.04 LTS, login as root add-apt-repository ppa:webupd8team/java apt-get update apt-get install oracle-jdk7-installer update-alternatives –display java java -version

Tuesday 22 January 2013

exFAT not working on xp but works on Win7 and Mac

My external drive formatted with exFAT to make is work on Mac (read & write) and Windows, just realised few weeks later it does not working on XP but works on Win7 and Mac. Yep, you need to install a Windows XP patch http://www.microsoft.com/en-us/download/details.aspx?id=19364 KB articles: KB955704 Date published: 1/26/2009 WindowsXP-KB955704-x86-ENU.exe 3.2 MB Tested and works fine (Jan 2013).

Wednesday 9 January 2013

Can't edit fstab as it's a read only file

This command saved me from a reinstall / repair mount -n -o remount / I messed up turning my NTFS partition to Linux, and after next reboot it will start, says fsck needed, but that did not work. Above command needed in single user mode