Standby Database for report

为解决生产数据库因报表查询导致的性能瓶颈,本文介绍了一种利用备用数据库进行报表处理的方法。通过在非高峰时段同步归档日志并应用到专用报表数据库,有效减轻了生产系统的负担。

原先的reportProduction DB上跑,已经使得其不堪重负。User多次反映有时速度很慢,影响工作效率。

[@more@]

Standby Database for report

原先的reportProduction DB上跑,已经使得其不堪重负。User多次反映有时速度很慢,影响工作效率。

RHEL4 + 9IR2

目前已经有一台Physical Standby Database,但主要目的是备援,不适合用来做Report DB

因此需要另外再搭建一台standby database for report.

详细搭建不多说,这台Report DBLOG传输和LOG apply完全靠OS上的机制。

9ir2Standby database本可以从另一个standby DB上接收Archived log,这个称作cascaded redo log destinations。这种机制依赖于LGWR transport method,这对于Server负载本已经很高的Production DB来说,依然是负担。

所以还是依靠CRON & shell来实现从现有的standby DB上拉回Archived log

首先要和应用人员确定可以用来Apply Archived log的时间段,然后再确定一次Apply需要多久的时间。

以上确定好之后,便可以确定CRONJob的时间设定。

由于一天产生的Archived log数量众多,因此会分时先将Archived log通过SCPCopy过来。

COPYshell:

#!/bin/sh

if [ ! ${#} -eq "3" ]; then

echo "Usage is "

echo $0 '"a trusted host" "archived log dest" "time range"'

exit 1

fi

copyfile='/tmp/ready_to_copy.lst'

export copyfile

ssh $1 "/usr/bin/find $2/*.arc -mmin -$3" > $copyfile

cat $copyfile | while read FILENAME

do

scp $1:$FILENAME $2

done

然后在每天的特定时间段便可Apply log

主要还是调用这样一段SQL:

host echo "Shutdown Database!!"

shutdown immediate;

host echo "Sleep 35 secs"

host sleep 35;

host echo "Start Database Mount!!"

startup nomount;

host echo "Alter database mount standby database;"

alter database mount standby database;

host echo "Recover standby database automatically"

recover automatic standby database;

host echo "Alter database open read only"

alter database open read only;

目前运行一周多正常。只是在Report DBV$archived_log上的信息不能同步。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10856805/viewspace-998093/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10856805/viewspace-998093/

翻译下面内容 Oracle Database 11g Release 11.2.0.4.0 ORACLE DATABASE Patch for Bug# 8857940 for AIX5L Platforms This patch is RAC Rolling Installable - Please read My Oracle Support Document 244241.1 https://support.us.oracle.com/oip/faces/secure/km/DocumentDisplay.jspx?id=244241.1 Rolling Patch - OPatch Support for RAC. This patch is Data Guard Standby-First Installable - Please read My Oracle Support Note 1265700.1 https://support.us.oracle.com/oip/faces/secure/km/DocumentDisplay.jspx?id=1265700.1 Oracle Patch Assurance - Data Guard Standby-First Patch Apply for details on how to remove risk and reduce downtime when applying this patch. Released: Sat Jun 11 09:03:01 2016 This document describes how you can install the ORACLE DATABASE interim patch for bug# 8857940 on your Oracle Database 11g Release 11.2.0.4.0 (I) Prerequisites -------------------- Before you install or deinstall the patch, ensure that you meet the following requirements: Note: In case of an Oracle RAC environment, meet these prerequisites on each of the nodes. 1. Ensure that the Oracle home on which you are installing the patch or from which you are rolling back the patch is Oracle Database 11g Release 11.2.0.4.0. 2. Oracle recommends that you use the latest version available for 11g Release 11.2.0.4.0. If you do not have OPatch 11g Release 11.2.0.3.5 or the latest version available for 11g Release 11.2.0.4.0,then download it from patch# 6880880 for 11.2.0.4.0 release. For information about OPatch documentation, including any known issues, see My Oracle Support Document 293369.1 OPatch documentation list: https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=224346.1 3. Ensure that you set (as the home user) the ORACLE_HOME environment variable to the Oracle home. 4. Ensure that the $PATH definition has the following executables: make, ar, ld and nm. The location of these executables depends on your operating system. On many operating systems, they are located in /usr/ccs/bin. 5. Ensure that you verify the Oracle Inventory because OPatch accesses it to install the patches. To verify the inventory, run the following command. $ opatch lsinventory Note: - If this command succeeds, it will list the Top-Level Oracle Products and one-off patches if any that are installed in the Oralce Home. - Save the output so you have the status prior to the patch apply. - If the command displays some errors, then contact Oracle Support and resolve the issue first before proceeding further. 6. (Only for Installation) Maintain a location for storing the contents of the patch ZIP file. In the rest of the document, this location (absolute path) is referred to as <PATCH_TOP_DIR>. Extract the contents of the patch ZIP file to the location (PATCH_TOP_DIR) you have created above. To do so, run the following command: $ unzip -d <PATCH_TOP_DIR> p8857940_112040_AIX64-5L.zip 7. (Only for Installation) Determine whether any currently installed interim patches conflict with this patch 8857940 as shown below: $ cd <PATCH_TOP_DIR>/8857940 $ opatch prereq CheckConflictAgainstOHWithDetail -ph ./ The report will indicate the patches that conflict with this patch and the patches for which the current 8857940 is a superset. Note: When OPatch starts, it validates the patch and ensures that there are no conflicts with the software already installed in the ORACLE_HOME. OPatch categorizes conflicts into the following types: - Conflicts with a patch already applied to the ORACLE_HOME that is a subset of the patch you are trying to apply - In this case, continue with the patch installation because the new patch contains all the fixes from the existing patch in the ORACLE_HOME. The subset patch will automatically be rolled back prior to the installation of the new patch. - Conflicts with a patch already applied to the ORACLE_HOME - In this case, stop the patch installation and contact Oracle Support Services. 8. Ensure that you shut down all the services running from the Oracle home. Note: - For a Non-RAC environment, shut down all the services running from the Oracle home. - For a RAC environment, shut down all the services (database, ASM, listeners, nodeapps, and CRS daemons) running from the Oracle home of the node you want to patch. After you patch this node, start the services on this node.Repeat this process for each of the other nodes of the Oracle RAC system. OPatch is used on only one node at a time. (II) Installation ----------------- To install the patch, follow these steps: 1. Set your current directory to the directory where the patch is located and then run the OPatch utility by entering the following commands: $ cd <PATCH_TOP_DIR>/8857940 $ opatch apply 2. Verify whether the patch has been successfully installed by running the following command: $ opatch lsinventory 3. Start the services from the Oracle home. (III) Deinstallation ---------------------- Ensure to follow the Prerequsites (Section I). To deinstall the patch, follow these steps: 1. Deinstall the patch by running the following command: $ opatch rollback -id 8857940 2. Start the services from the Oracle home. 3. Ensure that you verify the Oracle Inventory and compare the output with the one run before the patch installation and re-apply any patches that were rolled back as part of this patch apply. To verify the inventory, run the following command: $ opatch lsinventory (IV) Bugs Fixed by This Patch --------------------------------- The following are the bugs fixed by this patch: 8857940: NEED COMMON DURATIONS FOR UNSHRINKABLE POOLS -------------------------------------------------------------------------- Copyright 2016, Oracle and/or its affiliates. All rights reserved. --------------------------------------------------------------------------
10-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值