Oracle sqlplus 常用命令
1、查看当前库的所有数据表:
SQL> select TABLE_NAME from all_tables;
select * from all_tables;
SQL> select table_name from all_tables where table_name like ‘u’; TABLE_NAME———————————————default_auditing_options
2、查看表结构:desc all_tables;
-显示CQI.T_BBS_XUSER的所有字段结构:
desc CQI.T_BBS_XUSER;
-获得CQI.T_BBS_XUSER表中的记录:
select * from CQI.T_BBS_XUSER;
3、增加数据库用户:(test11/test)
create user test11 identified by test default tablespace users Temporary TABLESPACE Temp;
4、用户授权:
grant connect,resource,dba to test11;
grant sysdba to test11;
commit;
5、更改数据库用户的密码:(将sys与system的密码改为test.) alter user sys indentified by test;
alter user system indentified by test;
show和set命令是两条用于维护SQL*Plus系统变量的命令
--设置运行命令是是否显示语句
set feedback on
--设置显示“已选择XX行”
set colsep |
--设置列与列之间的分割符号
set pagesize 10
--设置每一页的行数
set serveroutput on