哈佛图书馆的二十条训言

1.此刻打盹,你将做梦;而此刻学习,你将圆梦。
2.我荒废的今日,正是昨日殒身之人祈求的明日。
3.觉得为时已晚的时候,恰恰是最早的时候。
4.勿将今日之事拖到明日。
5.学习时的苦痛是暂时的,未学到的痛苦是终生的。
6.学习这件事,不是缺乏时间,而是缺乏努力。
7.幸福或许不排名次,但成功必排名次。
8.学习并不是人生的全部。但既然连人生的一部分―――学习也无法征服,还能做什么呢?
9.请享受无法回避的痛苦。
10.只有比别人更早、更勤奋地努力,才能尝到成功的滋味。
11.谁也不能随随便便成功,它来自彻底的自我管理和毅力。
12.时间在流逝。
13.现在流的口水,将成为明天的眼泪。
14.狗一样地学,绅士一样地玩。
15.今天不走,明天要跑。
16.投资未来的人,是忠于现实的人。
17.受教育程度代表收入。
18.一天过完,不会再来。
19.即使现在,对手也不停地翻动书页。
20.没有艰辛,便无所获。

oracle之datafile,tablespace

1、创建一般tablespace
create tablespace xifenfei datafile ‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\
xifenfei.DBF’ size 10m reuse autoextend on next 10m maxsize UNLIMITED ;
2、创建temp tablespace
create temporary tablespace xff_temp tempfile
‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\xff_temp.dbf’ size 10m;
3、创建undo tablespace
create undo tablespace xff_undo datafile
‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\xff_undo.dbf’ size 10m;
4、更改数据库的默认临时表空间
alter database default temporary tablespace xff_temp;
5、查询表空间类型
select tablespace_name,contents from dba_tablespaces;
6、查询默认临时表空间
select * from database_properties where property_name like ‘%TEMP_TABLE%’;
7、表空间变为只读状态
alter tablespace xifenfei read only;
note:该表空间中的objects可以被drop,因为表的记录是放在数据字典(system)中
8、表空间变为读写状态
alter tablespace xifenfei read write;
9、表空间offline
alter tablespace xifenfei offline;
note:如果有数据没有commit,会自动被commit掉
10、表空间online
alter tablespace xifenfei online;
11、查看表空间剩余大小

select f.tablespace_name,a.total,u.used,f.free,round((u.used/a.total)*100) "% used", round((f.free/a.total)*100) "% Free"
 from
 (select tablespace_name, sum(bytes/(1024*1024)) total
 from dba_data_files group by tablespace_name) a,
 (select tablespace_name, round(sum(bytes/(1024*1024))) used
 from dba_extents group by tablespace_name) u,
 (select tablespace_name, round(sum(bytes/(1024*1024))) free
 from dba_free_space group by tablespace_name) f
 WHERE a.tablespace_name = f.tablespace_name and a.tablespace_name = u.tablespace_name order by "% Free"; 

12、表空间自增长
alter database datafile ‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\XIFENFEI.DBF
‘ autoextend on next 2m maxsize 100m;
13、表空间中添加数据文件
alter tablespace xifenfei add datafile ‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\OR
CL\XIFENFEI1.DBF’ size 20m;
14、查看表空间是否是自增长
select file_name,autoextensible from dba_data_files;
15、修改表空间大小
alter database datafile ‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\
XIFENFEI1.DBF’ resize 15m;
16、查询临时表空间
select tablespace_name,file_name from dba_temp_files;
17、datafile  rename
1)alter tablespace xifenfei rename datafile
‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ XIFENFEI1.DBF’ to
‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\abc\ XIFENFEI1.DBF’
note:target文件必须存在,表空间必须离线
2) alter database rename file ‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\XIFENFEI1.DBF’
to ‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\orcl\XIFENFEI1.DBF’
note:target文件必须存在,数据库必须mount状态
18、删除表空间中的某个datafile
alter tablespace xifenfei drop datafile
‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\XIFENFEI1.DBF’;
19、删除表空间
drop tablespace xifenfei including contents and datafiles;

jquery插件弹出div

