How to reject the @ symbol in the password of an Oracle Database

Source: Internet
Author: User

Password Complexity is an important aspect for IT auditors to check whether a system is secure. IT policies often point out that the password should have a minimum length and contain a mix of uppercase letters, lowercase letters, numbers, and special characters.

In Oracle, do not use special characters @ in the password, because in Oracle, the @ symbol is used to indicate which Oracle server to use. The complete SQL * Plus connection statement format is as follows:

CONNECT username/password @ alias

Alias is an Oracle Net alias, representing a server, fracture, and Instance name.

List A displays the error: ORA-12154, "TNS: the specified connection identifier cannot be resolved when the @ character is used in the password ." The @ symbol is incorrectly used as an Oracle Net alias because the part after @ is not a valid alias and thus produces an error.

List
SQL> CREATE USER testuser1 IDENTIFIED BY "Cat"

2 default tablespace users

3 temporary tablespace temp;

User created.

SQL> CREATE USER testuser2 IDENTIFIED BY "H @ t"

2 default tablespace users

3 temporary tablespace temp;

User created.

SQL> GRANT create session TO testuser1, testuser2;

Grant succeeded.

SQL> connect testuser1/cat

Connected.

SQL> connect testuser2/h @ t

ERROR:

ORA-12154: TNS: cocould not resolve the connect identifier specified

Warning: You are no longer connected to ORACLE.

SQL> connect testuser2/"h @ t"

Connected.

SQL>

The workaround is to enclose the password in quotes, as shown in the listing.

This problem also exists in the second version of Oracle 10g. At the same time, it is worth noting that testuser1 can log on successfully even if its password is "cat. in the next major release of 11 GB, Oracle plans to replace the original algorithm with a safer password algorithm. The new algorithm allows real uppercase and lowercase letters to be used in the password. At the same time, the @ problem will not occur again.

At the same time, you can create a password complexity function in PL/SQL to prevent users from setting a password containing the @ symbol. If the new password contains the @ symbol, it will be rejected.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.