SlideShare a Scribd company logo
Creating a Physical Standby Database 
Cách thực hiện: 
1. Tạo 2 máy ảo ping thông mạng và phải có môi trường giống nhau. 
2. Cấu hình tnsname, listener, sql và kiểm tra kết nối. 
3. Cấu hình Initialization Parameter File cho primary và standby 
4. Add redolog file 
5. Tạo controlfile cho standby từ primary. 
6. Copy source primary đến standby 
7. Kiểm tra 
Chuẩn bị: 
- OS Names: "prime" for the Primary database and "standby" for the Standby database. 
Network: 
Trên Prime:
Trên Standby: 
Next: 
+ The primary and standby databases must be using the same version of Oracle Database 11g. 
+ The primary database must be opened in ARCHIVELOG mode. 
+Install the database, Enterprise edition. (using DBCA) 
+Set up Oracle net components (using NETCA)
+Test sql net connectivity. 
PRIME: 
SQL> Alter system set db_recovery_file_dest_size=2G scope=both; 
System altered. 
Alter system set db_recovery_file_dest=’C:BKFRA’ 
Select * from v$recovery_file_dest 
Oracle Net Services network files must be set up on the primary database and on the standby 
database. 
SQLNET.ORA file of the Primary:
TNSNAMES.ORA file of the Primary:
LISTENER.ORA file of the Primary: 
SQLNET.ORA file of the Standby: 
TNSNAMES.ORA file of the Standby:
LISTENER.ORA file of the Standby: 
You can use "tnsping" to test the sql connectivity: On standby
Next: (On PRIME) Create the password file.
Create standby redo logs(On Prime): 
SELECT * from v$logfile; 
Alter database add standby logfile group 4 (‘C:apporacleoradataoraprimestandbyredo01.LOG’) 
size 50M; 
Alter database add standby logfile group 5 (‘C:apporacleoradataoraprimestandbyredo03.LOG’) 
size 50M; 
Alter database add standby logfile group 6 (‘C:apporacleoradataoraprimestandbyredo03.LOG’) 
size 50M; 
Alter database add standby logfile group 7 (‘C:apporacleoradataoraprimestandbyredo04.LOG’) 
size 50M; 
Next: Enable force logging (Optional) (On Prime) 
Select log_mode from v$database; 
Alter database force logging;
Configure the pfile of the primary: 
USING: SQL> ALTER SYSTEM SET ….
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(oraprime,orastandby)'; 
alter system set LOG_ARCHIVE_DEST_1='LOCATION=+DATA VALID_FOR=(ALL_LOGFILES,ALL_ROLES) 
DB_UNIQUE_NAME=oraprime'; 
alter system set LOG_ARCHIVE_DEST_2='SERVICE=orastandby LGWR ASYNC 
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME= orastandby’; 
alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE; 
alter system set FAL_SERVER=orastandby; 
alter system set FAL_CLIENT=oraprime; 
alter database add standby logfile '+DATA'; 
alter database add standby logfile '+DATA'; 
alter database add standby logfile '+DATA'; 
alter database add standby logfile '+DATA'; 
On Standby: 
Option 1: Create pfile with only one parameter DB_NAME. 
Start up no mount the database using the pfile.
Using: - Run RMAN Dupplicate database on primary 
rman target sys/@oraprime auxiliary sys/oracle@orastandby 
run { 
allocate channel prmy1 type disk; 
allocate channel prmy2 type disk; 
allocate channel prmy3 type disk; 
allocate channel prmy4 type disk; 
allocate auxiliary channel stby type disk; 
duplicate target database for standby from active database 
spfile 
parameter_value_convert 'oraprime','orastandby' 
set db_unique_name='orastandby' 
set control_files='+DATA' 
set log_archive_max_processes='5' 
set fal_client='oraprime' 
set fal_server='orastandby' 
set standby_file_management='AUTO' 
set log_archive_config='dg_config=(oraprime,orastandby)' 
set log_archive_dest_2='service=oraprime LGWR ASYNC 
valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=prime'
; 
} 
Start apply service on standby & Open for read-only 
recover managed standby database using current logfile disconnect from session; 
recover managed standby database cancel; 
alter database open; 
recover managed standby database using current logfile disconnect from session; 
Option 2: On PRIME 
Create a Control File for the Standby Database 
SQL> SHUTDOWN IMMEDIATE; 
SQL> STARTUP MOUNT; 
SQL>ALTER DATABASE CREATE STANDBY CONTROLFILE AS 
'C:tostandbycontrolstd.ctl'; 
SQL> ALTER DATABASE OPEN; 
Create a pFile for the Standby Database:
Copy pfile to standby and edit: 
1. FAL_SERVER 
2. FAL_CLIENT 
3. CONTROL_FILES: add standby controlfile 
*.fal_client='orastandby' 
*.fal_server='oraprime' 
*.control_files='C:apporacleoradataoraprimecontrol01.ctl','C:apporacleflash_recover 
y_areaoraprimecontrol02.ctl','C:tostandbyCONTROLSTD.CTL' 
*.log_archive_config='DG_CONFIG=(oraprime,orastandby)' 
*.log_archive_dest_1='LOCATION=C:apporacleoradataorastandby 
VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=standby' 
*.log_archive_dest_2='SERVICE=oraprime LGWR ASYNC 
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=prime'
SQL>Startup mount; 
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION; 
Check that primary and standby are synchronized 
Using: 
PRIMARY 
SQL> archive log list; 
Database log mode Archive Mode 
Automatic archival Enabled 
Archive destination /u01/arch1/orcl/ 
Oldest online log sequence 43 
Next log sequence to archive 45 
Current log sequence 45 
SQL> select database_role, open_mode from v$database; 
DATABASE_ROLE OPEN_MODE 
---------------- ---------- 
PRIMARY READ WRITE 
STANDBY
SQL> archive log list; 
Database log mode Archive Mode 
Automatic archival Enabled 
Archive destination /u01/arch1/orcl/ 
Oldest online log sequence 43 
Next log sequence to archive 0 
Current log sequence 45 
SQL> select database_role, open_mode from v$database; 
DATABASE_ROLE OPEN_MODE 
---------------- ---------- 
PHYSICAL STANDBY MOUNTED

