Playing with oracle DB 18c on-premises before official release

Rodrigo Jorge has already explained a great way to install and play with Oracle 18c DB instance on-premises using Exadata binaries downloaded from edelivery. The basic idea is to install the oracle exadata binaries and before creating the database replace the library “libserver18.a” with the  version gotten from an oracle cloud instance  (Using Oracle Cloud trial account). And that’s it !

But for those like me that don’t have an international credit card required to create an Oracle Cloud trial account  (Yes i don’t have one 😦 ) or don’t want to create one  ! How to proceed to get a copy of this working libserver18.a library ? May be ask one of the oracle folks to upload it to somewhere and hope that there is no backdoor on it :p  or just try to hack it your self 😀

So after some digging i figure out a way 😀 no need to change the library “libserver18.a” just run this systemtap script that will change the return value of the function “ksz_exadata_feature_on” to 1 and that’s all !!

TEST ENV : OEL6/UEK4

stap -g -v -e ‘ function  _hatem_startup_force() %{ long ret; ret = 1; memcpy( ((char *)CONTEXT->uregs) + 80 , &ret, sizeof(ret)); %} probe process(“oracle”).function(“ksz_exadata_feature_on”).return { _hatem_startup_force(); }’

Before :

Capture 51

Capture 01

Patched / Hacked / whatever !!!

Capture 80

Capture 02

Capture 03

Of course this is only for fun and testing 😀

 

UPDATE 07/03/2018 : Another way is to set the parameter “_exadata_feature_on=true”

That’s all 😀

11 thoughts on “Playing with oracle DB 18c on-premises before official release

  1. That’s cool, especially the function _hatem_startup_force, the advanced C embedded function. Is there a detailed explanation for coming up the “memcpy( ((char *)CONTEXT->uregs) + 80 , &ret, sizeof(ret)); “? what “context->uregs” is? and why 80 is used here?

    Or is there any more in-depth material to show how to modify a return code of any functions of oracle binary or whatever a program?

    Thanks

  2. Thanks a lot, Mahmoud.
    By slightly modifying your script, I managed to cheat Oracle that I have 6 CPU_COUNT, although I really have 2:

    #!/usr/bin/stap
    function modify_rax() %{ long ret; ret = 6; memcpy( ((char *)CONTEXT->uregs) + 80 , &ret, sizeof(ret)); %}
    probe process(“oracle”).function(“skgpnumcpu”).return { modify_rax(); }

    Best Regards

  3. hi,
    I am getting the below error after executing the script as root.
    Pass 1: parsed user script and 119 library scripts using 228000virt/44072res/6240shr/38040data kb, in 520usr/50sys/564real ms.
    semantic error: while resolving probe point: identifier ‘process’ at :1:126
    source: function _hatem_startup_force() %{ long ret; ret = 1; memcpy( ((char *)CONTEXT->uregs) + 80 , &ret, sizeof(ret)); %} probe process(“oracle”).function(“ksz_exadata_feature_on”).return { _hatem_startup_force(); }
    ^

    semantic error: cannot find executable ‘oracle’

    Pass 2: analyzed script: 0 probes, 1 function, 0 embeds, 0 globals using 229188virt/45244res/6372shr/39228data kb, in 10usr/0sys/12real ms.
    Pass 2: analysis failed. [man error::pass2]
    Could you please help me out with this.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s