实验案例:删除文件系统日志组,保留ASM日志组
说明:
oracle文件系统迁移至ASM,需要删除文件系统的日志组,只保留ASM日志组。若两者均保留,会出现读写日志性能不平衡状态。向ASM中读写日志要远快于向文件系统中读写日志。
操作步骤:
SQL> select * from v$log;
--查看到当前日志组为2,第1、3日志组处于INACTIVE状态,脏块已经写完,可以将这...
分类:
其他好文 时间:
2014-06-01 09:58:48
阅读次数:
365
常见的oracle分页查询实现方式有三种,分别是通过ROWNUM、ROWID、或分析函数实现,本文将以本人在项目中的用户表为例,简述三种分页的实现:
1.根据ROWNUM分页
SELECT TT.*
FROM (SELECT ROWNUM RN, T.*
FROM (SELECT UI.USER_ID,
UI.NAME...
分类:
数据库 时间:
2014-06-01 09:55:07
阅读次数:
289
/******* 导出到excel
EXEC master..xp_cmdshell 'bcp SettleDB.dbo.shanghu out c:\temp1.xls -c -q -S"GNETDATA/GNETDATA" -U"sa" -P""'
/*********** 导入Excel
SELECT *
FROM OpenDataSource( 'Microsoft....
分类:
数据库 时间:
2014-06-01 09:14:39
阅读次数:
410
【题目】
A message containing letters from A-Z is being encoded to numbers using the following mapping:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine the total number of ways to decode it.
For example,
Given encoded ...
分类:
其他好文 时间:
2014-06-01 08:59:37
阅读次数:
258
select total_user from a_user_no where date_time=(select max(date_time) from a_user_no where
‘2013-05’+ "'=to_char(date_time,‘yyyy-mm’));
通过max 函数来去5月份出现最大日期的数据...
分类:
数据库 时间:
2014-06-01 08:53:00
阅读次数:
312
查询crm_linkman表中,birthday(数据库中为date类型)字段中,月日为5-31的记录(主要用于检索今天有没有联系人生日)
SELECT * FROM crm_linkman WHERE MONTH(birthday) = 5 and DAYOFMONTH(birthday) = 31...
分类:
编程语言 时间:
2014-06-01 08:52:21
阅读次数:
355
【题目】
Given a collection of integers that might contain duplicates, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.
The solution set must not contain duplicate subsets.
For example,
If S = [1,2,2], a solution ...
分类:
其他好文 时间:
2014-06-01 08:51:06
阅读次数:
292
每年
select to_char(createtime, 'YYYY') 年, count(*) from table group by to_char(createtime, 'YYYY');
每季度
select to_char(createtime, 'q') 年, count(*) from table group by to_char(createtime, 'q');
...
分类:
数据库 时间:
2014-06-01 08:48:29
阅读次数:
368
今天学习到表的增操作,写个博客总结一下,PS:下面所有的注释都是我在电脑上全部操作完成后,再复制到记事本上添加的。至于在执行的时候可不可以那样添加注释,就有待考证了。
选择库
mysql> show databases;#查看目前有哪些数据库存在
+--------------------+
| Database |
+--------------------+
| inf...
分类:
数据库 时间:
2014-06-01 05:34:00
阅读次数:
453
add_months(trunc(to_date('2013','yyyy') ,'yyyy'),12)-1 2013年最后一天
trunc(to_date('2013','yyyy') ,'yyyy') 2013年第一天
5月的最后一天
select last_day(to_date('2013-05','yyyy-mm')) d from dual...
分类:
数据库 时间:
2014-06-01 00:07:37
阅读次数:
345