UNIX tricks and treats

Aller au contenu | Aller au menu | Aller à la recherche

lundi 20 mai 2013

First Jolla device preorders opened

Today, the 20th of May, Jolla unveiled its first, very reasonably-priced (under 400 €, VAT included!) and modular device.

Here are the specs:

- 4.5 '' display

- dual core,

- 4G,

- 16 GB expandable through micro SD,

- 8 MP camera,

- user replaceable battery,

- "the other half" which is an expansion module (maybe with QWERTY keyboad?),

- Saifish gesture-based  OS,

- android (TM) compatibility

You may preorder here and be part of the movement, like me!:

https://join.jolla.com/en

Happy computing

Nixman

jeudi 18 avril 2013

First Jolla Sailfish phone to be announced in May

According to finnish economic journal Taloussanomat Jolla will be announcing their first Sailfish smartphone in May.

It will be possible to preorder the phone startin in the second half of May.

The early birds will receive "some goodies the others won't get", promises Antti Saarnio from Jolla.

So get your credit card ready :-)

Happy computing,

Nixman

dimanche 6 janvier 2013

First well filmed Sailfish OS demo

Hello, everyone,

The buzz around Sailfish and Jolla is growing...

Engadget has released a good quality demo of the sailfish OS here. It's the first well filmed demo (no shaking camera and chittering on the background) that I've been able to spot since the launch at Slush. Over 500 comments, so there is definitely interest in some truly open (OS AND ecosystem, unlike Android) multitasking player in the mobile scene.

And Forbes magazine has mentioned Jola as a major contender in the future of mobile over here.

Can't wait for the release of the first real Jolla handset!

Happy computing till then.

Nixman

jeudi 27 décembre 2012

Querying Oracle instance alertlog via SQL

As of Oracle 11g, the contents of Oracle alert log can be queried directly via a fixed table X$DBGALERTEXT.

desc X$DBGALERTEXT
 ADDR                                               RAW(8)
INDX NUMBER
INST_ID NUMBER
ORIGINATING_TIMESTAMP TIMESTAMP(3) WITH TIME ZONE
NORMALIZED_TIMESTAMP TIMESTAMP(3) WITH TIME ZONE
ORGANIZATION_ID VARCHAR2(64)
COMPONENT_ID VARCHAR2(64)
HOST_ID VARCHAR2(64)
HOST_ADDRESS VARCHAR2(46)
MESSAGE_TYPE NUMBER
MESSAGE_LEVEL NUMBER
MESSAGE_ID VARCHAR2(64)
MESSAGE_GROUP VARCHAR2(64)
CLIENT_ID VARCHAR2(64)
MODULE_ID VARCHAR2(64)
PROCESS_ID VARCHAR2(32)
THREAD_ID VARCHAR2(64)
USER_ID VARCHAR2(64)
INSTANCE_ID VARCHAR2(64)
DETAILED_LOCATION VARCHAR2(160)
PROBLEM_KEY VARCHAR2(64)
UPSTREAM_COMP_ID VARCHAR2(100)
DOWNSTREAM_COMP_ID VARCHAR2(100)
EXECUTION_CONTEXT_ID VARCHAR2(100)
EXECUTION_CONTEXT_SEQUENCE NUMBER
ERROR_INSTANCE_ID NUMBER
ERROR_INSTANCE_SEQUENCE NUMBER
VERSION NUMBER
MESSAGE_TEXT VARCHAR2(2048)
MESSAGE_ARGUMENTS VARCHAR2(128)
SUPPLEMENTAL_ATTRIBUTES VARCHAR2(128)
SUPPLEMENTAL_DETAILS VARCHAR2(128)
PARTITION NUMBER
RECORD_ID NUMBER


The PROBLEM_KEY column gives the ORA- error code.

However, being a fixed table, it means that the table is only accessible by SYS, and not viewable in SYS's catalog.

A quick and dirty fix can be to create a V$ public synonym for the view, and grant SELECT to the view to whoever has to access it.

CREATE VIEW SYS.V_$ALERT_LOG
AS SELECT * FROM x$dbgalertext;

CREATE OR REPLACE PUBLIC SYNONYM V$ALERT_LOG FOR SYS.V_$ALERT_LOG;

GRANT SELECT ON SYS.V_$ALERT_LOG TO MYDBUSER;


You can then query the view for interesting details.

For example:

SELECT * FROM V$ALERT_LOG WHERE MESSAGE_LEVEL <> 16 ORDER BY ORIGINATING_TIMESTAMP DESC;


