How to change keyboard layout in CentOS Linux

Today I ran into the problem of installing a virtual machine that has a french keyboard layout.  I have a US keyboard so it’s clear that I needed to change. Here’s how to do it from console. Open the keyboard file for editing vi /etc/sysconfig/keyboard You will see something like this: Change KEYTABLE and LAYOUT from “fr” to “us” Save it …

How to empty an Oracle 11g XE database

Once I needed to empty an Oracle database that was used by several systems, so it was a big mess with tables not needed and a lot of trash. Anyway, here’s a script that will generate a file with drop commands, this is the one that will drop all objects in the database. The good thing about this is that you …

How to connect to a remote Oracle database

Here is how to connect to a remote Oracle database using SQLPlus: sqlplus user/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=protocol)(HOST=host)(PORT=port))(CONNECT_DATA=(SID=sid))) Please note that the words in Italics represent variables: user – user name for the remote database pass – password for the remote database protocol – protocol used to connect to remote database, usually TCP host – IP address or hostname of the remote host port – remote …

How to change IP address on CentOS Linux

A few weeks back I needed to change my IP address on a Linux CentOS installed in a VirtualBox machine. Here is how to do it: ifconfig eth0 192.168.0.34 ifconfig eth0 netmask 255.255.255.0 Sources: http://www.tecmint.com/ifconfig-command-examples/ http://christophermaier.name/blog/2010/09/01/host-only-networking-with-virtualbox

How to get your MAC address in Windows 7

I needed to get mine today, the command is very simple and needs to be executed in a cmd window. Here is how to get the MAC address with the name of the adapter. C:Usershecperez>getmac -v You will see something like this:

How to solve ORA-25188: Cannot drop/disable/defer the primary key constraint for index-organized tables or sorted hash cluster

This time I was trying to reproduce an specific scenario and all of a sudden I was getting ORA-25188 in Tomcat’s console. A quick search on google revealed this method:  Connect as sysdba C:Userszulu>sqlplus / as sysdba Run the command, wait for the confirmation message SQL> PURGE DBA_RECYCLEBIN; DBA Recyclebin purged. That’s it, at least for me it worked but …

How to open computer management window from cmd in Windows 7?

A few days ago I needed to connect an external hard drive with a weird partition to my computer to format it as NTFS. I right clicked Computer and click Manage and nothing happened. I really don’t know why and I didn’t even care about solving it. The work around for this is to run the executable file directly from …

How to solve ORA-01017: Invalid username/password; logon denied

I was trying to connect to a database today when I found this: I think there could be a lot of reasons for this, but the easiest approach is to reset the user’s password, that is if the user exists of course. Here is the solution: Connect as sysdba to the database C:Usershecperez>sqlplus / as sysdba Run the following query …

How to check Oracle database version?

So today I needed to check what was my Oracle version because the PARTITION is not working and as far as I understand my version is not compatible with it. Here’s how to do it. Log in as sysdba C:Usersrecon1>sqlplus / as sysdba Run the following query SQL> select * from v$version; BANNER ——————————————————————————– Oracle Database 11g Express Edition Release …

How to solve ORA-28001: The password has expired

The other day I was happily opening SQL Developer when I found this horrible thing. Here is how to solve it. Connect as sysdba to the database. C:UsersSiry>sqlplus / as sysdba Run the query to set the password’s life time to unlimited. SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; Profile altered. Set a password for the locked user. SQL> ALTER …