Nov
16
2009
0

Oracle RMAN backups to Amazon s3

Was looking into backup solutions for a big oracle database and ran across a plugin to RMAN to backup directly to s3! http://www.oracle.com/technology/software/tech/cloud/index.html Seems like a very interesting option.

“As Cloud Backups are done over the public Internet, their performance is highly
dependent on Internet network throughput – typically less than 1 MB/Sec per
connection. Additionally, Cloud vendors may also throttle sessions to prevent
individual users from consuming disproportionate amounts of resources.
According to internal tests conducted at Oracle, Amazon S3 limits an individual
session’s read/write throughput to around 2-3 MB/Sec. However by using the right
Oracle Database Backup in the Cloud Page 9
combination of parallelism and compression, backup speeds of up to 40-50
MB/Sec were attained. ”

Plenty fast for a great offsite backup solution! Can get a little pricy for terabytes of data, but a cheap for 100′s of gigs. May be a good solution for people in need of off site backups.

VN:F [1.9.3_1094]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)
Written by admin in: Technobabble | Tags: , , , ,
Nov
05
2009
0

Java String Performance

I have know for a long time that the + operation for Strings in Java is horrible for performance. Because Strings are immutable in Java another String object is created for each +, not so good! I did notice the other day that there is a String.concat() operation. I wondered if it would run faster then + or even as fast as a StringBuilder. The following is the test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import java.util.Date;
class st{
	public static void main(String args[]){
		// Test the + operator. We know this one is bad.
		// Its good to know its still bad in Java6
		long t = new Date().getTime();
		String x="";
		for(int i=0;i<100000;i++)
			x = x + " ";
		long e = new Date().getTime();
		System.out.println("Time to use the + operations on a string: " + (e-t));
 
		// Test the String.concat method. 
		// Is it any faster?
		t=new Date().getTime();
		x="";
		for(int i=0;i<100000;i++)
			x = x.concat(" ");
		e=new Date().getTime();
		System.out.println("Time to use the concat method on a string: " + (e-t));
 
		// Finaly out baseline. We know StringBuilder is(was)
		// the fastest way to build Strings.
		t=new Date().getTime();
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<100000;i++)
			sb.append(" ");
		String xx=sb.toString();
		e=new Date().getTime();
		System.out.println("Time to use a StringBuilder object: " + (e-t));
	}
}

And the results are!

abc:~ def$ java -version
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-90, mixed mode)
abc:~ def$ javac st.java
abc:~ def$ java st
Time to use the + operations on a string: 29464
Time to use the concat method on a string: 7075
Time to use a StringBuilder object: 2
abc:~ def$