一直在为弹出遮挡层的div烦恼着,今天网上找了下,发现jmpopups很不错,稍微修改下,基本上可以实现需要功能
总体HTML代码

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
 <title>Untitled</title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
 <script type="text/javascript" src="jquery.jmpopups-0.5.1.js"></script>
 <script type="text/javascript">
 //<![CDATA[
 $.setupJMPopups({
 screenLockerBackground: "#003366",
 screenLockerOpacity: "0.7"
 });
 function openStaticPopup() {
 $.openPopupLayer({
 name: "myStaticPopup",
 width: 400,
 target: "myHiddenDiv"
 });
 }
 //]]>
 </script>
 <style type="text/css" media="screen">
 #myHiddenDiv {display:none;}
 .popup {background:#FFF; border:1px solid #333; padding:1px;}
 .popup-header {height:24px; padding:7px; background:url("bgr_popup_header.jpg") repeat-x;}
 .popup-header h2 {margin:0; padding:0; font-size:18px; float:left;}
 .popup-header .close-link {float:right; font-size:11px;}
 .popup-body {padding:10px;}
 </style>
</head>
<body>
<a href="javascript:void();" onclick="openStaticPopup();" title="Static example">添加Flash信息</a>
 <div id="myHiddenDiv">
 <div>
 <div>
 <h2>添加Flash信息</h2>
 <a href="javascript:void();" onclick="$.closePopupLayer('myStaticPopup');" title="Close">Close</a>
 <br clear="all" />
 </div>
 <div>
 <table>
 <tr><td>选择图片</td><td>13123124124312413413</td></tr>
 <tr><td>选择图片</td><td>13123124124312413413</td></tr>
 <tr><td>选择图片</td><td>13123124124312413413</td></tr>
 <tr><td></td><td>提交</td></tr>
 </table>
 </div>
 </div>
 </div>
</body>
</html>

jmpopups代码:

(function($) {
 var openedPopups = [];
 var popupLayerScreenLocker = false;
 var focusableElement = [];
 var setupJqueryMPopups = {
 screenLockerBackground: "#000",
 screenLockerOpacity: "0.5"
 };
 $.setupJMPopups = function(settings) {
 setupJqueryMPopups = jQuery.extend(setupJqueryMPopups, settings);
 return this;
 }
 $.openPopupLayer = function(settings) {
 if (typeof(settings.name) != "undefined" && !checkIfItExists(settings.name)) {
 settings = jQuery.extend({
 width: "auto",
 height: "auto",
 parameters: {},
 target: "",
 success: function() {},
 error: function() {},
 beforeClose: function() {},
 afterClose: function() {},
 reloadSuccess: null,
 cache: false
 }, settings);
 loadPopupLayerContent(settings, true);
 return this;
 }
 }
 $.closePopupLayer = function(name) {
 if (name) {
 for (var i = 0; i < openedPopups.length; i++) {
 if (openedPopups[i].name == name) {
 var thisPopup = openedPopups[i];
 openedPopups.splice(i,1)
 thisPopup.beforeClose();
 $("#popupLayer_" + name).fadeOut(function(){
 $("#popupLayer_" + name).remove();
 focusableElement.pop();
 if (focusableElement.length > 0) {
 $(focusableElement[focusableElement.length-1]).focus();
 }
 thisPopup.afterClose();
 hideScreenLocker(name);
 });
 break;
 }
 }
 } else {
 if (openedPopups.length > 0) {
 $.closePopupLayer(openedPopups[openedPopups.length-1].name);
 }
 }
 return this;
 }
 $.reloadPopupLayer = function(name, callback) {
 if (name) {
 for (var i = 0; i < openedPopups.length; i++) {
 if (openedPopups[i].name == name) {
 if (callback) {
 openedPopups[i].reloadSuccess = callback;
 }
 loadPopupLayerContent(openedPopups[i], false);
 break;
 }
 }
 } else {
 if (openedPopups.length > 0) {
 $.reloadPopupLayer(openedPopups[openedPopups.length-1].name);
 }
 }
 return this;
 }
 function setScreenLockerSize() {
 if (popupLayerScreenLocker) {
 $('#popupLayerScreenLocker').height($(document).height() + "px");
 $('#popupLayerScreenLocker').width($(document.body).outerWidth(true) + "px");
 }
 }
 function checkIfItExists(name) {
 if (name) {
 for (var i = 0; i < openedPopups.length; i++) {
 if (openedPopups[i].name == name) {
 return true;
 }
 }
 }
 return false;
 }
 function showScreenLocker() {
 if ($("#popupLayerScreenLocker").length) {
 if (openedPopups.length == 1) {
 popupLayerScreenLocker = true;
 setScreenLockerSize();
 $('#popupLayerScreenLocker').fadeIn();
 }
 if ($.browser.msie && $.browser.version < 7) {
 $("select:not(.hidden-by-jmp)").addClass("hidden-by-jmp hidden-by-" + openedPopups[openedPopups.length-1].name).css("visibility","hidden");
 }
 $('#popupLayerScreenLocker').css("z-index",parseInt(openedPopups.length == 1 ? 999 : $("#popupLayer_" + openedPopups[openedPopups.length - 2].name).css("z-index")) + 1);
 } else {
 $("body").append("<div id='popupLayerScreenLocker'><!-- --></div>");
 $("#popupLayerScreenLocker").css({
 position: "absolute",
 background: setupJqueryMPopups.screenLockerBackground,
 left: "0",
 top: "0",
 opacity: setupJqueryMPopups.screenLockerOpacity,
 display: "none"
 });
 showScreenLocker();
 $("#popupLayerScreenLocker").click(function() {
 $.closePopupLayer();
 });
 }
 }
 function hideScreenLocker(popupName) {
 if (openedPopups.length == 0) {
 screenlocker = false;
 $('#popupLayerScreenLocker').fadeOut();
 } else {
 $('#popupLayerScreenLocker').css("z-index",parseInt($("#popupLayer_" + openedPopups[openedPopups.length - 1].name).css("z-index")) - 1);
 }
 if ($.browser.msie && $.browser.version < 7) {
 $("select.hidden-by-" + popupName).removeClass("hidden-by-jmp hidden-by-" + popupName).css("visibility","visible");
 }
 }
 function setPopupLayersPosition(popupElement, animate) {
 if (popupElement) {
 if (popupElement.width() < $(window).width()) {
 var leftPosition = (document.documentElement.offsetWidth - popupElement.width()) / 2;
 } else {
 var leftPosition = document.documentElement.scrollLeft + 5;
 }
 if (popupElement.height() < $(window).height()) {
 var topPosition = document.documentElement.scrollTop + ($(window).height() - popupElement.height()) / 2;
 } else {
 var topPosition = document.documentElement.scrollTop + 5;
 }
 var positions = {
 left: leftPosition + "px",
 top: topPosition + "px"
 };
 if (!animate) {
 popupElement.css(positions);
 } else {
 popupElement.animate(positions, "slow");
 }
 setScreenLockerSize();
 } else {
 for (var i = 0; i < openedPopups.length; i++) {
 setPopupLayersPosition($("#popupLayer_" + openedPopups[i].name), true);
 }
 }
 }
 function showPopupLayerContent(popupObject, newElement, data) {
 var idElement = "popupLayer_" + popupObject.name;
 if (newElement) {
 showScreenLocker();
 $("body").append("<div id='" + idElement + "'><!-- --></div>");
 var zIndex = parseInt(openedPopups.length == 1 ? 1000 : $("#popupLayer_" + openedPopups[openedPopups.length - 2].name).css("z-index")) + 2;
 }  else {
 var zIndex = $("#" + idElement).css("z-index");
 }
 var popupElement = $("#" + idElement);
 popupElement.css({
 visibility: "hidden",
 width: popupObject.width == "auto" ? "" : popupObject.width + "px",
 height: popupObject.height == "auto" ? "" : popupObject.height + "px",
 position: "absolute",
 "z-index": zIndex
 });
 var linkAtTop = "<a href='#' class='jmp-link-at-top' style='position:absolute; left:-9999px; top:-1px;'>&nbsp;</a><input class='jmp-link-at-top' style='position:absolute; left:-9999px; top:-1px;' />";
 var linkAtBottom = "<a href='#' class='jmp-link-at-bottom' style='position:absolute; left:-9999px; bottom:-1px;'>&nbsp;</a><input class='jmp-link-at-bottom' style='position:absolute; left:-9999px; top:-1px;' />";
 popupElement.html(linkAtTop + data + linkAtBottom);
 setPopupLayersPosition(popupElement);
 popupElement.css("display","none");
 popupElement.css("visibility","visible");
 if (newElement) {
 popupElement.fadeIn();
 } else {
 popupElement.show();
 }
 $("#" + idElement + " .jmp-link-at-top, " +
 "#" + idElement + " .jmp-link-at-bottom").focus(function(){
 $(focusableElement[focusableElement.length-1]).focus();
 });
 var jFocusableElements = $("#" + idElement + " a:visible:not(.jmp-link-at-top, .jmp-link-at-bottom), " +
 "#" + idElement + " *:input:visible:not(.jmp-link-at-top, .jmp-link-at-bottom)");
 if (jFocusableElements.length == 0) {
 var linkInsidePopup = "<a href='#' class='jmp-link-inside-popup' style='position:absolute; left:-9999px;'>&nbsp;</a>";
 popupElement.find(".jmp-link-at-top").after(linkInsidePopup);
 focusableElement.push($(popupElement).find(".jmp-link-inside-popup")[0]);
 } else {
 jFocusableElements.each(function(){
 if (!$(this).hasClass("jmp-link-at-top") && !$(this).hasClass("jmp-link-at-bottom")) {
 focusableElement.push(this);
 return false;
 }
 });
 }
 $(focusableElement[focusableElement.length-1]).focus();
 popupObject.success();
 if (popupObject.reloadSuccess) {
 popupObject.reloadSuccess();
 popupObject.reloadSuccess = null;
 }
 }
 function loadPopupLayerContent(popupObject, newElement) {
 if (newElement) {
 openedPopups.push(popupObject);
 }
 if (popupObject.target != "") {
 showPopupLayerContent(popupObject, newElement, $("#" + popupObject.target).html());
 } else {
 $.ajax({
 url: popupObject.url,
 data: popupObject.parameters,
 cache: popupObject.cache,
 dataType: "html",
 method: "GET",
 success: function(data) {
 showPopupLayerContent(popupObject, newElement, data);
 },
 error: popupObject.error
 });
 }
 }
 $(window).resize(function(){
 setScreenLockerSize();
 setPopupLayersPosition();
 });
 $(document).keydown(function(e){
 if (e.keyCode == 27) {
 $.closePopupLayer();
 }
 });
})(jQuery);

使用说明:
myHiddenDiv表示要弹出来的整体div
popup-body中的内容替换为你需要的内容
openStaticPopup();表示弹出div,锁定界面
$.closePopupLayer(‘myStaticPopup’);表示关闭div,解锁界面
<h2></h2>弹出div的标题
openStaticPopup中的width表示弹出div的宽度
其实就是细节上的调整
效果
jquery.jmpopups(弹出div,锁住界面)

oracle之redo file

1、切换日志文件
alter system switch logfile;
2、增加联机日志组
alter database add logfile group 4 (‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\
REDO04_1.LOG’,’C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO04_2.LOG’) size 10m;
3、添加联机日志文件
alter database add logfile member ‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\RE
DO04_3.LOG’ to group 4;
4、删除联机日志组
alter database drop logfile group 1;
note:不会删除对应文件(见13、14)
5、删除联机日志文件
ALTER DATABASE DROP LOGFILE MEMBER ‘c:/LOCATION_DUST/REDO0N_N.LOG’;
note:不会删除对应文件(见13、14)
6、归档当前联机日志文件
alter system archive log current
7、dos删除文件
del filename
8、dos强制删除文件夹(无提示)
rd C:\oracle\product\10.2.0\oradata\orcl\A /s/q
note:/s删除一个非空文件夹 /q无提示
9、联机重做日志文件重命名或者移动
1)shutdown 数据库
2)拷贝redo文件到需要的位置(或者并重命名)
3)startup mount数据库
4) alter database rename file ‘C:\oracle\product\10.2.0\oradata\orcl\REDO01.LOG’
to ‘C:\oracle\product\10.2.0\oradata\orcl\REDO01.rdo’;
5)open 数据库
10、清空redo log file
1)不归档情况下
alter database clear logfile group 1;
2)归档情况下
alter database clear unarchived logfile group 1;

