- 博客(141)
- 资源 (1)
- 收藏
- 关注
原创 [2022-06-09]主库添加PDB,备库报ORA-01186、ORA-01157
背景,环境为RAC->RAC(ADG),在主库新添加一个PDB之后,备库提示如下报错:1、新增前主库PDB信息2、新增前备库PDB信息3、新增PDB_NEW--//主库日志--//备库日志4、--//备库状态--//解决办法,可以参考MOS两篇文章5、备库取消应用6、备库恢复新创建的PDB--//数据库日志7、查看数据文件状态8、recovery standby database...
2022-06-09 10:11:58
1464
原创 [2022-04-27] refresh PDB
参考资料:Switching Over a Refreshable Clone PDBAbout Refreshable Clone PDBsrefresh pdb使用情况如:原PDB所在CDB的主机资源紧张,可以迁走部分PDB减轻主机压力。 或者对PDB做容灾使用等。PDB的刷新可以分两种, 手动刷新和自动刷新。自动和手动刷新模式您可以将克隆 PDB 配置为按设定的时间间隔自动刷新,也可以使用ALTER PLUGGABLE DATABASE REFRESH语句手动刷新它。该REFR.
2022-04-27 13:44:28
1181
原创 [2022-04-27] CDB启动时,PDB的打开模式
Preserving or Discarding the Open Mode of PDBs When the CDB Restarts如果想每次打开CDB的时候,PDB都是启动到mount状态,如下:SQL> startupORACLE instance started.Total System Global Area 780137928 bytesFixed Size 9139656 bytesVariable Size
2022-04-27 10:35:27
895
原创 [2022-04-26]dg_broker switchover to XXX 报ORA-01017
背景,使用dgmgrl / 方式登录,默认使用SYSDG用户[oracle@rac1-adg admin]$ dgmgrl / DGMGRL for Linux: Release 19.0.0.0.0 - Production on Tue Apr 26 15:19:35 2022Version 19.7.0.0.0Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.Welcome to
2022-04-26 15:29:31
1168
原创 [2022-04-24]插拔PDB
拔PDB可以参考文档:Unplugging a PDB from a CDBUnplug a PDB with a ALTER PLUGGABLE DATABASE ... UNPLUG INTO statement.PrerequisitesThe following prerequisites must be met:The current user must have SYSDBA or SYSOPER administrative privilege, and the privilege
2022-04-24 16:54:03
693
原创 [2022-04-24] 删除PDB
当您想要将PDB移动到一个新的CDB或当您不再需要它时,这个时候就需要删除PDB。When you drop a PDB, the control file of the CDB is modified to eliminate all references to the dropped PDB. Archived redo log files and backups associated with the PDB are not removed, but you can use Oracle Rec
2022-04-24 14:24:57
1014
原创 [2022-04-24]NOCDB转换PDB步骤
背景,如果从11g数据库升级12c或以后,升级完成之后默认还是NOCDB,如果这个时候想把NOCDB转换为CDB,可以把NOCDB转换为一个已经存在的CDB的PDB,参考文档:Adopting a Non-CDB as a PDB1、提前创建CDBCreate the CDB if it does not exist提前创建一个CDB容器,后续把NOCDB数据库插入到新创建的CDB容器。CDB创建过程略。2、确保NOCDB的事务一致性Ensure that the non-CDB i
2022-04-24 11:51:17
776
原创 [2022-4-18]CRS-5010: Update of configuration file
背景:配置备库时新增加了1522端口,监听名字LISTENER_DG, 使用srvctl添加监听之后,启动的时候报如下错误:[grid@rac1-adg ~]$ srvctl start listener -l LISTENER_DGPRCR-1079 : Failed to start resource ora.LISTENER_DG.lsnrCRS-5010: Update of configuration file "/u01/app/oracle/product/19.0.0.0/dbho
2022-04-18 10:54:43
1137
原创 [2022-04-07] 搭建dataguard报 dbms_backup_restore.restoreCancel() failed
1、备库搭建时报如下错误[oracle@rac1-adg ~]$ rman target sys/tiger@primary auxiliary sys/tiger@standbyRecovery Manager: Release 19.0.0.0.0 - Production on Thu Apr 7 12:44:24 2022Version 19.7.0.0.0Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rig
2022-04-07 16:41:42
1651
原创 [2022-03-29] No connections allowed during/after terminal recovery
背景,主备库failover切换测试,备库日志提示No connections allowed during/after terminal recovery报错,具体过程如下。1、主库flush 最后redo到备库15:15:12 SYS@db1(11g)> startup mount;ORACLE instance started.Total System Global Area 1252663296 bytesFixed Size 2252824
2022-03-29 15:46:33
792
原创 [2022-03-22] ORA-03297: file contains used data beyond requested RESIZE value
对表空间数据文件进行resize时提示ORA-03297报错。该报错的主要原因是回收数据文件大小时,resize的值太小不能满足该表空间中的已有的对象。测试过程如下1、创建测试表空间14:31:43 TEST@db1(11g)> create tablespace test datafile '/oracle/app/db/oradata/db1/test.dbf' size 100m extent management local uniform size 1m;Tablespac
2022-03-22 14:59:17
3053
原创 [2022-03-21] sqlplus 显示格式化
sqlplus登录之后默认的显示前缀为SQL> 如果想把前缀进行修改,可以设置sqlprompt变量的值,可以设置当前已经定义的变量值SQL > defineDEFINE _DATE = "21-MAR-22" (CHAR)DEFINE _CONNECT_IDENTIFIER = "db1" (CHAR)DEFINE _USER = "SYS" (CHAR)DEFINE _PRIVILEGE = "AS SYSDBA" (
2022-03-21 11:19:20
1815
原创 [2022-3-17]19c安装应用RU,OJVM报错irman ioracle idrdactl idrdalsnr
19c Installation with 19.11 OJVM RU Fails with Error "undefined reference to jox_eujs_nowait_" (Doc ID 2788203.1) APPLIES TO:Oracle Database - Enterprise Edition - Version 19.11.0.0.0 and laterLinux x86-64SYMPTOMSWhen performing 19c installation .
2022-03-17 15:35:42
1513
原创 [2020-3-16]Postgresql 调用脚本方法
postgresql数据执行脚本常用的两种方式1、在psql中通过\i 或者\ir的方式执行脚本,语法如下:Input/Output \copy ... perform SQL COPY with data stream to the client host \echo [STRING] write string to standard output \i FILE execute commands from fi
2022-03-16 16:55:52
2998
2
原创 [2022-03-16]posgresql连接提示psql: error: FATAL: no pg_hba.conf
新安装的数据库连接时提示如下错误:[postgres@postgres data]$ psql -h 192.168.40.160 -p5432 -d postgrespsql: error: FATAL: no pg_hba.conf entry for host "192.168.40.160", user "postgres", database "postgres", SSL off[postgres@postgres data]$ 出现该错误的原因是没有在pg_hba.conf 里
2022-03-16 15:14:38
2645
原创 [2022-03-14]安装数据库软件ERROR: The home is not clean
背景,runInstaller -applyRU方式安装数据库,刚执行中断意外中断,重新执行提示报错报错信息如下:[oracle@rac1 dbhome_1]$ ./runInstaller -applyRU /home/oracle/30899722 ERROR: The home is not clean. This home cannot be used since there was a failed OPatch execution in this home. Use a diffe
2022-03-14 16:35:28
3728
原创 [2022-03-10]安装集群执行root.sh 时报CLSRSC-169: Failed to create or upgrade OLR
1、报错信息如下[root@rac1 etc]# /oracle/app/grid/18/root.sh Performing root user operation.The following environment variables are set as: ORACLE_OWNER= grid ORACLE_HOME= /oracle/app/grid/18Enter the full pathname of the local bi
2022-03-10 16:06:16
1550
原创 [2022-2-24]19c数据库通过restore point降级报ORA-38762
客户测试11g升级19c,升级测试完成执行想通过还原点回退到11g,但是在通过还原点回退的时候出现了如下报错ORA-38754: FLASHBACK DATABASE not started; required redo log is not availableORA-38762: redo logs needed for SCN 2914082 to SCN 2914082ORA-38761: redo log sequence 178 in thread 1, incarnation 3 co
2022-02-24 14:22:04
518
原创 [2022-02-21]调用package时提示ORA-04068报错
业务反馈,调用package时提示ORA-04068报错,该报错在MOS(Doc ID 444968.1 Receiving ORA-04061 After Modifying A PL/SQL body)上有详细描述,主要是由于package body被修改,其他会话再次查询时已经缓存的值和编译之后的不一致,最后会提示ORA-04068,这是一个预期行为。业务想知道怎么能避免这种报错或者提前发现错误。测试过程session 11、创建包头CREATE OR REPLACE PACKAGE
2022-02-21 11:29:45
1442
原创 [2021-10-11]Oracle数据库产生大量归档日志排查方法(MOS文档)
SQL: How to Find Sessions Generating Lots of Redo or Archive logs (Doc ID 167492.1)***Checked for relevance on 13-Oct-2015***goal: How to find sessions generating lots of redofact: Oracle Server - Enterprise Edition 8fact: Oracle Server - Enterpris
2021-10-11 13:49:12
1375
原创 [2021-08-23]oracle统计信息过期原因
13.3.1About Manual Statistics Collection with DBMS_STATSUse theDBMS_STATSpackage to manipulate optimizer statistics. You can gather statistics on objects and columns at various levels of granularity: object, schema, and database. You can also gather s...
2021-08-23 17:27:59
1765
原创 [2021-08-18]oracle临时表收集统计信息
How to Gather Optimizer Statistics for an ON COMMIT DELETE ROWS Temporary Table (Doc ID 403587.1) To Bottom APPLIES TO: Oracle Database - Enterprise Edition - Version 9.0.1.0 to 10.2.0.1 [Release 9.0....
2021-08-18 14:55:54
338
原创 [2021-08-10]物化视图刷新远端数据到本地
https://blog.youkuaiyun.com/m15217321304/article/details/119571834介绍了本地物化视图创建和查询。#1、远端IP 192.168.40.33#2、远端表 TEST#3、本地IP 192.168.40.30#4、本地物化视图 TEST_MATER1、首先要创建DB_LINK(192.168.40.30)CREATE PUBLIC DATABASE LINK "MATER"CONNECT TO scott IDENTIFIED BY "
2021-08-10 16:30:41
327
原创 [2021-08-10]oracle物化视图创建例子和常用关联语句
物化视图常用于同步远端数据到本地,同样也适用创建本地表的物化视图(应该很少用)。#####创建物化视图相关语法CREATE MATERIALIZED VIEW语法CREATE MATERIALIZED VIEW [ schema. ] materialized_view [ column_alias [ENCRYPT [encryption_spec]] [, column_alias [ENCRYPT [encryption_spec]] ]... ] [ OF[ schema. ...
2021-08-10 16:02:16
759
原创 [2021-07-17]删除UNDO表空间提示ORA-01561
1、删除表空间报错SQL> drop tablespace UNDOTBS1 including contents and datafiles;drop tablespace UNDOTBS1 including contents and datafiles*ERROR at line 1:ORA-01561: failed to remove all objects in the tablespace specified2、查询表空间对应的段类型SQL> selec
2021-07-17 17:23:48
407
原创 [2021-06-18]mysql 表使用discard和import的方式迁移
如果想把一个数据库的表迁移到另外一个数据库,或者被迁移的数据库由于某种原因无法打开,那么可以使用discard和import的方式迁移表数据。1、创建一个新表t4db01 [(none)]>use gtidReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase chan
2021-06-18 17:37:39
1614
原创 [2021-06-18]mysql中GTID的幂等性
开启GTID后,MySQL恢复Binlog时,重复GTID的事务不会再执行了,那如果想恢复时怎么办?1、创建新一个测试库db01 [(none)]>create database gtid charset utf8;Query OK, 1 row affected (0.05 sec)db01 [(none)]>db01 [(none)]>select @@gtid_mode;+-------------+| @@gtid_mode |+-------------+
2021-06-18 14:27:40
287
原创 [2021-06-17]PostgreSQL事物提交日志信息clog解析
--//源码位置 src/backend/access/transam/clog.c--//xid事物的状态信息可以在头文件查看--//头文件位置src/include/access/clog.h
2021-06-17 16:31:19
849
1
转载 [2021-06-15]The Internals of PostgreSQL (二)
Chapter 2Process and Memory ArchitectureIn this chapter, the process architecture and memory architecture in PostgreSQL are summarized to help to read the subsequent chapters. If you are already familiar with them, you may skip over this chapter.2.1.
2021-06-15 15:40:10
302
转载 [2021-06-15]The Internals of PostgreSQL (一)
Chapter 1Database Cluster, Databases, and TablesThis chapter and the next chapter summarize the basic knowledge of PostgreSQL to help to read the subsequent chapters. In this chapter, following topics are described:The logical structure of a database
2021-06-15 15:37:12
556
原创 [2021-06-11]PostgreSQL Page页解析
通过使用主机层面的hexdump命令结合PG插件pageinspect可以对PG的Page分析,这样对PG的page会有更深的了解--//创建测试表
2021-06-11 16:01:07
684
原创 [2021-06-11]PostgresSQL中如何获取源码中定义变量的大小
在分析PostgresSQL源码时,有时候需要知道某些结构体、变量的大小,如果只是从字面来看又无法确定变量的大小,那这个时候可以借助C语言来实现这需求,比如下面的结构体: typedef struct PageHeaderData { /* XXX LSN is member of *any* block, not only page-organized ones */ PageXLogRecPtr pd_lsn; /* LSN: next
2021-06-11 15:21:39
224
原创 [2021-06-08]PostgresSQL 查看参数
用过Oracle的朋友都知道,在sqlplus里面可以通过show parameter +name,然后就可以模糊查询到所有相关的参数(隐含参数并且没有修改的除外),如下:
2021-06-08 17:28:40
1141
原创 [2021-06-02]Oracle一台主机多个实例配置多个监听
1、主机mncndn1上存在两个实例-bash-4.1$ hostnamemncndn1-bash-4.1$ ps -ef |grep pmonoracle 3788 1 0 05:46 ? 00:00:02 ora_pmon_QXYoracle 92205 1 0 09:10 ? 00:00:00 ora_pmon_XTTSoracle 98117 61181 0 09:15 pts/0 00:00:00 g
2021-06-02 15:08:44
812
原创 [2021-02-24] 块替换导致ORA-08103
有时候表可能出现坏块情况,这个时候可以使用其他块来覆盖,但是覆盖的时候需要注意一些自己,否则可能会遇到一些问题。1、创建测试数据SQL> conn / as sysdbaConnected.SQL> select * from t;no rows selectedSQL> insert into t values (10);1 row created.SQL> commit;Commit complete.SQL> drop table t
2021-02-24 17:08:50
281
原创 [2021-02-23] DBA_ROLLBACK_SEGS视图中回滚段状态
set lin 2000set long 20000set pagesize 1000select dbms_metadata.get_ddl('VIEW','DBA_ROLLBACK_SEGS','SYS') from dual CREATE OR REPLACE FORCE VIEW "SYS"."DBA_ROLLBACK_SEGS" ("SEGMENT_NAME", "OWNER", "TABLESPACE_NAME", "SEGMENT_ID", "FILE_ID", "BLOCK_
2021-02-23 11:15:18
582
ORACLE SQL优化工具sqlhc
2020-09-30
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人