Knowledge about Oracle usage in Linux

Source: Internet
Author: User
1. Oracle has two ways to connect to the database: local or remote. When logging on to the database server, setting Oracle_SID, and no longer connecting to the database specified in $ sqlplussystem,

1. Oracle has two ways to connect to the database: local or remote. When logging on to the database server, setting Oracle_SID, and no longer connecting to the database specified in $ sqlplus system,

1. Oracle has two ways to connect to the database: local or remote.

When you log on to the database server, set Oracle_SID, and no longer connect to the database specified in $ sqlplus system in the string, use a local connection.

The local connection uses the bequeath protocol and does not need to run listener.

This is a typical method for most DBAs to connect to the database, because DBAs have logged on to the Unix server remotely or Xwindows.

For example:
SQL> sqlplus/nolog
SQL> conn/as sysdba;

Connnected to a idle instance // This message is displayed, indicating that the database has not been started.

SQL> startup

// At this point, we can not use the SID connection, if you want to use this form

SQL> conn sys/sys_Oracle @ orcl as sysdba;

The no listener error occurs.

The listener must be started first!

2. Modify the error when writing SQL statements, that is, specify the editor during ed.

First, create a login. SQL file.

For example:
My path is/opt/app/Oracle/admin/orcl/create/login. SQL.

Add the following to login. SQL:
DEFINE _ edit = vi (the editor you want to use) (Note: Not define_edit, but define _ edit; this problem puzzles me for one night)

Then we can add this sentence to. bash_profile in the Oracle user's home directory.

SQLPATH =/opt/app/Oracle/admin/orcl/create

OK. In this way, sqlplus can load the login. SQL content each time it starts.

The vi is opened and can be edited.

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.