Happy computing

Drop me a line and hang out on the sidebar links if this note has been useful to you.

Nixman

dimanche 23 décembre 2012

Jolla Unlike ringtone available for download!

If you were like me and loved the theme tune, "Unlike", the first Jolla videos featured, here are some great news for you:

Jolla has made it available as a ringtone here. Rings nicely on my phone, too, now.

Now, all I hope for till the first Jolla smartphone comes out, is that they make some of their "Unlike the Ordinary" T-shirts available for sale, so that we can help spread the word around!

Happy computing till then,

Nixman

mercredi 19 décembre 2012

Making PostgreSQL logs more verbous

Default PostgreSQL logging is quite discreet.

Supposing you would want to log some SQL statements, and in the same time have a more frequent rotation of your logs, here are the lines to change in you postgresql. conf file:

# Changed from -%a to -%a%H%M
log_filename = 'postgresql-%a%H%M.log' # log file name pattern,

# Changed from 1d to 60min
log_rotation_age = 60 # Automatic rotation of logfiles will # happen after that time. 0 disables.

# Changed from 0 to 512k
log_rotation_size = 512 # Automatic rotation of logfiles will # happen after that much log output. # 0 disables.

# Changed from -1 to 0
log_min_duration_statement = 0 # -1 is disabled, 0 logs all statements # and their durations, > 0 logs only # statements running at least this number # of milliseconds

# Changed from none to mod
log_statement = 'mod' # none, ddl, mod, all

Beware of the log_statement parameter on overloaded systems, as your log files might experience some pretty heavy I/O.

Leave me a note if this post has been useful.

Happy computing,

Nixman

Trying out Sailfish Mer SDK

For all of those too impatient to wait for a full Sailfish OS binary SDK release (due for Q1 2013), the Mer project has released a good documentation on how to build your own environment under VirtualBox.

And it's here:

https://wiki.merproject.org/wiki/Platform_SDK_on_VirtualBox

You will need a Linux box and some extra RAM, and you're ready to write some Qt apps for Jolla.

Nixman

dimanche 25 novembre 2012

New Sailfish demo videos out from Jolla

A few new Sailfish demos from Jolla are out

First the Sailfish SDK demo from Slush:

http://www.youtube.com/watch?feature=player_embedded&v=ZrwYyN-vNVo

Very fast development indeed with this new Qt SDK. Some whiners will of course complain about the lack of an efl SDK...

The second one is in finnish only from Jolla's Senior designer:

http://www.youtube.com/watch?feature=player_embedded&v=NtEbOGuxuig

There are some interesting comments from Jaakko Roppola about the philosophy of the Sailfish UI, that I've tried to translate as accurately possible:

"The UI has been built around simplicity and ease of use"

"No need to into the application and back off. You can just slide the application icon on the side to execute commands"

"What are the limits? - Basically the physical size (of the screen), and in some cases there is no need for interaction. For example the People application doesn't have any interaction"

"What about the multitasking and its limits? - There's a human limit. We don't want to make a second page with icons. When you have a certain number of applications open, the least used one will not be visible. It will still be running, but won't be visible on the home screen" (From what I've heard, it should be 9 application maximum on the home screen currently)

"You can close the application like this (by pressing them a few seconds and tapping the cross)"

"Is there a context menu? - Yes, and we can demonstrate our Ambiance application at the same time. You get the context menu for the application by swiping from top to bottom from anywhere on the screen. When I release it, it executes the function it has been asigned"

"There have been many questions about the Ambiance: is it not just some eye candy? No, it was just one of the targets we wanted to show. You have to think much further than adapting the colours of the phone to some picture you just find in the gallery."

"There is one thing we have been quite clear about when we've been discussing the UI between ourselves: we don't want any buttons everywhere on the screen. Rather, the navigation is by gestures only."

"For example, here , I can go digging very far in the hierarchy, and just swipe my way back to top. But I still see the hierarchy and just by one gesture I can go back to my home screen to check whether I have network, how much battery I've got left..."

"What about notifications? - If you're not using the phone, the notification will be on the home screeen, but if you're using an app, the notification for a call for example will pop up ,but it won't be persistent in the application window. It will be directly on the screen, and you won't have to search for an SMS somewhere in another application. Basically, everything must be very close anywhere, but everything must NOT be everywhere."


Here's a shorter demo in english by Jaakko:

http://www.youtube.com/watch?v=_c_BqnR_vAM

And a second short demo of multitasking in english:

http://www.youtube.com/watch?v=KHn3qp_E3_A&feature=related


And a third one with the quick glance feature:

http://www.youtube.com/watch?v=bLKN7QdGzWU&feature=related

The bottom line is: cool user-friendly interface that you can use single-handedly blindfolded. THAT seems to be the idea behind Sailfish OS UI. Ans it's truly open, not like the  Android ecosystem where Google's basically bullying everyone around.

Nixman

jeudi 22 novembre 2012

Jolla's Sailfish OS is out!

Jolla's Sailfish OS was announced yesterday at the nordic Slush startup event.


As the organizers of the event humorously pointed out, Finland in November certainly isn't California, but the startups have never been better. 

Simultaneously, the jolla.com and sailfishos.org websites were finally opened to the public.
Until now, Jolla had been quite secretive about the project, having only a twitter and a facebook account, plus some haphazard interviews with executives like Jussi Hurmola.
Seeing the superb result, a true multitask OS that can be operated single-handedly (no politically incorrect pun at Marc Dillon intended) with just a few swiping gestures, I can understand why these guys were busyier coding and making their product work, rather than putting up communication hype.
You could sense the tension, emotion of the moment, and a bit of a lack of polished PR preparation in the keynote.
That's all right guys, you really rock, far away from usual hype of contentless startups!
Not a single single technical glitch during the presentation, except for the sound guys at slush ;-). The demos just worked fluidly.

Several new partnerships were announced, in addition to the existing chinese D-Phone deal, amongst which:
DNA: A finnish mobile operator,
Myriad: for the Android compatibility layer,
ST-Ericsson: that will ensure OS compatibility with Sony-Ericsson smartphone hardware like the powerful NovaThor system-on-chips.

etc...

The video for the keynote is here:
http://www.youtube.com/watch?v=bdLUJZR078k&feature=plcp

A shorter hands-on preview here:
http://www.youtube.com/watch?v=_c_BqnR_vAM&feature=plcp&list=PLQgR2jhO_J0y6zifH8KkevJoEYM9LOtkM

And a coverage of the Jolal part of the meeting, plus interview here:
http://bergie.iki.fi/blog/jolla-sailfish/

Basically, my next smartphone will be running Sailfish. Provided Angry Birds Star Wars and Bad Piggies will be available ;-).

Nixman

mercredi 25 août 2010

A handy command to monitor Linux multipath

Works on: Red Hat 5.3 with Qlogic fiber channel cards

Monitoring failing paths on a fibre channel card connected to a SAN on Linux isn't very straightforward

A handy command to check it in real time would be this one:

watch -n 1 "echo show paths | multipathd -k "

The output would look something like this:

multipathd> hcil    dev  dev_t  pri dm_st   chk_st   next_check

[...]
1:0:3:3 sdam 66:96  50  [failed][faulty] XX........ 4/20
1:0:3:4 sdan 66:112 50  [failed][faulty] XX........ 4/20
0:0:0:0 sda  8:0    50  [active][ready]  XXXXXXXX.. 17/20
0:0:0:1 sdb  8:16   10  [active][ready]  XXXXXXXX.. 17/20
0:0:0:2 sdc  8:32   50  [active][ready]  XXXXXXXX.. 17/20

[...]

Here, controller 1 is failing, resulting in 4 failed paths out of 8.

"4/20" and "17/20" being the number of secons left till the next check

Leave me a note if this post has been useful to you

Happy computing

Nixman

mercredi 7 avril 2010

Multiplexing an Oracle controlfile in ASM


1) Check current controlfile's name and restart the database NOMOUNT

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------------------------------------
control_files                        string      +FRA/MYDB/controlfile/current.256.715620719


SQL> shutdown immediate

SQL> startup nomount


2) Copy/restore current controlfile through RMAN

$ rman target /

RMAN> restore controlfile to '+DATA' from '+FRA/MYDB/controlfile/current.256.715620719';

Starting restore at 07-APR-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=272 device type=DISK

channel ORA_DISK_1: copied control file copy
Finished restore at 07-APR-10

3) Find out the name of the new controlfile through asmcmd

ASMCMD> ls -lsa +DATA/MYDB/controlfile

Type         Redund  Striped  Time             Sys  Block_Size  Blocks    Bytes     Space  Name
CONTROLFILE  UNPROT  FINE     APR 07 14:00:00  Y         16384     595  9748480  16777216  none => current.283.715704921


4) Modify your spfile to take into account the new controlfile

SQL> alter system set control_files='+DATA/MYDB/controlfiles/current.283.715704921','+FRA/MYDB/controlfile/current.256.715620719' scope=spfile;


5) Restart the database and check

SQL> shutdown immediate

SQL> startup

SQL> show parameter control_files;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      +DATA/MYDB/controlfiles/cu
                                                 rrent.283.715704921, +FRA/mmtw
                                                 ebdv/controlfile/current.256.7
                                                 15620719



Leave me a line if this note has been useful to you.

Happy computing


Nixman

lundi 21 septembre 2009

Installing ocfs2 filesystem on RHEL 5.3


Until Oracle finally releases its much awaited-for Universal FileSystem, the only way to install grid infrastructure on shared storage is still ocfs2, which you may find useful as a regular cluster filesystem, too.

Download the rpms for Red Hat from
http://oss.oracle.com/projects/ocfs2/

For a 64-bit platform, you will need these ones:

( Do a uname -r to check which is your platform)

ocfs2-2.6.18-128.el5-1.4.2-1.el5.x86_64.rpm
ocfs2-tools-1.4.2-1.el5.x86_64.rpm
ocfs2console-1.4.2-1.el5.x86_64.rpm

# rpm -Uvh ocfs2-tools-1.4.2-1.el5.x86_64.rpm ocfs2-2.6.18-128.el5-1.4.2-1.el5.x86_64.rpm ocfs2console-1.4.2-1.el5.x86_64.rpm

You might have to install pygtk and vte first
# yum install vte.x86_64
# yum install pygtk2.x86_64

Contrarily to what the install doc states, you will first have to edit the /etc/ocfs2/cluster.conf by hand before being able to do anything.

cluster:
       node_count =1
       name=ocfs2
node:
        ip_port = 7777
        ip_address = my_cluster_node_1_interconnect_ip_adress
        number = 1
        name = my_cluster_node_1_hostname
        cluster = ocfs2


Once you've edited the file on one of the nodes, you're not done yet. Do a:

# service o2cb configure
Configuring the O2CB driver.

This will configure the on-boot properties of the O2CB driver.
The following questions will determine whether the driver is loaded on
boot.  The current values will be shown in brackets ('[]').  Hitting
<ENTER> without typing an answer will keep that current value.  Ctrl-C
will abort.

