[RMAN] use duplicate to copy the database locally
Task: the same host uses RMAN duplicate to copy the database. In the linux operating system, there is a set of running database aux after enmoedu replication.
Tutorial steps:
1. master database RMAN backup
[Oracle @ test ~] $ Export ORACLE_SID = enmoedu
[Oracle @ test ~] $ Rman target/
Recovery Manager: Release 11.2.0.3.0-Production on Fri Jun 6 00:43:13 2014
Copyright (c) 1982,201 1, Oracle and/or its affiliates. All rights reserved.
Connected to target database: ENMOEDU (DBID = 108163061)
RMAN> backup database plus archivelog;
Starting backup at 06-jun14
Using target database control file instead of recovery catalog
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID = 61 device type = DISK
Channel ORA_DISK_1: starting full datafile backup set
Channel ORA_DISK_1: specifying datafile (s) in backup set
Input datafile file number = 00001 name =/11g/app/oracle/oradata/enmoedu/system01.dbf
Input datafile file number = 00002 name =/11g/app/oracle/oradata/enmoedu/sysaux01.dbf
Input datafile file number = 00005 name =/11g/app/oracle/oradata/enmoedu/example01.dbf
Input datafile file number = 00003 name =/11g/app/oracle/oradata/enmoedu/undotbs01.dbf
Input datafile file number = 00006 name =/11g/app/oracle/oradata/enmoedu/pitr. dbf
Input datafile file number = 00007 name =/11g/app/oracle/oradata/enmoedu/pitr_ind.dbf
Input datafile file number = 00008 name =/11g/app/oracle/oradata/enmoedu/index01.dbf
Input datafile file number = 00010 name =/11g/app/oracle/oradata/enmoedu/ts_users_1.dbf
Input datafile file number = 00004 name =/11g/app/oracle/oradata/enmoedu/users01.dbf
Input datafile file number = 00009 name =/11g/app/oracle/oradata/enmoedu/ts_users.dbf
Input datafile file number = 00011 name =/11g/app/oracle/oradata/enmoedu/ts_users1.dbf
Channel ORA_DISK_1: starting piece 1 at 06-jun14
Channel ORA_DISK_1: finished piece 1 at 06-jun14
Piece handle =/11g/app/backup/db_53pa49ha_00001.bak tag = TAG20140606T004322 comment = NONE
Channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Channel ORA_DISK_1: starting full datafile backup set
Channel ORA_DISK_1: specifying datafile (s) in backup set
Including current control file in backup set
Including current SPFILE in backup set
Channel ORA_DISK_1: starting piece 1 at 06-jun14
Channel ORA_DISK_1: finished piece 1 at 06-jun14
Piece handle =/11g/app/backup/db_54pa49i3_00001.bak tag = TAG20140606T004322 comment = NONE
Channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-jun14
RMAN> quit
--------------------------------------------------------------------------------
RMAN: Configure an archive log deletion policy
Basic Oracle tutorial-copying a database through RMAN
Reference for RMAN backup policy formulation
RMAN backup learning notes
Oracle Database Backup encryption RMAN Encryption
Installing Oracle 12C in Linux-6-64
Install Oracle 11gR2 (x64) in CentOS 6.4)
Steps for installing Oracle 11gR2 in vmwarevm
Install Oracle 11g XE R2 In Debian
--------------------------------------------------------------------------------
2. Configure the listener file and tnsnames. ora
-- Change the listener to static listener. ora because the copied aux database is in nomount state and the pmon is dynamically registered when it is in mount state, you need to add static registration.
After the Listener. ora file is modified:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = enmoedu)
(ORACLE_HOME =/11g/app/oracle/product/11.2.0/dbhome)
(SID_NAME = enmoedu)
)
(SID_DESC =
(GLOBAL_DBNAME = aux)
(ORACLE_HOME =/11g/app/oracle/product/11.2.0/dbhome)
(SID_NAME = aux)
)
)
Add the following to the Tnsnames. ora file:
Aux =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.10.8) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = aux)
)
)
3. Use the spfile of the enmoedu library to generate PFILE, copy the PFILE file, change the SID Name to aux, and modify the parameters in the file.
[Oracle @ test ~] $ Sqlplus/as sysdba
SQLPlus Release 11.2.0.3.0 Production on Thu Jun 5 235614 2014
Copyright (c) 1982,201 1, Oracle. All rights reserved.
Connected
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL select instance_name, status from v $ instance;
INSTANCE_NAME STATUS
----------------------------
Enmoedu OPEN
SQL create pfile from spfile;
File created.
SQLexit
[Oracle @ test ~] $ Cd $ ORACLE_HOMEdbs
[Oracle @ test dbs] $ cp initenmoedu. ora initaux. ora
Initaux. ora before modification
Enmoedu. _ db_cache_size = 201326592
Enmoedu. _ java_pool_size = 4194304
Enmoedu. _ large_pool_size = 4194304
Enmoedu. _ oracle_base = '/11g/app/oracle' # ORACLE_BASE set from environment
Enmoedu. _ pga_aggregate_target = 293601280
Enmoedu. _ sga_target = 545259520
Enmoedu. _ shared_io_pool_size = 0
Enmoedu. _ shared_pool_size = 318767104
Enmoedu. _ streams_pool_size = 8388608
*. _ Shared_io_pool_size = 0
*. Audit_file_dest = '/11g/app/oracle/admin/enmoedu/adump'
*. Audit_trail = 'db'
*. Compatible = '11. 2.0.0.0'
*. Control_files = '/11g/app/oracle/oradata/enmoedu/control01.ctl', '/11g/app/oracle/oradata/enmoedu/control02.ctl'
*. Db_block_size = 8192
*. Db_cache_size = 201326592
*. Db_create_file_dest =''
*. Db_domain =''
*. Db_flashback_retention_target = 2880
*. Db_name = 'enabrou'
*. Db_recovery_file_dest_size = 2147483648
*. Db_recovery_file_dest = '/11g/app/backup'
*. Db_writer_processes = 2
*. Diagnostic_dest = '/11g/app/oracle'
*. Java_pool_size = 4194304
*. Large_pool_size = 4194304
*. Log_archive_format = '% t _ % s _ % r. arc'
*. Memory_target = 0
*. Open_cursors = 300
*. Pga_aggregate_target = 293601280
*. Processses = 300
*. Remote_login_passwordfile = 'clusive'
*. Sga_target = 0
*. Shared_pool_size = 318767104
*. Streams_pool_size = 8388608
*. Undo_tablespace = 'undotbs1'
After the modification, initaux. ora (the specific parameters can be adjusted according to your environment) is marked in yellow as the change item, and you need to create the path directory after the change.
Aux. _ db_cache_size = 201326592
Aux. _ java_pool_size = 4194304
Aux. _ large_pool_size = 4194304
Aux. _ oracle_base = '/11g/app/oracle' # ORACLE_BASE set from environment
Aux. _ pga_aggregate_target = 293601280
Aux. _ sga_target = 545259520
Aux. _ shared_io_pool_size = 0
Aux. _ shared_pool_size = 318767104
Aux. _ streams_pool_size = 8388608
*. _ Shared_io_pool_size = 0
*. Audit_file_dest = '/11g/app/oracle/admin/aux/adump'
*. Audit_trail = 'db'
*. Compatible = '11. 2.0.0.0'
*. Control_files = '/11g/app/oracle/oradata/aux/control01.ctl', '/11g/app/oracle/oradata/aux/control02.ctl'
*. Db_block_size = 8192
*. Db_cache_size = 201326592
*. Db_create_file_dest =''
*. Db_domain =''
*. Db_flashback_retention_target = 2880
*. Db_name = 'aux'
*. Db_recovery_file_dest_size = 2147483648
*. Db_recovery_file_dest = '/11g/app/flashback_aux'
*. Db_writer_processes = 2
*. Diagnostic_dest = '/11g/app/oracle'
*. Java_pool_size = 4194304
*. Large_pool_size = 4194304
*. Log_archive_format = '% t _ % s _ % r. arc'
*. Memory_target = 0
*. Open_cursors = 300
*. Pga_aggregate_target = 293601280
*. Processses = 300
*. Remote_login_passwordfile = 'clusive'
*. Sga_target = 0
*. Shared_pool_size = 318767104
*. Streams_pool_size = 8388608
*. Undo_tablespace = 'undotbs1'
*. Db_file_name_convert = '/11g/app/oracle/oradata/enmoedu/', '/11g/app/oracle/oradata/aux /'
*. Log_file_name_convert = '/11g/app/oracle/oradata/enmoedu/', '/11g/app/oracle/oradata/aux /'
For more details, please continue to read the highlights on the next page: