ORA-00600: internal error code, arguments: [ORA_NPI_ERROR], [600], [ORA-00600: internal error code, arguments: [KFCHK_ERRRET], [kfa.c], [3025]

January 2nd, 2014 Matthias Pölzinger No comments

 
Problem description:

You are trying to recursively delete an ASM folder in asmcmd on 12.1.0.1 and are receiving the following ORA-00600:

ASMCMD> rm -rf 2013_12_10
ORA-29261: bad argument
ORA-00600: internal error code, arguments: [ORA_NPI_ERROR], [600], [ORA-00600: internal error code, arguments: [KFCHK_ERRRET], [kfa.c], [3025], [], [], [], [], [], [], [], [], []
], [], [], [], [], [], [], [], [], []
ORA-06512: at line 4 (DBD ERROR: OCIStmtExecute)
ASMCMD>

 
Problem resolution:

This seems to be a currently unresolved issue in 12.1.0.1. Even applying PSU1 will not fix this issue. Currently it is only possible to workaround this issue by not recursively deleting folders and instead delete the files inside:

ASMCMD> rm -f 2013_12_10/*
ASMCMD> ls -l
Type  Redund  Striped  Time             Sys  Name
                                        Y    2013_12_11/
                                        Y    2013_12_12/
                                        Y    2013_12_13/
ASMCMD>

 
System generated folders will be deleted automatically by Oracle ASM if no files are stored inside any longer.

Categories: Uncategorized Tags:

How To unlock APEX admin without changing the password

August 3rd, 2013 Matthias Pölzinger 1 comment

 
Problem description:

You have locked your APEX administrator account by mistyping the account’s password too often. As other persons are also using the account, you don’t want to use the “apxchpwd”-script.

 
Problem resolution:

If you just want to unlock the account instead of completely resetting the password, you can use the following PL/SQL block to establish this task:

begin
    wwv_flow_security.g_security_group_id := <APEX_WORKSPACE_ID>;
    wwv_flow_fnd_user_api.UNLOCK_ACCOUNT('<APEX_ACCOUNT_NAME>');
    commit;
end;
/

 
Example:

  1. Query the id for the “INTERNAL” workspace:

    SQL> SELECT workspace_id FROM apex_workspaces WHERE workspace = 'INTERNAL';
    
    WORKSPACE_ID
    ------------
              10
    
    SQL>
    

     

  2. Query the APEX schema’s name for your version:

    SQL> select username from dba_users where username like 'APEX%' order by 1;
    
    USERNAME
    ------------------------------
    APEX
    APEX_040200
    APEX_PUBLIC_USER
    
    SQL>
    

     

  3. Switch your session to the APEX-schema:

    SQL> alter session set current_schema = APEX_040200;                      
    
    Session altered.
    
    SQL>
    

     

  4. Unlock your ADMIN account with the following code:

    SQL> begin
      2    wwv_flow_security.g_security_group_id := 10;
      3    wwv_flow_fnd_user_api.UNLOCK_ACCOUNT('ADMIN');
      4    commit;
      5  end;
      6  /
    
    PL/SQL procedure successfully completed.
    
    SQL>
    
Categories: Uncategorized Tags:

How To remove all messages from a sendmail mail queue

 
Problem description:

Somehow your sendmail outgoing message queue got flooded by e.g. a job and you want to remove all of the messages to be delivered.

 
Problem resolution:

Outgoing messages in the sendmail queue are stored in /var/spool/mqueue. In order to get an overview of the messages you could execute the following sendmail command:

sendmail -bp

 
As your sendmail queue got flooded with a lot of messages, this command might take forever. So instead of querying all of the stored messages you can also check the files directly:

[root@server01 mqueue]# pwd
/var/spool/mqueue
[root@server01 mqueue]# 

[root@server01 mqueue]# ls -al
...
-rw-------  1 root smmsp    1285 18. Mai 10:35 qfr4I8ZSBn009790
-rw-------  1 root smmsp    1242 18. Mai 10:35 qfr4I8ZSu1009786
-rw-------  1 root smmsp    1233 18. Mai 10:35 qfr4I8ZumY009830
-rw-------  1 root smmsp    1253 18. Mai 10:35 qfr4I8ZUOF009794
-rw-------  1 root smmsp    1257 18. Mai 10:35 qfr4I8ZXPu009798
-rw-------  1 root smmsp    1253 18. Mai 10:35 qfr4I8ZZhj009802
...
[root@server01 mqueue]# 

[root@server01 mqueue]# ls -al | wc -l
34439
[root@server01 mqueue]#

 
There is no explicit command for removing all messages. You can directly delete them with “rm”. In order to remove all messages, we just delete the queued files:

[root@server01 mqueue]# pwd
/var/spool/mqueue
[root@server01 mqueue]# 

[root@server01 mqueue]# rm -f *
[root@server01 mqueue]# 

[root@server01 mqueue]# ls -al
insgesamt 1128
drwx------  2 root mail 1138688 20. Mai 11:06 .
drwxr-xr-x 16 root root    4096 11. Mai 2011  ..
[root@server01 mqueue]#

 
“sendmail -bq” should now report an empty mail queue:

[root@server01 mqueue]# sendmail -bp
/var/spool/mqueue is empty
          Total requests: 0
[root@server01 mqueue]#

 

Categories: Uncategorized Tags:

CentOS: yum operations fail with errors like “HTTP Error 404: Not Found” or “550 os: No such file or directory”

Problem description:

You want to update / upgrade your CentOS / RHEL-based Linux installation, but you are receiving errors like “HTTP Error 404: Not Found” or “550 os: No such file or directory”:

[root@centos01 ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.fraunhofer.de
 * extras: mirror.fraunhofer.de
 * updates: centos.bio.lmu.de
ftp://mirror.fraunhofer.de/centos.org/5.7/os/i386/repodata/repomd.xml: [Errno 4] IOError: [Errno ftp error] 550 os: No such file or directory
Trying other mirror.
http://centos.intergenia.de/5.7/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://centos.kiewel-online.ch/centos/5.7/os/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (-2, 'Der Name oder der Dienst ist nicht bekannt')>
Trying other mirror.
http://centos.mirroraustria.at/5.7/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://centos.psw.net/centos/5.7/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://centos.vieth-server.de/5.7/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
...
...

 
Problem resolution:
The repomd.xml file listed as missing comes from the Continuous Refresh Repo (CR) for your CentOS version, but your release has been superseded by a new one. In order to get yum to refresh its metadata, just clean up the existing one:

[root@centos01 ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@centos01 ~]#

 
Now yum should determine the new mirror information and allow you to continue your update, upgrade or install operation by using the correct mirror-URLs:

[root@centos01 ~]# yum update
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: tweedo.com
 * extras: centos.mirroraustria.at
 * updates: centos.mirroraustria.at
base                                                                                                                                                                      | 1.1 kB     00:00     
base/primary                                                                                                                                                              | 967 kB     00:00     
base                                                                                                                                                                                   2725/2725
extras                                                                                                                                                                    | 2.1 kB     00:00     
extras/primary_db                                                                                                                                                         | 171 kB     00:00     
updates                                                                                                                                                                   | 1.9 kB     00:00     
updates/primary_db                                                                                                                                                        | 564 kB     00:00     
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package acl.i386 0:2.2.39-8.el5 set to be updated
---> Package acpid.i386 0:1.0.4-12.el5 set to be updated
...
...

 

Categories: Uncategorized Tags:

Oracle Clusterware / Grid Infrastructure: How to determine the configured name of your cluster?

Problem description:

You need to know the cluster name defined during the installation of Oracle Clusterware / Oracle Grid Infrastructure. Maybe because you are configuring Oracle Enterprise Manager Database Console for one of your RAC Databases via emca:

[oracle@racn01 ~]$ emca -config dbcontrol db -repos create -cluster
 
STARTED EMCA at May 27, 2012 10:42:10 AM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.
 
Enter the following information:
Database unique name: RACDB
Service name: RACDB
Listener port number: 1521
Listener ORACLE_HOME [ /oracle/app/grid/11.2.0/grid ]:
Password for SYS user: 
Password for DBSNMP user: 
Password for SYSMAN user: 
Cluster name:

 
Problem resolution:

Oracle Clusterware’s command “cemutlo” can be used to determine the name defined for your cluster during the installation:

[root@racn01 ~]# /oracle/app/grid/11.2.0/grid/bin/cemutlo -n
playground
[root@racn01 ~]#

 

Categories: Uncategorized Tags:

QNAP: How to add a static route or add commands that should be executed during startup/reboot

Problem description:

You need to add an additional static route to your QNAP storage system. “route add” works fine through ssh, but does not persist a reboot.

 
Problem resolution:

Unfortunately the configuration of routes is not possible via the web interface. You will have to connect via ssh and edit a script that will be executed on every startup.

Just follow the next steps:

  1. Connect via ssh

    mbp:~ matt $ ssh admin@qnap15
    admin@qnap15's password: 
    [~] #

     

  2. Mount of the QNAP-Configuration device

    The name of the actual device to mount depends on your model number. In general for x86-based systems this should be /dev/sdx6. For Marvell ARM based models it should be /dev/mtdblock5 or /dev/mtdblock4. In this case we are working on higher model based on x86 and will mount /dev/sdx6:

    [~] # mount -t ext2 /dev/sdx6 /tmp/config
    [~] # df -h
    Filesystem                Size      Used Available Use% Mounted on
    /dev/ramdisk            139.5M    111.9M     27.5M  80% /
    tmpfs                    64.0M    164.0k     63.8M   0% /tmp
    /dev/sda4               310.0M    220.0M     90.0M  71% /mnt/ext
    /dev/md9                509.5M     88.8M    420.6M  17% /mnt/HDA_ROOT
    /dev/md0                  7.2T    402.7G      6.8T   5% /share/MD0_DATA
    tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
    /dev/sdx6                 3.9M     44.0k      3.8M   1% /tmp/config
    [~] # 
    [~] # ls -al /tmp/config/
    drwxr-xr-x    3 admin    administ     1024 May 11 17:43 ./
    drwxrwxrwx    8 admin    administ     1160 May 11 17:43 ../
    -rw-r--r--    1 admin    administ        1 May  3 17:30 BOOT_COUNT
    -rw-r--r--    1 admin    administ       27 Mar  6 12:21 customise.conf
    drwx------    2 admin    administ    12288 Jan 11  2010 lost+found/
    -rw-r--r--    1 admin    administ     3036 May  3 17:28 smb.conf
    -rw-r--r--    1 admin    administ       11 May  3 17:28 smb.conf.cksum
    -rw-r--r--    1 admin    administ       37 May  3 17:28 system.map.key
    -rw-r--r--    1 admin    administ     4552 Mar  8 11:48 uLinux.conf
    [~] #

     

  3. Create or adapt autorun.sh

    A shell script called “autorun.sh” will be executed by your QNAP storage system on every startup. If you have a freshly installed QNAP and never created/adapted “autorun.sh”, it might be possible that file currently does not exist.
    In this example we created the “autorun.sh” and implemented the following commands:

    [~] # vi /tmp/config/autorun.sh
    [~] # 
    [~] # cat /tmp/config/autorun.sh
    #!/bin/sh
     
    route add -net 192.168.35.0 netmask 255.255.255.0 gw 192.168.91.254
     
    [~] #

     

  4. Make sure that autorun.sh is executable

    In order to be executable during startup, we will have to set the executable flag for “autorun.sh”:

    [~] # ls -al /tmp/config/autorun.sh   
    -rw-r--r--    1 admin    administ       60 May 11 17:43 /tmp/config/autorun.sh*
    [~] # 
    [~] # chmod +x /tmp/config/autorun.sh 
    [~] # 
    [~] # ls -al /tmp/config/autorun.sh   
    -rwxr-xr-x    1 admin    administ       60 May 11 17:43 /tmp/config/autorun.sh*
    [~] #
  5. Test the command or autorun.sh

    Test the actual added content of your autorun.sh or if it is newly created test the execution of the whole script. In this case we have created a completely new autorun.sh and therefore can test the whole execution:

    [~] # /tmp/config/autorun.sh
    [~] # netstat -rn
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    ...
    192.168.35.0    192.168.91.254  255.255.255.0   UG    0      0        0 eth0
    ...
    [~] #
  6. Unmount /tmp/config

    If everything went well, unmount /tmp/config:

    [~] # umount /tmp/config/
    [~] # df -h
    Filesystem                Size      Used Available Use% Mounted on
    /dev/ramdisk            139.5M    111.9M     27.5M  80% /
    tmpfs                    64.0M    156.0k     63.8M   0% /tmp
    /dev/sda4               310.0M    219.9M     90.1M  71% /mnt/ext
    /dev/md9                509.5M     88.8M    420.6M  17% /mnt/HDA_ROOT
    /dev/md0                  7.2T    400.2G      6.8T   5% /share/MD0_DATA
    tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
    [~] #
Categories: Uncategorized Tags:

Lion / Lion Server: How to add/configure a static route

January 22nd, 2012 Matthias Pölzinger No comments

Problem description:

You need to add a static route on your Mac OS X Lion or Lion Server installation, so that after a reboot the route will be readded.

 
Problem resolution:

With Mac OS X Lion you can use launchd to configure the route during startup.

Just follow the next steps:

  1. Become root
    lion01:~ myuser$ sudo su -
    Password:
    lion01:~ root#

     

  2. Create a launchd file in /Library/LaunchDaemons
    In this example we want to add a route for the network 192.66.4.0/24 and configure 192.168.0.254 as the gateway:

    lion01:~ root# cd /Library/LaunchDaemons/
    lion01:LaunchDaemons root# 
    lion01:LaunchDaemons root# vi local.lion01.route.plist 
    lion01:LaunchDaemons root# 
    lion01:LaunchDaemons root# cat local.lion01.route.plist 
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>Label</key>
      <string>local.lion.route</string>
      <key>OnDemand</key>
      <false/>
      <key>ProgramArguments</key>
      <array>
      <string>route</string>
      <string>add</string>
      <string>192.166.4.0/24</string>
      <string>192.168.0.254</string>
      </array>
      <key>KeepAlive</key>
      <false/>
      <key>RunAtLoad</key>
      <true/>
      <key>ServiceIPC</key>
      <false/>
      <key>UserName</key>
      <string>root</string>
      <key>LaunchOnlyOnce</key>
      <true/>
    </dict>
    </plist>
    lion01:LaunchDaemons root#

     

  3. Run launchctl
    lion01:LaunchDaemons root# launchctl load /Library/LaunchDaemons/local.lion01.route.plist 
    lion01:LaunchDaemons root#

     

  4. Now you should be able to reach the destination
    lion01:~ root# netstat -rn
    Routing tables
     
    Internet:
    Destination        Gateway            Flags        Refs      Use   Netif Expire
    ...
    ...
    192.168.4/24       192.168.0.254      UGSc            1        8     en0
    ...
    ...
     
    Internet6:
    Destination                             Gateway                         Flags         Netif Expire
    ...
    ...
    lion01:~ root# 
    lion01:~ root# ping -c 3 192.168.4.1
    PING 192.168.4.1 (192.168.4.1): 56 data bytes
    64 bytes from 192.168.4.1: icmp_seq=0 ttl=64 time=0.403 ms
    64 bytes from 192.168.4.1: icmp_seq=1 ttl=64 time=0.445 ms
    64 bytes from 192.168.4.1: icmp_seq=2 ttl=64 time=0.545 ms
     
    --- 192.168.4.1 ping statistics ---
    3 packets transmitted, 3 packets received, 0.0% packet loss
    round-trip min/avg/max/stddev = 0.403/0.464/0.545/0.060 ms
    lion01:~ root#
Categories: Uncategorized Tags:

pfSense: Why can’t I access the latest information of a log file with tail, grep, cat or vi?

November 24th, 2011 Matthias Pölzinger No comments

Problem description:

You want to debug the logfiles of a pfSense firewall, but tail, grep, cat or vi do not provide the latest information and always ends with a “CLOG@?|?”:

# cd /var/log/
# tail -10l system.log 
Nov 24 15:33:14 pfsense99 sshd[45576]: error: PAM: authentication error for root from 192.168.210.198
Nov 24 15:33:14 pfsense99 last message repeated 2 times
Nov 24 15:33:14 pfsense99 sshd[45576]: Failed keyboard-interactive/pam for root from 192.168.210.198 port 47927 ssh2
Nov 24 15:33:14 pfsense99 sshd[45576]: Failed password for root from 192.168.210.198 port 47927 ssh2
Nov 24 15:33:14 pfsense99 last message repeated 2 times
Nov 24 15:33:14 pfsense99 sshd[45576]: Failed password for root from 192.168.210.198 port 47927 ssh2
Nov 24 15:34:18 pfsense99 sshd[45741]: error: PAM: authentication error for root from 192.168.210.198
Nov 24 15:34:18 pfsense99 sshd[45741]: error: PAM: authentication error for root from 192.168.210.198
Nov 24 15:34:18 pfsense99 last message repeated 2 times
Nov 24 15:34:18 pfsense99 sshd[45741]: Failed keyboard-interactive/pam for root fromCLOG@?|?# 
# 
# date
Thu Nov 24 19:15:38 CET 2011
#

 
Problem resolution:
pfSense writes its log information in a circular log format in order to keep a constant size. This prevents filesystem fillup, but also restricts you from using your standard shell tools to access the data inside these logfiles. Instead of using tail, grep, cat or vi directly, you should first access the log file with a command called “clog”:

# clog system.log 
2
Nov 24 12:59:08 pfsense99 sshd[20315]: error: PAM: authentication error for root from 192.168.210.198
...
...
...
Nov 24 19:15:42 pfsense99 sshd[20501]: Accepted publickey for root from 192.168.210.198 port 38451 ssh2
Nov 24 19:15:42 pfsense99 sshd[20503]: Accepted publickey for root from 192.168.210.198 port 38452 ssh2
#

 
clog also provides a follow option like tail:

# clog -f system.log 
...
...
...
Nov 24 19:15:42 pfsense99 sshd[20501]: Accepted publickey for root from 192.168.210.198 port 38451 ssh2
Nov 24 19:15:42 pfsense99 sshd[20503]: Accepted publickey for root from 192.168.210.198 port 38452 ssh2

 
If you want to grep for specific messages, just add a pipe and a grep:

# clog system.log | grep "keyboard-interactive"
Nov 24 19:15:09 pfsense99 sshd[16616]: Accepted keyboard-interactive/pam for root from 192.168.210.198 port 45104 ssh2
#

 

Categories: Uncategorized Tags:

Red Hat: How to check and repair your root-filesystem in rescue mode

November 24th, 2011 Matthias Pölzinger No comments

Problem description:

Your Linux server had some troubles with it’s underlying storage devices and put all your filesystems into read only mode. You corrected the issue and are booting up your Linux server. The boot process determines some problems with your root filesystems and requires a manual intervention by logging in with the root password. Unfortunately your are unable to login because the root password is not accepted (although you are using the correct one for the 25th time ;-) ).

You are unable to boot because of filesystem issues. At the same time your are unable to fix the filesystem, because your root password is not accepted.

 
Problem resolution:

Take a Linux installation media of your distribution and boot into linux rescue mode by typing the following command when asked for boot options:

linux rescue



 
Select your language and keyboard layout:

 



 
Network configuration is not necessary and can be skipped:

 


 
A very important step is to SKIP the mount of your Linux installation. Do not use MOUNT or READ-ONLY. For a filesystem check it is required that the filesystem is unmounted. Once mounted it is nearly unpossible to unmount your root-filesystem in rescue mode.

 


 
If you are not using a Logical Volume Manager for your filesystems you can directly jump to execute the “fsck” command. Otherwise you will have to first scan for your Physical Volumes and review them:

lvm pvscan
lvm pvdisplay

 


 
If your Physical Volumes were listed correctly continue to review the detected Volume Groups:

lvm vgdisplay

 
Now continue to activate your Volume Groups in order to create your Logical Volume devices in the “/dev” filesystem. In this example a Volume Group with the name “VolGroup00″ has to be activated:

lvm vgchange -a y VolGroup00

 


 
After activating your Volume Group(s), you will be able to perform a filesystem check and correct problems:

fsck /dev/VolGroup00/LogVol00

 


 
Once the filesystem check finishes successfully, you should be able to reboot without any further complication.

 

Categories: Uncategorized Tags:

EMC: Netto / Raw Capacity of an EMC disk

October 20th, 2011 Matthias Pölzinger No comments

Problem description:

As a DBA, System Archtitect or Engineer you are sometimes faced to create the storage layout for database systems. In order to get a detailed picture on how much capacity is available for your system, you have to calculate the netto capacity for your RAID-Level. Unfortunately EMC disks do not provide the same capacity as they are labeled with (independent of the used RAID-Level). In order to calculate the right capacity for your RAID-Level, you have to calculate with the raw capacity of an EMC disk.

 
Problem resolution:

Below you can find a table of EMC Clariion disks and their actual raw capacity:

Disk Size Raw / Usable Capacity
73 GB 66.61 GB
146 GB 133.65 GB
250 GB 230.13 GB
300 GB 268.37 GB
320 GB 297.01 GB
400 GB 366.76 GB
450 GB 402.57 GB
500 GB 458.56 GB
750 GB 687.86 GB
1 TB 917.15 GB
Categories: Uncategorized Tags: