Second, Oracle Sql*plus common commands

Source: Internet
Author: User
Tags clear screen sqlplus

the SYS user and system user Oracle installation automatically generates SYS users and system users (1), sys user is superuser, has the highest privileges, has the SYSDBA role, has the permission to create database, the user's default password is Change_on_install (2), the system user is a management operator, and the permissions are large. With the Sysoper role, without the CREATE DATABASE permission, the default password is the manager (3generally speaking, for database maintenance, using System user login can pull attention: that is, SYS and system of the two users the biggest difference is that there is no CREATE DATABASE permissions. Second, SQL*Introduction to the Plus tool SQL*Plus is Oracle's own tool software, primarily used to execute SQL statements, Pl\sql blocks. The operation is as follows: (1), in D:\dev\oracle\product\10.2.0Sqlplusw.exe in the \db_1\bin\ directory. (D:\dev\oracle\ for Oracle installation directory) (2), enter "SQLPLUSW" in the run bar to three, Sqlplus DOS tool introduction (1), overview: Sqlplus is a tool for operating Oracle under DOS, its features and SQL*plus similar. (2), the operation is as follows: Enter "Sqlplus" in the run bar to four, Plsql developer tools, need to install themselves, recommend that you use five, SQL*Plus common Commands1), connect commands1. conn[ect]USAGE: Conn User name/Password@ Network SERVICE name [As Sysdba/sysoper]Note: When connecting with a privileged user, you must bring as SYSDBA or as Sysopereg, SQL>ShowUserUSERto "SCOTT" SQL>Conn System/Oracle@orclis connected. SQL>ShowUserUSERto "SYSTEM" SQL>the above command achieves the same effect as switching users2. Disc/Disconn/Disconnect Description: This command is used to disconnect from the current database3. PSSW[Ord]Note: This command is used to modify the user's password, if you want to modify the other user's password, you need to use the SYS/System Login. eg, SQL>Conn Scott/Oracle is connected. SQL>PASSW Change SCOTT's password old password: New password: Retype new password: password changed SQL>4. ShowUserDescription: Displays the current user name5.ExitDescription: The command disconnects from the database and exits the SQL*Plus5. Clear screen to clear screens2), File Operations Command1. Start and @ Description: Run SQL script case: SQL>@ d:\a.sql or SQL>Start D:\a.sql2. Edit description: The command can edit the specified SQL script case: SQL>edit D:\a.sql, this will open the D:\a.sql file.3. Spool Description: This command enables the SQL*the contents of the plus screen are output to the specified file. Case: SQL>Spool D:\b.sql and enter SQL>Spoolifeg, SQL>Spool D:\b.sql;sql>Select *  fromEmp;sql>Spooloff; 3), interactive commands1.&Note: You can override a variable, which needs to be entered by the user when it executes. Select *  fromEmpwhereJob='&job';4), display and set environment variables Overview: Various formats that you can use to control the output,SetShow If you want to permanently save the relevant settings, you can go to modify the Glogin.sql script1. Linesize Description: Sets the width of the display line, the default is 80 characters show LinesizeSetLinesize -2. PageSize Description: Sets the number of rows displayed per page, by default 14 usage and linesize as for the use of other environmental parameters is similar
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.