Oracle常用系统表查询
-- get all dictionary for oracle db
select * from dict;
--select * from dictionary;
-- get all columns for dictionarys
select * from dict_columns;
-- get the default name-space for current user
select username,default_tablespace from user_users;
-- get roles for current user
select * from user_role_privs;
-- get system privilage and table privilage for current user
select * from user_sys_privs;
select * from user_tab_privs;
-- get all tables for current user
select * from user_tables;
-- get all tables whoes name includes log
select object_name,object_id from user_objects where instr(object_name,'LOG')>0
-- get the create date for a table
select object_name,created from user_objects where object_name=upper('&table_name');
-- get the size for the given table
select sum(bytes)/(1024*1024) as "size(M)" from user_segments where segment_name=upper('&table_name');
-- get tables in ram
select table_name,cache from user_tables where instr(cache,'Y')>0
-- get index couter and types
select index_name,index_type,table_name from user_indexes order by table_name
-- get the columns indexed by the given index
select * from user_ind_columns where index_name=upper('&index_name')
-- get the size for the given index
select sum(bytes)/(1024*1024) as "size(M)" from user_segments where segment_name=upper('&index_name')
-- get the last number for all sequence
select * from user_sequences
-- get all views
select view_name from user_views
-- get the sql to defined the given view
select view_name,text_length from user_views;
set long 417;
select text from user_views where view_name=upper('&view_name');
-- get all synonyms
select * from user_synonyms
-- get constraints for given table
select constraint_name, constraint_type,search_condition, r_constraint_name from
user_constraints where table_name = upper('&table_name');
select c.constraint_name,c.constraint_type,cc.column_name
from us
相关文档:
Oracle
函
数之substr
关键字: substr
substr函数有三个参数,允许你将目标字符串的一部份输出,
第一个参数为目标字符串,
第二个字符串是将要输出的子串的起点,
第三个参数是将要输出的子串的长度。
例子1:
substr('ABCDEFG', 2, 3) ......
自己整理了下Oracle的数据库备份方案,用过冷备份。其他没有测试过
一、 导出/导入(Export/Import)
利用Export可将数据从数据库
中提取出来,利用Import则可将提取出来的数据送回到Oracle
数据库中去。
1、 简单导出数据(Export)和导入数据(Import):
Oracle支持三种方式类型的输出:
(1)、表方式(T方 ......
一、 内存结构
共享池:分为库高速缓存和字典高速缓冲区
库高速缓存,用于存储经过语法分析并且正确的SQL语句,并随时准备执行。
字典高速缓冲区,存储登陆到ORACLE的用户名,及这些用户有哪些数据库对象以及这些数据库对象的位置。
数据缓 ......
ORACLE 数据库对象
——索引
q 索引是与表相关的一个可选结构
q 用以提高 SQL 语句执行的性能
q 减少磁盘I/O
q 使用 CREATE INDEX 语句创建索引
q &n ......
搞oracle都会经常碰到rowid,本文是笔者根据网上各位的文章,加上自己学习中的体会,总结而成。
一.rowid简介
rowid就是唯一标志记录物理位置的一个id,在oracle 8版本以前,rowid由file#+block#+row#组成,占用6个bytes的空间,10 bit 的 file# ......