[20180222]改变oracle执行时的参数0.txt

简介: [20180222]改变oracle执行时的参数0.txt --//春节放假,看了链接https://blog.dbi-services.com/server-process-name-in-postgres-and-oracle/ --//里面提到postgres数据库可以显示执行时参数,作者想到oracle如何修改参数0.

[20180222]改变oracle执行时的参数0.txt

--//春节放假,看了链接https://blog.dbi-services.com/server-process-name-in-postgres-and-oracle/
--//里面提到postgres数据库可以显示执行时参数,作者想到oracle如何修改参数0.真心佩服这家伙Franck Pachot 的技术功底.
--//里面提到使用top,ps 显示参数的方法:例子:
# top -c -U oracle
$ ps -u oracle -o pid,comm,cmd,args

--//但是我一直认为oracle连接无法改变的参数显示,实际上作者给出了例子,我仅仅重复测试:
sqlplus scott/book@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.78)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=book)))
sqlplus scott/book@(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))(CONNECT_DATA=(SERVER=DEDICATED)(SID=book)(SERVICE_NAME=book)))

--//以上两个方式都可以连接数据库,但是加入(ARGV0=aaaa)无效.

1.环境:
SCOTT@book> @ &r/ver1

PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

2.测试bed连接方式:
sqlplus scott/book@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.78)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=book)))
sqlplus scott/book@(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))(CONNECT_DATA=(SERVER=DEDICATED)(SID=book)(SERVICE_NAME=book)))

sqlplus scott/book@"(DESCRIPTION=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oraclebook)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')(ENVS='ORACLE_SID=book,ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1')))"
sqlplus scott/book@"(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oraclebook)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')(ENVS='ORACLE_SID=book,ORACLE_HOME=$ORACLE_HOME'))"

--//4个都可以,另外说明一下使用bed链接不用引号出现如下错误ora-12547:
$ rlwrap sqlplus   scott/book@(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=testtest)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')(ENVS='ORACLE_SID=book,ORACLE_HOME=$ORACLE_HOME'))
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 22 09:06:14 2018
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
ERROR:
ORA-12547: TNS:lost contact

$ oerr ora 12547
12547, 00000, "TNS:lost contact"
// *Cause: Partner has unexpectedly gone away, usually during process
// startup.
// *Action: Investigate partner application for abnormal termination. On an
// Interchange, this can happen if the machine is overloaded.

--//不知道为什么?

$ rlwrap sqlplus scott/book@"(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oraclebook)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')(ENVS='ORACLE_SID=book,ORACLE_HOME=$ORACLE_HOME'))"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 22 08:54:21 2018
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

string beginning "'SCOTT@(AD..." is too long. maximum size is 50 characters.
SQL> show user;
USER is "SCOTT"

--//实际上已经连上,至于报这个错误,我在链接blog.itpub.net/267265/viewspace-2140401/上有说明,不过这里没有服务名大小写问题.不知道那里有出现错误.

$ rlwrap sqlplus   "scott/book@(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=testtest)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')(ENVS='ORACLE_SID=book,ORACLE_HOME=$ORACLE_HOME'))"

SQL> host ps -u oracle -o pid,comm,cmd,args | grep testtes[t]
33906 rlwrap          rlwrap sqlplus -L scott/boo rlwrap sqlplus -L scott/book@(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=testtest)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')(ENVS='ORACLE_SID=book,ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1'))
33909 oracle          testtest (DESCRIPTION=(LOCA testtest (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))

---//修改参数开头testtest.

$ rlwrap sqlplus scott/book@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.78)(PORT=1521)(ARGV0=testtest))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=book)))
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 22 09:10:30 2018
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SCOTT@book> host ps -u oracle -o pid,comm,cmd,args | grep testtes[t]
33971 rlwrap          rlwrap sqlplus scott/book@( rlwrap sqlplus scott/book@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.78)(PORT=1521)(ARGV0=testtest))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=book)))

--//这样不行.

3.测试远程连接如何修改:

--//The remote connection can have the name changed from the static registration, adding an ARVG0 value on the listener side:
--//修改监听配置:
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
#      (ADDRESS = (PROTOCOL = TCP)(HOST = gxqyydg4)(PORT = 1521))
#      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
#      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.78)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
  )
)

--//再次佩服这家伙技术功底,主机IP写入0.0.0.0就是表示在全部接口上接听.
--//再加入服务如下:
SID_LIST_LISTENER =
   (SID_LIST =
    (SID_DESC =
      (SDU=32767)
      (GLOBAL_DBNAME = book)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0.4/dbhome_1)
      (SID_NAME=book)
      )
    (SID_DESC =
      (SDU=32767)
      (GLOBAL_DBNAME = book123)
      (ARGV0=myapp0)
~~~~~~~~~~~~~~~~~~     
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0.4/dbhome_1)
      (SID_NAME=book)
      )
    )


$ sqlplus scott/book@192.168.100.78:1521/book123

SCOTT@192.168.100.78:1521/book123> host ps -u oracle -o pid,comm,cmd,args | grep myap[p]
34274 oracle          myapp0 (DESCRIPTION=(LOCAL= myapp0 (DESCRIPTION=(LOCAL=NO)(SDU=32767))

--//我的测试好像仅仅配置静态监听可以实现.

目录
相关文章
|
SQL 运维 Oracle
Oracle 超时设置2:设置实例级参数
Oracle超时设置系列的第二篇文章,设置实例级参数
594 0
|
8天前
|
Oracle 关系型数据库 数据库
【赵渝强老师】Oracle的参数文件与告警日志文件
本文介绍了Oracle数据库的参数文件和告警日志文件。参数文件分为初始化参数文件(PFile)和服务器端参数文件(SPFile),在数据库启动时读取并分配资源。告警日志文件记录了数据库的重要活动、错误和警告信息,帮助诊断问题。文中还提供了相关视频讲解和示例代码。
|
6月前
|
Oracle 关系型数据库 Java
Oracle 19c 查看隐含参数视图
Oracle 19c 查看隐含参数视图
101 7
|
6月前
|
SQL 监控 Oracle
Oracle 性能优化之AWR、ASH和ADDM(含报告生成和参数解读)
Oracle 性能优化之AWR、ASH和ADDM(含报告生成和参数解读)
|
6月前
|
运维 Oracle 关系型数据库
Oracle服务器参数文件:数据王国的“调控大师”
【4月更文挑战第19天】Oracle服务器参数文件,数据库的“调控大师”,掌控着内存管理、进程调度等关键设置。通过参数调整如SGA_MAX_SIZE和PROCESSES,实现性能优化和故障防控。虽然挑战重重,但成功的性能调优带来无尽成就感。它在备份恢复中也扮演重要角色,保障数据一致性与可用性。成为真正的“调控大师”,为数据王国效力!
|
6月前
|
存储 SQL Oracle
【Oracle】玩转Oracle数据库(二):体系结构、存储结构与各类参数
【Oracle】玩转Oracle数据库(二):体系结构、存储结构与各类参数
111 7
|
6月前
修改oracle11g的awr快照参数
修改oracle11g的awr快照参数
46 0
|
6月前
|
SQL Oracle 关系型数据库
oracle查询数据库参数sql语句
oracle查询数据库参数sql语句
|
6月前
|
SQL Oracle 关系型数据库
Oracle - Spool导出数据到TXT文件
Oracle - Spool导出数据到TXT文件
109 0