Oracle 11g彻底卸载重装

1.关闭所有的服务。可以在windows的服务管理器中关闭:  
  一般有以下服务:
  (1)Oracle SID VSS Writer Service:Oracle对VSS的支持服务。(非必须启动)
  (2)OracleDBConsole+SID:Oracle控制台服务,即企业管理器(OEM)。(非必须启动)
  (3)OracleJobScheduler+SID:Oracle定时器服务。(非必须启动)
  (4)OracleMTRecoveryService:该服务允许数据库充当一个微软事务服务器、COM/COM+对象和分布式环境下的事务资源管理器。
  (5)OracleOraDb11g_home1ClrAgent:Oracle数据库.NET扩展服务的一部分。
  (6)OracleOraDb11g_home1TNSListener+ListenerInstance:该服务是服务器端为客户端提供的监听服务,只有该服务启动,客户端才能连接到服务器。该服务接收客户端请求,将请求传递给服务器。(必须启动)
  (7)OracleService+SID:数据库服务(数据库实例),是Oracle核心服务该服务,是数据库启动的基础, 只有该服务启动,Oracle数据库才能正常启动。(必须启动)

  服务的启动及停止顺序:
Start Oracle 11g Service
@echo off
echo 确定要启动Oracle 11g服务吗?
pause
net start OracleOraDb11g_home1TNSListener
net start OracleServiceSID
net start OracleDBConsoleSID
echo 启动Oracle 11g服务完成。
Pause
Stop Oracle 11g Service
@echo off
echo 确定要停止Oracle 11g服务吗?
pause
net stop OracleDBConsoleSID
net stop OracleServiceSID
net stop OracleOraDb11g_home1TNSListener
echo 停止Oracle 11g服务完成,请确认有没有错误发生。
Pause

2.开始->程序->[Oracle目录]->Oracle Installation Products->Universal Installer
  卸装所有Oracle产品,但Universal Installer本身不能被删除。

3.打开注册表:regedit,打开路径:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\   
  删除该路径下的所有以oracle开始的服务名称,这个键是标识Oracle在windows下注册的各种服务!   

4.打开注册表:regedit,打开路径:HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\
  删除该oracle目录,该目录下注册着Oracle数据库的软件安装信息。   

5.删除注册的oracle事件日志,打开注册表:regedit,打开路径:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\
  删除注册表的以oracle开头的所有项目。   

6.删除环境变量Oracle_Base、Oracle_Home、Oracle_SID、path中关于oracle的内容。 
  鼠标右键单击“我的电脑–>属性–>高级–>环境变量–>path变量。  
  删除Oracle在该值中的内容。注意:path中记录着一堆操作系统的目录,在windows中各个目录之间使用分号(;)隔开的,删除时注意。 
  建议:删除path环境变量中关于Oracle的值时,将该值全部拷贝到文本编辑器中,找到对应的Oracle的值,删除后,再拷贝修改的串,粘贴到path环境变量中,这样相对而言比较安全。 

7.重新启动操作系统。  
  以上1~6个步骤操作完毕后,重新启动操作系统。   

8.重启操作系统后各种Oracle相关的进程都不会加载了。这时删除Oracle_Home下的所有数据。(Oracle_Home指Oracle程序的安装目录)   

9.删除C:\Program Files下oracle目录。(该目录视Oracle安装所在路径而定)  

10.删除开始菜单下oracle项,不同的安装这个目录稍有不同。  
 
11.从Windows目录下删除以下文件ORACLE.INI、oradim73.INI、oradim80.INI、oraodbc.ini等等。

12.WIN.INI文件中若有[ORACLE]的标记段,删除该段。

13.如有必要,删除所有Oracle相关的ODBC的DSN。

14.在事件查看器中,删除Oracle相关的日志。
  

至此,Windows平台下Oracle就彻底卸载了。


via http://www.cnblogs.com/Jinge/archive/2012/08/06/2624957.html

标签为 | 留下评论

Oracle OraOLEDB错误解释

最近需要将以前的老代码(+)环境配置起来。过程中又碰到了很多OraOLEDB的问题。

Server.CreateObject 失败

