当前位置:  编程技术>综合
本页文章导读:
    ▪流程控制语句(C#)      1.选择语句         1.1  if…else语句            if语句用于根据一个布尔表达式的值选择一条语句来执行,其基本格式如.........
    ▪fishcat论 RMAN还原归档日志时应注意       fishcat论 RMAN还原归档日志时应注意 1、先备份归档 RMAN> BACKUP 2> FORMAT '/backup/arch_%T_%s_%p' 3> SKIP INACCESSIBLE 4> ARCHIVELOG ALL DELETE INPUT; Starting backup at 09-JAN-13 current log archived using channel ORA_DISK.........
    ▪SharePoint 2013 在不同的环境中(开发环境,测试环境,生产环境)移植由SharePoint designer 2013 设计的List Workflow      本文讲述SharePoint 2013如何在不同的环境之间(开发环境,测试环境,生产环境)移植由SharePoint designer 2013 设计的List Workflow。 在SharePoint 2010和2007 中,如果针对某个List 使用 SharePoint designer设计一.........

[1]流程控制语句(C#)
    来源: 互联网  发布时间: 2013-11-10
1.选择语句

 

      1.1  if…else语句

           if语句用于根据一个布尔表达式的值选择一条语句来执行,其基本格式如下:

if (布尔表达式)

{

      [语句块]

}

        示例代码:

staticvoid Main(string[] args)           

{

   int i = 333;                        //声明一个int类型变量i 

   if (i > 998)                        //调用if语句判断i是否大于998

   {

      Console.WriteLine("i大于998");   //如果i大于998则输出“i大于998”

   }

   else                              //否则

   {

      Console.WriteLine("i不大于998"); //输出“i不大于998”

   }

   Console.ReadLine();

} 

            运行结果:

                                                   

           当然了,程序的条件判断式不止一个,可能需要一个嵌套式的if…else语句,也就是在if或else语句中的程序块中加入另一段if语句或者if…else语句。

      1.2  switch语句

            switch语句是多分支选择语句,它根据表达式的值来使程序从多个分支中选择一个用于执行的分支。基本格式为:

switch([表达式 ])

{

    case[常量表达式]:[语句块]

    break;

    case[常量表达式]:[语句块]

    break;

    …

    case[常量表达式]:[语句块]

    default:[语句块]

    break;

}

       示例代码:

staticvoid Main(string[] args)     

{

    string MyStr = "用一生下载你";

    switch (MyStr)

    {   

        //如果MyStr值是“用一生下载你”,就执行分支1

        case "用一生下载你":Console.WriteLine("用一生下载你"); break;

        //如果MyStr值是“一生所爱”,就执行分支2

        case "一生所爱": Console.WriteLine("一生所爱"); break;

        //如果MyStr值是“值都不符合以上分支内容,则执行default语句

        default : Console.WriteLine("无字符"); break;

     }

     Console.ReadLine();

     }   

          运行结果:

                       

2. 迭代语句

 

     2.1  while语句

             while语句用于根据条件值执行一条语句零次或多次,当每次while语句中德代码执行完毕时,将重新查看是否符合条件值,若符合则再次执行相同的代码,否则跳出while语句。

           示例代码:

staticvoid Main(string[] args)     

{

    int s = 0, num = 80;       //声明两个int类型变量并初始化

    while (s < num)          //调用while语句,当s小于num时执行

    {

        s++;                   //s自增1

        if (s >40)           //使用if语句判断s是否大于40

        {

            break ;         //如果大于40,则使用break语句终止循环

         }

        if (s %2==0)         //如果小于40,则调用if语句判断s是否为偶数

        {

                continue;        //如果结果又符合条件,则转到下一次循环

        }

        Console.WriteLine (s ); 

      }

      Console.ReadLine ();

        }   

            运行结果:

                         

        2.2  do…while语句

                do…while语句和while语句类似,不同的是它的判断条件在循环后。do…while循环会在计算条件表达式之前执行。

              示例代码:

staticvoid Main(string[] args)     

{

  bool term = false;       //声明一个bool类型变量term,并初始化为false

  int[] myArray = new int[5] { 0,1,2,3,4};   //声明一个int数组并初始化

  do                                 //调用do...while语句

  {                        

    for (int i = 0; i < myArray.Length; i++)//调用for语句输出数组中的所有数据

    {

       Console.WriteLine(myArray[i ]);    //输出数组中的数据

    }

  } while (term);                       //设置do...while语句的条件

  Console.ReadLine();

   }  

          运行结果:

                      

      2.3  for语句

            for语句用于计算一个初始化序列,然后当某个条件为真时,重复执行嵌套语句并计算一个迭代表达式序列。如果为假,则终止循环,退出for循环。

          示例代码:

static void Main(string[] args)
 {
     int[] myint = new int[5];       //声明一个具有5个元素的整型数组
     myint[0] = 0;                   //向数组中添加第一个元素
     myint[1] = 1;                   //向数组中添加第二个元素
     myint[2] = 2;                   //向数组中添加第三个元素
     myint[3] = 3;                   //向数组中添加第四个元素
     myint[4] = 4;                   //向数组中添加第五个元素
     for (int i = 0; i < myint.Length; i++)     //调用for循环语句
     {
         Console.WriteLine("myint[{0}]的值是:{1}",i ,myint [i]);  //输出结果
     }
     Console.ReadLine();
     }

        
                         

    
[2]fishcat论 RMAN还原归档日志时应注意
    来源: 互联网  发布时间: 2013-11-10


fishcat论 RMAN还原归档日志时应注意

1、先备份归档
RMAN> BACKUP
2> FORMAT '/backup/arch_%T_%s_%p'
3> SKIP INACCESSIBLE
4> ARCHIVELOG ALL DELETE INPUT;

Starting backup at 09-JAN-13
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=72 RECID=6 STAMP=804228455
input archived log thread=1 sequence=73 RECID=7 STAMP=804228639
input archived log thread=1 sequence=74 RECID=8 STAMP=804228749
channel ORA_DISK_1: starting piece 1 at 09-JAN-13
channel ORA_DISK_1: finished piece 1 at 09-JAN-13
piece handle=/backup/arch_20130109_6_1 tag=TAG20130109T045229 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/archive1/1_72_803945866.dbf RECID=6 STAMP=804228455
archived log file name=/archive1/1_73_803945866.dbf RECID=7 STAMP=804228639
archived log file name=/archive1/1_74_803945866.dbf RECID=8 STAMP=804228749
Finished backup at 09-JAN-13

2、上边看到备份了sequence72,73,74的归档文件然后还原72-74

RMAN> restore archivelog sequence between 72 and 74;

Starting restore at 09-JAN-13
using channel ORA_DISK_1

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=72
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=73
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=74
channel ORA_DISK_1: reading from backup piece /backup/arch_20130109_6_1
channel ORA_DISK_1: piece handle=/backup/arch_20130109_6_1 tag=TAG20130109T045229
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 09-JAN-13

3、再次备份归档

RMAN> BACKUP
2> FORMAT '/backup/arch_%T_%s_%p'
3> SKIP INACCESSIBLE
4> ARCHIVELOG ALL DELETE INPUT;

Starting backup at 09-JAN-13
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=72 RECID=11 STAMP=804228908
input archived log thread=1 sequence=73 RECID=9 STAMP=804228907
input archived log thread=1 sequence=74 RECID=10 STAMP=804228907
input archived log thread=1 sequence=75 RECID=12 STAMP=804228962
channel ORA_DISK_1: starting piece 1 at 09-JAN-13
channel ORA_DISK_1: finished piece 1 at 09-JAN-13
piece handle=/backup/arch_20130109_7_1 tag=TAG20130109T045602 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/archive1/1_72_803945866.dbf RECID=11 STAMP=804228908
archived log file name=/archive1/1_73_803945866.dbf RECID=9 STAMP=804228907
archived log file name=/archive1/1_74_803945866.dbf RECID=10 STAMP=804228907
archived log file name=/archive1/1_75_803945866.dbf RECID=12 STAMP=804228962
Finished backup at 09-JAN-13

4、上面又出现了72-74的备份,查看rman备份集,又现惊人一幕72-74有重复

RMAN> list backup of archivelog all;


List of Backup Sets
===================


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
6       27.90M     DISK        00:00:01     09-JAN-13     
        BP Key: 6   Status: AVAILABLE  Compressed: NO  Tag: TAG20130109T045229
        Piece Name: /backup/arch_20130109_6_1

  List of Archived Logs in backup set 6
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    72      585166     08-JAN-13 619196     09-JAN-13
  1    73      619196     09-JAN-13 619547     09-JAN-13
  1    74      619547     09-JAN-13 619601     09-JAN-13

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
7       27.91M     DISK        00:00:02     09-JAN-13     
        BP Key: 7   Status: AVAILABLE  Compressed: NO  Tag: TAG20130109T045602
        Piece Name: /backup/arch_20130109_7_1

  List of Archived Logs in backup set 7
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    72      585166     08-JAN-13 619196     09-JAN-13
  1    73      619196     09-JAN-13 619547     09-JAN-13
  1    74      619547     09-JAN-13 619601     09-JAN-13
  1    75      619601     09-JAN-13 619722     09-JAN-13

5、如果手动把还原的归档删除,那么在备份的时候会出现如下情况


RMAN> BACKUP
2> FORMAT '/backup/arch_%T_%s_%p'
3> SKIP INACCESSIBLE
4> ARCHIVELOG ALL DELETE INPUT;

Starting backup at 09-JAN-13
current log archived
using channel ORA_DISK_1
archived log /archive1/1_72_803945866.dbf not found or out of sync with catalog
skipping inaccessible file /archive1/1_72_803945866.dbf
archived log /archive1/1_73_803945866.dbf not found or out of sync with catalog
skipping inaccessible file /archive1/1_73_803945866.dbf
archived log /archive1/1_74_803945866.dbf not found or out of sync with catalog
skipping inaccessible file /archive1/1_74_803945866.dbf
RMAN-06061: WARNING: skipping archived log compromises recoverability
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=76 RECID=16 STAMP=804229192
channel ORA_DISK_1: starting piece 1 at 09-JAN-13
channel ORA_DISK_1: finished piece 1 at 09-JAN-13
piece handle=/backup/arch_20130109_8_1 tag=TAG20130109T045952 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/archive1/1_76_803945866.dbf RECID=16 STAMP=804229192
Finished backup at 09-JAN-13

备份语句中不加SKIP INACCESSIBLE则备份就会时失败

RMAN> BACKUP
2> FORMAT '/backup/arch_%T_%s_%p'
3> ARCHIVELOG ALL DELETE INPUT;

Starting backup at 09-JAN-13
current log archived
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 01/09/2013 05:00:17
RMAN-06059: expected archived log not found, loss of archived log compromises recoverability
ORA-19625: error identifying file /archive1/1_72_803945866.dbf
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3


6、遇到删除归档的情况就只能通过crosscheck archivelog处理了,处理后备份正常


RMAN> crosscheck archivelog all;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=41 device type=DISK
validation failed for archived log
archived log file name=/archive1/1_72_803945866.dbf RECID=15 STAMP=804229133
validation failed for archived log
archived log file name=/archive1/1_73_803945866.dbf RECID=13 STAMP=804229132
validation failed for archived log
archived log file name=/archive1/1_74_803945866.dbf RECID=14 STAMP=804229132
validation succeeded for archived log
archived log file name=/archive1/1_77_803945866.dbf RECID=17 STAMP=804229217
Crosschecked 4 objects


RMAN> delete expired archivelog all;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=41 device type=DISK
List of Archived Log Copies for database with db_unique_name C1
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
15   &

    
[3]SharePoint 2013 在不同的环境中(开发环境,测试环境,生产环境)移植由SharePoint designer 2013 设计的List Workflow
    来源: 互联网  发布时间: 2013-11-10

本文讲述SharePoint 2013如何在不同的环境之间(开发环境,测试环境,生产环境)移植由SharePoint designer 2013 设计的List Workflow。

在SharePoint 2010和2007 中,如果针对某个List 使用 SharePoint designer设计一个Workflow,通常我们有 三个环境(开发环境,测试环境,生产环境),但是我没办法把workflow 从开发环境移植到其他环境,需要在其他环境重复在 SharePoint designer设计该Workflow的步骤,也就是说至少要做三遍的重复劳动。

在SharePoint 2013里面就不需要这样了,只需要简单的几步就可以实现在各个环境中的移植。

但是因为SharePoint 2013环境中既可以 SharePoint 2010版本的工作流也可以运行SharePoint 2013版的新工作流, SharePoint 2010还是不能移植的,只有新建工作流时选择了平台为SharePoint 2013才移植:

但是SharePoint 2013安装好后默认是没有该选项的,需要安装配置Workflow Manager 1.0 ,如何安装配置Workflow Manager 1.0参考http://technet.microsoft.com/en-us/library/jj658588(v=office.15)。

以下步骤假设环境全部就绪:

 1. 新建一个列表(命名为ListA)用于帮定工作流

 2. 启动SharePoint designer 2013为ListA新建工作流,这里的例子是一个非常简单的工作流

3. 保存并发布该工作流

4.将该工作流另存为模板

5.另存成功的工作流模板在Site Asset中,将该模板导出到本地文件夹

6.将ListA另存为模板,并下载到本地文件夹

7.将ListA的模板上传到要迁移到的目标环境的对应网站的list template中

8. 在目标环境新建以ListA的模板为模板新建列表,同样要命名为ListA,和Site的相对路径要保持一致

9. 上传工作流模板Notification.wsp到目标环境的对应网站的solution 列表中

10. Active 该Solution 

11. 在Site Feature找到Notification workflow相关的Feature 并active 该feature.

注意8,9步的顺序不能弄反,否则会出现如下错误:

Unexpected       System.InvalidOperationException: System.ArgumentException: WSEventSourceGUID    at Microsoft.SharePoint.WorkflowServices.WorkflowSubscriptionStorageEventReceiver.ItemAdded(SPItemEventProperties properties)    at Microsoft.SharePoint.WorkflowServices.SPWorkflowPackageFeatureReceiver.FeatureActivated(SPFeatureReceiverProperties properties)     at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce)     at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce)     at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean fo...     5ba2f29b-0de2-c096-b988-1adcf27a6c6c
01/08/2013 10:24:13.46*               w3wp.exe (0x2894)                       0x2DC0 SharePoint Foundation                 Runtime                                       tkau       Unexpected       ...rce, Boolean fMarkOnly)     at Microsoft.SharePoint.SPFeatureCollection.AddInternalWithName(Guid featureId, Int32 compatibilityLevel, String featureName, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly, SPFeatureDefinitionScope featdefScope)     at Microsoft.SharePoint.WebControls.FeatureActivator.ActivateFeature(Guid featid, Int32 compatibilityLevel, SPFeatureDefinitionScope featdefScope)     at Microsoft.SharePoint.WebControls.FeatureActivatorItem.ToggleFeatureActivation()     at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 5ba2f29b-0de2-c096-b988-1adcf27a6c6c

 

 

 

作者:farawayplace613 发表于2013-1-8 21:21:23 原文链接
阅读:27 评论:0 查看评论

    
最新技术文章:
▪error while loading shared libraries的解決方法    ▪版本控制的极佳实践    ▪安装多个jdk,多个tomcat版本的冲突问题
▪简单选择排序算法    ▪国外 Android资源大集合 和个人学习android收藏    ▪.NET MVC 给loading数据加 ajax 等待loading效果
▪http代理工作原理(3)    ▪关注细节-TWaver Android    ▪Spring怎样把Bean实例暴露出来?
▪java写入excel2007的操作    ▪http代理工作原理(1)    ▪浅谈三层架构
▪http代理工作原理(2)    ▪解析三层架构……如何分层?    ▪linux PS命令
▪secureMRT Linux命令汉字出现乱码    ▪把C++类成员方法直接作为线程回调函数    ▪weak-and算法原理演示(wand)
▪53个要点提高PHP编程效率    ▪linux僵尸进程    ▪java 序列化到mysql数据库中
▪利用ndk编译ffmpeg    ▪活用CSS巧妙解决超长文本内容显示问题    ▪通过DBMS_RANDOM得到随机
▪CodeSmith 使用教程(8): CodeTemplate对象    ▪android4.0 进程回收机制    ▪仿天猫首页-产品分类
▪从Samples中入门IOS开发(四)------ 基于socket的...    ▪工作趣事 之 重装服务器后的网站不能正常访...    ▪java序列化学习笔记
▪Office 2010下VBA Addressof的应用    ▪一起来学ASP.NET Ajax(二)之初识ASP.NET Ajax    ▪更改CentOS yum 源为163的源
▪ORACLE 常用表达式    ▪记录一下,AS3反射功能的实现方法    ▪u盘文件系统问题
▪java设计模式-观察者模式初探    ▪MANIFEST.MF格式总结    ▪Android 4.2 Wifi Display核心分析 (一)
▪Perl 正则表达式 记忆方法    ▪.NET MVC 给loading数据加 ajax 等待laoding效果    ▪java 类之访问权限
▪extjs在myeclipse提示    ▪xml不提示问题    ▪Android应用程序运行的性能设计
▪sharepoint 2010 自定义列表启用版本记录控制 如...    ▪解决UIScrollView截获touch事件的一个极其简单有...    ▪Chain of Responsibility -- 责任链模式
▪运行skyeye缺少libbfd-2.18.50.0.2.20071001.so问题    ▪sharepoint 2010 使用sharepoint脚本STSNavigate方法实...    ▪让javascript显原型!
▪kohana基本安装配置    ▪MVVM开发模式实例解析    ▪sharepoint 2010 设置pdf文件在浏览器中访问
▪spring+hibernate+事务    ▪MyEclipse中文乱码,编码格式设置,文件编码格...    ▪struts+spring+hibernate用jquery实现数据分页异步加...
▪windows平台c++开发"麻烦"总结    ▪Android Wifi几点    ▪Myeclipse中JDBC连接池的配置
▪优化后的冒泡排序算法    ▪elasticsearch RESTful搜索引擎-(java jest 使用[入门])...    ▪MyEclipse下安装SVN插件SubEclipse的方法
▪100个windows平台C++开发错误之七编程    ▪串口转以太网模块WIZ140SR/WIZ145SR 数据手册(版...    ▪初识XML(三)Schema
▪Deep Copy VS Shallow Copy    ▪iphone游戏开发之cocos2d (七) 自定义精灵类,实...    ▪100个windows平台C++开发错误之八编程
▪C++程序的内存布局    ▪将不确定变为确定系列~Linq的批量操作靠的住...    ▪DIV始终保持在浏览器中央,兼容各浏览器版本
▪Activity生命周期管理之三——Stopping或者Restarti...    ▪《C语言参悟之旅》-读书笔记(八)    ▪C++函数参数小结
▪android Content Provider详解九    ▪简单的图片无缝滚动效果    ▪required artifact is missing.
▪c++编程风格----读书笔记(1)    ▪codeforces round 160    ▪【Visual C++】游戏开发笔记四十 浅墨DirectX教程...
▪【D3D11游戏编程】学习笔记十八:模板缓冲区...    ▪codeforces 70D 动态凸包    ▪c++编程风格----读书笔记(2)
▪Android窗口管理服务WindowManagerService计算Activity...    ▪keytool 错误: java.io.FileNotFoundException: MyAndroidKey....    ▪《HTTP权威指南》读书笔记---缓存
▪markdown    ▪[设计模式]总结    ▪网站用户行为分析在用户市场领域的应用
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,,E-mail:www_#163.com(请将#改为@)

浙ICP备11055608号-3