随笔分类 -  Oracle

摘要:目录 configing active dataguard for 11.2 rac. 1 一、建组、建用户、配置环境变量、内核参数等... 1 二、配置共享磁盘... 3 1)创建4块共享磁盘并fdisk格式化。... 3 2)安装asm rpm包... 3 3)配置asm driver服务... 阅读全文
posted @ 2017-04-03 01:29 ChavinKing 阅读(452) 评论(0) 推荐(0) 编辑
摘要:set echo offset scan onset lines 150set pages 66set verify offset feedback offset termout offcolumn uservar new_value Table_Owner noprintselect user uservar from dual;set termout oncolumn TABLE_NAME h... 阅读全文
posted @ 2017-04-03 01:28 ChavinKing 阅读(220) 评论(0) 推荐(0) 编辑
摘要:-- -------------------------------------------------------------------------------------------------- Script: xplan.sql---- Author: Adrian Billington-- ---- Description: Cre... 阅读全文
posted @ 2017-04-03 01:27 ChavinKing 阅读(212) 评论(0) 推荐(0) 编辑
摘要:------------------表统计信息---------------------------------------------------------------------select t.owner,t.table_name,t.tablespace_name,t.last_analyzed,t.num_rows,t.blocks,t.avg_row_len from dba_tab... 阅读全文
posted @ 2017-04-03 01:26 ChavinKing 阅读(295) 评论(0) 推荐(0) 编辑
摘要:SELECT S.OWNER, S.SEGMENT_NAME, S.SEGMENT_TYPE, S.PARTITION_NAME, ROUND(BYTES / (1024 * 1024), 2) "USED_SPACE(M)", EXTENTS USED_EXTENTS, S.MAX_EXTENTS 阅读全文
posted @ 2017-04-03 01:25 ChavinKing 阅读(170) 评论(0) 推荐(0) 编辑
摘要:create or replace procedure expity_date_user isbegin execute immediate 'truncate table expiry_users'; for edu_users in (select username, expiry_date from dba_users ... 阅读全文
posted @ 2017-04-03 01:24 ChavinKing 阅读(230) 评论(0) 推荐(0) 编辑
摘要:SELECT D.TABLESPACE_NAME, SPACE "SUM_SPACE(M)", BLOCKS SUM_BLOCKS, SPACE - NVL(FREE_SPACE, 0) "USED_SPACE(M)", ROUND((1 - NVL(FREE_SPACE, 0) / SPACE) 阅读全文
posted @ 2017-04-03 01:23 ChavinKing 阅读(663) 评论(0) 推荐(0) 编辑
摘要:--PL/SQL块删除用户 declare cursor cur_duser is select sid, serial# from v$session where username in ('T1'); v_str string(200);begin for d_u in cur_duser lo 阅读全文
posted @ 2017-04-03 01:22 ChavinKing 阅读(200) 评论(0) 推荐(0) 编辑
摘要:accept owner prompt " Enter the schema name to check for Row Chaining (RETURN for All): "promptpromptaccept table prompt " Enter the table name to check (RETURN for All tables owned by &owner): "promp... 阅读全文
posted @ 2017-04-03 01:21 ChavinKing 阅读(231) 评论(0) 推荐(0) 编辑
摘要:今天收到压力测试期间awr报告,测试人员要我看看数据库是否有可以优化的地方,数据库服务器配置信息:CPU:32*8,内存:480g 单实例数据库:oracle 11.2.0.4。具体分析过程如下: 可以发现,压力测试期间出现队列锁:enq: TX - allocate ITL entry。 通过Se 阅读全文
posted @ 2017-04-03 01:19 ChavinKing 阅读(1323) 评论(0) 推荐(0) 编辑
摘要:1 对这一个小时进行AWR的收集和分析,首先,从报告头中看到DB Time达到近500分钟,(DB Time)/Elapsed=8,这个比值偏高: Snap Id Snap Time Sessions Cursors/Session Begin Snap: 15142 20-11月-12 09:00 阅读全文
posted @ 2017-04-03 01:16 ChavinKing 阅读(1293) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash#Usage:Log on as the superuser('root') on node1,node2 cd /u01/app/11.2.0/grid/bin./crsctl stop crs -fcd /echo ...................cd /etc/or 阅读全文
posted @ 2017-04-03 01:15 ChavinKing 阅读(543) 评论(0) 推荐(0) 编辑
摘要:1、查询碎片程度高的表 条件为什么block>100,因为一些很小的表,只有几行数据实际大小很小,但是block一次性分配就是5个(11g开始默认一次性分配1M的block大小了,见create table storged的NEXT参数),5个block相对于几行小表数据来说就相差太大了。 算法中/0.9是因为块的pfree一般为10%,所以一个块最多只用了90%,而且一行数据大于8KB时容易产生... 阅读全文
posted @ 2017-04-03 01:14 ChavinKing 阅读(250) 评论(0) 推荐(0) 编辑
摘要:查询语句语法: Select 属性 From 表 Where 条件 Group by 分组条件 Having 分组选择条件 Order by 排序条件 1、from子句组装来自不同数据源的数据; 2、where子句基于指定的条件对记录行进行筛选;3、group by子句将数据划分为多个分组;4、使用 阅读全文
posted @ 2017-04-03 01:13 ChavinKing 阅读(229) 评论(0) 推荐(0) 编辑
摘要:试验环境: 1)数据库版本:oracle 11.2.0.4 2)建表脚本:以scott的dept及emp表为基础。 父表:dept -- Create table create table DEPT ( DEPTNO NUMBER(2) not null, DNAME VARCHAR2(14), L 阅读全文
posted @ 2017-04-03 01:12 ChavinKing 阅读(5071) 评论(0) 推荐(0) 编辑
摘要:问题描述: SQL> show user USER is "SYS" SQL> drop user efmis_zhongyang cascade; drop user efmis_zhongyang cascade * ERROR at line 1: ORA-00604: error occurred at recursive SQL level 1 ORA-38301: can not pe... 阅读全文
posted @ 2017-04-03 01:10 ChavinKing 阅读(616) 评论(0) 推荐(0) 编辑
摘要:今天公司开发在删除表时报错ora-12083,很是疑惑,数据字典记录的是表,而删除要用物化视图方式删除,如下: SQL> DROP TABLE CODE_M_AGENCY;DROP TABLE CODE_M_AGENCY *ERROR at line 1:ORA-12083: must use DROP MATERIALIZED VIEW to drop "EFMIS_36".... 阅读全文
posted @ 2017-04-03 01:09 ChavinKing 阅读(1766) 评论(0) 推荐(0) 编辑
摘要:问题: 我的rac环境不小心通过chown命令改变了/u01目录及其子目录的权限,导致rac节点2数据库宕掉,sqlplus下打开数据库报错如下: [oracle@node2 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 25 19:53:58 2016 Copyright (c) 1982, ... 阅读全文
posted @ 2017-04-03 01:08 ChavinKing 阅读(1270) 评论(0) 推荐(0) 编辑
摘要:1、数据库打开报错如下: SQL> alter database open; alter database open * ERROR at line 1: ORA-01157: cannot identify/lock data file 4 - see DBWR trace file ORA-01110: data file 4: '/weblogic/oradata/orcl/users01.... 阅读全文
posted @ 2017-04-03 01:08 ChavinKing 阅读(1036) 评论(0) 推荐(0) 编辑
摘要:SQL> drop user EFMIS_87_LK cascade;drop user EFMIS_87_LK cascade*ERROR at line 1:ORA-00604: error occurred at recursive SQL level 1ORA-00054: resource busy and acquire with NOWAIT specified or timeout... 阅读全文
posted @ 2017-04-03 01:07 ChavinKing 阅读(453) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示