bash-3.00$ ./sqlplus -h
SQL*Plus: Release 10.2.0.2.0 - Production
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Usage 1: sqlplus -H | -V
-H Displays the SQL*Plus version and the
usage help.
-V Displays the SQL*Plus version.
Usage 2: sqlplus [ [] [] [] ] ---三节,就是三个部分
is: [-C ] [-L] [-M ""] [-R ] [-S]
-C Sets the compatibility of affected commands to the
version specified by . The version has
the form. "x.y[.z]". For example, -C 10.2.0
-L Attempts to log on just once, instead of --登陆一次就ok
reprompting on error.
-M "" Sets automatic HTML markup of output. The options
have the form.:
HTML [ON|OFF] [HEAD text] [BODY text] [TABLE text]
[ENTMAP {ON|OFF}] [SPOOL {ON|OFF}] [PRE[FORMAT] {ON|OFF}]
-R Sets restricted mode to disable SQL*Plus commands --就是在sqlplus中不能使用主机命令
that interact with the file system. The level can
be 1, 2 or 3. The most restrictive is -R 3 which
disables all user commands interacting with the
file system.
-S Sets silent mode which suppresses the display of --进入sqlplus中显示sqlplus的标题广告及命令提示及回应
the SQL*Plus banner, prompts, and echoing of
commands.
is: ([/][@] | /)
[AS SYSDBA | AS SYSOPER] | /NOLOG
Specifies the database account username, password and connect
identifier for the database connection. Without a connect
identifier, SQL*Plus connects to the default database.
The AS SYSDBA and AS SYSOPER options are database administration
privileges.
The /NOLOG option starts SQL*Plus without connecting to a
database.
is: @|[.] [ ...] --运地一个脚本文件,也可以从url远程调用脚本文件,文件名前加@
Runs the specified SQL*Plus script. from a web server (URL) or the
local file system (filename.ext) with specified parameters that
will be assigned to substitution variables in the script.
When SQL*Plus starts, and after CONNECT commands, the site profile
(e.g. $ORACLE_HOME/sqlplus/admin/glogin.sql) and the user profile
(e.g. login.sql in the working directory) are run. The files may
contain SQL*Plus commands.
Refer to the SQL*Plus User's Guide and Reference for more information.
----开始测试
bash-3.00$ ./sqlplus -c 9.2.0 '/as sysdba'
SQL*Plus: Release 10.2.0.2.0 - Production on Sat Sep 5 20:02:32 2009
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$ ./sqlplus -L '/as sysdba'
SQL*Plus: Release 10.2.0.2.0 - Production on Sat Sep 5 20:03:19 2009
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$ ./sqlplus -R 3 '/as sysdba'
SQL*Plus: Release 10.2.0.2.0 - Production on Sat Sep 5 20:03:46 2009
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> host pwd
SP2-0738: Restricted command "host" not available
SQL> host ls
SP2-0738: Restricted command "host" not available
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$ ./sqlplus -S '/as sysdba'
host pwd
/oracle/product/10.2.0/db_1/bin
desc pv;
Name Null? Type
----------------------------------------- -------- ----------------------------
A NUMBER(38)
exit;
bash-3.00$
bash-3.00$ ./sqlplus "/as sysdba" @./createtable.sql
SQL*Plus: Release 10.2.0.2.0 - Production on Sat Sep 5 20:05:47 2009
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
create table pv(a int)
*
ERROR at line 1:
ORA-00955: name is already used by an existing object
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-614024/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9240380/viewspace-614024/