Load O2CB driver on boot (y/n) [y]: y
Cluster stack backing O2CB [o2cb]:
Cluster to start on boot (Enter "none" to clear) [ocfs2: ocfs2
Specify heartbeat dead threshold (>=7) [31]:
Specify network idle timeout in ms (>=5000) [30000]:
Specify network keepalive delay in ms (>=1000) [2000]:
Specify network reconnect delay in ms (>=2000) [2000]:
Writing O2CB configuration: OK
Starting O2CB cluster ocfs2: OK

Then only you may start the graphic ocfs2 console:

# ocfs2console

In the GUI, go to Edit-> Add node, and add your second node, with its interconnect ip address. Validate.

Go to Edit -> Propagate Configuration.

By now, you should see the following configuration on your two nodes.

node:
        ip_port = 7777
        ip_address = my_cluster_node_1_interconnect_ip_adress
        number = 1
        name = my_cluster_node_1_hostname
        cluster = ocfs2

node:
        ip_port = 7777
        ip_address = my_cluster_node_2_interconnect_ip_adress
        number = 2
        name = my_cluster_node_2_hostname
        cluster = ocfs2

cluster:
       node_count =3
       name=ocfs2



Do a:
# service o2cb configure
on the second node

Check if the service is finally up and running running on both nodes:

# ps -ef | grep o2
root     24816   153  0 17:27 ?        00:00:00 [o2net]
root     24891 18206  0 17:27 pts/0    00:00:00 grep o2

Then, you may go on formatting the volume you've prepared on your shared storage.

Here, the volume is configured under Linux with Device-Mapper multipath, and is seen under /dev/mapper as VOL1.

# mkfs.ocfs2 -c 4K -C 4K -L "ocfs2volume1" /dev/mapper/VOL1


Then, you may  just create a mount point on which to mount the volume on both nodes, /u01/app/ocfs2mounts/grid for example, if you're planning on installing Oracle grid infrastructure.

Mount the filesystem on both nodes

# mount /dev/mapper/VOL1 /u01/app/ocfs2mounts/grid

Drop me a line, or have a look at the links, if this post has been useful to you.

Happy computing

Nixman.






vendredi 18 septembre 2009

Discrepancies and catchas in Oracle 11gR2 grid infrastructure install guide for Linux


Discrepancies in Oracle 11gR2 grid infrastructure install guide for Linux:

- Oracle instructs you to create VIP's on both nodes as a preinstall task.
However, if you do so, Oracle grid infrastructure installer will tell you the VIP adresses are already in use.

- Even though you have set up passwordless ssh connectivity between two RAC nodes, the installer keeps telling you this is not the case. I guess it has something to do with Oracle using rsa1. I gave up and gave both my oracle users the same password, and clicked on "setup", and let the installer do it for me. Everything went fine afterwards.

- /usr/sbin/oracleasm enable and disable have been deprecated on RHEL 5.3.
You have to use chckconfig oracleasm on.
If you fail to do so, upon reboot, asmlib is not loaded, and your voting disks and OCR are corrupted.

- If you use ACFS have to use different ORACLE_BASE directories for the Oracle grid infrastructure user (ex:grid: /u01/app/grid/), and the Oracle database user (ex: oracle: /u01/app/oracle/).
In the install doc, this is not so clear, as only ORACLE_HOME directories (ex:/u01/app/11.2.0/grid/ for grid and /u01/app/oracle/acfsmounts/orahome1/ for oracle) have to be different, the ORACLE_BASE seeming to be a unique one.

- Even though you can set up a shared ORACLE_HOME through ACFS for the database binaries, you still have to rely on ocfs2 if you want to have the Oracle grid infrastructure binaries on a shared filesystem.

- You absolutely have to be patient ant wait for the root.sh script to finish on your first node (can last half an hour), before you may execute it on your other nodes. Else, your  installation will miserably fail.

A complete RAC installation guide for Oracle 11gR2 on RHEL 5.3 with multipath will follow soon.

mercredi 16 septembre 2009

Enabling server-side failover, TAF and load-balancing on Oracle 1OgR2 RAC


Sometimes, you don't  have the possiblity enable Transparent application failover on the client side (in the tnsnames.ora file for example).

That's where this new feature in Oracle 10gR2 RAC comes handy:

You can enable both failover and load-balancing on the server side, by executing a simple dbms_service procedure.

EXECUTE DBMS_SERVICE.MODIFY_SERVICE (service_name => 'MY_SERVICE_NAME'
, aq_ha_notifications => TRUE
, failover_method => DBMS_SERVICE.FAILOVER_METHOD_BASIC
, failover_type => DBMS_SERVICE.FAILOVER_TYPE_SELECT
, failover_retries => 60
, failover_delay => 10
, clb_goal => DBMS_SERVICE.CLB_GOAL_LONG);


To disable the feature, it's as simple:

begin
    dbms_service.modify_service(
      service_name=>'MY_SERVICE_NAME',
      failover_type=>DBMS_SERVICE.FAILOVER_TYPE_NONE,
      failover_method=>DBMS_SERVICE.FAILOVER_METHOD_NONE
    );
  end;
/


For complete documentation, you can check:

http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/hafeats.htm#BABIAICG



Happy computing,

Nixman

lundi 12 janvier 2009

Turning on verbose boot logging for Solaris 10

Note: la traduction française de cet article se trouve ici.

By default, the Solaris 10 boot is "quiet" on the console.

This behaviour, stemming from the usage of svcadm, can be found annoying by experienced Solaris sysadmins, used to previous versions of the OS.

This behaviour can be changed with svccfg.

Turn on verbose boot logging for Solaris 10

  # /usr/sbin/svccfg -s system/svc/restarter:default
  svc:/system/svc/restarter:default> addpg options application
  svc:/system/svc/restarter:default> setprop options/logging = astring: verbose
  svc:/system/svc/restarter:default> listprop
...
options/logging            astring  verbose
...

  svc:/system/svc/restarter:default> exit


Remove verbose Solaris boot logging

  # svccfg -s system/svc/restarter:default
  svc:/system/svc/restarter:default> delpg options
  svc:/system/svc/restarter:default> listprop
  svc:/system/svc/restarter:default> exit

Happy computing.

Drop me a comment if this post has been useful to you, or if you see any reason for add-on or modification.

Alternatively, you could also visit a few links to keep me in business ;-)

Nixman

mercredi 10 septembre 2008

Purging a sendmail mailqueue on AIX

Tested on: IBM AIX 5.2

Sendmail processes may run wild, due to huge process loads, or even badly configured applications sending automatized mails.

