Configure ORACLE 11g adg and oracle11gadg

Source: Internet
Author: User

Configure ORACLE 11g adg and oracle11gadg

I installed 10 Gbit/s in the past without taking notes. I used the duplicate method to install an 11 Gbit/s ADG yesterday. The process was hard and I recorded the following:

 

I. Environment Configuration

 

Master Database

IP Address: 192.168.233.128/24

Operating system version: rhel5.8 64bit

Database Version: 11.2.0.1 64bit

Database sid Name: orcl

Database Name: orcl

Database db_unique_name: orcl1

Host Name: pr

 

Physical standby Database

IP Address: 192.168.233.129/24

Operating system version: rhel5.8 64bit

Database Version: 11.2.0.1 64bit

Database sid Name: orcl

Database Name: orcl

Database db_unique_name: orcl2

Host Name: st

 

2. Modify the listener. ora and tnsnames. ora files of the master and slave databases as follows:

[Oracle @ pr admin] $ more listener. ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = pr) (PORT = 1521 ))
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521 ))
)
)

[Oracle @ pr admin] $ more tnsnames. ora
Orcl1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.233.128) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl1)
)
)

Orcl2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.233.129) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl2)
)
)

 

[Oracle @ st admin] $ more listener. ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = st) (PORT = 1521 ))
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521 ))
)
)


SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl2)
(ORACLE_HOME =/export/11g/product)
(SID_NAME = orcl)
)
)


[Oracle @ st admin] $ more tnsnames. ora
Orcl1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.233.128) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl1)
)
)

Orcl2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.233.129) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl2)
)
)

 


 

3. Modify the pfile file of the master and slave databases. The red part is the new one.

[Oracle @ pr dbs] $ more initorcl. ora
Orcl. _ db_cache_size = 142606336
Orcl. _ Java _pool_size = 4194304
Orcl. _ large_pool_size = 4194304
Orcl. _ oracle_base = '/export/11g' # ORACLE_BASE set from environment
Orcl. _ pga_aggregate_target = 167772160
Orcl. _ sga_target = 251658240
Orcl. _ shared_io_pool_size = 0
Orcl. _ shared_pool_size = 92274688
Orcl. _ streams_pool_size = 0
*. Audit_file_dest = '/export/11g/admin/orcl/adump'
*. Audit_trail = 'db'
*. Compatible = '11. 2.0.0.0'
*. Control_files = '/export/11g/oradata/orcl/control01.ctl', '/export/11g/flash_recovery_area/orcl/control02.ctl'
*. Db_block_size = 8192
*. Db_domain =''
*. Db_name = 'orcl'
*. Db_recovery_file_dest = '/export/11g/flash_recovery_area'
*. Db_recovery_file_dest_size = 4070572032
*. Diagnostic_dest = '/export/11g'
*. Dispatchers = '(PROTOCOL = TCP) (SERVICE = orclXDB )'
*. Log_archive_format = '% t _ % s _ % r. dbf'
*. Memory_target = 417333248
*. Open_cursors = 300
*. Processses = 150
*. Remote_login_passwordfile = 'clusive'
*. Undo_tablespace = 'undotbs1'
*. Db_unique_name = 'orcl1'
*. Fal_client = 'orcl1'
*. Fal_server = 'orcl2'
*. Log_archive_config = 'dg _ CONFIG = (orcl1, orcl2 )'
*. Log_archive_dest_1 = 'location = USE_DB_RECOVERY_FILE_DEST valid_for = (all_logfiles, primary_role) db_unique_name = orcl1'
*. Log_archive_dest_2 = 'service = orcl2 lgwr async valid_for = (online_logfile, primary_role) db_unique_name = orcl2'
*. Remote_login_passwordfile = 'clusive'
*. Standby_file_management = 'auto'

 

[Oracle @ st dbs] $ more initorcl. ora
Orcl. _ db_cache_size = 142606336
Orcl. _ Java _pool_size = 4194304
Orcl. _ large_pool_size = 4194304
Orcl. _ oracle_base = '/export/11g' # ORACLE_BASE set from environment
Orcl. _ pga_aggregate_target = 167772160
Orcl. _ sga_target = 251658240
Orcl. _ shared_io_pool_size = 0
Orcl. _ shared_pool_size = 92274688
Orcl. _ streams_pool_size = 0
*. Audit_file_dest = '/export/11g/admin/orcl/adump'
*. Audit_trail = 'db'
*. Compatible = '11. 2.0.0.0'
*. Control_files = '/export/11g/oradata/orcl/control01.ctl', '/export/11g/flash_recovery_area/orcl/control02.ctl'
*. Db_block_size = 8192
*. Db_domain =''
*. Db_name = 'orcl'
*. Db_recovery_file_dest = '/export/11g/flash_recovery_area'
*. Db_recovery_file_dest_size = 4070572032
*. Diagnostic_dest = '/export/11g'
*. Dispatchers = '(PROTOCOL = TCP) (SERVICE = orclXDB )'
*. Log_archive_format = '% t _ % s _ % r. dbf'
*. Memory_target = 417333248
*. Open_cursors = 300
*. Processses = 150
*. Remote_login_passwordfile = 'clusive'
*. Undo_tablespace = 'undotbs1'
*. Fal_client = 'orcl2'
*. Fal_server = 'orcl1'
*. Log_archive_config = 'dg _ CONFIG = (orcl1, orcl2 )'
*. Log_archive_dest_1 = 'location = USE_DB_RECOVERY_FILE_DEST valid_for = (all_logfiles, primary_role) db_unique_name = orcl2'
*. Log_archive_dest_2 = 'service = orcl1 lgwr async valid_for = (online_logfile, primary_role) db_unique_name = orcl1'
*. Remote_login_passwordfile = 'clusive'
*. Standby_file_management = 'auto'
*. Db_unique_name = 'orcl2'

 

