LATEST TOPICS

Oracle Database: Using a strong password

Using a strong password for the Database User’s account is a primary need to secure the database access.  A strong password requires a combination of letters, numbers, special characters, upper and lower case combination and a length of minimum 8 characters in the password.

Using a simple password for a Oracle Database User is quite easy to use as shown below.

SQL:labpa > create user testpass identified by testpass1;

User created.

SQL:labpa > alter user testpass identified by testpass123;

User altered.

However, while choosing strong passwords in a Oracle database, certain combination of special characters in the password leads errors as shown below

SQL:labpa > create user testpass identified by t3sT^l0g#;
create user testpass identified by t3sT^l0g#
                                       *
ERROR at line 1:
ORA-00922: missing or invalid option

SQL:labpa > create user testpass identified by $aC3s$#14;
create user testpass identified by $aC3s$#14
                                   *
ERROR at line 1:
ORA-00911: invalid character

SQL:labpa > alter user testpass identified by 1L0g%12*;
alter user testpass identified by 1L0g%12*
                                      *
ERROR at line 1:
ORA-00911: invalid character

SQL:labpa > alter user testpass identified by l0G87*$;
alter user testpass identified by l0G87*$
                                        *
ERROR at line 1:
ORA-00911: invalid character

The reason behind the errors are, certain special characters have predefined meanings with respect to the Operating System as well as Database context.

You can use the following method to define the password while using special characters.

SQL:labpa > create user testpass identified by "l0G87*$";

User created.

SQL:labpa > alter user testpass identified by "t3sT^l0g#";

User altered.

SQL:labpa > alter user testpass identified by "$aC3s$#14";

User altered.

Using the double quotes (” “) avoids the Database and the OS to interpret the predefined meaning of the special characters

If you are using the password utility (ORAPWD) for defining the SYS password, a single quote (‘ ‘) can be used for using special characters in the password as show below

[oracle@labserver dbs]$ orapwd file=orapwlabpa password='$aC3s$#14' entries=10
[oracle@labserver dbs]$ ls -lrt orapwlabpa
-rw-r----- 1 oracle dba 7680 Sep 15 19:38 orapwlabpa

[oracle@labserver dbs]$ sqlplus

SQL*Plus: Release 12.1.0.1.0 Production on Mon Sep 15 19:38:29 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Enter user-name: sys/$aC3s$#14@labpa as sysdba

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL:labpa >

 

 

%d bloggers like this:
Visit Us On LinkedinVisit Us On TwitterVisit Us On Google PlusCheck Our Feed