flash幻灯片

以前一直想写这个这个类此的东西,都苦于没有项目驱动,这次因项目需要,真的搞了一个出来
js代码(导入js文件未给出)

AC_FL_RunContent('type', 'application/x-shockwave-flash', 'data', 'img/advertising.swf?xml=ahsx/flash.ashx', 'width', '300', 'height','200', 'id', 'xifenfei_flash', 'movie', 'img/advertising?xml=ashx/flash.ashx');

c#生成类xml代码

System.Text.StringBuilder str = new System.Text.StringBuilder();
 str.Append("<data>  <channel>");
 str.Append("   <item><link>http://www.baidu.com</link>").Append("   <image>1.jpg</image>").Append("   <title>111111</title></item>");
 str.Append("  <item> <link>http://http://www.baidu.com</link>").Append("   <image>2.jpg</image>").Append("   <title>222222</title></item>");
 str.Append(" <item>   <link>http://www.baidu.com</link>").Append("   <image>3.jpg</image>").Append("   <title>333333</title></item>");
 str.Append("   <item> <link>http://www.baidu.com</link>").Append("   <image>1.jpg</image>").Append("   <title>444444</title></item>");
 str.Append("   <item> <link>http://www.baidu.com</link>").Append("   <image>2.jpg</image>").Append("   <title>555555</title></item>");
 str.Append("   <item> <link>http://www.baidu.com</link>").Append("   <image>3.jpg</image>").Append("   <title>666666</title></item>");
 str.Append(" </channel>");
 str.Append("</data>");
 context.Response.Write(str.ToString());

