Friday, April 10, 2009

Changing forgotten password in Oracle

If you log in as a user with the ORA_DBA group, you will be able to get into your instance without a password. Usually the user on your machine that installed Oracle will work.

Just do this at a command prompt (after setting ORACLE_HOME and ORACLE_SID)

sqlplus "/ as sysdba"

Once you've done that, you can "alter user sys identified by xxxxx" to change the SYS password (replace xxxxx with the new one) .

Faced the problem listener was not starting because it did not have access to the log file for writing.

Exported the following variable at command line
$ LSNR=$ORACLE_HOME/bin/lsnrctl
$ SQLPLUS=$ORACLE_HOME/bin/sqlplus
$ export ORACLE_HOME
$ export PATH=$ORACLE_HOME/bin:$PATH
$ /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/lsnrctl status

TNS:net service name is incorrectly specified
Went to ORACLE_HOME above /network.admin/tnsnames.ora to find out the settings.


user - The login user name defined in the Oracle server.

password - The password for the login user.

host - The host name where Oracle server is running.
Default is - the IP address of localhost.

port - The port number where Oracle is listening for connection.
Default is 1521.

SID - System ID of the Oracle server database instance.
SID is a required value. By default, Oracle Database 10g Express
Edition creates one database instance called XE.

No comments: