find & vi
来源:互联网 发布:电力监控软件开发 编辑:程序博客网 时间:2024/05/23 12:26
After grid control sccessfully install on server db2 , I added listener1 using port 1821 and modified tnsnames.ora using the new listener.
then the repostory couldn't be connected , I then go to sysman log files and found many error saying it still using port 1521 .
lack of knowledge where the port number 1521 is stored in some config file (I knew there must be)
firstly I use find * -exec grep 1521 {} \;which I used alot in the past but this command didn't return the file name I needed.
then I baidued and find http://blog.csdn.net/duguduchong/article/details/7716908 by using find . | xargs grep -ri 1521 -l can return the file name which I want
in the command , -r means recursive -i means case insentive -l only print the find name
here I print the context of the file : emoms.properties after modify the port number the oms can be started
#Sun Apr 14 05:39:05 EDT 2013
oracle.sysman.emSDK.svlt.ConsoleServerName=db2.localdomain\:4889_Management_Service
oracle.sysman.eml.mntr.emdRepPwd=789991115e7f322a
emdrep.ping.pingCommand=/bin/ping -c 3 -w 30 <hostname>
em_oob_shutdown=false
LargeRepository=false
oracle.sysman.eml.mntr.emdRepPort=1821
em_email_address=
oracle.sysman.eml.mntr.emdRepPwdSeed=7595875322002216448
em_oob_crash=false
em.oms.dumpModules=omsThread,repos
oracle.sysman.emRep.dbConn.statementCacheSize=50
oracle.sysman.db.isqlplusUrl=%ISQLPLUS_PROTOCOL%\://%ISQLPLUS_HOST%\:%ISQLPLUS_PORT%/isqlplus/dynamic
em_oob_startup=false
oracle.sysman.emSDK.svlt.ConsoleServerPort=4889
em_from_email_address=_NOT_AVAILABLE_
oracle.sysman.eml.mntr.emdRepPwdEncrypted=TRUE
oracle.sysman.db.isqlplusWebDBAUrl=%ISQLPLUS_PROTOCOL%\://%ISQLPLUS_HOST%\:%ISQLPLUS_PORT%/isqlplus/dba/dynamic
oracle.sysman.emSDK.svlt.ConsoleServerHost=db2.localdomain
em_from_email_name=_NOT_AVAILABLE_
oracle.sysman.emSDK.svlt.ConsoleServerHTTPSPort=1159
em_email_gateway=
oracle.sysman.eml.mntr.emdRepServer=db2.localdomain
oracle.sysman.eml.mntr.emdRepSID=repdb
oracle.sysman.eml.mntr.emdRepConnectDescriptor=(DESCRIPTION\=(ADDRESS_LIST\=(ADDRESS\=(PROTOCOL\=TCP)(HOST\=db2.localdomain)(PORT\=1821)))(CONNECT_DATA\=(SID\=repdb)))
oracle.sysman.emkeyfile=/u01/oracle/OracleHomes/oms10g/sysman/config/emkey.ora
em.ip.ui.enable=true
oracle.sysman.eml.mntr.emdRepUser=sysman
oracle.sysman.emSDK.svlt.PublicServletEnabled=true
something is stupid for oracle still using the sid rather than service name .
[oracle@db2 config]$ find . | xargs grep -ri "1521" -l
./emoms.properties
./emoms.properties
[oracle@db2 config]$ find * -exec grep "1521" {} \;
oracle.sysman.eml.mntr.emdRepPort=1521
oracle.sysman.eml.mntr.emdRepConnectDescriptor=(DESCRIPTION\=(ADDRESS_LIST\=(ADDRESS\=(PROTOCOL\=TCP)(HOST\=db2.localdomain)(PORT\=1521)))(CONNECT_DATA\=(SID\=repdb)))
also the agent should be modified too , the key word 1521 is in agent10g/sysman/emd/targets.xml file.
an awk sample below
ps -fe | grep lsnr | grep -v "grep" | kill -9 `awk '{ print $2 }' `
awk ' patten { command } ' input
[oracle@db2 dbs]$ awk '/dest/' initdb.ora
background_dump_dest=/u01/oracle/admin/db/bdump
core_dump_dest=/u01/oracle/admin/db/cdump
user_dump_dest=/u01/oracle/admin/db/udump
audit_file_dest=/u01/oracle/admin/db/adump
#log_archive_dest_1='location=/u01/oracle/arch/db valid_for=(all_logfiles,all_roles) db_unique_name=db'
#log_archive_dest_2='service=db valid_for=(online_logfiles,primary_role) db_unique_name=db lgwr sync'
[oracle@db2 dbs]$ awk -F "=" '/dest/ {print $1}' initdb.ora
background_dump_dest
core_dump_dest
user_dump_dest
audit_file_dest
#log_archive_dest_1
#log_archive_dest_2
vi command
1) add a # in front of all lines below 34 : 34,$s/^/#/ -- add comment to tnsname.ora
2) goto line 34 : 34
3) delete all empty rows below line 34 :34,$s/^\n==g :g/^s*$/d
- find & vi
- bash:vi:command not find
- unix vi find chmod chown 命令使用方法
- linux 常用命令: find tar vi 中查找
- VI/VIM text editor 12 Powerful Find and Replace Examples
- 基本文件操作之常用命令和工具(vi、find)
- Vi / VIM: Find And Replace All Text Substitute Command
- 解决 linux 的 bash:vi:command not find
- 变量环境设置错误引起bash:vi:command not find
- VI
- vi
- vi
- vi
- vi
- vi
- VI
- vi
- vi
- 23种设计模式(8):观察者模式
- C/C++/mfc/vc++中怎样通过代码让你做的应用程序以管理员的身份安装执行
- 第五章 RANDRECT
- 矩阵裸题hdu 1757 A Simple Math Problem
- Q23 Q24 字符串操作的练习题
- find & vi
- js日期函数
- HDU 2553 N皇后问题(深搜)
- C++ STL 之 auto_ptr
- oracle /etc/sysctl.conf参数说明
- 【leetcode】Roman to Integer
- GCC指令详解
- 使用servlet,jsp网页编码错误
- SDFormatter(手机内存卡格式化修复工具) v4.0 中文免费版