note:仅供测试,没有和数据库关联起来
flash幻灯片附件

fckeditor使用说明

在asp.net中使用fckeditor比freetextbox复杂的多,但是这个是完全开源,开源自己控制
配置:web.config中

<appSettings>
<add key="FCKeditor:BasePath" value="~/fckeditor/"/>
</appSettings>

修改fckcofig.js文件(主要)

var _FileBrowserLanguage    = 'aspx' ;
var _QuickUploadLanguage = 'aspx'; 

修改config.asx文件,主要是为了实现不同用户的文件夹放置位置不同

private bool CheckAuthentication()
 {
 if (Session["vip"] == null ||Session["vip"].ToString() == "")
 {
 Session["vip"] = "public";
 }
 return true;
}
UserFilesPath = "../../../../../upload/" + Session["vip"].ToString();
string file_path = folder.Create_folder("../../../../../upload/" + Session["vip"].ToString());
 UserFilesAbsolutePath = file_path;TypeConfig[ "Image" ].AllowedExtensions            = new string[] { "bmp", "gif", "jpeg", "jpg", "png" };
 TypeConfig[ "Image" ].DeniedExtensions            = new string[] { };
 TypeConfig[ "Image" ].FilesPath                    = "%UserFilesPath%"+Session["vip"].ToString()+"/";
 TypeConfig[ "Image" ].FilesAbsolutePath            = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );
 TypeConfig[ "Image" ].QuickUploadPath            = "%UserFilesPath%";
 TypeConfig[ "Image" ].QuickUploadAbsolutePath    = ( UserFilesAbsolutePath == "" ? "" : "%UserFilesAbsolutePath%" );

修改后的fckeditor

windows下oracle手工创建和删除数据库

创建oracle_sid为feifei的数据库
1、设置oracle_sid:set oracle_sid=feifei
2、建立pfile文件:文件名为:initfeifei.ora
内容为:

feifei.__db_cache_size=79691776
feifei.__java_pool_size=4194304
feifei.__large_pool_size=4194304
feifei.__shared_pool_size=100663296
feifei.__streams_pool_size=12582912
audit_file_dest='C:\oracle\product\10.2.0/admin/feifei/adump'
background_dump_dest='C:\oracle\product\10.2.0/admin/feifei/bdump'
compatible='10.2.0.1.0'
control_files='C:\oracle\product\10.2.0\oradata\feifei\control01.ctl','C:\oracle\product\10.2.0\oradata\feifei\control02.ctl','C:\oracle\product\10.2.0\oradata\feifei\control03.ctl'
core_dump_dest='C:\oracle\product\10.2.0/admin/feifei/cdump'
db_block_size=8192
db_domain=''
db_file_multiblock_read_count=16
db_name='feifei'
db_recovery_file_dest='C:\oracle\product\10.2.0\flash_recovery_area'
db_recovery_file_dest_size=2147483648
dispatchers='(PROTOCOL=TCP) (SERVICE=feifeiXDB)'
job_queue_processes=10
log_archive_dest_1='location=C:\oracle\product\10.2.0\archive'
open_cursors=300
pga_aggregate_target=20971520
processes=150
remote_login_passwordfile='EXCLUSIVE'
resource_limit=TRUE
sga_target=209715200
sort_area_size=65536#test
undo_management='AUTO'
undo_tablespace='UNDOTBS1'
user_dump_dest='C:\oracle\product\10.2.0/admin/feifei/udump'
utl_file_dir='c:\temp'

note:如果不是很熟悉可以从其他数据库拷贝
3、建立pfile文件中的相关的文件夹
4、建立oracle服务进程,并创建oracle密码文件
oradim -new -sid %ORACLE_SID% -intpwd MYSECRETPASSWORD -startmode M
5、执行sqlplus /nolog和connect sys/MYSECRETPASSWORD as sysdba(conn / as sysdba)(两种不同的认证方式)
6、执行startup nomount命令
7、执行create database命令

create database feifei
 logfile   group 1 ('C:\oracle\product\10.2.0\oradata\feifei\redo1.log') size 10M,
 group 2 ('C:\oracle\product\10.2.0\oradata\feifei\redo2.log') size 10M,
 group 3 ('C:\oracle\product\10.2.0\oradata\feifei\redo3.log') size 10M
 character set          WE8ISO8859P1
 national character set utf8
 datafile 'C:\oracle\product\10.2.0\oradata\feifei\system.dbf'
 size 50M
 autoextend on
 next 10M maxsize unlimited
 extent management local
 sysaux datafile 'C:\oracle\product\10.2.0\oradata\feifei\sysaux.dbf'
 size 10M
 autoextend on
 next 10M
 maxsize unlimited
 undo tablespace UNDOTBS1
 datafile 'C:\oracle\product\10.2.0\oradata\feifei\undo.dbf'
 size 10M
 default temporary tablespace temp
 tempfile 'C:\oracle\product\10.2.0\oradata\feifei\temp.dbf'

note:可以把create database写在notepad中,然后通过@path执行
8、添加需要的表空间

create tablespace Usersdatafile  'C:\oracle\product\10.2.0\oradata\feifei\user01.dbf'
 size 50M
 autoextend on
 next 10M maxsize unlimited

9、执行相关的sql脚本,主要有:
C:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\catalog.sql(主要是数据字典)
C:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\catproc.sql(主要是pl/sql相关操作)
C:\oracle\product\10.2.0\db_1\sqlplus\admin\pupbld.sql(主要是sqlplus相关操作)
至此手工创建数据库基本完成,当然在生产系统中,创建数据库要比这个复杂的多,主要集中在创建的pfile文件和create database命令的复杂
删除oracle_sid=feifei数据库
1、注销掉windows服务的oracle进程oradim -delete -sid feifei
2、删除oracle创建的相关文件主要是:
1)C:\oracle\product\10.2.0\oradata\feifei下的文件
2)C:\oracle\product\10.2.0\admin\feifei下的文件
3)C:\oracle\product\10.2.0\db_1\database下文件名有feifei的文件

常见数据库对日期时间格式化

