Mac OS yosemite手动卸载db2 v10.1以及重新安装过程(不断更新中...)

Mac OS yosemite手动卸载db2 v10.1以及重新安装过程(不断更新中...)好不容易安装完 结果在 create sample 数据库的时候报错 bash 3 2 db2sampl Starting the DB2 instance Creating database SAMPLE Attempt to create the database SAMPLE failed

大家好,我是讯享网,很高兴认识大家。

好不容易安装完,结果在create sample数据库的时候报错……

bash-3.2$ db2sampl Starting the DB2 instance... Creating database "SAMPLE"... Attempt to create the database "SAMPLE" failed. SQL1032N No start database manager command was issued. SQLSTATE=57019 'db2sampl' processing complete.

讯享网

看来是安装db2没有安装正确,没办法,推倒重来吧。决定卸载db2数据库。结果输入./db2_deinstall命令一看,image都没找到……

讯享网huangs-mbp:expc Elsa$ ./db2_deinstall dyld: Library not loaded: /db2unix/db2galileo/db2_galileo_darwinport/darwin64/s/engn/lib/libdb2locale.dylib Referenced from: /Users/Elsa/Downloads/expc/db2/macos/install/../bin/db2langdir Reason: image not found dyld: Library not loaded: /db2unix/db2galileo/db2_galileo_darwinport/darwin64/s/engn/lib/libdb2locale.dylib Referenced from: /Users/Elsa/Downloads/expc/db2/macos/install/../bin/db2langdir Reason: image not found DBI1055E The message file db2install.cat cannot be found. Explanation: The message file required by this script is missing from the system; it may have been deleted or the database products may have been loaded incorrectly. User Response: Verify that the product option containing the message file is installed correctly. If there are verification errors; reinstall the product option.

第一步:卸载db2整个文件夹

看了一下当初安装的目录/opt/IBM/db2下面,发现有两个版V10.1和V9.5,然而我对后者一点印象都没有,难道说我在装其他应用比如notes或者sametime的时候系统偷偷地给我下了一个?不过我在linux操作系统上新装V10.1版本是没有这种情况的。不知道会不会有影响。不管了,都先删掉吧。到时候再看看。

cd /opt/IBM/db2 ls /opt/IBM/db2

回退到/opt/目录下面,然后输入必杀命令

讯享网rm -rf IBM/ //注释:此命令有风险,输入需谨慎

这样就删掉了整个db2的文件夹


第二步:卸载db2inst1用户

sh-3.2# su db2inst1 su: unknown login: db2inst1

找不到db2inst1,说明删除用户成功。


第三步:去把之前设置的path给屏蔽掉


讯享网

然后找到.bash_profile

讯享网vim ~/.bash_profile
#屏蔽掉之前配置的路径 #PATH=$PATH:/opt/IBM/db2/V10.1/bin #if [[ -f ~db2inst1/sqllib/db2profile ]] #then #source ~db2inst1/sqllib/db2profile #fi

真的这么顺利吗?我不信,按照我奇葩的从业经历,不整出点幺蛾子不是我的风格。接着重新安装看看。

又遇到类似的问题……使用非root权限输入./db2_install安装, 就会出错:

讯享网huangs-mbp:expc Elsa$ ./db2_install DBI1324W Support of the db2_install command is deprecated. For more information, see the DB2 Information Center. DBI1244I Directory for non-root installation of DB2 - /Users/Elsa/sqllib DBI1160I Non-root install is being performed. A major error occurred during the execution that caused this program to terminate prematurely. If the problem persists, contact your technical service representative. For more information see the DB2 installation log at "/tmp/db2_install_Elsa.log".

输入vi /tmp/db2_install_Elsa.log查看我的log发现:

ERROR: The user name specified is invalid.

但是我想用非root用户的权限安装,于是就输入./db2setup进行安装。
由于担心会出错。参考了以下这个方案修改了。
http://stackoverflow.com/questions//how-do-i-install-ibm-db2-express-c-on-mac-os-x-10-7-lion

修改了db2setup的只读权限为755,然后开始./db2setup run,依然跳出一个空白的java安装界面对话框。又绕回了java的问题。然并卵。

讯享网Huangs-MacBook-Pro:expc Elsa$ ./db2setup DBI1190I db2setup is preparing the DB2 Setup wizard which will guide you through the program setup process. Please wait. /Users/Elsa/Downloads/expc/db2/macos/install/db2setup: line 606: /tmp/db2_Elsa.tmp.11824/db2/macos/install/../java/jre/bin/java: No such file or directory DBI1160I Non-root install is being performed. You are using a Java(TM) Runtime Environment that has not been officially tested for use with DB2. This command will continue to execute, however if you experience problems, refer to the DB2 installation documentation for a list of supported environments. 

检查了一下我的jdk和jre版本都为最新的1.8.0_51:

Huangs-MacBook-Pro:Desktop Elsa$ javac -version javac 1.8.0_51 Huangs-MacBook-Pro:Desktop Elsa$ java -version java version "1.8.0_51" Java(TM) SE Runtime Environment (build 1.8.0_51-b16) Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode) Huangs-MacBook-Pro:Desktop Elsa$ which javac /usr/bin/javac Huangs-MacBook-Pro:Desktop Elsa$ which java /usr/bin/java

没办法,重来吧……用mac的system preference->users&groups的图形界面创建完db2inst1用户以后,在terminal输入以下命令创建:

讯享网Huangs-MacBook-Pro:instance Elsa$ sudo ./db2icrt -u db2inst1 db2inst1 DBI1446I The db2icrt command is running, please wait. DB2 installation is being initialized. Total number of tasks to be performed: 4 Total estimated time for all tasks to be performed: 309 second(s) Task #1 start Description: Setting default global profile registry variables Estimated time 1 second(s) Task #1 end  Task #2 start Description: Initializing instance list Estimated time 5 second(s) Task #2 end  Task #3 start Description: Configuring DB2 instances Estimated time 300 second(s) Task #3 end  Task #4 start Description: Updating global profile registry Estimated time 3 second(s) Task #4 end  The execution completed successfully. For more information see the DB2 installation log at "/tmp/db2icrt.log.52790". DBI1070I Program db2icrt completed successfully.

未完待续。。。

小讯
上一篇 2025-03-30 14:35
下一篇 2025-01-24 23:20

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/59133.html