orcle常用语句
来源:互联网 发布:mac地址修改器 wi10 编辑:程序博客网 时间:2024/05/17 22:12
--1.创建临时表空间create temporary tablespace AUTOMONITORV5_temptempfile 'D:\ORACLE\KARL\ORADATA\ORCL\AUTOMONITORV5_temp.DBF' size 50m autoextend on next 50m maxsize 10240m extent management local; --2.创建表空间create tablespace AUTOMONITORV5 logging datafile 'D:\ORACLE\KARL\ORADATA\ORCL\AUTOMONITORV5.DBF' size 50m autoextend on next 50m maxsize 12720m extent management local; --3.创建用户create user automonitorv5 identified by "123456" default tablespace AUTOMONITORV5 temporary tablespace AUTOMONITORV5_temp; --4.授权grant connect,resource,dba to automonitorv5; --5.删除用户drop user automonitorv5 cascade;--6.删除表空间DROP TABLESPACE automonitorv5 INCLUDING CONTENTS AND DATAFILES;--7.查询表空间位置及大小select tablespace_name, file_id, file_name, round(bytes / (1024 * 1024), 0) total_space from dba_data_files order by tablespace_name; --8.表空间使用率SELECT a.tablespace_name "表空间名", total "表空间大小", free "表空间剩余大小", (total - free) "表空间使用大小", Round((total - free) / total, 4) * 100 "使用率 %" FROM (SELECT tablespace_name, Sum(bytes) free FROM DBA_FREE_SPACE GROUP BY tablespace_name) a, (SELECT tablespace_name, Sum(bytes) total FROM DBA_DATA_FILES GROUP BY tablespace_name) b WHERE a.tablespace_name = b.tablespace_name; --9.增大表空间大小alter database datafile 'D:\ORACLE\KARL\ORADATA\ORCL\AUTOMONITORV5.DBF' resize 4000m;--10.增加文件个数alter tablespace AUTOMONITORV5 add datafile 'D:\ORACLE\KARL\ORADATA\ORCL\AUTOMONITORV51.DBF' size 1000m; --11.设置表空间自动增长alter database datafile 'D:\ORACLE\KARL\ORADATA\ORCL\AUTOMONITORV5.DBF' autoextend on next 100m maxsize 10240m;--12.获取10年前的日期select to_char(sysdate-numtoyminterval(10,'year'),'yyyy-MM-dd HH24:mi:ss') from dual;--13.小数转字符补零方法1)将小数点前的第一位置为0即可(注意9的个数要大于数值的位数)select to_char(.23,'fm999999990.999999999') from dual;2)既然小于1的小数首位必然是'.',那就判断首位是否为'.',是则在前面加上'0'即可select decode(substr(.23,1,1),'.','0'||.23,.23) from dual; <a target=_blank href="http://www.2cto.com/database/201304/205087.html">oracle小数转字符串</a>
0 0
- orcle常用语句
- Orcle 常用语句
- ORCLE常用语句
- orcle常用查询
- orcle
- ORCLE
- Orcle SQL基础命令语句
- orcle sql 语句 varchar 比较大小
- orcle 的 常用函数 总结 (日文版)
- Orcle查询语句字段和变量的混乱
- 常用语句
- 常用语句
- 常用语句
- 常用语句
- 常用语句
- 常用语句
- 常用语句
- SQL语句 常用语句
- 友情检测--tomcat管理程序认证上传及代码执行漏洞
- 函数指针和函数指针数组
- Effective JavaScript Item 30 理解prototype, getPrototypeOf和__proto__的不同
- window.open()与window.showModalDialog区别
- iOS 开发之 URL Scheme
- orcle常用语句
- db2卸载与安装
- editplus - 你不知道的那些事
- android 把虚拟键盘的回车改为搜索功能(亲试)
- Startup Script for Python(x,y)
- vmware workstation 9安装教程(图文)
- 命名管道
- dup2 解析
- sqlcmd不能远程连接问题及解决方案