崔旭oracle,RYAN'S BLOG - INTO THE ORACLE

0b8636073ad5c0cf0818e2593417b0f7.png

【故障描述】

/u02是之前单实例数据库的安装目录,客户执行删除脚本已经把数据库软件和实例都删除了,现在新装Grid软件,Grid目录指定在/u01下, 现在安装提示没有u02目录。截图如下:

【问题分析】

oracle软件安装时,通常都需要产品清单目录来保存软件安装的目录等信息,有点类似于window里面的注册表。再删除软件时,也需要读取产品清单目录里面的内容,来确定曾经安装的软件位置。

产品清单目录的位置,是保存在/etc/oraInst.loc文件中,如下:

[cce]

[root@sdedu ~]# cat … [Read more...]

Filed Under: Oracle

前言

HLL是 HyperLogLog数据结构的简称。PostgresSQL通过插件的方式引入了这种新的数据类型hll。HyperLogLog是一个具有固定大小,类似于集合结构,用于可调精度的不同值计数。例如,在1280字节的hll数据结构中,它可以在很小的误差范围内估算出数百亿的不同值计数。

算法

hll可以被视为层次结构的不同集合/不同值计数算法的组合,并向上移动该层次结构的规则。为了区分上述描述算法,将其命名为以下:

♠ EMPTY

表示空集的常量值

♠ EXPLICIT

集合中确定的,唯一的,排序完整的整数列表,该列表保持一个固定的基数

♠ SPARSE

HyperLogLog是基于映射的“惰性”实现,是一种基于概率集合的数据结构。仅将非零寄存器的索引和值存储在 map中,直到非零寄存器的数量超过固定的基数。

♠ … [Read more...]

Filed Under: Oracle

前言

pgBackRest是一款开源的备份还原工具,目标旨在为备份和还原提供可靠易用的备份。

特性

并行备份和还原

备份操作期间压缩通常是其瓶颈所在。pgBackRest通过并行处理解决了备份期间压缩出现的瓶颈问题。

本地远程操作

自定义协议允许 … [Read more...]

Filed Under: Oracle

前言

通常,在PostgreSQL中,由于经常需要对表进行 UPDATE 和 DELETE,因此表会产生碎片空间。在 PostgreSQL中,使用VACUUM 仅仅对需要执行 VACUUM 表将已删除的空间标识为未使用,以便以后重用这些空间,但是不能立即将占用的空间返还给操作系统,因此需要使用 VACUUM FULL,才可以释放空间,并立即将空间返还给操作系统。

实现脚本

记录收集表创建

[cce]

CREATE TABLE IF NOT EXISTS tab_vacuum_record

(sqltext text);

[/cce]

收集需要VACUUM 表函数

[cce]

CREATE OR REPLACE FUNCTION f_vacuum_tables()

RETURNS void AS

$FUNCTION$

DECLARE

v_tablename text;

v_dead_cond bigint;

v_sql text;

cur_tablename REFCURSOR;

v_vacuum_record text;

BEGIN

v_vacuum_record := 'tab_vacuum_record';

OPEN cur_tablename FOR SELECT tablename FROM pg_tables WHERE tablename !~ '^pg|^sql';

LOOP

FETCH cur_tablename INTO v_tablename;

SELECT n_dead_tup INTO v_dead_cond FROM … [Read more...]

Filed Under: Oracle

连接状态函数

PQdb

返回连接的数据库名称

PQuser

返回连接的用户名称

PQpass

返回连接的用户密码

如果连接密码没有被提供,那么将会尝试从 password_file 文件中获取。

PQhost

返回连接的服务器主机名称

PQhostaddr

返回连接的服务器IP地址

PQport

返回连接服务器的端口

PQtty

返回连接的DEBUG 终端信息

PQoptions

返回命令行传递的参数信息

PQstatus

返回连接的状态信息

示例:

[cce]

#include

#include

#include "libpq-fe.h"

int

main(int argc, char **argv)

