Resize redo/standby log on Oracle 11.2.0.3 Active Dataguard
Refer to Doc in Metalink and test in on Prod.I have one physical standby database in sync with the primary database with the logs being applied in the form of real time apply. As you might be aware, for the “Real Time Apply” implementation, we need to make sure that we have created the Standby...
higher log file sync wait
oracle 10g dataguard 配置,物理standby,高的log file sync等待, 没有看见 log buffer space wait event,,所以buffer尺寸不打算调整 现在初步估计是i/o问题,和高的应用提交频率引起过多的log file sync, 但是看...
一个关于非空约束enable novalidate的测试
SQL> drop table locations_demo;Table dropped.SQL> CREATE TABLE locations_demo 2 ( location_id NUMBER(4) 3 , street_address VARCHAR2(40) 4 , postal_code VARCHAR2(12) 5 , city VARCHAR2(30) 6 , state_province VARCHAR2(25) 7 , country_id CHAR(2) 8 , CONSTRAINT loc_id_pk PRIMARY KEY (location_id));Table created.SQL> insert into locations_demo values (1,'east load','100000','beijing','beijing','86');1 row created.SQL> insert int
oracle 11g新的后台进程
VKTM - The virtual keeper of time provides wall-clock time and reference time for other sessions/processes. 时间参照进程,为其他进程提供时间参照FBAR - (sadly now renamed to FBDA partway through the beta) The flashback data archiver writes old row-versions of tables with 'flashback archive' enabled into flashback data archives on commit. Anyone remember Oracle v.5 BIFs? flashback 数据存档进程,负责写提交的变化数据到归档文件。注意不是归档日志DIAG - The diagnosibility process (DIAG) runs oradebug c
使用oracle外部表读取文件数据
1 、创建目录及授权create directory exttab as 'F:oracleproduct10.2.0oradataexttab'GRANT READ ON DIRECTORY exttab TO system; GRANT WRITE ON DIRECTORY exttab TO system; 2、准备数据文件到相关目录F:oracleproduct10.2.0oradataexttab>dir Volume in drive F has no label. Volume Serial Number is 5B8D-A9E4 Directory of F:oracleproduct10.2.0oradataexttab2007-05-18 16:09 <DIR> .2007-05-18 16:09 <DIR> ..2007-05-18 15:17 221 1.dat2007-05-18 14:49
oracle用户表空间数据文件损坏或丢失恢复事例
一个印度同事让给他做个简单的恢复测试,具体测试步骤如下:10g v1 for windows xp:数据库工作在归档方式:数据文件丢失后通过重建来恢复;要恢复的数据文件必定在数据库工作在归档日至之后创建[@more@]Microsoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp.C:Documents and Settingsyongrui.chen>f:F:>sqlplus "/ as sysdba"SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 5月 15 09:55:04 2007Copyright (c) 1982, 2005, Oracle. All rights reserved.连接到:Oracle Database 10g En
oralce 9i&10g切换undo tablespace 步骤
select * from v$tablespace create undo tablespace undotbs01 datafile '/oradata/rdev/undotbs01.dbf' size 2000m autoextend on /* Formatted on 2007/05/01 17:04 (Formatter Plus v4.8.8) */SELECT a.usn, a.status, b.tablespace_name, b.segment_name FROM v$rollstat a, dba_rollback_segs b WHERE a.usn = b.segment_idalter system set undo_tablespace=undotbs01 scope=bothSELECT a.usn, a.status, b.tablespace_name, b.segment_name FROM v$rollstat a, dba_rollback_segs b WHERE a.usn = b.segment_id alter tab
unix 下监控oracle日志脚本
在unix下监控oracle日志,如果发现错误,发送邮件给dba。[@more@]#!/bin/sh# Script used to check the Oracle Database Server log ,in which search error to send mail to dba# the script was writen by chenyongrui . Copyright. Do not copy it.for SID in sid1 sid2 sid3 doORACLE_SID=$SIDexport ORACLE_SIDecho $ORACLE_SID#extrace the logfile path of the current instanceLOG_DIR=`sqlplus -silent "/ as sysdba" <<EOFset pagesize 0 feedback off verify off heading off echo offselect value from v$sp
ipcs /ipcrm 命令 说明
摘自 ibm文档[@more@]ipcs 命令用途报告进程间通信设施状态。语法ipcs [ -m] [ -q] [ -s] [ -S] [ -P] [ -l] [ -a | -b -c -o -p -t] [ -T] [ -C CoreFile] [ -N Kernel ]描述ipcs 命令往标准输出写入一些关于活动进程间通信设施的信息。如果没有指定任何标志,ipcs 命令用简短格式写入一些关于当前活动消息队列、共享内存段、信号量、远程队列和本地队列标题。列标题和在 ipcs 命令中的列的含义列在下面。圆括号内的字母表示导致对应的报头出现的标志。all 设计符表示始终显示报头。这些标志仅仅确定提供给每个设备何种信息。但它们并不确
一个记录客户端session ip的触发器
CREATE OR REPLACE TRIGGER record_ip_logon_trigger AFTER LOGON ON DATABASEDECLARE v_user_identifier VARCHAR2 (64);BEGIN SELECT SYS_CONTEXT ('USERENV', 'OS_USER') || ':' || SYS_CONTEXT ('USERENV', 'IP_ADDRESS') INTO v_user_identifier FROM DUAL; DBMS_SESSION.set_identifier (v_user_identifier);END;/这样在v$session里可以直接看到session ip地址,以便我们在作进一步处理[@more@]
linux下 Oracle自动启动与停止
linux下启动与停止oracle数据库[@more@]1、 修改Oracle系统配置文件/etc/oratab/etc/oratab 格式为: SID:ORACLE_HOME:AUTO把AUTO域设置为Y(大写),只有这样,oracle 自带的dbstart和dbshut才能够发挥作用。我的为:ora10g:/home/oracle/products/10.2.0:Y当然也可以不用oracle的脚本,本例采用自己写的脚本,所以这一步可以略过。2、 服务脚本:(命名为oracle)如下#!/bin/bash##################FUNCTION############### AutoStart Oracle and listener# AutoStop Oracle and listener######################################## Created
oracle 触发器常用的System-Defined Event Attributes
System-Defined Event AttributesAttributeTypeDescriptionExampleora_client_ip_address VARCHAR2 Returns IP address of the client in a LOGON event when the underlying protocol is TCP/IPDECLARE v_addr VARCHAR2(11); IF (ora_sysevent = 'LOGON') THEN v_addr := ora_client_ip_address; END IF; END; ora_database_name VARCHAR2(50) Database name.DECLARE v_db_name VARCHAR2(50); BEGIN v_db_name := ora_database_name; END; ora_des_encrypted_password VARCHAR2 The DES-encrypted passwo
两个简单的触发器 控制用户drop或alter any database object
oracle数据库在拥有create session权限下默认对所创建的对象有drop and alter权限,这些权限我们不能revoke,我们可以通过以下触发器来控制普通用户这些权限,来满足部分安全上的需要CREATE OR REPLACE TRIGGER trg_dropdenybefore drop on databasebeginif (ora_login_user!='SYS' and ora_login_user!='SYSTEM')thenraise_application_error(num=>-20000,msg=>'You can not drop ' || ora_dict_obj_name() || ' ! please ask dba to finish version control.thank you1');end if;end;CREATE OR REPLACE TRIGGER trg_alter
oracle rda使用演示
oracle rda使用演示[@more@]1、解压源程序文件到相应目录:E:rda_4[1].1-051205rda>dirVolume in drive E has no label.Volume Serial Number is B866-D396Directory of E:rda_4[1].1-051205rda12/05/2005 11:09 AM .12/05/2005 11:09 AM ..03/28/2005 09:15 PM 4,087 DISCLAIM.txt12/05/2005 11:00 AM modules12/02/2005 08:53 PM RDA11/08/2005 04:16 PM 2,918 rda.bat12/05/2005 11:04 AM 26,891 rda.pl11/22/2005 07:59 PM 3,017 rda.sh11/24/2005 09:28 AM 12,662 README_Unix.txt11/24/2005 09:15 AM 12,546 README_Windows.txt6
关于REDHAT CLUSTER FOR ORACLE的问题
关于REDHAT CLUSTER FOR ORACLE的问题[@more@]近日托朋友要求装一套oracle 10g for redhat cluster es4.0,双机热备,单机工作一切正常,但是因对redhat cluster不是很熟悉,在调用oracle启动时出现双机来回切换,估计是启动脚本状态检测出现问题,不太明白redhat cluster要求状态检测的返回值为什么?大家能否给提个醒。下面是我的脚本分三部分:oradb:cluster调用的主脚本# copyright: Written by chenyongrui, free to distribute.# You must keep everything in this file, including the copyright# announcement.#!/bin/sh## Cluste
有时候作oracle双机热备,一个实例报不能mount database in EXCLUSIVE MODE
有时候作双机热备,一个实例报以下错误cannot mount database in EXCLUSIVE MODE可又出现了新问题,当我启动数据库时,出现cannot mount database in EXCLUSIVE MODE 请问这要怎么解决呀! Solution: 你在什么操作系统下??如果是unix,删除掉$ORACLE_HOME/dbs/1kSID文件就可以了。或者把能够启动的那个实例的该文件复制到不能启动实例的相应位置即可 [@more@]
windows sqlplus 帮助安装过程
Microsoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp.C:>set system_pass system/oracleEnvironment variable system_pass not definedC:>helpinsORACLE_HOME environment variable is not setC:>set oracle_home=E:oracleproduct10.2.0db_1C:>helpinsSet SYSTEM_PASS in the environment, then restart help installation.SYSTEM_PASS should be set to system/pw where pw is the passwordof the SYSTEM schema.C:>set system_pass system/oracleEnvironment variable system_pass not defi
redhat 4.0 es cluster 双机热备oracle脚本
一、oracle文件 由redhat cluster软件调用#!/bin/bash## Cluster service script to start/stop oracle#cd /home/oracle. /etc/rc.d/init.d/functionscase $1 instart)su - oracle -c "./dbstart";;stop)su - oracle -c "./dbshut";;restart)su - oracle -c "./dbshut"su - oracle -c "./dbstart";;status)status oracle(或者 用自己写的状态检测脚本也行);; esacdbstart:#!/bin/bash#su - oracle<< EOF#. ~/.profilesqlplus /nolog<<EOFconn / as sysdbastartup!lsnrctl startexi
经典赞美30句(转载)
1. you look great today.(你今天看上去很棒。)【每天都可以用!】 2. you did a good job. (你干得非常好。)【国际最通用的表扬!】 3. we're so proud of you.(我们十分为你骄傲。)【最高级的表扬!】 4. i'm very pleased with your work.(我对你的工作非常满意。)【正式、真诚的赞扬!】 5. this is really a nice place.(这真是个好地方!)【随口就说、但效果很好的表扬!】 6. you're looking sharp!(你看上去真精神/真棒/真漂亮。)【与众不同的表扬!】 7. you always know the right thing to say. = 8. you're very
一篇男人必看的雄文(转载)
心理学课上,周正教授正在授课:“上次下课时,一个男孩子递了张纸条:'我是个比较内向的人,又没什么特长,不会踢足球,不会打篮球……唯一的爱好是写作。进入大学后,看到周围的同学在交往、工作中左右逢源、如鱼得水、洒脱干练,很是羡慕。就要步入社会了,我该如何规划自己的前途呢?……周教授,我想我还是当一名作家比较好,一个人,也不错,您说呢?’这个问题要不要回答?”周教授扬了扬手中的纸条。 “回——答——”同学们兴致大起,“作家梦”可是不少惮于竞争之人的救命稻草啊! 周教授放下手中的纸条:“好,今天我就当面