1、mysql
DATE_FORMAT(date,format)
根据format字符串格式化date值。下列修饰符可以被用在format字符串中:
%M  月名字(January……December)
%W  星期名字(Sunday……Saturday)
%D  有英语前缀的月份的日期(1st, 2nd, 3rd, 等等。)
%Y  年, 数字, 4 位
%y  年, 数字, 2 位
%a  缩写的星期名字(Sun……Sat)
%d  月份中的天数, 数字(00……31)
%e  月份中的天数, 数字(0……31)
%m  月, 数字(01……12)
%c  月, 数字(1……12)
%b  缩写的月份名字(Jan……Dec)
%j  一年中的天数(001……366)
%H  小时(00……23)
%k  小时(0……23)
%h  小时(01……12)
%I  小时(01……12)
%l  小时(1……12)
%i  分钟, 数字(00……59)
%r  时间,12 小时(hh:mm:ss [AP]M)
%T  时间,24 小时(hh:mm:ss)
%S  秒(00……59)
%s  秒(00……59)
%p  AM或PM
%w  一个星期中的天数(0=Sunday ……6=Saturday )
%U  星期(0……52), 这里星期天是星期的第一天
%u  星期(0……52), 这里星期一是星期的第一天
%%  一个文字“%”
2、sql server
sql server转换使用convert来实现

Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM
Select CONVERT(varchar(100), GETDATE(), 1): 05/16/06
Select CONVERT(varchar(100), GETDATE(), 2): 06.05.16
Select CONVERT(varchar(100), GETDATE(), 3): 16/05/06
Select CONVERT(varchar(100), GETDATE(), 4): 16.05.06
Select CONVERT(varchar(100), GETDATE(), 5): 16-05-06
Select CONVERT(varchar(100), GETDATE(), 6): 16 05 06
Select CONVERT(varchar(100), GETDATE(), 7): 05 16, 06
Select CONVERT(varchar(100), GETDATE(), 8 ): 10:57:46
Select CONVERT(varchar(100), GETDATE(), 9): 05 16 2006 10:57:46:827AM
Select CONVERT(varchar(100), GETDATE(), 10): 05-16-06
Select CONVERT(varchar(100), GETDATE(), 11): 06/05/16
Select CONVERT(varchar(100), GETDATE(), 12): 060516
Select CONVERT(varchar(100), GETDATE(), 13): 16 05 2006 10:57:46:937
Select CONVERT(varchar(100), GETDATE(), 14): 10:57:46:967
Select CONVERT(varchar(100), GETDATE(), 20): 2006-05-16 10:57:47
Select CONVERT(varchar(100), GETDATE(), 21): 2006-05-16 10:57:47.157
Select CONVERT(varchar(100), GETDATE(), 22): 05/16/06 10:57:47 AM
Select CONVERT(varchar(100), GETDATE(), 23): 2006-05-16
Select CONVERT(varchar(100), GETDATE(), 24): 10:57:47
Select CONVERT(varchar(100), GETDATE(), 25): 2006-05-16 10:57:47.250
Select CONVERT(varchar(100), GETDATE(), 100): 05 16 2006 10:57AM
Select CONVERT(varchar(100), GETDATE(), 101): 05/16/2006
Select CONVERT(varchar(100), GETDATE(), 102): 2006.05.16
Select CONVERT(varchar(100), GETDATE(), 103): 16/05/2006
Select CONVERT(varchar(100), GETDATE(), 104): 16.05.2006
Select CONVERT(varchar(100), GETDATE(), 105): 16-05-2006
Select CONVERT(varchar(100), GETDATE(), 106): 16 05 2006
Select CONVERT(varchar(100), GETDATE(), 107): 05 16, 2006
Select CONVERT(varchar(100), GETDATE(), 108): 10:57:49
Select CONVERT(varchar(100), GETDATE(), 109): 05 16 2006 10:57:49:437AM
Select CONVERT(varchar(100), GETDATE(), 110): 05-16-2006
Select CONVERT(varchar(100), GETDATE(), 111): 2006/05/16
Select CONVERT(varchar(100), GETDATE(), 112): 20060516
Select CONVERT(varchar(100), GETDATE(), 113): 16 05 2006 10:57:49:513
Select CONVERT(varchar(100), GETDATE(), 114): 10:57:49:547
Select CONVERT(varchar(100), GETDATE(), 120): 2006-05-16 10:57:49
Select CONVERT(varchar(100), GETDATE(), 121): 2006-05-16 10:57:49.700
Select CONVERT(varchar(100), GETDATE(), 126): 2006-05-16T10:57:49.827
Select CONVERT(varchar(100), GETDATE(), 130): 28 ????? 1431  3:26:31:180PM
Select CONVERT(varchar(100), GETDATE(), 131): 18/04/1427 10:57:49:920AM

3、oracle
oracle转换日期或者时间用to_char(datetime, format)
format的参数有
HH     一天的小时数 (01-12)
HH12     一天的小时数 (01-12)
HH24     一天的小时数 (00-23)
MI     分钟 (00-59)
SS     秒 (00-59)
SSSS     午夜后的秒 (0-86399)
AM or A.M. or PM or P.M.     正午标识(大写)
am or a.m. or pm or p.m.     正午标识(小写)
Y,YYY     带逗号的年(4 和更多位)
YYYY     年(4和更多位)
YYY     年的后三位
YY     年的后两位
Y     年的最后一位
BC or B.C. or AD or A.D.     年标识(大写)
bc or b.c. or ad or a.d.     年标识(小写)
MONTH     全长大写月份名(9字符)
Month     全长混合大小写月份名(9字符)
month     全长小写月份名(9字符)
MON     大写缩写月份名(3字符)
Mon     缩写混合大小写月份名(3字符)
mon     小写缩写月份名(3字符)
MM     月份 (01-12)
DAY     全长大写日期名(9字符)
Day     全长混合大小写日期名(9字符)
day     全长小写日期名(9字符)
DY     缩写大写日期名(3字符)
Dy     缩写混合大小写日期名(3字符)
dy     缩写小写日期名(3字符)
DDD     一年里的日子(001-366)
DD     一个月里的日子(01-31)
D     一周里的日子(1-7;SUN=1)
W     一个月里的周数
WW     一年里的周数
CC     世纪(2 位)
J     Julian 日期(自公元前4712年1月1日来的日期)
Q     季度
RM     罗马数字的月份(I-XII;I=JAN)-大写
rm     罗马数字的月份(I-XII;I=JAN)-小写

精彩SQL语句

1、oracle求每月第一天和最后一天

SELECT Trunc(Trunc(SYSDATE, 'MONTH') - 1, 'MONTH') First_Day_Last_Month,
 Trunc(SYSDATE, 'MONTH') - 1 / 86400 Last_Day_Last_Month,
 Trunc(SYSDATE, 'MONTH') First_Day_Cur_Month,
 LAST_DAY(Trunc(SYSDATE, 'MONTH')) + 1 - 1 / 86400 Last_Day_Cur_Month
FROM dual;

2、sql server对日期的常规处理

SELECT REPLACE(CONVERT(varchar(10),GETDATE(),120),N'-0','-')  短日期格式:yyyy-m-d
SELECT STUFF(STUFF(CONVERT(char(8),GETDATE(),112),5,0,N'年'),8,0,N'月')+N'日'  长日期格式:yyyy年mm月dd日 --A. 方法1
SELECT DATENAME(Year,GETDATE())+N'年'+DATENAME(Month,GETDATE())+N'月'+DATENAME(Day,GETDATE())+N'日'   长日期格式:yyyy年mm月dd日 --A. 方法2
SELECT DATENAME(Year,GETDATE())+N'年'+CAST(DATEPART(Month,GETDATE()) AS varchar)+N'月 '+DATENAME(Day,GETDATE())+N'日'  短日期格式:yyyy年m月d日
SELECT CONVERT(char(11),GETDATE(),120)+CONVERT(char(12),GETDATE(),114)  完整日期+时间格式:yyyy-mm-dd hh:mi:ss:mmm
Select CONVERT(varchar(100), GETDATE(), 8 ): 10:57:46
Select CONVERT(varchar(100), GETDATE(), 24): 10:57:47
Select CONVERT(varchar(100), GETDATE(), 108): 10:57:49
Select CONVERT(varchar(100), GETDATE(), 12): 060516
Select CONVERT(varchar(100), GETDATE(), 23): 2006-05-16 

3、oracle中400w条记录的表中随机删除20条记录

--使用for
declare
begin
     for c in (select * from (  select rowid rd from t2  order by dbms_random.value)m where rownum<=20)
      loop
        delete from t2 where rowid=c.rd;
      end loop;
  commit;
end;
--不使用for
declare abc number;
arid rowid;
cursor cursor_sal is
 select * from (select rowid rd from t2  order by dbms_random.value)m where rownum<=20;
begin
      open cursor_sal;
      loop
        fetch cursor_sal into arid;
         exit when cursor_sal%notfound;
        delete from t2 where rowid=arid;
      end loop;
      close cursor_sal;
  commit;
end;