So, what did we learn?

  • The + operator and Strings is still BAD!
  • The concat method is MUCH faster then the + operator
  • The StringBuilder is still the fastest method to create a String in Java
  • VN:F [1.9.3_1094]
    Rating: 0.0/10 (0 votes cast)
    VN:F [1.9.3_1094]
    Rating: 0 (from 0 votes)
    Written by GreenO in: Technobabble | Tags: ,
    Oct
    29
    2009
    0

    Oracle, Python, and Red Hat Enterprise Linux 4 using cx_Oracle

    After a bunch of trial and error, the following packages are needed to Install cx_Oracle for Python and the required Oracle Instant Client for Red Hat Enterprise Linux 4. Its not that this is too difficult, its that RHEL4 is old. Getting the two to place nice took a sec to figure out. This will install cx_Oracle for python that comes with RHEL4, which as of this writing is Python version 2.3.4 for Red Hat Enterprise Linux AS release 4 (Nahant Update 8). I am sure you can use the newer libraries with the a new install of Python, but I wanted to stay as close as possible to the versions supported by Red Hat. For better for worse! ;-)

    1. Download the cx_Oracle library.
    wget http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-4.3.1-10g-py23-1.i386.rpm?download

    2. Install cx_Oracle
    rpm -i cx_Oracle-4.3.1-10g-py23-1.i386.rpm

    3. Download Oracle Instant Client from the URL below. Must be logged in so do this from a browser.

    http://download.oracle.com/otn/linux/instantclient/10204/oracle-instantclient-basiclite-10.2.0.4-1.i386.rpm

    4. Install Oracle Instant Client
    rpm -i oracle-instantclient-basic-10.2.0.4-1.i386.rpm

    5. Add the path to the instant client libs to LD_LIBRARY_PATH.
    echo “export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.4/client/lib/:\$LD_LIBRARY_PATH” >> /etc/profile

    Thats it! Want to be sure?

    [xyz@pdq ~]$ python2
    Python 2.3.4 (#1, Jul 16 2009, 07:01:37)
    [GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import cx_Oracle
    >>> oraConn=cx_Oracle.Connection("username/password@server/SqlNetAlias")
    >>> curs = oraConn.cursor()
    >>> curs.execute("select 1 from dual")
    []
    >>> rows = curs.fetchmany(curs.arraysize)
    >>> for row in rows:
    ... print row[0]
    ...
    1
    >>> oraConn.close()
    >>>

    The more I learn about cx_Oracle and Python I will try to update this space. All I know right now is that it is FAST!

    VN:F [1.9.3_1094]
    Rating: 5.5/10 (2 votes cast)
    VN:F [1.9.3_1094]
    Rating: 0 (from 0 votes)
    May
    14
    2009
    0

    New GPG key… For all my super secret communication.

    Below is my new GPG key for Chris.Greenough@nau.edu. All other keys for this email have expired. All other GPG/PGP keys should be ignored. While I was at it I also added a GPG key for Chris@ChrisGreenough.com.

    Chris.Greenough@nau.edu

    -----BEGIN PGP PUBLIC KEY BLOCK-----
    Version: GnuPG v1.4.2 (MingW32)
    Chris.Greenough@nau.edu GPG Public Key ID 41F1608F
    mQGiBEoMm5IRBADwzWXZ8DCX9TuGK/i2Njqn1Sv12vWehAQ8g8i0B1G8TEkHnaK+
    9Fwhz3z9GQLGcJXxpjL1XcnAO7JwwYeCPkOvJx9dFCCCjuHopB9kVpuv620cuivI
    j72MyAu+LQgCL5j5fNiEsV/FR+pRgAYr/Dc2L1w541i1xd2kTjK8rwGBHwCgupnz
    5+hvxe5ZQuUQU8dHPy7qVvED/iN3M2HXQSCBARrtdl4CICZDPsBjAzU9wNxh097R
    P7SlDy3HhMGuPG1ZqmO4Zkj+ewTmMVQExUgdUJOP4A2HYsZZQ7Zg95MTHeOVjakV
    WfQsH1ySbmJfE9Fh6q+AW3/2U4ovTDNJp++E4c9Twf4HX8LZXjAOx7jhziF6Fw26
    BqWJBADJoN5qBOq+ousFfH70IhUoukXVjRp0Ye/TV61mSdxeiF+TJhRmlOJPwKCS
    R0WreFfVIrGRZnaJIytg3JhtzLimSwfvc9p7AB09eo+NZKGHvetYDmzwK84pJ2OJ
    ngz0Kdh3LujlB2YSCKfcvEm7AMENhNzv48jwjdb0eRp0NwDo/rQpQ2hyaXMgR3Jl
    ZW5vdWdoIDxDaHJpcy5HcmVlbm91Z2hAbmF1LmVkdT6IYAQTEQIAIAUCSgybkgIb
    IwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEIq93FJB8WCPgZwAmwbR+nEuJ3QL
    FWAvJOn0w0yukHefAJ4mlJKPqjAw5bv7s0E7rOphQEeDl7kBDQRKDJuSEAQAwAqK
    hwiAuoY+NsafknsOU7oJf1dJO6FQp8xdYXLSWSM1X6/t4wfNxNfiEyluONeGgaqf
    FtuOlXnppIYosvUAud431ZfuF5/3MZNnordxLVKM4orzY1Z0db0uvZLHxYPtL+Oo
    lhK+x3ioDufdMbpOd+1BOFRimJsFpfyeHMdBQk8AAwUD/3pHuMCICSDVkh+2lSa8
    wKo/O9J/GX7plLmFsOQrvTGzJJHD0GqGnGNEBwXhDUkjaAjGzto2pVQ6RAYNjzhA
    MjJ8J+g0TMXUqiAUytiV7ZbvgoZSqhdGxZDU0CpYlz+WOKJB0VnhDU9HVz+a2a7f
    /SnHrYKQapXGlfXrhcZmkvX0iEkEGBECAAkFAkoMm5ICGwwACgkQir3cUkHxYI9o
    rgCfdum8mSlgi0sjXLTyLBhbqFLyT38An2dJBYfLTPcNEKDUNnTVRRsEnPbT
    =+AlU
    -----END PGP PUBLIC KEY BLOCK-----

    Chris.Greenough@nau.edu GPG Public Key ID 41F1608F

    Chris@ChrisGreenough.com

    -----BEGIN PGP PUBLIC KEY BLOCK-----
    Version: GnuPG v1.4.9 (MingW32)
    
    mQGiBEoMoQ0RBACjV30Xl9Is9K68yluALhlwnGQUD7ZlWBxHOFdQB3vd5Bn0UDrb
    QJYbpTSQOvalsXUy5FshgG7g5Ktzz92hp44zugsxPP529sX9VB7gfJ5Dvc3DChZ6
    H2k/WWtHqMNAc6MV47Fco4lKpooH9f77Vx2Od917Qd5y3haUdAaT+7DFiwCg7tyT
    kxSNgVs129E2Bu0+us+VnusD/3vE3b2l9cdaS0ae1zdiKMNEawYymKemHLvq+JCe
    ZI6X+wM3VDv9fxVU3ivF8YTIc55gNH637lqLhOpC+P8cT4DfqR2weFQCzkoahI0L
    ANstAumgcPSDF0wqqNEpykoEF9XbNHemQdr6P2xnmFmDMt5rkebTk4BtYkK8WCcE
    9QQnA/wOaJKne+pj89uWMRP6TcFn2R3UiarD8C64y3LqhsmR1Vqt0JF4BNu8dLZe
    MF+mvwy77oELN4iMjFkZeBevL0o853BHZdNIlwNHY1DGIy3u0ecmexYe/114XGMm
    HPudRMXwxmElvwXXabERAwjzxz2Nf3+G0nc98IyYBWCrLvEwarQ1Q2hyaXMgR3Jl
    ZW5vdWdoIChQZXJzb25hbCkgPENocmlzQENocmlzR3JlZW5vdWdoLmNvbT6IYAQT
    EQIAIAUCSgyhDQIbIwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEJ0RvbslwH6w
    408AoImSW7DfW7v1Gb3XsNumTLLZrstmAKCFPZfoalnwLG/dfEMp3dwH6pzAi7kB
    DQRKDKENEAQAms2edG3Ob50gZ7/bldyXgrv8HVQJ2WYz0z+UegIX6eao9ftjQoec
    bibtnoYkoUbRK9Pg8mf4rDpcivFANP3hTm3XIxOqJ4fh2anb2HMVF+vRKoTduWzf
    svovx164xTT22R3O2rt45CIaF4GWejK8OPkiQSPQZvMrW61pI0I2mDcAAwUD/jMR
    4ot1ef7Cry10aNv6n69iYUCm9goSuFlwZ7muSeVrdAa07IyedxGEZOVakK4HzTMs
    6fRhwhzrn6vceluOaJEb0YEXMl8AmTrUS+DII7QOjUFG1TqalHDKzVrY14BSSv7w
    iHJfJfELgo9+5fyAr5Z0P/3H7izeO6XcTUOGbU6jiEkEGBECAAkFAkoMoQ0CGwwA
    CgkQnRG9uyXAfrBDQQCg5WsPVH78/oAoBDCMOGej683eE0AAoMwQOv+0XG4ywT3v
    qoH/ZB5SQIFC
    =To1g
    -----END PGP PUBLIC KEY BLOCK-----
    Chris@ChrisGreenough.com Public GPG Key ID 25C07EB0
    VN:F [1.9.3_1094]
    Rating: 0.0/10 (0 votes cast)
    VN:F [1.9.3_1094]
    Rating: 0 (from 0 votes)
    Written by admin in: Technobabble |
    Mar
    11
    2009
    0

    Bluetooth Windows 7 beta and Bootcamp

    Found a solution for Bluetooth keyboard and mouse issues with my Mac Book Pro using boot camp and Windows 7 beta.

    1. Click the Bluetooth icon in the task bar.
    2. Go to add device
    3. If you device is discoverable you should see it listed, right click and go to properties
    4. Put a check in the box next to Mouse, keyboard drivers (Something like that).
    5. Continue to add as normal.

    Hope that help some other people! It drove me crazy!

     

    VN:F [1.9.3_1094]
    Rating: 9.0/10 (3 votes cast)
    VN:F [1.9.3_1094]
    Rating: +2 (from 2 votes)
    Written by admin in: Technobabble |

    Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes