2016年4月30日 星期六

022_DG_2_Backup

022_DG_2_Backup

SQL*Plus: Release 11.2.0.1.0 Production on Fri Apr 29 15:43:31 2016


Copyright (c) 1982, 2009, Oracle. All rights reserved.


Connected
to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options

SQL> SELECT LOG_MODE FROM
V$DATABASE;


如果是出現  ARCHIVELOG 
沒事

LOG_MODE
------------
ARCHIVELOG


SQL>
select force_logging from v$database;


如果是出現  YES  沒事
FOR
---

YES


$> 






4.3.1 建立TNS-Alias on Primary

PROD


orcl:MADPDB:PROD-oracle$ cd
$ORACLE_HOME/network/admin

orcl:MADPDB:PROD-oracle$
 vi tnsnames.ora





4.3.2 建立所需目錄於Standby Server

STAGE

orcl:Standby:dbs oracle$
cd $ORACLE_HOME/dbs
orcl:Standby:dbs
oracle$ vi initorcl.ora






4.3.3 Copy SPFILE from Primary to Standby



orcl:PROD-oracle$ cd
$ORACLE_HOME/dbs

orcl:PROD-oracle$
vi initorcl.ora






4.4 備份Primary資料庫

PROD




orcl:MobileAD_DB1:archive_log oracle$ rman target /


Recovery Manager: Release 11.2.0.1.0 - Production on Fri Apr 29 17:17:23
2016

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All
rights reserved.

connected to target database: ADPMOBIL
(DBID=2330223285)

RMAN>

RMAN> backup
database format '/rmanbackup/PRMY_%U.bk'
       
plus archivelog format '/rmanbackup/PRMY_AR%U.bk';




4.4  如果有 完整備份的話   

不要用完整備份會出人命


也可以直接將後面的 archivelog 備份即可






RMAN>    backup archivelog all format '/rmanbackup/PRMY_AR%U.bk';




4.5 備份controlfile for standby


RMAN> backup current controlfile for standby format '/rmanbackup/standby.ctl';




4.6 傳送備份至Standby Server


使用scp指令將Primary Database的備份傳送到Standby Server,紅字部份請依環境調整。






沒有留言:

RHEL install EPEL

  https://www.linuxtechi.com/install-epel-repo-on-rhel-system/ EPEL dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest...