lingo if函数软件如何将下图写作@for函数

英语流利说为个人、企业提供专业英语学习解决方案,使用方便、容易坚持、有效果。
黄祥飞·海航云商旗下嗨啦购运营总监
近几年人工智能+教育的布局势头渐涨,英语流利说作为业界先驱,发展尤其值得期待。
于红·纪源资本投资副总裁
英语流利说一直在专注探索英语教育新模式,真正打造出了极致的英语学习产品体验。
李晨·腾讯课堂高级产品经理
英语流利说的AI智能老师帮助我们公司的演员利用碎片化时间练习英语口语,让他们拥有了更加国际化的视野。
邹健·北京佟悦名新文化传媒有限公司副总经理
欢迎迈入智能学习时代,英语流利说邀你体验英语学习「黑科技」
和我们一起,用科技与创新,探索语言学习的无尽想象…
© 2017 上海流利说信息技术有限公司 |上篇讲述了如何安装Oracle Database 12c Release 2软件,以及其与老版本10g和11g的一些区别,这篇我们看看使用DBCA创建数据库的不同。
我们这里也是和上篇文章一样使用Xmanager作为图形界面管理程序,并且将图形界面映射到本地Windows界面上,运行dbca可执行程序后,可以启动数据库配置助手,如下所示:
我们要创建一个数据库,选择【Create a database】按钮
后续部分内容需要手工修改,这里选择高级配置,即【Advanced configuration】
我们这里是一个单实例数据库,下面的数据库模板,我们选择【General Purpose or Transaction Processing】
进入到数据库软件ORACLE_HOME的assistants/dbca/templates目录下,可以看到相应的模板配置文件,这里比老版本多了pdbseed.xml、pdbseed.dfb两个文件,即容器数据库的种子数据库模板数据库
查看数据库模板配置文件的内容如下,与其老版本区别不大,只是compatible的值为12.2.0较为醒目:
这里我们输入全局数据库名称和数据库实例名称hxdb,既然使用12.2版本的Oracle数据库,我们必然要创建容器数据库,这里如果不创建容器数据库,则和10g和11g版本的数据库一样,不具备容器、多租户等特性
我们这里暂时不创建插件数据库,后续我们手工创建
我们这里使用默认的存储选项
点击【File location variables】按钮,可以看到相关的配置,如DB_UNIQUE_NAME、DB_NAME等等。
这里我们不启用闪回和归档,后续再手工启用
和老版本相比,这里多了一个网络配置,如果之前配置了监听器,这里可以选择一个,并将该数据库实例注册到该监听器上,也可以通过下面的配置创建一个监听器,从12c之后开始,如果我们没有配置任何监听器,也可以使用lsnrctl start命令来创建一个默认的监听器,并且可以自动注册所有的数据库实例
这里我们同样不配置数据库钱包和安全标签功能,后续我们专题独立配置并详细讲解
内存配置,这里的显示比老版本都清晰,自动内存管理、自动共享内存管理和手动内存管理三种方式,都比老版本清晰明了,我们这里使用自动内存管理,并分配2GB内存
字符集设置界面中,已经默认为AL32UTF8,以前老版本都是使用操作系统的字符集,这里是更加人性化了
Enterprise Manager不进行配置
这里可以选择创建数据库之后运行的脚本,也可以将其保存位数据库模板,也可以生成数据库创建脚本
这里我们可以看看所有的初始化参数,如下所示,processes参数默认改为320了
也可以看到控制文件、数据文件和日志文件的路径和名称
数据库配置助手的汇总信息
开始了数据库创建的漫长过程…….
完成数据库创建后,我们可以修改密码
可以自定义用户密码,也可以解锁部分用户
完成数据库的创建后,可以使用sqlplus查看一下数据库实例和容器数据库
近一段时间,越来越多的客户都在使用Linux 7系列的Linux发行版,包括Redhat、CentOS、Oracle Linux等等,很多客户会咨询安装完成系统后,为了节省内存开销,是如何关闭图形界面,其实在Linux 7系列中比Linux 4、5、6麻烦了一些,因为Linux 7系列都是使用systemd的方式来管理服务和相应的功能,即使用systemctl命令来控制。原来老版本只需要修改/etc/inittab中配置的启动模式即可,但是在Linux 7系列中需要使用软连接的方式进行修改,详细步骤如下:
步骤一:如下界面时,我们使用ISO镜像安装好的Oracle Enterprise Linux 7.3,安装过程中我选择的是GUI模式,所以安装成功后,会看到如下界面
步骤二:我们使用root用户SSH到目标主机,查看系统启动模式配置文件,如下
/etc/systemd/system/default.target文件就是默认的主机启动模式配置文件,这里使用的是软连接的方式连接到graphical.target文件,即默认启动图形界面模式。
我们可以通过如下命令看到系统0-6不同级别对应不同的配置文件,2、3、4即是我们常用的字符界面管理模式,记得一定不要选择6哦,原因自行思考。
步骤三:备份原来的配置文件,将default.target软连接到multi-user.target文件中,当然我们也可以将原来的软连接删除,再新建
步骤四:重启操作系统后即可生效。
Oracle Database 12c Release 2已经发布一段时间了,一直没有时间进行测试,今天让我们来进行一次初试安装与建库吧,闲言少叙,直接使用Xmanager作为图形安装工具,12.2软件包下载后只有一个zip文件,感觉这个比11g要人性化一些,如下所示,大概3.3G。
还是老办法,使用Xmanager作为图形界面管理工具,将OUI安装程序的图形化界面重定向到自己的笔记本上,如下配置
直接运行安装文件夹中的runInstaller程序
经过大概几秒钟的等待,看到12c的安装界面,初看一下,和11g区别不大,首先还是建议使用MOS账号和密码
我们这里暂时不输入,点击【Yes】按钮即可
进入到安装类型界面,这里我们选择只安装软件,后续的监听和实例,我们再单独创建
在这里选择数据库安装类型,很显然,我们是一个单实例的数据库
软件安装后的磁盘空间占用较大,大概要7.5G,ORACLE真是越来越庞大了
对比一下10gR2、11gR2和12cR2,下面使用企业版10gR2占用1.5G
下面是企业版11gR2占用4.35G
下面是企业版12cR2占用7.5G
通过下图的对比,也可以很直观的发行,ORACLE数据库软件占用的磁盘空间在直线上升,预计在13cR2的时候,企业版和标准版都应该会达到10G以上
下面还是ORACLE_BASE和ORACLE_HOME的路径
下面是Oracle Inventory的目录
下面是各种不同的操作系统组,很明显,比11g多了备份恢复组、DG管理组、密钥管理组和集群管理组,默认都配置成dba组
安装前检查列表
一次性建议通过,我们这里使用的操作使用的Oracle Enterprise Linux 7.3,并且安装了oracle-database-server-12cR2-preinstall.x86_64组件,建议初学者也使用这个环境
可以将数据库软件安装响应文件进行保存,并用于后续的静默安装模式
漫长的安装开始了……
静悄悄的等待……
经过20多分钟的等待,终于看到了曙光
使用root用户执行orainstRoot.sh和root.sh,如下所示:
完成数据库12c Release 2软件的安装
在oracle用户的.bash_profile中配置ORACLE相关的环境变量,ORACLE_SID、ORACLE_BASE、ORACLE_HOME等,并且将ORACLE_HOME中的bin目录添加到PATH环境变量中,如下所示:
退出后,重新使用oracle用户登陆服务器,检查环境变量是否生效
使用sqlplus -v命令检查安装的ORACLE数据库的版本,如下所示:
支持12c Release 2单机版本的实验软件环境安装完毕,从安装过程来看,对比与11没有太多变化,更加说明ORACLE数据库的兼容性,不过比较明显的就是安装后软件占用的磁盘空间更加多了,不过也没关系,在这个磁盘越来越便宜的年代,也不算什么,再看一下ORACLE数据库的核心可执行文件,390M的可执行文件,可谓是相关牛X了吧
至此,Oracle Database 12c Release 2初体验完成,后续会带来更多更实用的数据库实战案例,祝君工作顺利!
本文基于Oracle网络服务,整理了如何使用SCAN、VIP、Service等来提供应用程序的连接高可用特性.
今日一个客户咨询我们,在他们的RAC环境下,有个节点重启后,部分程序连接中断,导致业务连续性的终止,大领导很不高兴,对其该负责人很是苦恼,于是我话了将近3个小时的时间讲解了Oracle数据库的网络服务、连接会话和RAC特性等等。基于此我们总结了此文章,来分析如何使用Oracle的网络服务来在RAC环境下提供高可用性,希望各位看客能有些收获。
Oracle网络服务是什么?
Oracle数据库的网络服务,即Oracle Net Service,它是在Oracle数据库环境下提供网络连接的基础组件,其主要有Oracle Net和Oracle Net Listener组成。Oracle Net在客户端和服务端提供基础运行库和环境,Oracle Net Listener运行在服务端,为客户端的连接请求提供服务。
Oracle Net Service提供多种配置工具和方法,如NETCA(Net Configuration Assistant)、NETMGR(Net Manager)、EM(Enterprise Manager)、配置文件等等。如下所示:
Oracle Net可以分为基础层和协议支持层。基础层负责在客户端应用程序和数据库服务器之间创建和维护连接,并且进行消息的交互。
在客户端,基础层接收客户端应用程序请求和解析数据库服务器的连通性;
在服务端,基础层执行客户端相同的工作,并且和监听器一起协调工作,接收传入的连接请求。
协议支持层将应用服务器的请求或数据传递转换成标准的工业协议,通过网络传递到服务器端,服务器端的协议支持层再将接受的数据转换成标准的数据提供给数据库服务器。其支持的工业标准:
?&TCP/IP(IPv4、IPv6)
?&SSL TCP/IP
?&命名管道(Named Pipes)
?&SDP(Sockets Direct Protocol)
Oracle Net Listener运行在数据库服务器端,用于接收客户端的连接请求。
1、在数据库服务端配置监听程序(在listener.ora文件中),在指定网络的指定端口进行监听,然后数据库实例通过静态或动态注册将服务注册到监听器上。
2、在应用程序客户端配置TNS连接字符串(在tnsnames.ora文件中),主要是要连接的IP地址、端口号,服务名称等。
3、用户程序调用Oracle Net组件连接远程的数据库监听程序。
4、监听程序认证通过后,在服务器端启动相应的前台服务进程。
5、服务端前台服务进程为特定用户提供相应的服务,如SQL执行处理等。
RAC中的网络服务
在Oracle RAC通过VIP的方式提供高可用性,其中VIP分为SCAN IP、节点VIP和HAIP等。SCAN是11gR2引入的一个非常重要的特性,通过它可以负载均衡地连接到集群数据库。它提供统一的名称来访问集群,不再需要像10g中那样在客户端配置多个VIP来进行连接,而是通过DNS或GNS服务器来解析SCAN名称,其对客户端是完全透明的,服务器端增删节点不影响客户端的任何配置。
SCAN监听器会连接多个本地监听器,客户端通过统一的连接字符串配置,只需要修改相应的DNS或GNS的解析配置即可完成应用程序的连接高可用性配置。
传统的客户端网络连接配置如下:
使用SCAN的客户端网络连接配置如下:
Oracle数据库的Service资源
Service资源时RAC高可用特性中非常重要的组成部分。Service是在服务端为用户连接进行控制和管理。应用程序通过Service资源固定连接到一个节点上,当此节点故障时,Service通过其特定功能,将连接转移到备用节点,确保可以保证客户端连接的高可用性,即Service提供了服务端的故障转移。在服务端配置高可用Service资源的步骤如下:
1、切换到oracle用户下,添加服务(因为Service要注册到实例中)
[root@node1 ~]# su – oracle
[DB-1]/home/oracle& srvctl add service -d hxdb -s hxsrv -r hxdb1 -a hxdb2 -P BASIC -y automatic -e SELECT -z 10 -w 300
其中配置参数说明如下:
-d &db_unique_name&:数据库名称
-s &service&:服务名称
-r “&preferred_list&”:首选节点列表
-a “&available_list&”:备用节点列表
-P {NONE | BASIC | PRECONNECT}:故障转移策略
-y (AUTOMATIC or MANUAL):故障是否自动切换
-e (NONE, SESSION, or SELECT):故障时对select的处理方式
-z &integer&:故障重试的次数
-w &integer&:故障延迟重试的时间
2、查看Service资源的状态
[DB-1]/home/oracle& srvctl status service -d hxdb
Service hxsrv is not running.
当前服务hxsrv没有运行
3、启动Service资源
[DB-1]/home/oracle& srvctl start service -d hxdb -s hxsrv
[DB-1]/home/oracle& srvctl status service -d hxdb
Service hxsrv is running on instance(s) hxdb1
使用start指令来启动hxsrv服务,可以看到该服务启动后,其运行在hxdb1上,因为首先节点为hxdb1
4、查看Service资源的详细信息
[DB-1]/home/oracle& srvctl config service -d hxdb -s hxsrv -a
Warning:-a option has been deprecated and will be ignored.
Service name: hxsrv
Service is enabled
Server pool: hxdb_hxsrv
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: SELECT
Failover method: NONE
TAF failover retries: 10
TAF failover delay: 300
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Preferred instances: hxdb1
Available instances: hxdb2
客户端的网络连接配置:
在客户端连接方式如下:
可以看到该会话连接到实例1上
当实例1故障后,如节点重启,上面的会话仍然依据运行,对客户端完全透明,故障切换后的连接会话信息如下:
可以看到上面的信息,INST_ID变为2,即原来连接实例1的客户端已经故障转移到实例2上,且FAILED_OVER显示为YES,即表示已经发生过故障转移。
1、Oracle 11gR2中通过Grid Plug and Play组件提供了高可用性连接的特性,其中包括SCAN、GNS、HAIP、Service等等;
2、SCAN用于实现节点间的负载均衡;
3、HAIP用于解决私有网络节点的高可用问题;
4、Service提供了服务端的故障转移和透明应用切换(TAF);
5、需要注意的是Oracle的JDBC不支持TAF,需要通过JDBC连接池来实现相应的功能;
Oracle RAC是一套单数据库多实例的共享设备资源的集群架构。Clusterware作为RAC的集群层的软件,提供了管理集群资源和协调各个节点的功能。Clusterware集群软件运行期间依赖很多磁盘文件:OCR(Oracle Cluster Register,即Oracle集群注册表)、Votedisk(表决磁盘)、以及11gR2之后新引入的OLR(Oracle Local Register,即Oracle本地注册表)。其中OCR和Votedisk必须存放到共享存储上,OLR存储在本地磁盘上。
本文我们着重说明表决磁盘在Oracle RAC中的作用及其管理方式。表决磁盘包含管理有关及其节点成员的重要信息,每个表决磁盘必须能被集群中的每个节点所访问,故表决磁盘必须存储到共享磁盘设备上。在11gR2之前表决磁盘和OCR可用存储在裸设备和文件系统上,从11gR2开始,表决磁盘和OCR都可以存储在ASM上,无论从性能、稳定和冗余保护方面,这都是值得推荐的,而且在Clusterware图形安装界面上已经不提供裸设备和文件系统形式的存储方式了,可见Oracle官方对ASM的重视程度。对于表决磁盘所在的ASM磁盘组,每个ASM磁盘分配1GB大小的空间就足够了。
表决磁盘概述
表决磁盘,Vote Disk,也称为表决文件Vote File,其存在是为了解决网络脑裂而产生的。Clusterware使用表决磁盘来决定哪些节点是属于集群的。表决磁盘的读写操作由ocssd进程来进行。
为了增强Clusterware的稳定性,官方建议在安装的时候配置多个表决磁盘。如果使用ASM作为表决磁盘的存储系统,建议使用Normal或者High磁盘组冗余模式:
?&在表决磁盘所在的ASM磁盘组为Normal模式时,至少要有3个故障组;
?&在表决磁盘所在的ASM磁盘组为High模式时,至少要有5个故障组;
如果使用External模式的ASM磁盘组,则所有的磁盘文件都只存在一份,在出现故障时,无法保障集群的稳定性。
如果在安装或运维中发现没有冗余问题,可以在线手工方式修改表决磁盘,但是任然建议使用3个或5个,最多支持15个表决磁盘。表决磁盘的个数最好为奇数个,因为在集群发生脑裂的情况下,投票算法能够很方面地计算出问题节点,并将其驱逐出集群。
表决磁盘的工作原理
Oracle RAC中的各个节点通过共享存储和私有网络来保存通信,如果私有网络出现问题,节点之间的通信就会收到影响,从而就会产生脑裂,此时,Clusterware就会通过共享存储上的表决磁盘来进行投票算法,提出投票数量少的节点。如果这个节点不能访问表决磁盘,则该节点就会自动离开集群。Clusterware在处理脑裂和表决磁盘故障的时候,一般都是使用重启主机来自动解决,通过重启主机来重新加入集群。
在RAC出现脑裂的时候,节点之间互相隔离是非常重要的,因为必须要保障数据的一致性。在Oracle的RAC环境中,Clusterware有自己的隔离保障机制,Database也有自己的隔离保障机制,通过这些机制,从而保障在节点出现脑裂的情况下,节点间能够安全稳定的隔离故障。为了提高这种问题的发生,通过我们会使用设备冗余的方式进行,如公共网络的网卡、私有网络的网卡、连接存储的HBA卡等等。
表决磁盘的备份与恢复
在11gR2之前的版本中,我们只能使用操作系统的dd命令来定期备份表决磁盘中的内容。从11gR2开始,可以不再使用dd命令来备份表决磁盘,而是使用自动的方式集群帮你来备份表决磁盘的数据。表决磁盘的任何配置的改变将自动备份,并且可以使用集群的crsctl工具来自动还原到相应的磁盘上。
集群脑裂的投票算法
集群中标号最小的节点称为reconfig manager(检查RM),在投票开始时,由RM向其他所有节点发送启动reconfig的信息,之后节点开始向RM发送该节点所能通信的成员列表(即为可通信的节点投票),RM检查是否发生脑裂,如果发生脑裂,则RM开始驱逐票数少的子集群节点,最后RM向剩余的节点发送最新的集群成员信息。
节点存活已经以下2种因素来决定:
1、拥有节点数量最多的子集群;
2、如果子集群节点数量相同,则标号最小的节点的子集群存活;
节点信息可以使用集群命令来查看:
对于ORA-00600错误,很多DBA和客户都会遇到,而且基本都是很头疼的问题,因为这个错误基本都是内容错误,如下:
ORA-00600: internal error code, arguments: [4194], [], [], [], [], [], [], [], [], [], [], []
上面的这个错误其实是一个关于undo的问题。但是当我们遇到这样的故障时,该如何处理呢?
Oracle对600错误的描述如下:
Errors of the form ORA-600 are called internal errors. This section clarifies the misunderstanding&of ORA-600s being synonymous with corruption.
An ORA-600 usually has up to five arguments associated with it which gives Oracle support and&developers more information about the error. The first argument of an ORA-600 indicates where&in the source code an unexpected condition was encountered.&The remaining arguments give&information about the variables and data being examined. An analyst can then determine if the&error was the result of some type of corruption.&
Oracle server source code is subdivided into about 13 different layers or modules,&each of which&is assigned a range of ORA-600 errors. Of these, only some ranges pertain directly to the types&of corruption described in this paper.
600错误描述
ORA-600的错误通常由5个参数,我们可以通过第一个参数来区分类型,Oracle数据库服务器将其分为13个不同layers 和 modules,分为如下两个大类:
(1)the first parameter is a number which reflects the source component or layer the error is connected with
(2)the first parameter is a mnemonic which indicates the source module where the error originated. This type of internal error is now used in preference to an internal error number.
内部错误分类的编号范围及其描述
Ora-600 Base
Functionality
Description
Service Layer
The service layer has within it a variety of service related components which are associated with in memory related activities in the SGA such as, for example : the management of Enqueues, System Parameters, System state objects (these objects track the use of structures in the SGA by Oracle server processes), etc.. In the main, this layer provides support to allow process communication and provides support for locking and the management of structures to support multiple user processes connecting and interacting within the SGA.
Note : vos – Virtual Operating System provides features to support the functionality above. As the name suggests it provides base functionality in much the same way as is provided by an Operating System.&
Ora-600 Base
Functionality
Description
Component notifier
System Parameters
System State object
Generic Linked List management
Instance Locks
User State object
Async Msgs
license Key
Instance Registration
I/O Services components
Cache Layer
Where errors are generated in this area, it is advisable to check whether the error is repeatable and whether the error is perhaps associated with recovery or
where this is the case and the error is repeatable, this may suggest some kind of hardware or physical issue with a data file, control file or log file. The Cache layer is responsible for making the changes to the underlying files and well as managing the related memory structures in the SGA.
Note : rcv&indicates recovery. It is important to remember that the Oracle cache layer is effectively going through the same code paths as used by the recovery mechanism.
Ora-600 Base
Functionality
Description
server/rcv
server/rcv
Control File mgmt
server/rcv
Misc (SCN etc.)
server/rcv
Buffer Instance Hash Table
server/rcv
Redo file component
server/rcv
server/rcv
Redo Application
server/cache
Buffer manager
server/rcv
Archival & media recovery component
server/rcv
recovery component
server/rcv
Thread component
server/rcv
Compatibility segment
It is important to consider when the error occurred and the context in which the error was generated. If the error does not reproduce, it may be an in memory issue.
Transaction Layer
Primarily the transaction layer is involved with maintaining structures associated with the management of transactions. As with the cache layer , problems encountered in this layer may indicate some kind of issue at a physical level. Thus it is important to try and repeat the same steps to see if the problem recurs.
Ora-600 Base
Functionality
Description
server/txn
Transaction Undo
server/txn
Transaction Undo
server/txn
Transaction Parallel
server/txn
Transaction List
space/spcmgmt
Transaction Segment
Transaction Control
distributed transaction control
Transaction Block
space/spcmgmt
Transaction Table
dict/rowcache
Query Row Cache
space/spcmgmt
Transaction Monitor
space/spcmgmt
Transaction Extent
It is important to try and determine what the object involved in any reproducible problem is. Then use the analyze command. For more information, please refer to the analyze command as detailed in the context of ; in addition, it may be worth using the dbverify as discussed in .
Data Layer
The data layer is responsible for maintaining and managing the data in the database tables and indexes. Issues in this area may indicate some kind of physical issue at the object level and therefore, it is important to try and isolate the object and then perform an anlayze on the object to validate its structure.
Ora-600 Base
Functionality
Description
ram/analyze
data, analyze command and index related activity
ram/object
lob related errors
general data access
index related
ram/object
general data access
Again, it is important to try and determine what the object involved in any reproducible problem is. Then use the analyze command. For more information, please refer to the analyze command as detailed in the context of ; in addition, it may be worth using the dbverify as discussed in .
User/Oracle Interface & SQL Layer Components
This layer governs the user interface with the Oracle server. Problems generated by this layer usually indicate : some kind of presentation or format error in the data received by the server, i.e. the client may have sent in or there is some kind of issue which indicates that the data is received out of sequence&
Ora-600 Base
Functionality
Description
progint/kpo&
progint/opi
lob related&
errors at interface level on server side, xa , etc.
progint/if
OCI interface to coordinating global transactions
sqlexec/rowsrc
table row source access
space/spcmgmt
operations associated with tablespace : alter / create / operations associated with create table / cluster
sqlexec/rowsrc
dictionary access routines associated with kernel compilation
kernel Index creation
sqllang/integ
constraint mechanism
progint/opi
archival and Media Recovery component
dict/sqlddl
alter table mechanism
security/audit
audit statement processing
objsupp/objdata
support for handling of object generation and object access
dict/sqlddl
sequence generation
progint/kpo
logon to Oracle
tools/sqlldr
sql loader related
You should try and repeat the issue and with the use of sql trace , try and isolate where exactly the issue may be occurring within the application.
System Dependent Component internal error values
This layer manages interaction with the OS. Effectively it acts as the glue which allows the Oracle server to interact with the OS. The types of operation which this layer manages are indicated as follows.
Ora-600 Base
Functionality
Description
File access
Exception-handler or signal handler management
Memory allocation
security/dac,&
security/logon&
security/ldap
local us challenge / response activity for remo any activities associated with granting and re validation of password with external password file
dict/sqlddl
this component manages operations associated with creating, compiling (altering), renaming, invalidating, and dropping procedures, functions, and packages.
cost based optimizer layer is used to determine optimal path to the data based on statistical information available on the relevant tables and indexes.
cost based optimizer layer. Used in the generation of a new index to determine how the index should be created. Should it be constructed from the table data or from another index.
dict/shrdcurs
used to in creating sharable context area associated with shared cursors
dict/sqlddl
manages the compilation of triggers
dict/dictlkup&
dict/libcache
dictionary lookup and library cache access
server/drv
manages alter system and alter session operations
progint/if
manages compilation of pl/sql packages and procedures
dict/dictlkup
performs dictionary lookup to ensure semantics are correct
sqlexec/execsvc&
sqlexec/rowsrc
parallel row source management
sqlexec/pq
component provides support for Parallel Query operation
repl/snapshots
manages the creation of snapshot or materialized views as well as related snapshot / MV operations
repl/defrdrpc
layer containing various functions for examining the deferred transaction queue and retrieving information
jobqs/jobq
manages the operation of the Job queue background processes
sqlexec/pq
component provides support for Parallel Query operation
sqlexec/pq
component provides support for Parallel Q specifically mechanism for starting up and shutting down query slaves
sqlexec/pq
component provides support for Parallel Query operation
sqlexec/pq
component provides support for Parallel Q specifically functions for creating mechanisms through which Query co-ordinator can communicate with PQ
sqlexec/pq
component provides support for Parallel Query operation
sqlexec/execsvc
component provides support for the execution of SQL statements
sqlexec/pq
component provides support for Parallel Query operation
sql Loader d
this layer is used for ‘C’ level call outs to dir
dict/libcache
this is part of library Cache operation. Amongst other things it manages the dependency of SQL objects and tracks who is permitted to
dict/libcache
this component is responsible for managing access to remote objects as part of library C
this component relates to MTS (Multi Threaded Server) operation
dict/sqlddl
this layer contains functionality which allows tables to be loaded / truncated and their definitions to be modified. This is part of
dict/libcache
this layer layer provides support for multi-instance access
this functionality is applicable therefore to OPS
dict/rowcache
this layer provides support to load / cache Oracle’s dictionary in memory
sqlexec/fixedtab
this component maps data structures maintained in the Oracle code to fixed tables such that they can be queried using the SQL
dict/libcache
this layer performs management of data structures with
dict/libcache
this layer performs management of dictionary related information within library C
dict/libcache
this layer provides library Cache support to support database creation and forms part of t
dict/libcache
this is the main library Cache manager. This Layer maintains the in memory representation of cached sql statements together will all the necessary suppo
generic/vos
this layer implementations error management operations: signalling errors, catching errors, recovering from errors, setting error frames, etc.;
generic/vos
Heap manager. The Heap manager manages the storage of internal data in an orderly and consistent manner. There can be many heaps serv and heaps within heaps. Common examples are the SGA heap, UGA heap and the PGA heap. Within a Heap there are consistency markers which aim to ensure that the Heap is always in a consistent state. Heaps are use extensively and are in memory structures – not on disk.
dict/libcache
this component deals with loading remote library objects into the local library cache with information from the remote database.
dict/libcache
more l functionality for handling pipe operation associated with dbms_pipe
dict/instmgmt
this component manages instantiations of procedures, functions, packages, and cursors in a session. This provides a means to keep track of what has been loaded in the ev
generic/vos
manages certain types of memory allocation structure. This functionality is an extension of the Heap manager.
generic/vos
relates to various I/O operations. These relate to async i/o operation, direct i/o operation and the management of writing buffers from the buffer cache by potentially a number of datab
dict/libcache
additional library Cache supporting functions
plsql ‘standard’ package related issues
transaction and savepoint management operations
cost based optimizer related operations
bitmap index and index related errors.
ram/partnmap
operations on partition related objects
server/rcv
server recovery related operation
repl/defrdrpc,
repl/snapshot,&
repl/trigger
replication related features
AQ related errors.
dict/libcache
operations associated with managing stored outlines
server/rcv
tablespace management operations
如下错误,是由于主机断电导致undo数据块头部损坏造成的
ORA-00600: internal error code, arguments: [4193], [1805], [2101], [], [], [], [], [], [], [], [], []
第二个参数1805为undo block中的最大记录号,
第三个2101来自redo 的记录号
该错误通过修改一些系统参数和系统事件来解决,如下:
undo_management = manual
event = &# trace name context forever, level 2’
event = &# trace name context forever, level 1’
event = &# trace name context forever, level 2’
event = &# trace name context forever, level 1’
对于一个企业的核心设备数据库服务器的IP地址,其实我们做运维的一般都不建议做修改的,但是无奈各种原因各种用户都会提出这个问题,于是在本文中,我梳理了一下如何修改Oracle数据库集群的各种IP地址和步骤。
本文以Oracle数据库11g为说明对象,其他版本可能略有差异。如果对于单实例的数据库,我们可以直接修改主机物理IP地址,然后修改监听,再重启监听,之后如果使用了静态注册则修改local_listener参数即可,如果使用了HA架构,对于VIP的修改也是很容易的,只不过是不同的HA软件和差异略有不同。那么如果对于多实例的数据库,即集群数据库的情况就较为复杂了,下面我们以实例演示讲解如何修改Oracle RAC中的各种IP地址。
修改目标:实验环境为Oracle Enterprise Linux 6.4上的ORACLE 11g Release 2 RAC环境
原来的IP地址如下:
物理IP地址
<span style="font-family:宋体;font-size:10.8.56.181
<span style="font-family:宋体;font-size:10.8.56.182
虚拟IP地址
<span style="font-family:宋体;font-size:10.8.56.191
<span style="font-family:宋体;font-size:10.8.56.192
私有IP地址
<span style="font-family:宋体;font-size:10..0.1
<span style="font-family:宋体;font-size:10..0.2
虚拟网卡名称
私有网卡名称
node1-priv
node2-priv
SCAN IP地址
<span style="font-family:宋体;font-size:10.8.56.180
node-cluster-scan
修改后的IP地址如下:
物理IP地址
<span style="font-family:宋体;font-size:10.8.56.131
<span style="font-family:宋体;font-size:10.8.56.132
虚拟IP地址
<span style="font-family:宋体;font-size:10.8.56.141
<span style="font-family:宋体;font-size:10.8.56.142
私有IP地址
<span style="font-family:宋体;font-size:10..0.1
<span style="font-family:宋体;font-size:10..0.2
虚拟网卡名称
私有网卡名称
node1-priv
node2-priv
SCAN IP地址
<span style="font-family:宋体;font-size:10.8.56.140
node-cluster-scan
实施步骤:
1、停止集群数据库和监听服务
2、修改集群注册表中的私有网络和共有网络设置
3、停止CRS集群服务
4、修改主机的私有网络和共有网络设置
5、修改/etc/hosts文件中的名称和IP地址的映射
6、启动CRS集群服务
7、修改SCAN IP地址
8、启动数据库实例
9、连接测试
检查现有网络配置情况
集群资源情况如下:
停止数据库和集群
节点2的CRS也要停掉
启动集群的CRS服务:
检查集群是否启动成功
修改集群注册表中的私有网络配置信息
修改节点1的共有网络和私有网络的IP地址
修改节点2的共有网络和私有网络的IP地址
修改后的/etc/hosts文件如下:
重启CRS,这里建议使用ohas脚本进行重启,该脚本在Linux平台在/etc/init.d下的ohasd,在AIX平台的/etc下的ohasd,注意不同平台可能所在目录不同。
停止节点1的CRS
启动节点1的CRS
停止节点2的CRS
启动节点2的CRS
集群CRS启动完成
修改SCAN IP地址
启动数据库实例
验证数据库的连通性:
如果上面连接VIP地址的数据库,没有报错,表明所有IP地址均修改成功。
至此完成的RAC中所有IP地址的修改工作,这里面有可能还需要配置数据库的local_listener和remote_listener参数,此文不再赘述。
显示10个消耗CPU最多的进程
ps aux|head -l; ps aux|sort -rn +2|head -10
显示10个消耗存储空间最多的进程
ps aux|head -l; ps aux|sort -rn +3|head -10
按照顺序显示系统中受罚的进程
ps -eakl|head -l; ps -eakl|sort -rn +5
按优先级顺序显示系统中的进程
ps -eakl|sort -n +6|head
按出来时间为顺序显示系统中的前十个进程
ps vx|head -l; ps vx|grep -v PID|sort -rn +3|head -10
按照实际内存使用的多少顺序显示系统中的前十个进程
ps vx|head -l; ps vx|grep -v PID|sort -rn +6|head -10
按换入页面的多少顺序显示系统中前十个进程
ps vx|head -l; ps vx|grep -v PID|sort -rn +4|head -10
对于一个数据库集群来说,时间同步时非常重要的,让我们试想一下,如果用户A下了一个订单在9:00完成并支付成功,而用户立即查询后发现没有订单数据,这时用户就会心跳加速,想:我的订单呢?
其实这可能是由于集群时间不同步造成的,查询业务和订单业务不在同一个节点造成的,这个问题看似可笑,实则是真实存在的。比如电子商务中的商品秒杀,电信业务中的充值缴费之类都可能会出现类似的现象。所以说在一个集群中,时钟同步是必不可少的,而且是非常重要的。尤其在ORACLE数据库集群环境中,节点时间相差太大可能导致节点重启,甚至无法正常启动。我们处理过多起由于时间不同步导致的节点重启或宕机的故障。另外软件的日志的时间戳基本都是使用本地节点时间记录,如果在集群中的时间有明显偏差,日志分析又可能受到比较多的影响。
在ORACLE的10g版本的RAC环境中要时间同步,需要在操作系统上配置NTP服务,一般企业都会有时间服务器。NTP是传统的用于服务器时间同步的服务,以防止整个企业服务器时间的不一致,他是避免个别节点突然进行时间调整的最好方法,在RAC中,执行非常慢的时间调整有可能导致节点被剔出。
从11gR2开始,为了使Grid Infrastructure不受外面资源的约束,Oracle退出了时间同步服务CTSS,使用ctssd进程(Oracle Cluster Time Synchronization Service Daemon)来完成集群服务器之间的时间同步工作。
该进程在判断如果存在NTP服务的时候,则任然可以选用NTP服务进行时间同步,这里的NTP服务不存在,指的是ntpd进程不存在,并且NTP服务器的配置文件也不存在。如果在满足这两个条件的情况下,CTSS服务就会自动被安装,之后在各个节点之间进行自动的时间同步。
时间同步服务CTSS作为Clusterware的一部分,在系统中,如果观察到时间同步服务或者时间同步服务器配置,那么CTSS将以观察者的模式进行启动和运行,不执行时间同步操作。但是在符合上面的条件后,CTSS服务开始工作,并且校验各个节点上的时间同步情况。
在NTP不存在的情况下,CTSS服务被激活,接管RAC集群中的时间同步任务,以活动模式启动和运行,并且以最早加入集群的节点的服务器的时间作为参考,同步到其他服务器的时间。
[root@node1 ~]# ps -ef|grep ntp
root &&&&& &0 16:14 pts/0 &&&00:00:00 grep ntp
[root@node1 ~]# mv /etc/ntp.conf /etc/ntp.conf.bak
[root@node1 ~]# ls -l /etc/ntp.*
-rw-r&#8211;r&#8211;. 1 root root 1917 Feb 24 &2013 /etc/ntp.conf.bak
如果由于种种原因,集群节点的时钟与CTSS的参考时钟不同步时,CTSS执行旋转时间同步,CTSS会加快或放慢节点的系统时间直到同参考系统时间同步为止。在这个时间同步方法中,CTSS不会向后调整时间,保证只会单向增加系统时间。CTSS定期写告警日志,其中包含有关如何调整节点时间,保持与参考时钟时间同步的相关信息。
CTSS服务进程的日志可以到目录$ORACLE_HOME/log/&hostname&/ctssd下查看:
1、建议用户首选在企业数据中心环境配置统一的时间同步服务器
2、如果没有专门的时间同步服务器的情况下,需要监控CTSS服务进程的日志
今天是个值得纪念的日子,今天是开年第一天正式工作,又是Oracle Database 12c Release 2提供下载和使用的日子,前者无关紧要,后者更加令人激动,可能是有很多人在下载吧,所以今天的Delivery Cloud网络下载速度格外缓慢,看看如下的速度:
童鞋们可以到https://edelivery.oracle.com去下载了,大概3.2GB的软件安装包
大家开始搞起吧,不过不要忘记先看文档哦!^_^

我要回帖

更多关于 lingo创建函数 的文章

 

随机推荐