当前位置:网站首页>【Oracle 数据库】奶妈式教程day02 数据库管理工具SQLPLUS的使用
【Oracle 数据库】奶妈式教程day02 数据库管理工具SQLPLUS的使用
2022-06-11 07:22:00 【菜鸟进阶站】
SQLPLUS的使用
安装完Oracle 11G,在开始菜单中会产生Oracle自带的管理工具,其中就包括SQL Plus。
SQL Plus的登录
1. 打开Oracle自带的SQL Plus插件
win+r 输入cmd敲回车

2. 以管理员身份登录SQL Plus
sqlplus / as sysdba

解锁用户
alter user 用户名 account unlock;

修改用户密码
alter user 用户名 identified by 密码;

3. SQL Plus 直接登录数据
sqlplus 用户名/密码@ip:port/数据库实例
ip:本机ip127.0.0.1
sqlplus 用户名/密码 --连接默认实例

4. 不登录连接数据库
sqlplus /nolog

通过conn(ect)命令连接数据库
conn 用户名/密码@ip:port/数据库实例
conn scott/scott --连接到默认的数据库实例上
conn 用户名
conn 用户名/密码@orcl

SQL Plus 中的命令
1. l命令
L(IST):查看sqlplus缓存的上一条语句

2. /命令
/:执行缓存中的sql语句

如果说l命令是查询你刚上一句命令的话,那么 / 命令就是执行你的上一条命令
4. n命令
n:它是一个自然数,表示把光标放到缓存中sql语句的第n行

5. a命令
a :给当前行添加内容

6. c命令
c:修改sql语句的内容c /源字符串/新字符串

7. del命令
del:删除当前行的内容

8. show all
show all 显示sqlplus中的所有参数配置

9. col命令
col 列名|别名 for 显示格式
字符串格式:a长度 col hiredate for a2
数字格式:9点位符 col sal for 9999.99
col sal for L9999.99 --L 本地货币符号
col sal for $9999.99

10. save命令
save 文件路径:将执行的sql语句保存到文件中

11. spool命令
spool 文件路径
sql语句
spool off
将spool 和spool off之间所执行过的语句及结果保存到文件中

12. desc命令
desc 表名查看表结构

边栏推荐
猜你喜欢

教育专家王中泽老师:家庭教育重在自己成长

Leetcode-141. Linked List Cycle
![[STL source code analysis] summary notes (5): a good helper for understanding iterators --list](/img/a7/c54bfb6a03c04e4ffeafdfcf8cedc2.jpg)
[STL source code analysis] summary notes (5): a good helper for understanding iterators --list

1、 Sqlserver2008 installation (with password), database creation, C form project test

CMAP of Matplotlib

教育专家王中泽老师一招解决学生问题

The difference between arrow function and ordinary function

No response from win10 explorer when dragging files

@Jsonproperty annotation

The rotation of the earth and the moon (II)
随机推荐
Mobile console Gobang (first draft of detailed design)
2022低压电工操作证考试题模拟考试平台操作
2022 low voltage electrician operation certificate test question simulation test platform operation
es5和es6的学习小记
Explain the difference between void 0 and undefined
生物序列智能分析平台blog(1)
1、 Sqlserver2008 installation (with password), database creation, C form project test
Concurrent tool class
[deploy private warehouse based on harbor] 3 deploy harbor
[STL source code analysis] summary notes (12): functors and adapters
webserver
Atom, the top stream editor, will leave the historical stage on December 15
Bat (batch processing) processing special symbols (exclamation point, percent sign), etc
【LeetCode】-- 17. Letter combination of telephone number
Multi thread review summary parsing volatile keyword
Leetcode-141. Linked List Cycle
R language Parallel Computing practice tutorial
Leetcode-141. Linked List Cycle
1442. number of triples forming two exclusive or equal arrays
Method to determine whether it is an array