DOS 选择跳转实现、dos + bcp 双击导入和导出数据

DOS 选择跳转实现、dos + bcp 双击导入和导出数据

  • option.bat
@echo off
:Start2
cls
goto Start
:Start
title Frequently Used Websites
echo Please select a website from the list
echo with the corresponding key
echo --------------------------------------
echo [1] Google
echo [2] Wikipedia
echo [3] Facebook
echo [4] Youtube
echo [5] Yahoo
set input=
set /p input= Choice:
if "%input%" =="" goto N
if %input%==1 goto Z if NOT goto Start2
if %input%==2 goto X if NOT goto Start2
if %input%==3 goto C if NOT goto Start2
if %input%==4 goto V if NOT goto Start2
if %input%==5 goto B if NOT goto Start2
if %input% gtr 5 goto N

:Z
cls
echo You have selected Google
pause
start www.google.com
exit
:X
cls
echo You have selected Wikipedia
pause
start www.wikipedia.com
exit
:C
cls
echo You have selected Facebook
pause
start www.facebook.com
exit
:V
cls
echo You have selected Youtube
pause
start www.youtube.com
exit
:B
cls
echo You have selected Yahoo
pause
start www.Yahoo.com
exit
:N
cls
echo Invalid Selection! Try again
pause
goto :start2
  • Mantis0000225_ExportSalesOrder_Autosys.cmd
  • watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2FuZ3pocHdhbmc=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" >

@cls
@echo OFF
@set "endfix=%date:~,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%"
@SETLOCAL ENABLEEXTENSIONS
@SETLOCAL ENABLEDELAYEDEXPANSION
@echo ...
@echo VALIDATE ENVIRONMENT VARIABLES ...
rem +--------------------------------------------------------------------------+
rem | VALIDATE ENVIRONMENT VARIABLES                                           |
rem +--------------------------------------------------------------------------+

@set MSBACKUP=D:\SalesOrder_NEWDRM
@set MSLOG=D:\SalesOrder_NEWDRM
@set MSTMP=D:\SalesOrder_NEWDRM
@echo ...
@echo DECLARE ALL GLOBAL VARIABLES...
rem +--------------------------------------------------------------------------+
rem | DECLARE ALL GLOBAL VARIABLES.                                            |
rem +--------------------------------------------------------------------------+

@set FILENAME=SALESORDER
@set DB_USERNAME=DRMPOS
@set DB_PASSWORD=DRMPOS
@set TNS_ALIAS=DRMPROD
@set LOGFILE=%MSLOG%\%FILENAME%_%TNS_ALIAS%.log
@set DUMPFILE=%MSBACKUP%\%FILENAME%_%TNS_ALIAS%.dat
rem +--------------------------------------------------------------------------+
rem | WRITE EXPORT PARAMETER FILE.                                             |
rem +--------------------------------------------------------------------------+
@echo ...
@echo MOVE OLD EXPORT (DUMP) FILE....
rem +--------------------------------------------------------------------------+
rem | MOVE OLD EXPORT (DUMP) FILE.                                             |
rem +--------------------------------------------------------------------------+

@if exist "%DUMPFILE%.backup" (del /q "%DUMPFILE%.backup")

@if exist %DUMPFILE% (echo f|@xcopy /y   %DUMPFILE% %DUMPFILE%.backup)
@if exist %LOGFILE% (echo f|xcopy /y  %LOGFILE% "%LOGFILE%.%endfix%")
@if exist "%LOGFILE%.%endfix%" (echo f | xcopy /y  "%LOGFILE%.%endfix%" D:\SalesOrder_NEWDRM\logfile\&del /q "%LOGFILE%.%endfix%")
@if exist %LOGFILE% (del /q %LOGFILE%)
@echo ...
@echo PERFORM EXPORT...
rem +--------------------------------------------------------------------------+
rem | PERFORM EXPORT.                                                          |
rem +--------------------------------------------------------------------------+

rem exp parfile=%PARFILE%
@bcp " select * from drmpos.SALESORDER where orderdate >= convert(DATE,getdate()-10)" queryout %DUMPFILE% -T -c -t^| -d apoms -e %LOGFILE% 

@IF not EXIST %LOGFILE% GOTO end

@echo ...error occured
@echo SCAN THE EXPORT LOGFILE FOR ERRORS...
rem +--------------------------------------------------------------------------+
rem | SCAN THE EXPORT LOGFILE FOR ERRORS.                                      |
rem +--------------------------------------------------------------------------+
@echo ...
@echo Analyzing log file for errors...
@findstr /I /C:"Export terminated unsuccessfully" %LOGFILE%
@if errorlevel 1 (goto good1) else (goto exception)
:END
@echo ...
@echo finished WITHOUT errorlog
@exit /b 0
:good1
@echo ...
@echo Analyzing log file for MS-errors...
@findstr /I /C:"invalid" %LOGFILE%
@if errorlevel 1 (goto good2) else (goto exception)

:good2
@echo ...
@echo Analyzing log file for warnings...
@findstr /I /C:"error" %LOGFILE%
@if errorlevel 1 (goto good3) else (goto exception)

:good3
@echo ...
@echo Analyzing log file for warnings...
@findstr /I /C:"rows" %LOGFILE%
@if errorlevel 1 (cmd /c exit 0) else (goto exception)
@exit /b 0

:exception
@exit /b 1

  • Mantis0000227_ImportSalesOrder_Autosys.cmd
@cls
@echo OFF
@set "endfix=%date:~,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%"
@SETLOCAL ENABLEEXTENSIONS
@SETLOCAL ENABLEDELAYEDEXPANSION
@echo ...
@echo VALIDATE ENVIRONMENT VARIABLES ...
rem +--------------------------------------------------------------------------+
rem | VALIDATE ENVIRONMENT VARIABLES                                           |
rem +--------------------------------------------------------------------------+

@set MSBACKUP=D:\SalesOrder_NEWDRM
@set MSLOG=D:\SalesOrder_NEWDRM
@set MSTMP=D:\SalesOrder_NEWDRM
@echo ...
@echo DECLARE ALL GLOBAL VARIABLES...
rem +--------------------------------------------------------------------------+
rem | DECLARE ALL GLOBAL VARIABLES.                                            |
rem +--------------------------------------------------------------------------+

@set FILENAME=SALESORDER
@set DB_USERNAME=DRMPOS
@set DB_PASSWORD=DRMPOS
@set TNS_ALIAS=DRMPROD
@set LOGFILE=%MSLOG%\IMP_%FILENAME%_%TNS_ALIAS%.log
@set DUMPFILE=%MSBACKUP%\%FILENAME%_%TNS_ALIAS%.dat
rem +--------------------------------------------------------------------------+
rem | WRITE EXPORT PARAMETER FILE.                                             |
rem +--------------------------------------------------------------------------+
@echo ...
@echo MOVE OLD EXPORT (DUMP) FILE....
rem +--------------------------------------------------------------------------+
rem | MOVE OLD EXPORT (DUMP) FILE.                                             |
rem +--------------------------------------------------------------------------+

@if exist "%DUMPFILE%.backup" (del /q "%DUMPFILE%.backup")

@if exist %DUMPFILE% (echo f|@xcopy /y   %DUMPFILE% %DUMPFILE%.backup)
@if exist %LOGFILE% (echo f|xcopy /y  %LOGFILE% "%LOGFILE%.%endfix%")
@if exist "%LOGFILE%.%endfix%" (echo f | xcopy /y  "%LOGFILE%.%endfix%" D:\SalesOrder_NEWDRM\logfile\&del /q "%LOGFILE%.%endfix%")
@if exist %LOGFILE% (del /q %LOGFILE%)
@echo ...
@echo PERFORM EXPORT...
rem +--------------------------------------------------------------------------+
rem | PERFORM EXPORT.                                                          |
rem +--------------------------------------------------------------------------+

rem exp parfile=%PARFILE%
@bcp apoms.drmpos.SALESORDER in %DUMPFILE% -T -c -t^|  -e %LOGFILE% 

@IF not EXIST %LOGFILE% GOTO end

@echo ...error occured
@echo SCAN THE EXPORT LOGFILE FOR ERRORS...
rem +--------------------------------------------------------------------------+
rem | SCAN THE EXPORT LOGFILE FOR ERRORS.                                      |
rem +--------------------------------------------------------------------------+
@echo ...
@echo Analyzing log file for errors...
@findstr /I /C:"Export terminated unsuccessfully" %LOGFILE%
@if errorlevel 1 (goto good1) else (goto exception)
:END
@echo ...
@echo finished WITHOUT errorlog
@exit /b 0

echo ...
echo Analyzing log file for errors...
findstr /I /C:"Import terminated unsuccessfully" %LOGFILE%
if errorlevel 1 (goto good1) else (goto exception)

:good1
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"communication" %LOGFILE%
if errorlevel 1 (goto good2) else (goto exception)

:good2
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"errors" %LOGFILE%
if errorlevel 1 (goto good3) else (goto exception)

:good3
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"Snapshot" %LOGFILE%
if errorlevel 1 (goto good4) else (goto exception)

:good4
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"TNS" %LOGFILE%
if errorlevel 1 (goto good5) else (goto exception)

:good5
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"resource" %LOGFILE%
if errorlevel 1 (goto good6) else (goto exception)

:good6
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"deadlock" %LOGFILE%
if errorlevel 1 (goto good7) else (goto exception)

:good7
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"identifier" %LOGFILE%
if errorlevel 1 (goto good8) else (goto exception)

:good8
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"maximum" %LOGFILE%
if errorlevel 1 (goto good9) else (goto exception)

:good9
echo ...
echo Analyzing log file for ORA- errors...
findstr /I /C:"shutdown" %LOGFILE%
if errorlevel 1 (goto good10) else (goto exception)

:good10
echo ...
echo Analyzing log file for warnings...
findstr /I /C:"unable" %LOGFILE%
if errorlevel 1 (cmd /c exit 0) else (goto exception)