4. Create a directory on the slave Database

Such as udump/, oradate/

 

5. Start the slave database to the nomount status, and connect to the master database for duplicate operations.

 

[Oracle @ st dbs] rman targetsys/oracle @ orcl1 auxiliarysys/oracle @ orcl2

RMAN> duplicate target database for standby from activedatabase nofilenamecheck;

 

Starting Duplicate Db at 10-NOV-14

Using target databasecontrol file instead of recovery catalog

Allocated channel: ORA_AUX_DISK_1

Channel ORA_AUX_DISK_1: SID = 20 device type = DISK

 

Contents of MemoryScript:

{

Backup as copy reuse

Targetfile '/export/11g/product/dbs/orapworcl' auxiliary format

'/Export/11g/product/dbs/orapworcl ';

}

Executing Memory Script

 

Starting backup at 10-NOV-14

Allocated channel: ORA_DISK_1

Channel ORA_DISK_1: SID = 43 device type = DISK

Finished backup at10-NOV-14.

 

Contents of MemoryScript:

{

Backup as copy current controlfile forstandby auxiliary format '/export/11g/oradata/orcl/control01.ctl ';

Restore clone controlfile to '/export/11g/flash_recovery_area/orcl/control02.ctl' from

'/Export/11g/oradata/orcl/control01.ctl ';

}

Executing Memory Script

 

Starting backup at 10-NOV-14

Using channel ORA_DISK_1

Channel ORA_DISK_1: starting datafile copy

Copying standby controlfile

Output filename =/export/11g/product/dbs/snapcf_orcl.f tag = TAG20141110T094600 RECID = 5 STAMP = 863257560

Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03

Finished backup at10-NOV-14.

 

Starting restore at 10-NOV-14

Using channelORA_AUX_DISK_1

 

Channel ORA_AUX_DISK_1: copied control file copy

Finished restore at10-NOV-14

 

Contents of MemoryScript:

{

SQL clone 'alter database mount standbydatabase ';

}

Executing Memory Script

 

SQL statement: alterdatabase mount standby database

 

Contents of MemoryScript:

{

Set newname for tempfile 1

"/Export/11g/oradata/orcl/temp01.dbf ";

Switch clone tempfile all;

Set newname for datafile 1

"/Export/11g/oradata/orcl/system01.dbf ";

Set newname for datafile 2

"/Export/11g/oradata/orcl/sysaux01.dbf ";

Set newname for datafile 3

"/Export/11g/oradata/orcl/undotbs01.dbf ";

Set newname for datafile 4

"/Export/11g/oradata/orcl/users01.dbf ";

Set newname for datafile 5

"/Export/11g/oradata/orcl/example01.dbf ";

Backup as copy reuse

Datafile 1 auxiliary format

"/Export/11g/oradata/orcl/system01.dbf" datafile

2 auxiliary format

"/Export/11g/oradata/orcl/sysaux01.dbf" datafile

3 auxiliary format

"/Export/11g/oradata/orcl/undotbs01.dbf" datafile

4 auxiliary format

"/Export/11g/oradata/orcl/users01.dbf" datafile

5 auxiliary format

"/Export/11g/oradata/orcl/example01.dbf ";

SQL 'alter system archive log current ';

}

Executing Memory Script

 

Executing command: SETNEWNAME

 

Renamed tempfile 1 to/export/11g/oradata/orcl/temp01.dbf in control file

 

Executing command: SETNEWNAME

 

Executing command: SETNEWNAME

 

Executing command: SETNEWNAME

 

Executing command: SETNEWNAME

 

Executing command: SETNEWNAME

 

Starting backup at 10-NOV-14

Using channel ORA_DISK_1

Channel ORA_DISK_1: starting datafile copy

Input datafile filenumber = 00001 name =/export/11g/oradata/orcl/system01.dbf

Output filename =/export/11g/oradata/orcl/system01.dbf tag = TAG20141110T094610

Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:56

Channel ORA_DISK_1: startingdatafile copy

Input datafile filenumber = 00002 name =/export/11g/oradata/orcl/sysaux01.dbf

Output filename =/export/11g/oradata/orcl/sysaux01.dbf tag = TAG20141110T094610

Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35

Channel ORA_DISK_1: starting datafile copy

Input datafile filenumber = 00005 name =/export/11g/oradata/orcl/example01.dbf

Output filename =/export/11g/oradata/orcl/example01.dbf tag = TAG20141110T094610

Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:16

Channel ORA_DISK_1: starting datafile copy

Input datafile filenumber = 00003 name =/export/11g/oradata/orcl/undotbs01.dbf

Output filename =/export/11g/oradata/orcl/undotbs01.dbf tag = TAG20141110T094610

Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07

Channel ORA_DISK_1: starting datafile copy

Input datafile filenumber = 00004 name =/export/11g/oradata/orcl/users01.dbf

Output filename =/export/11g/oradata/orcl/users01.dbf tag = TAG20141110T094610

Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07

Finished backup at10-NOV-14.

 

SQL statement: altersystem archive log current

 

Contents of MemoryScript:

{

Switch clone datafile all;

}

Executing Memory Script

 

Datafile 1 switched todatafile copy

Input datafile copyRECID = 5 STAMP = 863257693 file name =/export/11g/oradata/orcl/system01.dbf

Datafile 2 switched todatafile copy

Input datafile copyRECID = 6 STAMP = 863257694 file name =/export/11g/oradata/orcl/sysaux01.dbf

Datafile 3 switched todatafile copy

Input datafile copyRECID = 7 STAMP = 863257694 file name =/export/11g/oradata/orcl/undotbs01.dbf

Datafile 4 switched todatafile copy

Input datafile copyRECID = 8 STAMP = 863257694 file name =/export/11g/oradata/orcl/users01.dbf

Datafile 5 switched todatafile copy

Input datafile copyRECID = 9 STAMP = 863257694 file name =/export/11g/oradata/orcl/example01.dbf

Finished Duplicate Db at10-NOV-14

 

RMAN> exit

 

 

Recovery Managercomplete.

 

So far, the slave database has been created.

 

Many problems encountered during this period are summarized as follows:
1. When you run [oracle @ st dbs] rman target sys/oracle @ orcl1 auxiliarysys/oracle @ orcl2, the system prompts that you cannot connect to orcl1, but can ping the pr. It turns out that the firewall is not enabled

2. the service_name in the tnsname. ora file corresponds to the service_name In the listener of the connection peer.

3. Static listening is configured in the slave database. For more information, see http://blog.itpub.net/23135684/viewspace-692707.

4. Execute duplicate target database for standby from active database nofilenamecheck. the following error occurs during running because the fourth step in the text is missing and the corresponding directory is not created on the slave database.

RMAN> duplicate target database for standby from active database;

Starting Duplicate Db at 10-NOV-14
Using target database control file instead of recovery catalog
Allocated channel: ORA_AUX_DISK_1
Channel ORA_AUX_DISK_1: SID = 19 device type = DISK

...... Omitted

Contents of Memory Script:
{
Backup as copy current controlfile for standby auxiliary format '/export/11g/oradata/orcl/control01.ctl ';
Restore clone controlfile to '/export/11g/flash_recovery_area/orcl/control02.ctl' from
'/Export/11g/oradata/orcl/control01.ctl ';
}
Executing Memory Script

Starting backup at 10-NOV-14
Using channel ORA_DISK_1
Channel ORA_DISK_1: starting datafile copy
Copying standby control file
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error message stack follows ==========================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of Duplicate Db command at 11/10/2014 09:24:29
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/10/2014 09:24:29
ORA-17628: Oracle error 19505 returned by remote Oracle server

 

5. Execute duplicate target database for standby from active database nofilenamecheck. the following error occurs during running because nofilenamecheck is not used.

RMAN> duplicate target database for standby from active database;

Starting Duplicate Db at 10-NOV-14
Using channel ORA_AUX_DISK_1

...... ...... Omitted

Contents of Memory Script:
{
SQL clone 'alter database mount standby database ';
}
Executing Memory Script

SQL statement: alter database mount standby database
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error message stack follows ==========================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of Duplicate Db command at 11/10/2014 09:33:14
RMAN-05501: aborting duplication of target database
RMAN-05001: auxiliary file name/export/11g/oradata/orcl/example01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name/export/11g/oradata/orcl/users01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name/export/11g/oradata/orcl/undotbs01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name/export/11g/oradata/orcl/sysaux01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary file name/export/11g/oradata/orcl/system01.dbf conflicts with a file used by the target database

 

 

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.