Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Basic Oracle commands for Oracle rookie learning

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Debut: http://www.arppinging.com/wordpress/?p=93

Oracle Rookie Learning Oracle basic commands 1.connect and show user

Connect users and view current users

SQL > show user;USER is "SCOTT" SQL > conn / as sysdbaConnected.SQL > show userUSER is "SYS" SQL > 2.clear screen

Clear screen output

3.spool

Record the output to text

Open record SQL > spool / tmp/sql.txtSQL > 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 DSQL > spool off# close record # check if there is a record in the text [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] # 4.set time on

Print the time information on the left side of the prompt

# Open time display SQL > set time on16:02:39 SQL > 16:02:41 SQL > set time off# shutdown time display SQL > 5.host

Host can execute linux or windows commands

SQL > host ls-ltotal 40 Murray RW Murray Rafe Murray. 1 oracle oinstall 20 Oct 3 12:59 afiedt.bufdrwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Desktopdrwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Documentsdrwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Downloadsdrwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Musicdrwxr-x---. 3 oracle oinstall 4096 Oct 2 11:28 oradiag_oracledrwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Picturesdrwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Publicdrwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 Templatesdrwxr-xr-x. 2 oracle oinstall 4096 Oct 2 10:54 VideosSQL > 6.@

@ can be used to execute the contents of a script in oracle

# View script information [root@localhost tmp] # cat test.sql select * from student;show user [root@localhost tmp] # # execute script 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 DUSER is "SCOTT" SQL >

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report