以前连接oracle 10g,用的以下代码,那是09年的事情了。手头没有oracle 10g win32安装包。oracle今日(2013年)也不再提供10g下载了。只有下载了11g。win32,win64两个都下载了。打开网页报错:

Server 对象 错误 'ASP 0177 : 800401f3' 

Server.CreateObject 失败 

/conn.asp,行 5 

800401f3 

以下是代码:

ConnectStr="Provider=OraOLEDB.Oracle.1;Data Source=orcl;User ID=test;Password=123"
set Conn = server.createobject("myCls.Login")
Conn.open connectstr

经过多次尝试,修改为以下object字符串搞定:

set Conn = server.createobject("adodb.connection")

ORA-12541: TNS: 无监听程序

报错信息:

OraOLEDB 错误 '80004005' 

ORA-12541: TNS: 无监听程序 

/conn.asp,行 9 

这个是因为没有打开Oracle监听程序(OracleOraDb11g_home1TNSListener)造成。

TNS: 监听程序无法分发客户机连接

OraOLEDB 错误 '80004005' 

ORA-12518: TNS: 监听程序无法分发客户机连接 

/conn.asp,行 9 


OracleOraDb11g_home1TNSListener服务开启了,但是OracleServiceORCL没有开启

invalid username/password; logon denied

OraOLEDB 错误 '80004005' 

ORA-01017: invalid username/password; logon denied 

/conn.asp,行 9 

登录用户名或密码错误,要么是无此用户,要么是密码错误。

表或视图不存在

OraOLEDB 错误 '80004005' 

ORA-00942: 表或视图不存在 

/login.asp,行 40 

没有找到table or view

标签为 , | 留下评论

重置Oracle 11g密码(Windows平台)

  1. 删除文件“D:\\product\11.2.0\dbhome_1\database\PWDorcl.ORA”(假设数据库实例名字为orcl,oracle家目录为D:\oracle)。
    如果不首先删除此文件,就运行第2点里面的orapwd命令会报错:OPW-00005: 存在同名文件 – 请删除或重命名
  2. cmd下运行:orapwd.exe file=D:/oracle/product/11.2.0/Dbhome_1/database/PWDorcl.ORA password=<YourNewPassWord>;
标签为 | 留下评论

CreateRemoteThread 返回 ERROR_ACCESS_DENIED (5) 访问拒绝错误

Question

本地测试一个远程DLL注入的例子。发现注入系统默认的notepad.exe失败。

单步调试到这句:

HANDLE hRemoteThread = CreateRemoteThread(hProcess,0, 0,(DWORD(__stdcall *)( void *))GetProcAddress(hKernel32,"LoadLibraryA"),pTargetArg, 0, &dwThreadID);
if(hRemoteThread == NULL)
{
	dwErr = GetLastError();
	break;
}

dwErr是5(ERROR_ACCESS_DENIED )。

Solution

原因是本机是Windows 7 x64系统。Win+R输入notepad运行的是C:\Windows\System32\notepad.exe,这个路径下的binary是x64平台的。运行C:\Windows\SysWow64\notepad.exe x86平台的exe注入成功。

由此可知,32bit exe注入64bit exe肯定失败。至于64bit exe注入32bit exe没有测试,估计应该不行。


留下评论

Error MSB6006: “mt.exe”已退出,代码为 31。

2010 with installed service pack 1 (Windows & 64 bit )

During Release builds for no obvioud reason random errors:

error MSB6006: “mt.exe” exited with code 31.

Disabling antivirus seems fixing the problem.
Debug builds (NO optimization?) seems are not affected.

Antivirus: Symantec Endpoint Protection.

解决:

project options -> linker -> manifest -> Generate Manifest-> NO.
项目->属性->链接器->清单文件->生成清单  改为 “否”

But I do not know why.
If anybody knows please tell me.


参考:http://connect.microsoft.com/VisualStudio/feedback/details/682867/error-msb6006-mt-exe-exited-with-code-31

标签为 | 留下评论

fatal error C1010: unexpected end of file while looking for precompiled header directive

问题

