Friday, May 27, 2011

 

DBCHECKORA

After upgrading to Oracle 11.2.0.2, we may want to update the PROF COMPATIBLE
parameter in DB02 or ST04.

I got an error
ORA-00942: table or view does not exist.
The table references was sap_dbcheckora_sap.

According to SAP Note 1397834 - DBACOCKPIT: ORA-00942 when changing "Check Conditions", we can implement this note, or upgrade to 7.01 SPS06.
The system I was working in is on SPS05 at the moment.

How about SQL?
The following query worked too.
update sapecc.DBCHECKORA set CHKVAL='11.2.0' where PARAM='COMPATIBLE' and CHKVAL='10.2.0';
1 row updated.
commit;

After commit, ST04 shows the new parameter value.


Friday, August 07, 2009

 

Anybody reading this

Please leave a comment!

Sunday, September 24, 2006

 

linux ifconfig compact output - part 3

Modifying the source code for the purpose here,
changing the output a bit, should be easy.
printf() is what we should look for.

main() calls if_print();
if_print() calls for_all_interfaces(do_if_print) or ife_print(struct interface);
for_all_interfaces() is not defined in ifconfig.c, do_if_print is the callback;
do_if_print() not in ifconfig.c;
ife_print() not in ifconfig.c;
all three are in lib/interface.c;
do_if_print() calls ife_print();


ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:3B:F3:69
inet addr:10.27.11.106 Bcast:255.255.255.0 Mask:255.255.252.0
inet6 addr: fe80::20c:29ff:fe3b:f369/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14026085 errors:7 dropped:11 overruns:0 frame:0
TX packets:8917277 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2957627992 (2.7 GiB) TX bytes:2694684505 (2.5 GiB)
Interrupt:17 Base address:0x1080


The words "Link", "encap", "HWaddr", tell us where to look
for the printf() calls.
Turns out the source code if very well organized.
It was easy to find where and what to modify.


ifconfig.c
main()
...
else if (!strcmp(*argv, "-s"))
ife_short = 1;

else if (!strcmp(*argv, "-c"))
ife_compact = 1;

else if (!strcmp(*argv, "-v"))
opt_v = 1;



So a variable ife_short is used for "short" output.
We follow that and use a variable "ife_compact"
for our "compact" output.


include/interface.h
...
extern int ife_short;
extern int ife_compact;

Here we follow the existing practice.



lib/interface.c
...
int ife_short;
int ife_compact;
...
void ife_print_compact(struct interface *ptr)
{
struct aftype *ap;
struct hwtype *hw;
int hf;
int can_compress = 0;
unsigned long long rx, tx, short_rx, short_tx;
const char *Rext = "b";
const char *Text = "b";

ap = get_afntype(ptr->addr.sa_family);
if (ap == NULL)
ap = get_afntype(0);

hf = ptr->type;

if (hf == ARPHRD_CSLIP || hf == ARPHRD_CSLIP6)
can_compress = 1;

hw = get_hwntype(hf);
if (hw == NULL)
hw = get_hwntype(-1);

printf(_("%s encap:%s "), ptr->name, hw->title);
if (hw->print != NULL && (! (hw_null_address(hw, ptr->hwaddr) && hw->suppress_null_addr) ))
printf(_("HWaddr:%s "), hw->print(ptr->hwaddr));
else
printf(_("HWaddr:null "));

#if HAVE_AFINET
if (ptr->has_ip) {
printf(_("%s:%s "), ap->name, ap->sprint(&ptr->addr, 1));
printf(_("Mask:%s "), ap->sprint(&ptr->netmask, 1));
}
#endif

if (ptr->flags & IFF_UP) printf(_("UP "));
if (ptr->flags & IFF_RUNNING) printf(_("RUNNING "));
printf(_("MTU:%d"), ptr->mtu);
printf("\n");
}

...
void ife_print(struct interface *i)
{
if (ife_short)
ife_print_short(i);
else if (ife_compact)
ife_print_compact(i);
else
ife_print_long(i);
}



Now we need to recompile.
I didnt find the rpmbuild option to just recompile.
"-ba" is not what we need. It would extract the source files
and over-write our changes.