{

const char *conninfo; //定义连接信息

PGconn *conn; //连接数据库传递参数

if (argc > 1)

conninfo = argv[1];

else

conninfo = "dbname = postgres";

/* 连接数据库字符串 */

conn = PQconnectdb(conninfo);

/*检查数据库是否连接成功 */

if (PQstatus(conn) != CONNECTION_OK)

{

fprintf(stderr, "连接数据库失败: … [Read more...]

Filed Under: Oracle

前言

Libpq 是为 C 语言开发这提供的关于 PostgreSQL 的接口。Libpq 由相关库函数组成,可以允许客户端程序通过将查询传递给 PostgreSQL 后台服务器并接收这些查询返回的结果。同时,libpq 也是其它几个 PostgreSQL 应用程序接口的基础引擎,包括 C++,Perl,Python,Tcl和ECPGC编程的嵌入式 SQL。

连接字符串

以下函数处理 PostgreSQL 后台服务器的连接。一个应用程序同时可以有多个打开的连接,这也是 PostgreSQL 服务器能够同时访问多个库的原因。每一个连接都通过 PGconn 对象表示,该对象可以从函数 PQconnectdb,PQconnectdbParams 中或者 PQsetdbLogin 获取信息。需要注意的是,这些对象通常返回一个非空的对象指针。除非由于内存太小导致无法分配 PGconn 对象。PQstatus … [Read more...]

Filed Under: Oracle

f950bef8d7865690b019403cdc70f5d7.png

今天一位客户说应用运行比较慢,让我看看数据库中锁的相关情况。

那么如何快速的找到持有锁的会话相关信息呢?

请参考如下SQL:

[cce_SQL]

set term on;

set lines 130;

column sid_ser format a12 heading 'session,|serial#';

column username format a12 heading 'os user/|db user'; column process format a9 heading 'os|process';

column spid format a7 heading 'trace|number';

column owner_object format a35 heading 'owner.object'; column locked_mode format a13 heading 'locked|mode'; column status format a8 heading 'status';

spool coe_locks.lst;

select

substr(to_char(l.session_id)||','||to_char(s.serial#),1,12) sid_ser, substr(l.os_user_name||'/'||l.oracle_username,1,12) username, l.process,

p.spid,

substr(o.owner||'.'||o.object_name,1,35) owner_object, decode(l.locked_mode,

1,'No Lock',

2,'Row Share',

3,'Row Exclusive',

4,'Share',

5,'Share Row Excl', 6,'Exclusive',null) locked_mode,

substr(s.status,1,8) status … [Read more...]

Filed Under: Oracle

APPLIES TO:

Oracle Database Cloud Exadata Service - Version N/A and later

Oracle Database Cloud Service - Version N/A and later

Oracle Database - Enterprise Edition - Version 11.2.0.4 and later

Oracle Database Backup Service - Version N/A and later

Oracle Database - Standard Edition - Version 11.2.0.4 and later

Information in this document applies to any platform.

PURPOSE

This document defines the patches and minimum releases for the Database Product Suite, Fusion Middleware Product Suite, Exalogic, and Enterprise Manager Suite Critical Patch Updates and Patch Set Updates released on July 14, 2020.

SCOPE

The document is for Database Administrators and/or others tasked with Quarterly Security Patching.

DETAILS

Database, Fusion Middleware, and Enterprise Manager Critical Patch Update July 2020 Patch Availability Document

My Oracle Support Note 2664876.1

Released July 14, 2020

This document contains the following sections:

Critical Patch Update July 2020 Patch … [Read more...]

Filed Under: MOS, Oracle

_cms|color management system (little cms)

_cms15Fixed16toDouble|Converts from 15.16 (signed) fixed point to cmsFloat64Number

_cms8Fixed8toDouble|Converts from 8.8 fixed point to cmsFloat64Number

_cmsCalloc|Allocate space for an array of num elements each of whose size in bytes is size

_cmsDecodeDateTimeNumber|Decodes from ICC date and time format to the standard “C” struct tm

_cmsDefaultICCintents|This function implements the standard ICC intents perceptual

_cmsDoubleTo15Fixed16|Converts from cmsFloat64Number to 15.16 fixed point

_cmsDoubleTo8Fixed8|Converts from cmsFloat64Number to 8.8 fixed point

_cmsDupMem|duplicates the contents of org into a new block

_cmsEncodeDateTimeNumber|Decodes from the standard “C” struct tm to ICC date and time format

_cmsFree|Cause the space pointed to by Ptr to be deallocated; that is

_cmsGetTransformUserData|Returns a pointer to the user data associated with current color … [Read more...]

Filed Under: PostgreSQL

任何关系型数据库中,ACID 是组成数据库的重要部分,是数据库事务的一组属性,该特性目的主要确保数据库在异常情况下保证数据的有效性。

数据库ACID特性

A(Atomicity)

原子性:

事务通常由多个语句组成。原子性保证将每个事务视为单个单元,该事务要么完全成功,要么完全失败。换句话说,如果在一个事务中,任何语句都未能完成,整个事务都会失败,未完成事务中的数据条目在数据库中保持不变。一个原子系统必须保证在任何情况下都具有原子性,包括电源故障,数据库错误和实例奔溃。同时,原子性可以防止在数据库中发生部分数据更新的情况。举一个例子,假设用户USER1 和 USER2 之间进行转账。这之间会进行两个动作,第一个动作,从USER1 账户中划钱;第二个动作,将从USER1账户中划拨的钱保存到 USER2 … [Read more...]

Filed Under: Oracle

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值