某项目中加入一个别人写好的类,叫做 netadapter。 netadapter有两个文件 netadapter.h 和 netadapter.cpp 。 将netadapter.h在stdafx.h预编译头文件中包含。编译出错:netadapter.cpp(384) : fatal error C1010: unexpected end of file while looking for precompiled header directive。

原因

一般情况下。netadapter.cpp的类声明放在netadapter.h,所以 netadapter.cpp #include了netadapter.h。但是此时的情况是netadapter.h已经在stdafx.h中包含。编译器在netadapter.cpp中没有查找到预编译头文件指令。其实预编译头文件指令就是:#include <stdafx.h>

解决

在netdapter.cpp的首行加入#include <stdafx.h>,再编译一次,通过!如果我们将 #include “netadapter.h”注释掉,同样编译通过了!

PS:网上有些朋友的做法是不使用预编译头文件(PCH)。这个可以起作用。不过没有了PCH,每次编译都比较耗时!!

标签为 | 留下评论

identifier was truncated to ’255′ characters in the debug information

问题

VC项目加入了头文件<vector>出现如下报错:

D:\vs6\VC98\INCLUDE\vector(60) : warning C4786: 'std::vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::all
ocator<unsigned short> > > >::~vector<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >,std::allocator<std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> 
> > >' : identifier was truncated to '255' characters in the debug information

原因

这些警告的意思是,某些标识符太长了,超过255个字符, 在debug显示的时候会被截断。 这个警告没办法解决的, 所以就不要在意了。VC6对STL的一些不完全支持造成。这是因为VC6对新标准支持力度不够,STL中的map等等的实现中名字过长,被VC6截断了.就是说因为用了模板库导致标识符过长,VC就出了警告。这可以看做是VC的一个BUG。


解决方法

为在源文件头部加入一下预编译代码

#ifdef WIN32
#pragma warning (disable: 4514 4083 4786)
#endif

这样可以关掉这个warning(当然这只是让他不显示而已)。有些人说加上了以上忽略警告的代码。但是还是会报错。那是因为你#include了<veter>的头文件被#include到了stdafx.h预编译头文件当中。需要在stdafx.h头几行加上以上代码。

此警告貌似现在MSDN上有只有针对WINCE 5.0平台的解释。不过是一个意思。


Compiler Warning (level 1) C4786 (Windows CE 5.0)

Windows CE 5.0
identifier‘ : identifier was truncated to ‘number‘ characters in the debug information

The identifier string exceeded the maximum allowable length and was truncated.

The debugger cannot debug code with symbols longer than 255 characters. In the debugger, you cannot view, evaluate, update, or watch the truncated symbols.

This limitation can be overcome by shortening identifier names. The example code below demonstrates this method.

A trace mechanism can also be used to solve this problem. A trace mechanism is like the printf statements in the code. It keeps track of what is going on in an application during the debugging process.

The _ASSERT_ASSERTE_RPTn and _RPTFn macros provide concise and flexible ways to perform the trace. These macros are not defined when _DEBUG is not defined.

The example below demonstrates a situation that would cause this compiler warning to occur, and the solution to this problem.

 //sample1.cpp
 //In this program we have a class of a very long name.
 //We instantiate an object of that class type. We will
 //get multiple C4786 warnings. The comments below
 //demonstrate the solution to this problem.

 #define a_really_long_class_name 
a_really_really_really_really_really_really_really_really_really_really_
really_really_really_really_really_really_really_really_really_really_
really_really_really_really_really_really_really_really_really_really_
really_really_really_really//_really_long_class_name

 //SOLUTION: Uncomment the lines below

 //#ifdef _DEBUG
 //#define a_really_long_class_name A_SHORT_CLASS_NAME
 //#endif

 class a_really_long_class_name
 {
 public:
a_really_long_class_name() {};
int m_data;
 };

 void main()
 {
 a_really_long_class_name test_obj;
 test_obj.m_data = 12;
 }

