Oracle sqlplus/as sysdba;

Source: Internet
Author: User

If multiple instances are installed on an Oracle Server, which instance is connected when sqlplus/as sysdba is executed?

In fact, when sqlplus/as sysdba is executed, the user name and password can be entered at will, or as it is now blank without entering. In essence, the password file is not verified at this time, but comes in through the operating system. The SID of the connected database is determined by the operating system environment variable $ ORACLE_SID. The viewing method is echo V $ ORACLE_SID. this SID verification can be performed after sqlplus/as sysdba goes in, run the database command to view: select t. instance_name from v $ instance t.

For more detailed environment information of the database corresponding to this SID, you can view it in $ ORACLE_HOME/network/admin/tnsnames. ora.

When the sys user password of the Oracle database is forgotten, you can access the database through sqlplus/as sysdba, and then execute alter user sys identified by xxx to modify the sys user password.

For execution of sqlplus/as sysdba, the user must be in the DBA user group. For example, an oracle user can execute this command, while other common users report an error of insufficient permissions when executing this command.

For $ ORACLE_SID value Modification, add export ORACLE_SID = xxx to the. bash_profile file in bash shell mode, and then make the modification take effect: source. bash_profile. In this way, sqlplus/as sysdba connects to the $ ORACLE_SID value configured in the. bash_profile file.

Rlwrap

SQLPLUS spool to dynamic Log File Name

Oracle SQLPLUS prompt settings

Accelerate SQL return by setting SQLPLUS ARRAYSIZE (row prefetch)

Related Article

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.