Tags: oracle--sqlplus How to set the width of sqlplus results display Oracle How to set the width of sqlplus results display the Oracle Sqlplus prompt settingFirst, sqlplus query results, can be adjusted according to their own screen conditions, set the following:1. Set the
statements.Usage 1:sqlplus-h | -V-h displays Sql*plus version and usage help.-V Displays the Sql*plus version.
Usage 2:sqlplus [[
-C -l Try to log on only once instead of prompting again when an error occurs. -M " HTML [on| OFF] [head text] [body text] [TABLE text][entmap {on| Off}] [SPOOL {on| Off}] [Pre[format] {on| Off}] -R -s set silent mode, This pattern hides the Sql*plus flag of the comma
The DML, DDL, and DCL statements we usually call are SQL * plus statements. After they are executed, they can be stored in a memory area called SQL buffer, in addition, only one SQL statement can be saved recently. We can modify the SQL statement stored in SQL buffer and execute it again. sqlplus generally deals with databases.
Frequently used:
Sqlplus username/password for
Explain the Oracle SQLPlus runtime environment, common Oracle System Function instances, and sqlplus instances
1. Introduction to the SET command
Set command sets the running environment of SQL * Plus. The syntax FORMAT OF THE set command is:
SET system_variable value
The system_variable parameter represents the variable name, and the value parameter represents the variable value.
For
When executing some scripts in sqlplus, It is troublesome to specify the script location each time. Therefore, you can set the sqlplus path and place the script to be executed under the configured path, execute the script in sqlplus without specifying the location of the script.
The following describes how to set the sqlplus
Sqlplus cannot be initialized and sqlplus is automatically disabledFirst, install the oracle database. After installation, enter sqlplus In the cmd command window for verification. If there is something that cannot be initialized, configure it. First, find the location where you want to install oracle.F: \ oracle \ product \ 10.2.0 \ db_1 \ BIN my installation pa
Sqlplus Command Format and set Usage and interpretation in sqlplus [oracle @ oracle02 username] $ sqlplus -- helpSQL * Plus: Release 9.2.0.4.0-Production Usage: SQLPLUS [[
[Oracle]sqlplus Start parameter description# su-oracle [Grid]Usage 1:sqlplus-h | -V-H[ELP]:Displays the syntax and usage of the Sql*plus command, and then returns control to the operating system.-v[ersion]:Displays the version number of the Sql*plus, and then returns control to the operating system.Usage 2:sqlplus [[-C Set the Sql*plus command to a compatible ver
Set sqlprompt "_user ' @ ' _connect_identified>"
Meaning: _user on behalf of the current login username _connect_identified connection string name, set global Sqlplus prompt in Glogin.sql user and connect identified is the sqlplus default variable
Note: At this point, the Sqlplus prompt is set to take effect in all directories, @ Replace "¥/#/ can", enter
the results to the standard output .Two non-interactive ways to use Sqlplus 2Sqlplus in non-interactive mode, it can provide SQL commands from two places: the first is through the external file, but through the standard input.2.1 via external command filesqlplus username/[emailprotected]/侦听服务名 @命令文件名称
Here's an example.The command file name is called 1.sql. The contents are as follows: select count(*) from dba_objects;
exit; The Run command is:
modeWhat is local mode: only in the current directory is valid, for example, we configure the Login.sql file in the current directory, then the current directory into the Sqlplus tool will load Login.sql file prompt will take effect, the other directory login does not take effect1. Create the Login.sql file in the current directoryExample Vim/home/oracle/login.sql2. Edit the Login.sql file and add a line o
example, the default value of dbms_output.put_line ('Hello sqlplus ') is OFF, to display, set it to ON 7 and Sqlprompt to set the command prompt for SQLPLUS, the default value is SQL> For example, Set sqlpromptprintout> 8. The TIME command is used to Set whether the Set time on 9 and Underline variables are displayed
username _ connect_identified connection string name. In glogin. SQL, set the global sqlplus prompt to indicate that user and connect identified are the default variables of sqlplus.Note: The setting takes effect at the sqlplus prompt in all directories. @ Replace [$/#/ all]. Entering sqlplus from another directory also loads the prompt variable.3. Save Exit4.
time sqlplus is started.
Set SQLPATHAdd the SQLPATH environment variable to the ORACLE user profile file. Mine is. bash_profileFor example, export SQLPATH =/data/app/sqlpath (this path is the directory where your login. SQL is located)Of course, you can also start sqlplus and then execute the file (use the @ command ). Ii. glogin. SQLThe glogin. SQL file is a de
Original value 2:where Deptno = a
New value 2:where Deptno = 20
Original value 3:and job = ' b '
New value 3:and job = ' Clerk '
Ename
----------
SMITH
Adams
9. Binding variables
1) Define binding variables
You can use the variable command to define a binding variable. When you use a binding variable in an SQL statement or a pl/sql block,
You must add a colon to the binding variable (:). When assigning a value directly to a bound variable, you need to use the Execute command, for
Label:SELECT * FROM dept; Input order by dname; Append text command del n DELETE statement Celar buffer; command to clear the buffer Conn SYS as SYSDBA login user Typically, Sqlplus is installed by default as long as the server-side or client of Oracle is installed. Instead, SQLPLUSW just adds a form on sqlplus that executes the SQL statement exactly like Sqlplus
service startup Problems
Different linux systems have different oracle boot files. For example, in Ubuntu, we need to create/etc/init. d/oracledb, and in the kylin system, the file is in/etc/init. d/dbora, but the location is roughly the same. We only need to look closely for such a startup service file. When running these files, pay attention to the variables in oracledb or dbora, such as ORACLE_HOME, ORACLE_SID, and PATH. These variables must be co
Tags: style io os ar using for SP file datafrequently used:
Sqlplus Username/password such as: normal user login Sqlplus Scott/tiger
sqlplus username/[email protected]net_service_name such as: Sqlplus Scott/[email protected]
Sqlplus Username/password as SYSDBA:
Tags: style using OS io file data for ARfrequently used:
Sqlplus Username/password such as: normal user login Sqlplus Scott/tiger
sqlplus username/[email protected]net_service_name such as: Sqlplus Scott/[email protected]
Sqlplus Username/password as SYSDBA:
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.