[RAC]ORACLE Database 10g RAC for Administrators学习笔记(一)
0. IntroductionWhat Is a Cluster?Interconnected nodes act as a single serverCluster software hides the structureDisks are available for read and write by all nodes.Operating system is the same on each machineWhat Is Oracle Real Application Clusters?Multiple instances accessing the same databaseOne Instance per nodePhysical or logical access to each database fileSoftware-controlled data accessWhy Use RACHigh availabilityScalabilityPay as you growKey grid computing featuresLevels of ScalabilityHar
[Data Guard]Oracle10g Data Guard学习笔记(三)
9. Performing Switchover and FailoverChoosing the Best Role Transition OperationPlanned role transition-switchoverPrimary database can be repaired in as timely manner -repair primary databasePrimary database can not be repaired in as timely manner-failoverSwitchover-no data loss/no resetting of online redo logsPerforming a Switchover by Using Enterprise Managera. A check is made to ensure that the primary database and standby database are not currentlyin an error status condition and that
[Data Guard]Oracle10g Data Guard学习笔记(二)
1. Using Data Guard Broker and Enterprise ManagerData Guard Broker: ComponentsClient-side:Two interfaces– Oracle Enterprise Manager 10g Grid Control– A command-line interface: DGMGRLServer-side: Data Guard monitor– DMON process– Configuration filesA broker configuration consists ofA configuration objectDatabase objectsInstance objectsData Guard Broker: Requirements• You must use the Enterprise Edition of Oracle Database 10g.• 10g企业版• 单实例或多实例•
[Data Guard]Oracle10g Data Guard学习笔记(一)
1. Oracle Data Guard: OverviewTypes of Standby DatabasesPhysical standby database block-for-block, redo applyLogical standby database Shares the same schema definition, SQL applyTypes of ServicesRedo transport services, Log apply services, Role-management servicesRole TransitionsSwitchoverFailoverData Protection ModesMaximum protection:commit完成前保证redo已被写入主数据库和至少一个备数据库,备机若异常不能传输redo则主库自动下掉Maximum availability:备机正常情况下同最大保护模式,
[Linux]Redhat AS4开启telnet过程[转载]
首先安装telnet包,使用rpm -ivh telnet...命令1、确定你的telnet服务打开没有:[root@111 ~]# chkconfig --list|grep telnettelnet: offkrb5-telnet: off[root@111 ~]# 注意检查结果这里是关闭状态2、打开telnet服务:[root@111 ~]# chkconfig --level 35 telnet on [root@111 ~]# chkconfig --list|grep telnettelnet: onkrb5-telnet: off[root@111 ~]#检查已经被打开了3、修改登陆文件securetty,主要增加要登陆的终端点[root@111 ~]# vi /etc/securetty 增加几个pts/x:pts/0pts/1pts/2pts/3pts/4pts/5……保存退出:4、测试登录:[root
[Linux]配置Xmanager[转载]
Step 1. Set any host can get a login window.Open /etc/X11/xdm/Xaccess.Remove "#" # * #any host can get a login window Step 2. Change runlevel to enable gdm.Open /etc/inittab file.Change the runlevel to 5 as following:id:5:initdefault:Replace with this x:5:respawn:/usr/bin/gdmStep 3. GDM configuration (When the Linux is using gdm)Open /etc/X11/gdm/gdm.conf file. (/etc/gdm/custom.conf for Fedora Core 5)Go to the [xdmcp]section.Set the value of Enable option to true or 1.Set the value of
[SQL]007学习笔记总结
between…and… 包含两头,必须把lower limit定义在前,否则不会报错但选不出结果。字符串作为边界值也可。使用Escape可设置一个escape character,用于在字符串中充当转义符。Where job_id like ‘%SA_%’ ESCAPE ‘’;to_date函数中Format_model中的fx前缀:保证必须精确匹配。连接种类OracleEquijoinwhere table1.column1=table2.column2NonequijoinOuter joinwhere table1.column(+)=table2.columnSelf joinSQL1999Cross joinssame with Cartesian product FROM table1 CROSS JOIN table2Natural joinsFROM table1 NATURAL JOIN tabl
[PL/SQL]10g PL/SQL学习笔记(三)
Declaring the CursorCURSOR cursor_name ISselect_statement;Open, Fetch&CloseOPEN emp_cursor;FETCH emp_cursor INTO empno, lname;CLOSE emp_cursor;Cursors and Recordsemp_record emp_cursor%ROWTYPE;……FETCH emp_cursor INTO emp_record;Cursor FOR LoopsFOR record_name IN cursor_name LOOPstatement1;statement2;. . .END LOOP;说明:无须显式地打开、fetch、关闭游标。无须定义record_name。Explicit Cursor Attributes%ISOPEN, %NOTFOUND, %FOUND, %ROWCOUNTCursor FOR Loops Using SubqueriesFOR emp_record IN (SELEC
[SQL]oracle 绑定变量(bind variable)[转载]
在oracle 中,对于一个提交的sql语句,存在两种可选的解析过程, 一种叫做硬解析,一种叫做软解析.一个硬解析需要经解析,制定执行路径,优化访问计划等许多的步骤.硬解释不仅仅耗费大量的cpu,更重要的是会占据重要的们闩(latch)资源,严重的影响系统的规模的扩大(即限制了系统的并发行), 而且引起的问题不能通过增加内存条和cpu的数量来解决。之所以这样是因为门闩是为了顺序访问以及修改一些内存区域而设置的,这些内存区域是不能被同时修改。当一个sql语句提交后,oracle会首先检查一下共享缓冲池(shared pool)里有没有与之完全相同
[PL/SQL]10g PL/SQL学习笔记(二)
SELECT Statements in PL/SQL必须使用INTO,只能选出一条记录Naming Conventions避免变量名与列名相同,如相同,优先选择列名。在where语句中会导致歧义。DECLAREhire_date employees.hire_date%TYPE;sysdate hire_date%TYPE;employee_id employees.employee_id%TYPE := 176;BEGINSELECT hire_date, sysdateINTO hire_date, sysdateFROM employeesWHERE employee_id = employee_id;END;/SQL Cursor• A cursor is a pointer to the private memory areaallocated by the Oracle server.• There are two types of cursors:– Im
[PL/SQL]10g PL/SQL学习笔记(一)
PL/SQL block structureDeclare(可选)BeginExecutable(必须)sql、pl/sqlException(可选,嵌在executable部分)end;block types1. Anonymous2. procedure3. fuction(必须返回值)在isql*plus中输出Set serveroutput onDelimiters in String Literalsevent VARCHAR2(15):='Father''s day';You can specify any character that is not present in the string as delimiter. The slide shows how to use the q' notation to specify the delimiter. The examples use ‘!’ and ‘[‘ as delimiters. Consider the following example:ev
[SQL]学习007有感
上周花了一个礼拜的时间仔细读了007的三本SG,做完了上面所有的实验,感觉收获颇丰。虽然大多是一些很简单的内容,很多东西我以前也知道,但是仔细读过以后,还是感觉自己长进了不少,对于很多知识的了解上升到了一个理论的层次,心里就觉得特别爽。虽然我的工作是维护型DBA,但像SQL、PL/SQL这种最基础的东西,没有系统学习过心里还真没底。现在我的感觉好多了。另外,说一下我对SG和document的学习体会。因为之前硬是把10g document中的performence tuning guide啃了下来,但整整花了两个月的时间,等到后面看完的时候,前面看了些什么早
[SQL]关于Concatenated Groupings的问题[转载]
关于Concatenated Groupings的问题SELECT department_id, job_id, manager_id, SUM(salary)FROM employeesGROUP BY department_id,ROLLUP(job_id),CUBE(manager_id);The example in the slide results in the following groupings:• (department_id, manager_id, job_id )• (department_id, manager_id)• (department_id, job_id)• (department_id)解释:首先看看SG上面的例子,GROPU BY GROUPING SETS(a,b),GROPUING SETS(c,d)等价于:GROUP BY (a,c)UNIONGROUP BY (a,D)UNIONGROUP BY (b,c)UNIONGROUP BY (b,d)
[ADMIN]oracle入门-oracle体系结构
一个完整的oracle服务包括一个oracle instance和一个oracle database。前者主要包括内存结构和一些process,后者主要涉及一些存储方面的结构。oracle的内存结构主要包括SGA(共享内存区)和PGA(program global area)。SGA是在oracle instance起的时候就预分配好的,主要包括以下几个部分:shared pool:分别dictionary cache和library cache,前者主要存放数据字典的信息,后者主要存放一些sql语句和他们的执行计划等信息。database buffer cache:主要存放数据块log buffer:主要存放redo log entrieslarge pool:一般用于一些需要分配比较