Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How can I find (or change) password for SYS?

Re: How can I find (or change) password for SYS?

From: <fitzjarrell_at_cox.net>
Date: 23 Jun 2005 05:27:40 -0700
Message-ID: <1119529660.935240.98690@z14g2000cwz.googlegroups.com>

Comments embedded. And, do NOT top post, as it's difficult to follow threads.
Dave Best wrote:
> If the person created the database through dbca (database creation
> assistant) then they were prompted for a sys password.. Thats probably why
> it isn't change_on_install
>
> To change the sys password do the following:
>
> 1. Connect to the server and set your environment (ORACLE_HOME, ORACLE_SID).

You MUST, of course, be connected to the database server with a member account of one of the two following groups:

UNIX, Linus: dba (the default group for administration access to Oracle)

Windows: ORA_DBA

Note that ANY group in UNIX can be declared the administrative group for Oracle access. The usual, historic choice is 'dba'.

The easiest way to ensure you have such access is to connect to the database server as the software owner, in many cases 'oracle' or 'oinstall' on UNIX/Linux, or as ADministrator (usually) on a Windows server. And there is one sure way to know you've failed to connect with a proper O/S account.

> 2. Connect to Oracle.
> sqlplus /nolog
> SQL> connect / as sysdba

In the ascence of proper O/S permissions the second part of this directive fails with the following error:

/export/home/davidf> sqlplus /nolog

SQL*Plus: Release 9.2.0.6.0 - Production on Thu Jun 23 11:58:53 2005

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> connect / as sysdba
ERROR:
ORA-01031: insufficient privileges

SQL> As stated earlier, connecting with the proper O/S account makes all of the difference:

/export/home/oracle> sqlplus /nolog

SQL*Plus: Release 9.2.0.6.0 - Production on Thu Jun 23 12:00:53 2005

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> connect / as sysdba
Connected.
SQL>
> 3. To change the sys password type:
> SQL> alter user sys identified by newpassword;
>

I believe, with 9i and later, changing the SYS password, without changing the default setting of O7_DICTIONARY_ACCESSIBILITY (which is FALSE) really does no good, as access as SYS, in the absence of 'AS SYSDBA' causes the connection to fail:

SQL> connect sys
Enter password:
ERROR:
ORA-28009: connection to sys should be as sysdba or sysoper

Warning: You are no longer connected to ORACLE. SQL> As can be seen the password provided was correct; the O7_DICTIONARY_ACCESSIBILITY parameter setting prevents access as SYS. Changing the SYS password in this manner does, really, no good.

I expect the issue lies with the passwod file generated for the instance, which sets the INTERNAL (SYS as SYSDBA) password. A quick run of owapwd, from the O/S shell prompt (or the command prompt in Windows) is the proper way to set the SYS as SYSDBA password. The file resides in the $ORACLE_HOME/dbs directory on UNIX/Linux, and in %ORACLE_HOME%\dbs on Windows. Once in that location type:

$ orapwd file=<somefilename here> password=<your new SYS as SYSDBA password> entries=<number of possible entries for SYSDBA accounts>

For example:

$ orapwd file=orapwmydb password=my1337pass entries=5

Note the number provided to the entries parameter isn't creating that many SYSDBA database accounts, it's allowing up to that number of SYSDBA accounts to be created. You need not use but the one, for SYS, for such access. It is when you grant SYSDBA to an Oracle user account the password file gets updated with the necessary information, unless, of course, you've exceeded the maximum number you told Oracle you would create. At that point the grant would fail and you would then need to re-run the orapwd command to recreate the password file with a larger number of entries. But, I think 5 is more than enough.

Of course, since you didn't see fit to supply which version of Oracle was installed, this is purely speculation on my part. I am presuming the release is at least 9iR2, and, possibly, 10g. If my presumptions are incorrect, you're on your own, as you've installed a desupported release of Oracle.

I hope this has helped.

>
>
> --
> ----
> david.best_at_sympatico.ca
> "Thanks to the remote control I have the attention span of a gerbil!"
> "There are 10 types of people in the world. Those who understand binary,
> and those who don't."
> "Randi W" <randiwolner_at_hotmail.com> wrote in message
> news:d9dk3n$h7j$1_at_services.kq.no...
> > Hello,
> > Someone (not me) has installed Oracle 9.2.0.1.0, and I do not know what
> the
> > password for SYS is. In Oracle 8.1.7 the password was CHANGE_ON_INSTALL if
> > nothing was done to the default setup.
> > Is there another default for 9.2.0.1.0 ?
> > If there is not a default, or if another password was chosen at install
> > time - is there any way I can find out what the password is?
> > Or - as an alternative - is there any way to change the password for SYS
> > without knowing what it's password was?
> >
> > Thanks for any help,
> > Randi W
> >
> >

David Fitzjarrell Received on Thu Jun 23 2005 - 07:27:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US