Archive for the ‘Oracle’ Category

GQLPlus: Oracle SQLPlus on Crack.

It has always bugged me that the Oracle SQLPlus prompt on Windows allowed you to use the up arrow to repeat (and most often used to fix) the previous command but for some reason this functionality is lost with the Linux version.  That is until now.

I started to Google around to see how to turn this functionality on and that when I found the Holy Grail of SQL prompts; GQLPLus.  ”The difference between gqlplus and sqlplus is command-line editing and history, plus table-name and column-name completion.”

After downloading the gzip you can either compile the code your self, which didn’t work for me or just take the easy route and use the pre-complied binary located int he Linux folder of the gzip file.  I copied this binary to the /usr/local/bin folder for easy access.

You can download the source and binaries from the GQLPlus sourceforge page

Howto: Change Oracle sysman Password and Reconfigure Enterprise Manager

Note:
This guide was written for Oracle 10g running on a Windows server but the process is identical with the exception of how you stop and start the Enterprise Manager service.

When changing the sysman account password, which run the Oracle Enterprise Manager Application, you will need to stop the OracleDBConsole<SID> service from the Services Control Panel applet.  This will keep the sysman account from getting locked out.

Log into sqlplus as the user sys then type:

 ALTER USER sysman identified BY <new password>

Navigate in Windows Explorer to:

<ORACLE_HOME>\<localhost.domain_SID>\sysman\config
(Where localhost.domain_SID is specific to your installation environment.)

Open the file named emoms.properties in Wordpad

Located the value:
oracle.sysman.eml.mntr.emdRepPwd=<encrypted value>
(Where <encrypted value> is a random string of numbers and letters)
Change this to encrypted password to your new sysman password

Locate the Value:
oracle.sysman.eml.mntr.emdRepPwdEncrypted=TRUE

Change it to:
oracle.sysman.eml.mntr.emdRepPwdEncrypted=FALSE

Note:
Once you start the OracleDBConsole<SID> service it will change this cleartext password to its encrypted value.

Now start OracleDBConsole<SID> services that you stop before.

Note:
If the sysman or any other account becomes locked, you can unlock it with this command.

ALTER USER  account unlock;

How to: Manual Install of the Oracle dbConsole

Here is how to manually install an Oracle database server’s dbConsole service on Windows. You will need to run %ORACLE_HOME%\bin\emca.bat.

First you have to set a couple of system environment variables

c:\>set ORACLE_HOME=c:\path\to\oracle\home
c:\>set ORACLE_SID=DB_SID

Next run the emca.bat file with the parameters -config dbcontrol db

c:\>emca.bat -config dbcontrol db

Next you will be asked a few configuration setting

STARTED EMCA at Oct 12, 2009 3:34:20 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: DB_SID
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user: Password for SYSMAN user: Password for SYSMAN user: Email address for notifications (optional):email@yourserver.com
Outgoing Mail (SMTP) server for notifications (optional):mail.yourserver.com

It will then ask you to verify the setting that you just entered

You have specified the following settings
Database ORACLE_HOME ................ C:\path\to\oracle\home
Database hostname ................ yourdbserver.com
Listener port number ................ 1521
Database SID ................ DB_SID
Email address for notifications ............... email@yourserver.com
Outgoing Mail (SMTP) server for notifications ...............mail.yourserver.com
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: yes

Once you enter yes it will then display a bunch of log information. In this log will be the path to your Enterprise Management Console. ex. http://:1158/em

Enter the url in your browser and login. You are now all set. This will create the OracleDBConsole server and set it to start automatically.

A few notes. I didn’t know the password for my dbsnmp user account. So I attempted to login and Oracle told me that the account was locked. I then entered the following commands to unlock the account and to change the password.

c:\>sqlplus /nolog
sqlplus>conn sys as sysdba
Enter Password: sqlplus> ALTER USER dbsnmp ACCOUNT UNLOCK;
Account Unlocked
sqlplus>ALTER USER dbsnmp identified by ;
Password Changed.

Thats it.