Oracle语句记录
来源:互联网 发布:宁静长相 知乎 编辑:程序博客网 时间:2024/06/16 21:54
并:union和union all
交:intersect
差:minus
日期格式设定:
select to_char(time,'yyyy-mm-dd') from table_name
表字段赋值:
update table_name t set t.字段名=regexp_replace(字段1,'@+','')
update table_name set 字段名=(case
where 条件1 then values1
else values2
end)
查看各表(包括删除到回收站的表)的大小
select segment_name,bytes/1024/1024 M from user_segments where segment_type=‘TABLE’ and tablespace_name = ‘USERS’
表空间相关语句
select * from dba_data_files
alter database datafile ‘表空间路径’ resize 20480 m ##改变表空间大小
alter database datafile ‘表空间路径’ autoextend on next 200m ##自动变大小
select * from V$dataflie
select * from V$tempfile
select username default_tablespace,temporary_tablespaces from dba_users where usernames = 'Libra' ###查看表空间及临时表空间
create temporary tablespace 临时空间名 tempfile ‘新路径名’ size 30G autoextend on next 128m maxsize unlimited ###新建临时表空间
Alter user IAO default tablespace users ###该表IAO库的默认表空间为users
Alter user IAO temporary tablespace dq ####改变临时表空间为dq
purge recyclebin ###清空回收站
drop table table_name purge ###彻底删除
select * from recyclebin ####查看删除表的详细信息
flashback table 原表名 to before drop ####撤销删除表的命令
停用回收站
alter system set ‘_recyclebin’ = false ###10.1版本
alter system set recyclebin = off ####10.2版本
统计表总字段数量
select count(column_name) from user_tab_columns where table_name = ‘表名’
查表:select * from user_tables where table_name like ‘%A’
查询某个字段是否包含特定的多个字符
可用like ‘%A%’ or like %A%。。。。,但这样效率太低,可先把需要匹配的多个字符新建表导入,然后:
select * from table_name1 t ,table_name2 s where instr(t.column_name,s.匹配的字段)>0
- oracle查询语句记录
- Oracle 语句记录
- Oracle SQL语句记录
- Oracle 工作语句记录
- Oracle语句记录
- oracle sql 语句 记录备忘
- 记录oracle常用sql语句
- oracle数据库操作语句记录
- 记录一些sql语句oracle的
- SQL语句技巧记录(Oracle + MySQL)
- Oracle常用SQL语句记录(备查)
- Oracle百万记录sql语句优化技巧
- Oracle常用SQL语句记录单
- Oracle数据库SQL语句操作记录
- ORACLE百万记录SQL语句优化技巧
- Oracle百万记录sql语句优化技巧
- Oracle百万记录sql语句优化技巧
- ORACLE百万记录SQL语句优化技巧
- Java时间格式转换大
- bzoj 2244 [SDOI2011]拦截导弹
- jqGrid 多选
- Fiddler:更简单的方式读、写本地文件
- [leetcode]: 278. First Bad Version
- Oracle语句记录
- aspx前台调用后台的变量
- Ubuntu+cuda+CuDnn+Caffe完美安装教程
- 疯狂Java系列之Set集合
- ConcurrentHashMap个人理解
- angular-cli命令总结
- SE02 Unit01 文件操作——File 、 文件操作—— RandomAccessFile
- Android Retrofit HTTPS 单向认证 双向认证
- 剑指Offer-36