Dataguard Oracle Archive Management Scripts

Source: Internet
Author: User

Management Section

If database force logging is not enabled, the repository/*+ append */operation, nologging operation, will report the bad block;

Suggested table space Force logging or database force logging;

--force logging/nologging Test

ALTER DATABASE force Logging;select force_logging from Dba_tablespaces;select force_logging from V$database;alter Tablespace test Force Logging;select logging,table_name,tablespace_name from user_tables where table_name = ' test '; alter Tablespace Test No force logging;select tablespace_name,logging,force_logging from Dba_tablespaces;

# #配置主库的归档删除策略

CONFIGURE ARCHIVELOG deletion POLICY to applied on STANDBY;

--Pass it over and delete it.

CONFIGURE ARCHIVELOG deletion POLICY to SHIPPED to STANDBY;

Repository Delete Script

VI delete_archive.sh

#!/bin/shsource/home/oracle/.bash_profileexport oracle_sid=standbytable= ' V$archived_log ' $ORACLE _home/bin/  Sqlplus-silent "/As Sysdba" <<eofset heading off;set pagesize 0;set term off;set feedback off;set linesize 199;set trims on; set Verif off;spool/home/oracle/scripts/del_arch.sh;select ' RM-RF ' | | Name from V\ $archived _log where deleted= ' NO ' and applied= ' YES '; spool off;exit; Eofchmod +x/home/oracle/scripts/del_arch.shsh/home/oracle/scripts/del_arch.shrman Target/<<EOFcrosscheck Archivelog all;delete noprompt expired Archivelog all;exit; Eof

Adding timed tasks: crontab-e

0 1 * * * su-oracle-c/home/oracle/scripts/delete_archive.sh 1

Prepare the Library self-start script:

Vi/etc/rc.local

Su-oracle-c/home/oracle/scripts/start_db.shvi Start_db.shsource/home/oracle/.bash_profilelsnrctl Startexport Oracle_sid=standbysqlplus/as sysdba <<eofstartup;recover managed standby database using current logfile Disconnec T from Session;exit


This article is from the "Snowhill" blog, make sure to keep this source http://snowhill.blog.51cto.com/339421/1923810

Dataguard Oracle Archive Management Scripts

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.