When sendmail processes are overloaded, they may clog up the mailqueue and spawn multiple sendmail processes to treat the mailqueue, ultimately consuming most of your server's swap area, degrading performance, or even prevent other applications from running.

Here are the steps needed to stop rogue sendmail processes, and cleanly purge the sendmail mailqueue on IBM AIX 5.2. The process is similar on other UNIXes, except for the sendmail stop and start commands, which vary, depending of your OS. On Solaris, for example, you would use your own stop and start scripts in /etc/rcX.d/ or in /etc/init.d/.

First, find and kill the multiple sendmail processes if they have gone havoc.

# ps -ef | grep sendmail
 
# kill -9 SENDMAIL_PIDS

Then, stop sendmail cleanly (the commands depend of your OS. This one works only on IBM AIX).

# stopsrc -s sendmail  

You may check the number of messages that are in the queue, which will give you an idea of the time it will take to process the queue:

# sendmail -bp 

Check that there are no longer any sendmail processes running:

# ps -ef | grep sendmail
 
# kill -9 SENDMAIL_PIDS

Rename the current mailqueue to another directory:

# mv /var/spool/mqueue /var/spool/omqueue 

Restart sendmail

# startsrc -s sendmail
0513-059 The sendmail Subsystem has been started. Subsystem PID is 62118
 

Now process the old queue (may take time, depending upon the number of messages to process):

# /usr/sbin/sendmail -oQ/var/spool/omqueue -q -v

Running /var/spool/omqueue/m7HKkOM60666 (sequence XXXX of XXXXX)
Running /var/spool/omqueue/m7HKkOM60666 (sequence XXXX+1 of XXXXX)...
etc... 

Now, you may safely delete all messages in the old queue:

# rm -rf /var/spool/omqueue

Create a new mailqueue directory.

# mkdir /var/spool/mqueue

Stop and start sendmail:

# stopsrc -s sendmail

# startsrc -s sendmail

You're done!

Happy computing.

Drop me a comment if this post has been useful to you, or if you see any reason for add-on or modification.

Nixman

jeudi 14 août 2008

HR ACCESS user logins and passwords


HR ACCESS stores the user passwords without encryption in the UC10 table. As an Oracle DBA, if you have access to the database instance, all you have to do is issue the following command through SQL*PLUS:

 SQL> select cdutil, cdpass from UC10;

CDUTIL   CDPASS
-------- --------   
USER1     PASWORD1
USER2   PASWORD2
USER3   PASWORD3
USER4   PASWORD4
USER5  PASWORD5

Happy computing.

Drop me a comment if this post has been useful to you, or if you see any reason for add-on or modification.

Nixman

mercredi 28 mai 2008

Using Pen load balancer as a port-forwarding proxy


Suppose you're a Paris-based firm that has several databases spread across different locations.

For example:
a) several Oracle databases listening on port 1521 on your own network, on addresses 10.75.75.1 - 10,
b) one Oracle database listening on port 1521 in Turku, Finland linked by a VPN  tunnel, on address 172.16.2.2,
c) one oracle database listening on port 1521 in Toulouse linked by a leased line, on address 172.31.31.31,
d) one Oracle database listening on port 21521 on a public internet WAN port in Tanger, with just source-address filtering as security, on address 212.66.66.66,
e) plus about a dozen other databases in different parts of the world at your clients' sites.

You have a partner providing an extra service to your clients, and he has to connect in real time on all of your databases. He doesn't want to spend money on a network connection to each and everyone of your clients. He proposes to pay a leased line to your Paris site, and you will do the dispatching.
Of course, you don't want him to know too much about your network, so you will restrict his access to only one address, which will be a firewall at your end of the line between your two sites .

Let's suppose the outside interface address of your firewall is 192.168.15.100, and the inside address (the one on your network) 10.75.75.254.

Providing  connectivity to the (a) databases on your local  network is pretty easy: you just have to give a port-forwarding rule and an access list to your router.

For example:
port 2001 on the outside interface ---> port 1521 on server1 at  10.75.75.1,
port 2002 on the outside interface ---> port 1521 on server2 at 10.75.75.2,
port 2003 on the outside interface ---> port 1521 on server3 at 10.75.75.3,
and so on...
Then, you just tell your partner to configure his tnsnames.ora to point at address 192.168.15.100 and port 2001 for server1, address 192.168.15.100 and port 2002 for server2, and so on...

However, forwarding the ports to the external (b), (c) and (d) databases is another affair.