The following example demonstrates that templates with some long class names as their parameters can easily exceed the 255 character limit. Solutions to the problem are also provided.

 //sample2.cpp
 //SOLUTION1: uncomment the next 4 lines
 //#ifdef _DEBUG
 //#define VeryLongClassNameA A
 //#define VeryLongClassNameB B
 //#endif

 //SOLUTION2: An alternative solution:
 //uncomment the next 3 lines.
 //#ifdef _DEBUG
 //#define SomeRandomClass SRC
 //#endif

 template <class A1, class A2, class A3, class A4>
 class VeryLongClassNameA{};

 template <class B1, class B2, class B3>
 class VeryLongClassNameB{};

 template <class C1, class C2>
 class VeryLongClassNameC{};

 template <class D1>
 class VeryLongClassNameD{};

 class SomeRandomClass{};

 typedef VeryLongClassNameD<SomeRandomClass> ClassD ;
 typedef VeryLongClassNameC<SomeRandomClass, ClassD> ClassC;
 typedef VeryLongClassNameB<SomeRandomClass, ClassC, ClassD> ClassB;
 typedef VeryLongClassNameA<SomeRandomClass, ClassB, ClassC, ClassD> ClassA;

 void SomeRandomFunction(ClassA aobj){}

 void main()
 {
ClassA AObj ;
SomeRandomFunction(AObj) ;
 }


标签为 | 留下评论

让WordPress插件Simple Tags 2.2支持中文支持没有空格tag的匹配

Simple Tags是功能强大的Tag插件。但是对中文支持欠佳。通过手动的修改一下代码,可以让它更完美的支持中文。

第一步,找到 \inc\class.client.autoterms.php 文件,在大约第100行,

将类似如下语句:

	if ( preg_match("/\b".$term."\b/i", $content) );

中的两个 \b 去掉,\b 在正则表达式中表示单词边界,但是中文跟英文不一样,字(单词)与字(单词)之间没有边界。即:

	if ( preg_match("/".$term."/i", $content) );

第二步,找到 \inc\class.client.autolinks.php 文件,在大约第160行,

将类似如下语句的行首添加双斜杠,将这两句话注释掉:

//$match = '/(\PL|\A)(' . preg_quote($term_name, "/") . ')(\PL|\Z)/u'.$case; 
//$substitute = '$1<a href="'.$term_link.'" class="st_tag internal_tag" '.$rel.' title="'. esc_attr( sprintf( __('Posts tagged with %s', 'simpletags'), $term_name ) )."\">$2</a>$3";

然后将紧跟在下面的原本被注释掉的语句启用,并去掉其中的两个 \b ,即:

$match = "/" . preg_quote($term_name, "/") . "/".$case;
$substitute = '<a href="'.$term_link.'" class="st_tag internal_tag" '.$rel.' title="'. esc_attr( sprintf( __('Posts tagged with %s', 'simpletags'), $term_name ) )."\">$0</a>";

好了,现在就OK了。

标签为 | 一条评论

修改Vmware Workstation虚拟机物理硬盘序列号ID

有些软件的注册机制是根据物理硬盘序列号来作为唯一的标识符。此序列号写在硬盘的固件里面。一般的方法是无法修改此序列号的。

如果需要无限试用软件可以让软件在虚拟机内运行。试用期到了之后修改硬盘物理序列号好可以继续试用。

修改方法:

用winhex打开-vmx.exe,如果是32位直接打开程序下的-vmx.exe,64位在x64目录下-vmx.exe。搜索:“00000000000000000001”(18位字符串,不是hex),这个是默认的硬盘序列号。修改为其他的,比如“00000000000000000002”,然后保存重新打开虚拟机。发现序列号已经发生改变。

修改Vmware Workstation虚拟机物理硬盘序列号ID
标签为 | 留下评论

关于LoadLibrary return 126 路径问题

假设有一个程序main.exe需要动态调用此程序的一个子目录subfolder1下的一个dll。命名为1.dll。然后1.dll动态调用了同级目录下的2.dll。

文件结构如下:

main.exe
subfolder1
├─1.dll
└─2.dll

那么1.dll用LoadLibrary指定DLL路径的时候需要加上subfolder1,不然报错126找不到指定模块。

LoadLibrary("2.dll") -> ×
LoadLibrary("subfolder\\2.dll") -> √
标签为 | 留下评论