ORA-01005: Connect Username AS SYSDBA Behaves Differently in 7.3.4, 8.1 and 9.2 (Doc ID 243083.1)

Last updated on SEPTEMBER 03, 2010

Applies to:

Oracle Server - Enterprise Edition
Information in this document applies to any platform.
Checked for relevancce on 02-Sep-2010

Symptoms

When logged in the OS as the oracle binary owner and CONNECT AS SYSDBA with an ordinary database username, is the password required ?

--> in 9.2 : NULL value or any value is allowed

--> in 8.X.X : NULL value results in an ORA-01005 error

--> in 7.3.4 : NULL value results in an ORA-01017 error

Different Possibilities
-----------------------
9.2.X

$ id
uid=127(ora92) gid=101(dba)

$ sqlplus /nolog

SQL*Plus: Release 9.2.0.3.0 - Production on Thu Jul 3 12:23:09 2003
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> connect scott as sysdba
Enter password: (enter NULL or any value)
Connected.

SQL> connect / as sysdba
Connected.


8.X.X

$ id
uid=118(ora817) gid=101(dba)

$ sqlplus /nolog

SQL*Plus: Release 8.1.7.0.0 - Production on Thu Jul 3 12:13:50 2003
(c) Copyright 2000 Oracle Corporation. All rights reserved.

SQL> connect scott as sysdba
Enter password: (NULL value)
Enter password:
ERROR:
ORA-01005: null password given; logon denied

SQL> connect / as sysdba
Connected.


7.3.4

$ id
uid=164(ora734) gid=101(dba)

$ svrmgrl

SVRMGR> connect scott as sysdba
Password: (NULL value)
ORA-01017: invalid username/password; logon denied

SVRMGR> connect / as sysdba
Connected.


Changes

7.3.4

SVRMGR> connect scott/tiger as sysdba
Connected.
SVRMGR> connect scott/t as sysdba
Connected.

SVRMGR> connect scott as sysdba
Password: (Entered tiger)
Connected.
SVRMGR> connect scott as sysdba
Password: (Entered t)
Connected.

SVRMGR> connect as sysdba
Username: (NULL value)
Connected.

SVRMGR> connect as sysdba
Username: /
Connected.
SVRMGR> connect as sysdba
Username: (NULL value)
Connected.

SVRMGR> connect as sysdba
Username: scott
Password: (NULL value)
ORA-01017: invalid username/password; logon denied

8.X.X

Any database user when the OS user belongs to the dba group can connect as
sysdba as long as the user provides his user password :

SQL> connect scott/tiger as sysdba
Connected.
SQL> connect scott/t as sysdba
Connected.

SQL> connect scott as sysdba
Enter password: (Entered tiger)
Connected.
SQL> connect scott as sysdba
Enter password: (Entered t)
ERROR:
ORA-01017: invalid username/password; logon denied

SQL> connect as sysdba
Enter user-name: /
ERROR:
ORA-01017: invalid username/password; logon denied

SQL> connect as sysdba
Enter user-name: (NULL value)
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] | [INTERNAL]
where ::= [/][@] | /

SQL> connect as sysdba
Enter user-name: scott
Enter password:
Enter password:
ERROR:
ORA-01005: null password given; logon denied

Only the username's password is allowed in 8.X.X when not passing it in the
connect string.

9.2

You can enter any value for the password or null value: it connects.

All cases work , except when you do not provide any username:

SQL> connect as sysdba
Enter user-name: (NULL value)
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where ::= [/][@] | /

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms