• oracle 10g 免安装客户端在windows下配置


    Oracle 10G之后发布了instant client,这对于原来的安装客户端来说,真的是一大利好消息。
    下载地址可以到OTN上找一下。

    虽然是免安装,但是在环境配置上需要花不少的力气。比如path的修改,类似原来9i的注册表信息(有些应用程序需要使用)的导入等等
    下面的VBS代码完成以上所有的工作,你只需要另外做一件事,就是将tnsnames.ora与sqlnet.ora复制到同一个目录下面就可以了。

    经测试PB8.0可以使用,O84 Oracle8/8i (8.x.4+)、O90 Oracle9i (9.0.1);后台数据库9i 10G均可以运行。

    --------------------------------代码复制线-----------------------------------
    '
    ' oracle instant client 免安装环境设置脚本
    '*********************************************************************
    ' 默认为D:\oracle 如果不是请更改脚本
    ' BY:owen 2008-01-14
    ' QQ:123637765
    '**********************************************************************

    On Error Resume Next
    Dim oWshShell, sOldPath

    Const csPath="D:\oracle"
    '上面改为你需要添加的目录。 注意格式

    const csRegOracle = "HKLM\SOFTWARE\ORACLE\"

    Set oWshShell = WScript.CreateObject("WScript.Shell")

    '设置path
    sOldPath=oWshShell.RegRead("HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment\path")
    oWshShell.RegWrite "HKLM\SYSTEM\ControlSet001\Control\Session Manager\Environment\path", sOldPath+ ";" +csPath+";" , "REG_SZ"

    '增加两个环境变量
    oWshShell.Environment("system").Item("TNS_ADMIN")=csPath
    oWshShell.Environment("system").Item("NLS_LANG")="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"

    'oracle 注册表导入HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
    'HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE 先删除( 删除部分未完成) 后新建

    oWshShell.RegWrite csRegOracle
    oWshShell.RegWrite csRegOracle+"ORACLE_HOME",csPath
    oWshShell.RegWrite csRegOracle+"ORACLE_HOME_NAME" ,"OraHome"
    oWshShell.RegWrite csRegOracle+"NLS_LANG","SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
    oWshShell.RegWrite csRegOracle+"TNS_ADMIN",csPath

    oWshShell.RegWrite csRegOracle + "ALL_HOMES\"
    oWshShell.RegWrite csRegOracle + "ALL_HOMES\" + "HOME_COUNTER","1"
    oWshShell.RegWrite csRegOracle + "ALL_HOMES\" + "DEFAULT_HOME","OraHome"
    oWshShell.RegWrite csRegOracle + "ALL_HOMES\" + "LAST_HOME","0"

    oWshShell.RegWrite csRegOracle + "ALL_HOMES\"+"\ID0\"
    oWshShell.RegWrite csRegOracle + "ALL_HOMES\"+"\ID0\"+"NAME","OraHome"
    oWshShell.RegWrite csRegOracle + "ALL_HOMES\"+"\ID0\"+"PATH",csPath
    oWshShell.RegWrite csRegOracle + "ALL_HOMES\"+"\ID0\"+ "NLS_LANG","NA"

    oWshShell.RegWrite csRegOracle + "HOME0\"
    oWshShell.RegWrite csRegOracle + "HOME0\" + "ID","0"
    oWshShell.RegWrite csRegOracle + "HOME0\" + "ORACLE_GROUP_NAME" ,"Oracle - OraHome"
    oWshShell.RegWrite csRegOracle + "HOME0\" + "ORACLE_HOME_NAME","OraHome"
    oWshShell.RegWrite csRegOracle + "HOME0\" + "ORACLE_HOME",csPath
    oWshShell.RegWrite csRegOracle + "HOME0\" + "NLS_LANG","SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
    oWshShell.RegWrite csRegOracle + "HOME0\" + "ORACLE_HOME_KEY","Software\ORACLE\HOME0"


    Msgbox ( "已经成功设置ORACLE环境")

    --------------------------------代码复制线-----------------------------------
    将以上代码复制后另存成oracle.vbs 运行即可

  • 相关阅读:
    “猫癣”集团借IE7新漏洞再掀风浪 狼人:
    研究人员在黑帽安全大会演示SSL攻击 狼人:
    猫癣病毒“躲猫猫” 移师广东东莞月入百万 狼人:
    Adobe两款软件存在缺陷 黑客可控制用户PC 狼人:
    安全观点:遭遇数据泄露破坏 损失的不只是金钱 狼人:
    McAfee报告称七成手机制造商认为手机安全至关重要 狼人:
    微软表示本月将发布五个Windows 7更新 狼人:
    Gmail电子邮件曝全球性故障 谷歌向用户道歉 狼人:
    Google Talk被黑客利用 发动钓鱼攻击 狼人:
    谷歌GMail邮件服务出现故障 部分服务已恢复 狼人:
  • 原文地址:https://www.cnblogs.com/owenwong/p/1038971.html
Copyright © 2020-2023  润新知