redo日志组信息查询
set linesize 500col group# for 999col mb for 999col member for a100col thread# for 999col archived for a10select a.group#,a.BYTES/1024/1024 mb,b.MEMBER,a.thread#,a.sequence#,a.members,a.archived,a.status,a.first_time,a.next_time from gv$log a,gv$logfile b where a.GROUP#=b.G...
redo切换频率查询
SELECT to_char(first_time,'YYYY-MM-DD') day, to_char(sum(decode(to_char(first_time,'HH24'),'00',1,0)),'999') "00", to_char(sum(decode(to_char(first_time,'HH24'),'01',1,0)),'999') "01", to_char(sum(decode(to_char(first_time,'HH24'),'02',1,0))...
linux双网卡绑定
##一、编辑虚拟网络接口配置文件,指定网卡IP[root@localhost ~]# cd /etc/sysconfig/network-scripts/[root@localhost network-scripts]# cp ifcfg-em1 ifcfg-bond0[root@localhost network-scripts]# vi ifcfg-bond0DEVICE=bond0BOOTPROTO=staticIPADDR=10.8.6.30NETMASK=255.255.255.0...
_use_adaptive_log_file_sync设置 降低log_file_sync等待
_use_adaptive_log_file_sync该参数在commit次数较多的系统中,post/wait and polling特性对性能影响明显,主要是在写日志上的等待上影响了事务的提交速度.建议在11g中关闭(设置为false)._use_adaptive_log_file_sync造成性能下降的原因可能是其导致LGWR使用了polling 方式来取代 post/wait,并且polling的...
LVM
命令: pv pvcreate,pvremove,pvscan,pvs,pvdisplay,pvmove gv vgcreate,vgremove,vgextend,vgreduce,vgs,vgdisplay,vgscan lv lvcreate,lvremov...
ldap搭建
ldap master server192.168.56.99ldap master slave192.168.56.97ldap client192.168.56.98####server端配置###添加域名[root@localhost ~]# vi /etc/hosts# Do not remove the following line, or various programs# that require network functionality will fail...
获取用户权限
SELECT 'grant ' || tt.granted_role || ' to ' || tt.grantee || ';' AS SQL_text FROM dba_role_privs tt WHERE tt.grantee = (UPPER('scott'))UNION ALLSELECT 'grant ' || tt. PRIVILEGE || ' to ' || tt.grantee || ';' FROM dba_sys_privs tt WHERE tt.grantee = (UPPER('scott'))UNION ALLSELECT ...
指定快照时间内根据等待类查询消耗较高的sql
select wait_class_id, wait_class, count(*) cnt from dba_hist_active_sess_history where snap_id between 5508 and 5518 group by wait_class_id, wait_class order by 3;select event_id, event, count(*) cnt from dba_hist_active_sess_history where snap_id between 5508 and 5518 and wait_cla...
rman恢复部分表空间
SQL> conn / as sysdbaConnected.SQL> select name from v$datafile;NAME--------------------------------------------------------------------------------/u01/oracle/oradata/orcl/system01.dbf/u01/oracle/oradata/orcl/sysaux01.dbf/u01/oracle/oradata/orcl/undotbs01.dbf/u...
ORA-07445处理分析 关闭自动化任务
1 告警日志内容:[oracle@CnXzBus01POraclL01 ~]$ tail -1000f /opt/app/oracle/diag/rdbms/kcpt/kcpt/trace/alert_kcpt.log | grep -A 2 -B 2 "07445"Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x8] [PC:0x21607D1, apaneg()+227] [flags: 0x0, ...
ORA-12514: TNS:listener does not currently know of service requested in connect
[oracle@kcpttest ~]$ sqlplus scott/tiger@192.168.2.227:1521/kcptdg1SQL*Plus: Release 11.2.0.4.0 Production on Tue Sep 6 15:52:48 2016Copyright (c) 1982, 2013, Oracle. All rights reserved.ERROR:ORA-12514: TNS:listener does not currently know of service reques...
表数据被误操作的恢复
SQL> conn scott/tigerConnected.SQL> SQL> SQL> SQL> select * from tab;TNAME TABTYPE CLUSTERID------------------------------ ------- ----------BONUS ...
ldap安装
ldap master server192.168.56.99ldap master slave192.168.56.97ldap client192.168.56.98####server端配置###添加域名[root@localhost ~]# vi /etc/hosts# Do not remove the following line, or various programs# that require network functionality will fail...
查询当前执行的sql及相关内容
10G--10g及以后版本select distinct b.SID,b.SERIAL#,p.SPID,b.LAST_CALL_ET,a.sql_id, a.sql_text,b.status,b.event,b.MODULE, b.OSUSER,b.MACHINE from v$sql a,v$session b,v$process p where a.SQL_ID=b.SQL_ID and b.PADDR=p.ADDR and b.STATUS='ACTIVE' order by B.LAST_CALL_ET desc;--9i及以后版本s...
windows 常用命令行命令
CMD命令:开始->运行->键入cmd或command(在命令行里可以看到系统版本、文件系统版本)chcp 修改默认字符集chcp 936默认中文chcp 650011. appwiz.cpl:程序和功能 2. calc:启动计算器 5. chkdsk.exe:Chkdsk磁盘检查(管理员身份运行命令提示符) 6. cleanmgr: ...
oracle表空间查询
set linesize 300set pagesize 10000col TABLESPACE_NAME for a30;col PCT_FREE for a20;col PCT_USED for a20;col USED_MAX% for a20select a.tablespace_name, round(a.bytes_alloc / 1024 / 1024, 2) megs_alloc, ...
oracle单机静默安装脚本oracleAutoInstall.sh
注:脚本只在redhat和CentOS上面验证过,其他系统没有验证,安装包为11.0.2.0.4,其他安装包需要修改脚本。#!/bin/bash#by ray suen#v0.7##################################################################################before the bash you must install necessary rpm for oracle and edit hos...
添加监听密码
LSNRCTL> change_password Old password: New password: Reenter new password: Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))Password changed for LISTENERThe command completed successfullyLSNRCTL> set passwordPassword:&nb...
DG 添加修改redo日志组大小
注意:log_file_name_convert如果不配置,将导致备库redo 文件不能被删除检查主备库状态主库:select SEQUENCE#,first_time,next_time,APPLIED, THREAD# from v$archived_log order by SEQUENCE#,THREAD#; 49 31-MAR-16 &n...
更改字符集
1.更改数据库字符集为GBKSHUTDOWN IMMEDIATE; STARTUP MOUNT EXCLUSIVE; ALTER SYSTEM ENABLE RESTRICTED SESSION; ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0; ALTER SYSTEM SET AQ_TM_PROCESSES=0; ALTER DATABASE OPEN; ALTER DATABASE NATIONAL CHARACTER...