当前位置:网站首页>[Oracle database] mammy tutorial day02 use of database management tool sqlplus

[Oracle database] mammy tutorial day02 use of database management tool sqlplus

2022-06-11 07:24:00 Rookie advanced station

SQLPLUS Use

installed Oracle 11G, In the start menu, the Oracle It comes with management tools , Among them is SQL Plus.

SQL Plus The login

1. open Oracle Self contained SQL Plus plug-in unit

win+r Input cmd Knock back
 

2. Log in as Administrator SQL Plus

sqlplus / as sysdba

Unlocking users

alter user  user name  account unlock;

Change user password

alter user  user name  identified by  password ;

3. SQL Plus Direct login data

sqlplus  user name / password @ip:port/ Database instance 
ip: This machine ip127.0.0.1

sqlplus  user name / password    -- Connect to the default instance 

4. Do not log in and connect to the database

sqlplus /nolog

adopt conn(ect) Command to connect to database
conn user name / password @ip:port/ Database instance
conn scott/scott -- Connect to the default database instance
conn user name
conn user name / password @orcl
 

SQL Plus The command

1. l command

L(IST): see sqlplus The last statement cached
 

2. / command

/: Execute in cache sql sentence


if l The command is to query your last command , that / Command is to execute your last command

4. n command

n: It is a natural number , Means to put the cursor in the cache sql The second part of the sentence n That's ok


 

5. a command

a : Add content to the current row
 

6. c command

c: modify sql The content of the statement
c / The source string / New string



 

7. del command

del: Delete the contents of the current line  
 

8. show all

show all Show sqlplus All parameter configurations in

9. col command

col  Name | Alias  for  Display format 
 String format :a length  col hiredate for a2
 Digital format :9 Dot character  col sal for 9999.99 
 col sal for L9999.99  --L  Local currency symbol 
 col sal for $9999.99

10. save command

save File path : To be executed sql Statement to a file





 

11. spool command

spool  File path  
     	sql sentence 
spool off
 take spool  and spool off And save the executed statements and results to a file 







 

12. desc command

desc Table name View table structure

原网站

版权声明
本文为[Rookie advanced station]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206110722110041.html