exit /b 0

:exception
exit /b 1

版权声明:本文博主原创文章,博客,未经同意不得转载。

时间: 2024-12-05 13:03:57

DOS 选择跳转实现、dos + bcp 双击导入和导出数据的相关文章

DOS 选项跳转实现、dos + bcp 双击导入导出数据

DOS 选项跳转实现.dos + bcp 双击导入导出数据 option.bat @echo off :Start2 cls goto Start :Start title Frequently Used Websites echo Please select a website from the list echo with the corresponding key echo -------------------------------------- echo [1] Google ech

大容量导入和导出数据 -- bcp实用工具

大容量导入和导出数据 -- bcp实用工具 作用 bcp 实用工具可以在SQL Server实例和用户指定格式的数据文件间大容量复制数据. 使用 bcp 实用工具可以将大量新行导入 SQL Server 表,或将表数据导出到数据文件. 除非与 queryout 选项一起使用,否则使用该实用工具不需要了解 Transact-SQL 知识. 若要将数据导入表中,必须使用为该表创建的格式文件,或者必须了解表的结构以及对于该表中的列有效的数据类型. 注意: 如果使用 bcp 备份数据,请创建一个格式化文

uitableView 选择跳转后 再跳回来 颜色不变 问题

今天遇见过这个问题  以前都没这方面需求所以没有遇见 今天遇见了 网上查了 没有查到 好吧 只能说自己的问题 但是 还好kai哥到 一句话就解决了 ! 就是在- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath中反选回来 如下代码: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(

BCP是SQL Server中负责导入导出数据的一个命令行工具

BCP是SQL Server中负责导入导出数据的一个命令行工具,它是基于DB-Library的,并且能以并行的方式高效地导入导出大批量的数据.BCP可以将数据库的表或视图直接导出,也能通过SELECT FROM语句对表或视图进行过滤后导出.在导入导出数据时,可以使用默认值或是使用一个格式文件将文件中的数据导入到数据库或将数据库中的数据导出到文件中. 下面将详细讨论如何利用BCP导入导出数据. 1. BCP的主要参数介绍 BCP共有四个动作可以选择. (1) 导入. 这个动作使用in命令完成,后面

案例:Oracle exp dmp文件存在坏块并损坏 使用CPFL跳过坏块并成功导入恢复

Oracle数据库exp导出dmp文件损坏存在坏块/corruption通过CPFL工具跳过dmp坏块进发导入 在有些情况下,大家都知道通过dul可以恢复损坏的dmp文件的表的数据,但是该方法有很多问题,特别是对很多数据类型的支持不够完美,比如lob,long raw类型等,而且还有可能恢复出来数据大量丢失,本人通过对dmp结构的分析,使用使用一些特殊的技巧方法,可以实现对于损坏的dmp文件,通过跳过异常坏块所在表,继续恢复后续表,从而最大程度减少损坏 1.创建Oracle测试表 SQL> co

SQL Server BCP 资料导入导出

SQL Server BCP 导入导出使用 Bcp 导出导入数据高效,比使用SQL Server Management Stdio 提供的数据库导出导入要高效因为sql server 也没有提供提供类似oracle的expdp和impdp的工具,如果用SQL Server Management Stdio提供的导入导出对大表数据进行迁移速度太慢了 Bcp 导出数据高效比较适用于大表数据的迁移 进入doc命令行输入bcp命令,就弹出bcp命令的帮助信息: C:\Users\wangwei>bcp

WPF DataGrid 双击行 获得绑定数据

原文:WPF DataGrid 双击行 获得绑定数据 1)增加事件 2)增加对象获取 1)事件代码 Datagrid 增加事件 MouseDoubleClick="dataGrid_MouseDoubleClick" private void dataGrid_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e) { DataGrid datagrid = sender as DataG

DOS命令基础,包涵DOS库说明书

20种常用的DOS命令小结 作者: 字体:[增加 减小] 类型:转载 DOS命令总共大约有一百个(包括文本编辑.查杀病毒.配置文件.批处理等),我们这里详细介绍二十个常用的DOS命令 先介绍一下通配符的概念. 通配符*和? *表示一个字符串 ?只代表一个字符 注意通配符只能通配文件名或扩展名,不能全都表示.例如我们要查找以字母y开头的所有文件,可以输入以下命令:dir y*.*:如果要查找所有扩展名为exe的文件,可以用dir .exe.?只代表一个字符,例如我要查找第二个字母为s的所有文件,可

struts2 CVE-2014-0050(DoS), CVE-2014-0094(ClassLoader manipulation) S2-20 DoS attacks and ClassLoader manipulation

catalog 1. Description 2. Effected Scope 3. Exploit Analysis 4. Principle Of Vulnerability 5. Patch Fix 1. Description 0x1: 相关基础知识 Object是java的基础类,所有的class生成的对象,都会继承Object的所有属性和方法,因此当前action无论是什么代码,必须有Object自带的getClass方法,这个方法会返回一个Class对象,Class对象又一定会有