保存当前命令到文件+读取保存文件中的内容
这个功能属于sqlplus命令,有时会比较有用。
保存当前命令到文件 SQL> save c:a.sql append
读取保存文件中的内容 SQL> get c:a.sql
------------------------------------
C:\>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 12月 20 06:11:23 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select count(*) from tab;
COUNT(*)
----------
3645
SQL> save c:a.sql append
已将 file 附加到 c:\a.sql
SQL> select username ,account_status from dba_users;
USERNAME ACCOUNT_STATUS
------------------------------ --------------------------------
MGMT_VIEW OPEN
SYS OPEN
SYSTEM OPEN
DBSNMP OPEN
SYSMAN OPEN
SCOTT OPEN
HR OPEN
OUTLN EXPIRED & LOCKED
MDSYS EXPIRED & LOCKED
ORDSYS EXPIRED & LOCKED
EXFSYS EXPIRED & LOCKED
DMSYS EXPIRED & LOCKED
WMSYS EXPIRED & LOCKED
CTXSYS EXPIRED & LOCKED
ANONYMOUS EXPIRED & LOCKED
XDB EXPIRED & LOCKED
ORDPLUGINS EXPIRED & LOCKED
SI_INFORMTN_SCHEMA EXPIRED & LOCKED
OLAPSYS EXPIRED & LOCKED
TSMSYS EXPIRED & LOCKED
BI EXPIRED & LOCKED
PM EXPIRED & LOCKED
MDDATA EXPIRED & LOCKED
IX EXPIRED & LOCKED
SH EXPIRED & LOCKED
DIP EXPIRED & LOCKED
OE EXPIRED & LOCKED
已选择27行。
SQL> save c:a.sql append
已将 file 附加到 c:\a.sql
SQL> get c:a.sql
1 select count(*) from tab
2 /
3* select username ,account_status from dba_users
SQL>
--------------------------------------
以上。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/20335819/viewspace-713589/
,如需转载,请注明出处,否则将追究法律责任。