Oracle基本操作

来源:互联网 发布:淘宝无线端分类链接 编辑:程序博客网 时间:2024/06/08 19:27
1、普通用户登录:方式一:C:\Users\Administrator>sqlplus scott/scott(用户名/密码)SQL*Plus: Release 11.2.0.1.0 Production on 星期五 8月 11 21:53:53 2017Copyright (c) 1982, 2010, Oracle.  All rights reserved.连接到:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options方式二:C:\Users\Administrator>sqlplus scott/scottSQL*Plus: Release 11.2.0.1.0 Production on 星期五 8月 11 21:53:53 2017Copyright (c) 1982, 2010, Oracle.  All rights reserved.连接到:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options2、超级用户登录C:\Users\Administrator>sqlplus /nologSQL*Plus: Release 11.2.0.1.0 Production on 星期五 8月 11 22:18:04 2017Copyright (c) 1982, 2010, Oracle.  All rights reserved.SQL> connect /as sysdba已连接。3、退出登录SQL> quit从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options 断开4、查看当前用户下的所有表SQL> select * from tab;TNAME                          TABTYPE  CLUSTERID------------------------------ ------- ----------BONUS                          TABLEDEPT                           TABLEEMP                            TABLESALGRADE                       TABLE5、查询表的所有记录SQL> select * from dept;    DEPTNO DNAME          LOC---------- -------------- -------------        10 ACCOUNTING     NEW YORK        20 RESEARCH       DALLAS        30 SALES          CHICAGO        40 OPERATIONS     BOSTON6、查看表结构SQL> desc dept; 名称                                      是否为空? 类型 ----------------------------------------- -------- ---------------------------- DEPTNO                                    NOT NULL NUMBER(2) DNAME                                              VARCHAR2(14) LOC7、设置行宽SQL> set linesize 150;8、设置页大小SQL> set pagesize 120;9、设置列宽SQL> col deptno for 99999999;10、清屏SQL> host cls;11、修改SQL语句SQL> edit;


原创粉丝点击