show user; USER is S..."/>
您好,登錄后才能下訂單哦!
首發(fā):http://www.arppinging.com/wordpress/?p=93
連接用戶(hù)和查看當(dāng)前用戶(hù)
SQL> show user;
USER is "SCOTT"
SQL> conn /as sysdba
Connected.
SQL> show user
USER is "SYS"
SQL>
清除屏幕輸出
記錄輸出內(nèi)容到文本
開(kāi)啟記錄
SQL> spool /tmp/sql.txt
SQL> select * from student;
SNO SNAME BIRTHDAY
---------- ------------------------------ -------------------
1 A 0011-01-01 00:00:00
2 B 2011-01-01 00:00:00
3 1981-02-23 00:00:00
4 D
SQL> spool off
#關(guān)閉記錄
# 查看文本是否有記錄內(nèi)容
[root@localhost tmp]# cat /tmp/sql.txt
SQL> select * from student;
SNO SNAME BIRTHDAY
---------- ------------------------------ -------------------
1 A 0011-01-01 00:00:00
2 B 2011-01-01 00:00:00
3 1981-02-23 00:00:00
4 D
SQL> spool off
[root@localhost tmp]#
將時(shí)間信息打印在提示符的左邊
#開(kāi)啟時(shí)間顯示
SQL> set time on
16:02:39 SQL>
16:02:41 SQL> set time off
# 關(guān)閉時(shí)間顯示
SQL>
host可以執(zhí)行l(wèi)inux或者windows的命令
SQL> host ls -l
total 40
-rw-r--r--. 1 oracle oinstall 20 Oct 3 12:59 afiedt.buf
drwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Desktop
drwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Documents
drwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Downloads
drwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Music
drwxr-x---. 3 oracle oinstall 4096 Oct 2 11:28 oradiag_oracle
drwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Pictures
drwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Public
drwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Templates
drwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Videos
SQL>
@在oracle中可以用來(lái)執(zhí)行腳本中的內(nèi)容
# 查看腳本信息
[root@localhost tmp]# cat test.sql
select * from student;
show user;
[root@localhost tmp]#
# 執(zhí)行腳本
SQL> @/tmp/test.sql
SNO SNAME BIRTHDAY
---------- ------------------------------ -------------------
1 A 0011-01-01 00:00:00
2 B 2011-01-01 00:00:00
3 1981-02-23 00:00:00
4 D
USER is "SCOTT"
SQL>
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。