Luckily, Pen is there for you. It was designed as load-balancing piece of software for server farms, but its features allow it to be used as a port-forwarding proxy, which is what we need in this case. It is available prepackaged for rpm- as well as deb-based Linux  distros, or as GPL'ed source code. You may learn more on its numerous features on its website: http://siag.nu/pen/

All you need is is a standard PC on your network, with a Linux Distro, let's say Debian, installed on it , as well as one (yes, only one) NIC.

Do an apt-get install pen (or an rpm-Uvh pen on an rpm-based distro).

Let's suppose you've given address 10.75.75.75 to this computer.
It has to know the routes to reach the Turku, Toulouse, and Tanger based servers, and of course the route to reach your partner who wants to connect to them. It has also to be allowed to reach them on the ports on which they are listening (i.e 1521, 1521 and 21521 respectively).

All you need now is to write a little snippet of shell code in a file that you would call for example port-fwrd.sh:

###############
#!/bin/bash

# This is for the Turku-based database
pen 10.75.75.75:2011 172.16.2.2:1521

# This is for the Toulouse-based database
pen 10.75.75.75:2012 172.31.31.31:1521

# This is for the Tanger-based database
pen 10.75.75.75:2013 212.66.66.66:21521

exit
###############

Make port-fwrd.sh executable by a chmod, and launch it: ./port-fwrd.sh
Have it start in your init scripts at rc3 level, so that it will get executed upon reboot of your machine.

All you have to do now on your firewall is to forward:
port 2011 on the outside interface ---> port 2011 on 10.75.75.75
port 2012 on the outside interface ---> port 2012 on 10.75.75.75
port 2013 on the outside interface ---> port 2013 on 10.75.75.75

and tell your partner to configure his tnsnames.ora to reach:
Turku on address 192.168.15.100 and port 2011,
Toulouse on address 192.168.15.100 and port 2012,
Tanger on address 192.168.15.100 and port 2013.

Beautiful and simple, ain't it?

Note: of course, if the server on one of the locations doesn't support shared sockets (as it is the case with for example a Windows 2000 Server failsafe cluster), you won't be able to use portforwarding, since the answering port on the target server will a dynamic one, and thus unpredictable.

Happy computing.

Drop me a comment if this post has been useful to you, or if you see any reason for add-on or modification.

Nixman




dimanche 18 mai 2008

Installing and configuring Oracle Heterogeneous Services for SQLServer


All databases share a common set of normalized SQL, which, in theory, allows them to interoperate directly using database links.
However, reality is not so simple, as those who've tried to connect DB2 with SQLServer might have realized.

Luckily, with Oracle, there are at least two ways to achieve direct SQL*NET connectivity to foreign databases: Oracle Heterogeneous Services ODBC (HSODBC) and Oracle Transparent Gateways.

Here, we will achieve a simple database link between an Oracle database on a UNIX server and an SQLServer database residing on a Windows Server 2003 machine through the simplest of the two methods: Oracle Heterogeneous services. Bluntly, it consists in installing an Oracle pseudo-listener on the target non-Oracle database server.

As Microsoft doesn't provide any sort of UNIX client for SQL Server, all this interoperability is achieved thanks to work done by Oracle coders. Kudos to them, and  the opposite to the other guys.
 
X = Windows Server 2003 with SQLServer 2005 + Oracle 8iR3 with Oracle HS
Y = Solaris 8 server with Oracle 8iR3 + Heterogeneous Services installed.
 
 
On X:

Step 0) On X: Install Oracle Server 8iR3 software or later with Heterogenous Database connectivity (Check that ODBC DRIVERS have really been installed). I won't detail the installation of Oracle on Windows here.
 
Step 1) On X: Configure DSN:
Go to: Settings -> Control Panel. Double-click on ODBC icon.
Then click on the System DSN tab and Add button. Add SQL Server, as local server. Name it, for example, MSQL (we will be using "MSQL" in our example configuration files from now on).
Test it. The default database is the on we're targetting.
 
Step 2) On X :  Copy the file inithsodbc.ora into initMSQL.ora in the  $ORACLE_HOME\hs\admin directory (If you'd named the DSN "ZOZO" in the previous step, you would have named the file initZOZO.ora, of course).
 
Step 3) On X: Modify  the initMSQL.ora file in the following manner (HS_FDS_CONNECT_INFO must have the same name as the DSN):

###########
#
# HS init parameters
#
HS_FDS_CONNECT_INFO = MSQL
HS_FDS_TRACE_LEVEL = NO
###########
 
