码迷,mamicode.com
首页 > 数据库 > 详细

sqlplus

时间:2017-06-05 17:24:04      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:nbsp   partition   res   close   ora   rom   tab   bsp   --   

sqlplus   /   as sysdba

show user  查看当前是谁登陆

技术分享
[oracle@node1 ~]$ sqlplus  /  as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 5 10:35:05 2017

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show user
USER is "SYS"
SQL> 
View Code

sys 在oracle中最高权限

解锁scott

alter user scott identified by  tiger account unlock;

scott 用户下有几张表

select * from tab;

连接符的用法:用查询生成批量操作的命令

select ‘drop table ‘||tname||‘;‘ from tab;

技术分享
SQL> select drop table ||tname||; from tab;

DROPTABLE||TNAME||;
------------------------------------------
drop table BONUS;
drop table DEPT;
drop table EMP;
drop table SALGRADE;

SQL> select * from tab;

TNAME                   TABTYPE    CLUSTERID
------------------------------ ------- ----------
BONUS                   TABLE
DEPT                   TABLE
EMP                   TABLE
SALGRADE               TABLE

SQL> 
View Code

 

sqlplus

标签:nbsp   partition   res   close   ora   rom   tab   bsp   --   

原文地址:http://www.cnblogs.com/jycjy/p/6945950.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!