search
HomeDatabaseMysql TutorialORACLE查询使用方法

一、用户

  查看当前用户的缺省表空间

  SQL>select username,default_tablespace from user_users;

  查看当前用户的角色

  SQL>select * from user_role_privs;

  查看当前用户的系统权限和表级权限

  SQL>select * from user_sys_privs;

  SQL>select * from user_tab_privs;

  二、表

  查看用户下所有的表

  SQL>select * from user_tables;

  查看名称包含log字符的表

  SQL>select object_name,object_id from user_objects

  where instr(object_name,'LOG')>0;

  查看某表的创建时间

  SQL>select object_name,created from user_objects where object_name=upper('&table_name');

  查看某表的大小

  SQL>select sum(bytes)/(1024*1024) as "size(M)" from user_segments

  where segment_name=upper('&table_name');

  查看放在ORACLE的内存区里的表

  SQL>select table_name,cache from user_tables where instr(cache,'Y')>0;

  三、索引

  查看索引个数和类别

  SQL>select index_name,index_type,table_name from user_indexes order by table_name;

  查看索引被索引的字段

  SQL>select * from user_ind_columns where index_name=upper('&index_name');

  查看索引的大小

  SQL>select sum(bytes)/(1024*1024) as "size(M)" from user_segments

  where segment_name=upper('&index_name');

  四、序列号

  查看序列号,last_number是当前值

  SQL>select * from user_sequences;

  五、视图

  查看视图的名称

  SQL>select view_name from user_views;

  查看创建视图的select语句

  SQL>set view_name,text_length from user_views;

  SQL>set long 2000; 说明:可以根据视图的text_length值设定set long 的大小

  SQL>select text from user_views where view_name=upper('&view_name');

  

   六、同义词

  查看同义词的名称

  SQL>select * from user_synonyms;

  七、约束条件

  查看某表的约束条件

  SQL>select constraint_name, constraint_type,search_condition, r_constraint_name

  from user_constraints where table_name = upper('&table_name');

  SQL>select c.constraint_name,c.constraint_type,cc.column_name

  from user_constraints c,user_cons_columns cc

  where c.owner = upper('&table_owner') and c.table_name = upper('&table_name')

  and c.owner = cc.owner and c.constraint_name = cc.constraint_name

  order by cc.position;

  八、存储函数和过程

  查看函数和过程的状态

  SQL>select object_name,status from user_objects where object_type='FUNCTION';

  SQL>select object_name,status from user_objects where object_type='PROCEDURE';

  查看函数和过程的源代码

  SQL>select text from all_source where owner=user and name=upper('&plsql_name');

  九、触发器

  查看触发器

  set long 50000;

  set heading off;

  set pagesize 2000;

  select

  'create or replace trigger "' ||

  trigger_name || '"' || chr(10)||

  decode( substr( trigger_type, 1, 1 ),

  'A', 'AFTER', 'B', 'BEFORE', 'I', 'INSTEAD OF' ) ||

  chr(10) ||

  triggering_event || chr(10) ||

  'ON "' || table_owner || '"."' ||

  table_name || '"' || chr(10) ||

  decode( instr( trigger_type, 'EACH ROW' ), 0, null,

  'FOR EACH ROW' ) || chr(10) ,

  trigger_body

  from user_triggers;

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
使用golang进行Select Channels Go并发式编程的异步处理方法使用golang进行Select Channels Go并发式编程的异步处理方法Sep 28, 2023 pm 05:27 PM

使用golang进行SelectChannelsGo并发式编程的异步处理方法引言:并发式编程是现代软件开发中的一个重要领域,它可以有效地提高应用程序的性能和响应能力。在Go语言中,使用Channels和Select语句可以简单而高效地实现并发编程。本文将介绍如何使用golang进行SelectChannelsGo并发式编程的异步处理方法,并提供具体的

jquery如何隐藏select元素jquery如何隐藏select元素Aug 15, 2023 pm 01:56 PM

jquery隐藏select元素的方法:1、hide()方法,在HTML页面中引入jQuery库,可以使用不同选择器来隐藏select元素,ID选择器将selectId替换为你实际使用的select元素的ID;2、css()方法,使用ID选择器选择需要隐藏的select元素,使用css()方法将display属性设置为none,并将selectId替换为select元素的ID。

jQuery中如何实现select元素的改变事件绑定jQuery中如何实现select元素的改变事件绑定Feb 23, 2024 pm 01:12 PM

jQuery是一个流行的JavaScript库,可以用来简化DOM操作、事件处理、动画效果等。在web开发中,经常会遇到需要对select元素进行改变事件绑定的情况。本文将介绍如何使用jQuery实现对select元素改变事件的绑定,并提供具体的代码示例。首先,我们需要使用标签来创建一个包含选项的下拉菜单:

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code<form name="myform"

linux要用select的原因是什么linux要用select的原因是什么May 19, 2023 pm 03:07 PM

因为select可以使开发者在同时等待多个文件缓冲区,可减少IO等待的时间,能够提高进程的IO效率。select()函数是IO多路复用的函数,允许程序监视多个文件描述符,等待所监视的一个或者多个文件描述符变为“准备好”的状态;所谓的”准备好“状态是指:文件描述符不再是阻塞状态,可以用于某类IO操作了,包括可读,可写,发生异常三种。select是一个计算机函数,位于头文件#include。该函数用于监视文件描述符的变化情况——读写或是异常。1.select函数介绍select函数是IO多路复用的函

docker挂载目录权限问题怎么解决docker挂载目录权限问题怎么解决Feb 29, 2024 am 10:04 AM

在Docker中,挂载目录的权限问题通常可以通过以下方法解决:使用-v参数指定挂载目录时添加权限相关的选项。可以通过在挂载的目录后面添加:ro或:rw来指定挂载目录的权限,分别表示只读和读写权限。例如:dockerrun-v/host/path:/container/path:roimage_name在Dockerfile中定义USER指令来指定容器中运行的用户,以确保容器内部的操作符合权限要求。例如:FROMimage_name#CreateanewuserRUNuseradd-ms/bin/

mysql的select语法怎么使用mysql的select语法怎么使用Jun 01, 2023 pm 07:37 PM

1、SQL语句中的关键词对大小写不敏感,SELECT等效于SELECT,FROM等效于from。2、从users表中选择所有列的,可以用符号*代替列的名称。语法--这是注释--从FEOM指定的[表中],查询出[所有的]数据.*表示[所有列]SELECT*FROM--通过从FROM从指定的[表中],查询出指定列名称(字段)的数据SELECT列名称FROM表名称实例--注意:多个列之间,使用英文的逗号来分隔selectusername,passwordfrom

通过golang实现Select Channels Go并发式编程的性能优化通过golang实现Select Channels Go并发式编程的性能优化Sep 27, 2023 pm 01:09 PM

通过golang实现SelectChannelsGo并发式编程的性能优化在Go语言中,使用goroutine和channel实现并发编程是非常常见的。而在处理多个channel的情况下,我们通常会使用select语句来进行多路复用。但是,在大规模并发的情况下,使用select语句可能会导致性能下降。在本文中,我们将介绍一些通过golang实现select

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),