Step 4) On X:  Modify the listener.ora file in $ORACLE_HOME\network\admin directory in the following manner (you're modifying the  SID_LIST_LISTENER paragraph. SID_NAME must be the same as the DSN) :
 
###########
SID_LIST_LISTENER=
  (SID_LIST=
      (SID_DESC=
         (SID_NAME=MSQL)
         (ORACLE_HOME = c:\Orant)
         (PROGRAM=hsodbc)
       )
      )
 ###########

Another solution would be to add an altogether new listener, that you've called MSQL, like this (here, we've set it to listen on port 1522):

###########
MSQL =
 (ADDRESS_LIST=
      (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))
      (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
 
SID_LIST_MSQL=
  (SID_LIST=
      (SID_DESC=
         (SID_NAME=MSQL)
         (ORACLE_HOME = c:\Orant)
         (PROGRAM=hsodbc)
       )
      )
###########

In that case, you would have to start this listener specifically by issuing a lsnrctl start MSQL
 
Step 5) On X: restart the listener by issuing a  lsnrctl reload.
 
 
On Y:
 
Step 1) On Y: set GLOBAL_NAMES=FALSE  in your database's init.ora  file or in the initialization parameters.
 
Step 2) On Y: Add an entry pointing at server X listener by adding the following lines to the tnsnames.ora file:
 
###########
testMSQL  =
  (DESCRIPTION=
    (ADDRESS=
        (PROTOCOL=tcp)
        (HOST=SERVER_X_IP_ADDRESS)
        (PORT=SERVER_X_LISTENER_PORT)
     )
     (CONNECT_DATA=
        (SID=MSQL)
     )
     (HS=OK)
  )
###########
 
Step 3) On Y: Test connectivity by issuing a tnsping testMSQL
 
Step 4) On Y: Create the database link between your Oracle database and testMSQL by issuing the following SQL command:
SQL> create public database link testingMSQL connect to USER identified by PASSWORD using 'testMSQL';
 
Step 5) On Y: Do some selects on Server X's tables:
SQL> select * from TABLE_NAME@testingMSQL;

You're done!

Beware that you're restricted to normalized SQL. between the two databases. Old-timers will find themselves back in Oracle 6 days: You won't be able to use INSERT SELECT statements or other Oracle enhancements, but will have to go through a cursor, etc... However, you will be able to issue simple SELECT, INSERT and UPDATE commands. Which is what you wanted in the first place.

Happy computing.

Drop me a comment if this post has been useful to you, or if you see any reason for add-on or modification.

Nixman

jeudi 15 mai 2008

Installing a syslog server on AIX


Works on: AIX

AIX relies mostly on its own error reporting tools like errpt in order to keep track of incidents.

Thus, by default, AIX doesn't have a working configuration of syslog server, even though syslogd is installed. It simply lacks the proper configuration files.

Here are the steps to create a working configuration file and activate the service.

First, you have to create and edit the /etc/syslog.conf file. For example like this:

########
kern.debug;mail.none      /var/adm/messages       rotate size 2m files 3 compress
*.emerg;mail.none /var/adm/messages       rotate size 2m files 3 compress
*.alert;mail.none /var/adm/messages       rotate size 2m files 3 compress
*.crit;mail.none  /var/adm/messages       rotate size 2m files 3 compress
*.warning;mail.none       /var/adm/messages       rotate size 2m files 3 compress
*.err;mail.none   /var/adm/messages       rotate size 2m files 3 compress
*.notice;mail.none        /var/adm/messages       rotate size 2m files 3 compress
*.info;mail.none  /var/adm/messages       rotate size 2m files 3 compress
auth.notice     /var/adm/authlog        rotate size 2m files 3 compress
mail.info       /var/adm/mailerrors     rotate size 2m files 3 compress
########

This configuration allows you to rotate the logs on three files of 2MB each, and compress them.

Then, all you have to do is to run the following commands in order to create the log files, and restart the syslog service.
 
# touch /var/adm/messages
# touch /var/adm/authlog
# touch /var/adm/mailerrors
# refresh -s syslogd

 
If the configuration is successful, you will see a line resembling the following:
Nov 26 15:53:06 SERVER_NAME syslogd: restart
in the /var/adm/messages file right after running refresh -s syslogd

Happy computing.

Drop me a comment if this post has been useful to you, or if you see any reason for add-on or modification.

Nixman

- page 1 de 2