What I did was to compile "manually".

cd lib
make
cd ..
make ifconfig

cc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DHAVE_SELINUX -D_GNU_SOURCE -O2 -Wall -g -I. -idirafter ./include/ -Ilib -c -o ifconfig.o ifconfig.c
cc -lselinux -Llib -o ifconfig ifconfig.o -lnet-tools


The last two "cc" commands, are what "rpmbuild -ba ..." invoked.

Saturday, September 23, 2006

 

linux ifconfig compact output - part 2

Where to find the ifconfig source code?
Since Fedora Core is supposed to be open source,
it has got to be somewhere.
Turns out the Fedora home page
has a distribution page, and on that page,
there is a link to a mirror site.
Source SRPMs are available after all.

http://fedoraproject.org/wiki/Distribution
http://fedora.redhat.com/Download/mirrors.html
http://mirror.linux.duke.edu/pub/fedora/linux/core/5/source/SRPMS/

Which SRPM to get?
At the Fedora core 5 shell promt, find the path of ifconfig,
then find the package it belongs to.
Then assume that the SRPM has the same base name as the RPM.

which ifconfig
/sbin/ifconfig

rpm -qf /sbin/ifconfig
net-tools-1.60-62.1

So we need the net-tools SRPM.

wget http://mirror.linux.duke.edu/pub/fedora/linux/core/5/source/SRPMS/net-tools-1.60-62.1.src.rpm

It is a good idea to install RPM build tools as a non-privileged user.

yum install fedora-rpmdevtools

Then create an RPM build file directory structure:

fedora-buildrpmtree

After the above command, a file and a folder is created
in your homedir:

ls $HOME/.rpmmacros $HOME/rpmbuild

Then install the net-tools source

rpm --install net-tools-1.60-62.1.src.rpm

The above command install SRPMs in $HOME/rpmbuild
by default, no matter where your current working directory
is.

Then build the net-tools:

cd $HOME/rpmbuild/SPECS
rpmbuild -ba net-tools.spec

On my test PC, there are a lot of warnings,
but no fatal errors I could see. I got a new ifconfig
binary after a few seconds. Lets do a test:

$HOME/rpmbuild/BUILD/net-tools-1.60/ifconfig

Output is the same as that from /sbin/ifconfig.
Now all we have to figure out is where to make a few changes.

 

linux ifconfig compact output

Read somewhere that writing a blog is a good way to make myself
more visible on the net. Good for job search, etc.
Also thought it might be useful to others to record
my occasional findings.

ifconfig prints something like the the following by default:

ifconfig
eth0 Link encap:Ethernet HWaddr 00:0B:DB:2E:3C:05
inet addr:10.27.11.233 Bcast:255.255.255.0 Mask:255.255.252.0
inet6 addr: fe80::20b:dbff:fe2e:3c05/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7440425 errors:0 dropped:0 overruns:0 frame:0
TX packets:174599 errors:0 dropped:0 overruns:0 carrier:0
collisions:30134 txqueuelen:1000
RX bytes:1530104868 (1.4 GiB) TX bytes:121416585 (115.7 MiB)
Interrupt:11

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:505339 errors:0 dropped:0 overruns:0 frame:0
TX packets:505339 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:158945307 (151.5 MiB) TX bytes:158945307 (151.5 MiB)


I am running this on Fedora 5.
There is also a "short" version:

ifconfig -s

Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 7440754 0 0 0 174615 0 0 0 BMRU
lo 16436 0 505367 0 0 0 505367 0 0 0 LRU


Sometimes I want a different output, lets say a "compact" output.
Turns out this is easy to do.
I modified the existing ifconfig source code and the result is:

ifconfig -c
eth0 encap:Ethernet HWaddr:00:0C:29:3B:F3:69 inet:10.27.11.106 Mask:255.255.252.0 UP RUNNING MTU:1500
lo encap:Local Loopback HWaddr:null inet:127.0.0.1 Mask:255.0.0.0 UP RUNNING MTU:16436


Each line is one interface, and each field is separated by
a SPC (space) char, and some fields are key:value.
This output is more suitable for scripting.

This page is powered by Blogger. Isn't yours?