More Related Content

DOC
Controlfilemanagement
PPTX
Cloning Oracle EBS R12: A Step by Step Procedure
PDF
FIXING BLOCK CORRUPTION (RMAN) on 11G
 
PDF
Basic - Oracle Edition Based Redefinition Presentation
 
PDF
Step by Step Restore rman to different host
PDF
Oracle applications 11i hot backup cloning with rapid clone
DOC
Oracle applications 11i hot backup cloning with rapid clone
PDF
Oracle Database 11g Product Family
 
Controlfilemanagement
Cloning Oracle EBS R12: A Step by Step Procedure
FIXING BLOCK CORRUPTION (RMAN) on 11G
 
Basic - Oracle Edition Based Redefinition Presentation
 
Step by Step Restore rman to different host
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
Oracle Database 11g Product Family
 

What's hot (20)

DOCX
Asm disk group migration from
PPT
Oracle Golden Gate
PPTX
Data Migration in Database
DOC
Rman cloning guide
PDF
Test Dml With Nologging
 
DOCX
12c database migration from ASM storage to NON-ASM storage
DOCX
Backup and Recovery
DOCX
Rman cloning when both directory and db name are same.
PDF
Install and upgrade Oracle grid infrastructure 12.1.0.2
PDF
Backup andrecoverychecklist
DOCX
Migrate from database file system to asm
PDF
Oracle business intelligence enterprise edition 11g
PPT
2011 384 hackworth_ppt
DOC
Flashback (Practical Test)
PDF
Oracle database hot backup and recovery
PPT
Less17 Util
DOCX
Change DB Name
DOCX
Enable archivelod mode in oracle rac12cR1 with asm location
PPT
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
PPT
Les 07 Rman Rec
Asm disk group migration from
Oracle Golden Gate
Data Migration in Database
Rman cloning guide
Test Dml With Nologging
 
12c database migration from ASM storage to NON-ASM storage
Backup and Recovery
Rman cloning when both directory and db name are same.
Install and upgrade Oracle grid infrastructure 12.1.0.2
Backup andrecoverychecklist
Migrate from database file system to asm
Oracle business intelligence enterprise edition 11g
2011 384 hackworth_ppt
Flashback (Practical Test)
Oracle database hot backup and recovery
Less17 Util
Change DB Name
Enable archivelod mode in oracle rac12cR1 with asm location
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Les 07 Rman Rec
Ad

Similar to Creating a physical standby database 11g on windows (20)

PPT
D17316 gc20 l05_phys_sql
PDF
oracle upgradation
PDF
How to create a non managed standby database
PPTX
Data Guard New Features
DOCX
Physical_Standby_Database_R12.2.4
PPT
Les 07 rman_rec
PDF
Migrate database to Exadata using RMAN duplicate
DOCX
Rman cloning when both directory and db name are same.
PDF
Mid term & final- preparation- student-review(Oracle)
PPT
Les 06 Perform Rec
PDF
Refresh development from productions
PDF
Oracle 11g Installation With ASM and Data Guard Setup
PDF
Kp.3 pengaturan sistem dan user
PDF
12c db upgrade from 11.2.0.4
PDF
Oracle Data Guard Physical Standby Configuration
DOC
Oracle data guard configuration in 12c
PPT
Adventures in Dataguard
DOCX
Database upgradation
PPT
5895640.ppt
PDF
آموزش مدیریت بانک اطلاعاتی اوراکل - بخش پانزدهم
D17316 gc20 l05_phys_sql
oracle upgradation
How to create a non managed standby database
Data Guard New Features
Physical_Standby_Database_R12.2.4
Les 07 rman_rec
Migrate database to Exadata using RMAN duplicate
Rman cloning when both directory and db name are same.
Mid term & final- preparation- student-review(Oracle)
Les 06 Perform Rec
Refresh development from productions
Oracle 11g Installation With ASM and Data Guard Setup
Kp.3 pengaturan sistem dan user
12c db upgrade from 11.2.0.4
Oracle Data Guard Physical Standby Configuration
Oracle data guard configuration in 12c
Adventures in Dataguard
Database upgradation
5895640.ppt
آموزش مدیریت بانک اطلاعاتی اوراکل - بخش پانزدهم
Ad

Recently uploaded (20)

PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
medical staffing services at VALiNTRY
PDF
AI in Product Development-omnex systems
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
ai tools demonstartion for schools and inter college
PDF
System and Network Administraation Chapter 3
PDF
System and Network Administration Chapter 2
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Digital Strategies for Manufacturing Companies
PDF
top salesforce developer skills in 2025.pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
history of c programming in notes for students .pptx
How to Migrate SBCGlobal Email to Yahoo Easily
How to Choose the Right IT Partner for Your Business in Malaysia
medical staffing services at VALiNTRY
AI in Product Development-omnex systems
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Reimagine Home Health with the Power of Agentic AI​
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
How Creative Agencies Leverage Project Management Software.pdf
Odoo POS Development Services by CandidRoot Solutions
Navsoft: AI-Powered Business Solutions & Custom Software Development
ai tools demonstartion for schools and inter college
System and Network Administraation Chapter 3
System and Network Administration Chapter 2
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Digital Strategies for Manufacturing Companies
top salesforce developer skills in 2025.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Upgrade and Innovation Strategies for SAP ERP Customers
history of c programming in notes for students .pptx

Creating a physical standby database 11g on windows

  • 1. Creating a Physical Standby Database Cách thực hiện: 1. Tạo 2 máy ảo ping thông mạng và phải có môi trường giống nhau. 2. Cấu hình tnsname, listener, sql và kiểm tra kết nối. 3. Cấu hình Initialization Parameter File cho primary và standby 4. Add redolog file 5. Tạo controlfile cho standby từ primary. 6. Copy source primary đến standby 7. Kiểm tra Chuẩn bị: - OS Names: "prime" for the Primary database and "standby" for the Standby database. Network: Trên Prime:
  • 2. Trên Standby: Next: + The primary and standby databases must be using the same version of Oracle Database 11g. + The primary database must be opened in ARCHIVELOG mode. +Install the database, Enterprise edition. (using DBCA) +Set up Oracle net components (using NETCA)
  • 3. +Test sql net connectivity. PRIME: SQL> Alter system set db_recovery_file_dest_size=2G scope=both; System altered. Alter system set db_recovery_file_dest=’C:BKFRA’ Select * from v$recovery_file_dest Oracle Net Services network files must be set up on the primary database and on the standby database. SQLNET.ORA file of the Primary:
  • 4. TNSNAMES.ORA file of the Primary:
  • 5. LISTENER.ORA file of the Primary: SQLNET.ORA file of the Standby: TNSNAMES.ORA file of the Standby:
  • 6. LISTENER.ORA file of the Standby: You can use "tnsping" to test the sql connectivity: On standby
  • 7. Next: (On PRIME) Create the password file.
  • 8. Create standby redo logs(On Prime): SELECT * from v$logfile; Alter database add standby logfile group 4 (‘C:apporacleoradataoraprimestandbyredo01.LOG’) size 50M; Alter database add standby logfile group 5 (‘C:apporacleoradataoraprimestandbyredo03.LOG’) size 50M; Alter database add standby logfile group 6 (‘C:apporacleoradataoraprimestandbyredo03.LOG’) size 50M; Alter database add standby logfile group 7 (‘C:apporacleoradataoraprimestandbyredo04.LOG’) size 50M; Next: Enable force logging (Optional) (On Prime) Select log_mode from v$database; Alter database force logging;
  • 9. Configure the pfile of the primary: USING: SQL> ALTER SYSTEM SET ….
  • 10. alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(oraprime,orastandby)'; alter system set LOG_ARCHIVE_DEST_1='LOCATION=+DATA VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=oraprime'; alter system set LOG_ARCHIVE_DEST_2='SERVICE=orastandby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME= orastandby’; alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE; alter system set FAL_SERVER=orastandby; alter system set FAL_CLIENT=oraprime; alter database add standby logfile '+DATA'; alter database add standby logfile '+DATA'; alter database add standby logfile '+DATA'; alter database add standby logfile '+DATA'; On Standby: Option 1: Create pfile with only one parameter DB_NAME. Start up no mount the database using the pfile.
  • 11. Using: - Run RMAN Dupplicate database on primary rman target sys/@oraprime auxiliary sys/oracle@orastandby run { allocate channel prmy1 type disk; allocate channel prmy2 type disk; allocate channel prmy3 type disk; allocate channel prmy4 type disk; allocate auxiliary channel stby type disk; duplicate target database for standby from active database spfile parameter_value_convert 'oraprime','orastandby' set db_unique_name='orastandby' set control_files='+DATA' set log_archive_max_processes='5' set fal_client='oraprime' set fal_server='orastandby' set standby_file_management='AUTO' set log_archive_config='dg_config=(oraprime,orastandby)' set log_archive_dest_2='service=oraprime LGWR ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=prime'
  • 12. ; } Start apply service on standby & Open for read-only recover managed standby database using current logfile disconnect from session; recover managed standby database cancel; alter database open; recover managed standby database using current logfile disconnect from session; Option 2: On PRIME Create a Control File for the Standby Database SQL> SHUTDOWN IMMEDIATE; SQL> STARTUP MOUNT; SQL>ALTER DATABASE CREATE STANDBY CONTROLFILE AS 'C:tostandbycontrolstd.ctl'; SQL> ALTER DATABASE OPEN; Create a pFile for the Standby Database:
  • 13. Copy pfile to standby and edit: 1. FAL_SERVER 2. FAL_CLIENT 3. CONTROL_FILES: add standby controlfile *.fal_client='orastandby' *.fal_server='oraprime' *.control_files='C:apporacleoradataoraprimecontrol01.ctl','C:apporacleflash_recover y_areaoraprimecontrol02.ctl','C:tostandbyCONTROLSTD.CTL' *.log_archive_config='DG_CONFIG=(oraprime,orastandby)' *.log_archive_dest_1='LOCATION=C:apporacleoradataorastandby VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=standby' *.log_archive_dest_2='SERVICE=oraprime LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=prime'
  • 14. SQL>Startup mount; SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION; Check that primary and standby are synchronized Using: PRIMARY SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination /u01/arch1/orcl/ Oldest online log sequence 43 Next log sequence to archive 45 Current log sequence 45 SQL> select database_role, open_mode from v$database; DATABASE_ROLE OPEN_MODE ---------------- ---------- PRIMARY READ WRITE STANDBY
  • 15. SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination /u01/arch1/orcl/ Oldest online log sequence 43 Next log sequence to archive 0 Current log sequence 45 SQL> select database_role, open_mode from v$database; DATABASE_ROLE OPEN_MODE ---------------- ---------- PHYSICAL STANDBY MOUNTED