control_file_record_keep_time integer 7days
controlfile = $ORACLE_BASE/ORADATA/DB_UNIQUE_NAME/CONTROL01.dbf
if flash enabled
$ORACLE_BASE/FAST_RECOVERY_AREA/DB_UNIQUE_NAME/CONTROL02.CTL
REMOTE_LOGIn_PASSWORDFILE=exclusive.
audit_file_dest=$ORACLE_BASE/admin/DB_UNIQUE_NAME/adump
audit_trail=db
DB_recovery_file_dest
db_recovery_File_dest_size
things to be remembered
v$pwfile_users
oerr ora 16778
DGMGRL> show configuration;
Configuration - PeppiEnKokki
Protection Mode: MaxPerformance
Databases:
peppi - Primary database
kokki - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
https://docs.oracle.com/cd/B28359_01/backup.111/b28270/rcmdupdb.htm#BRADV89933 - auxilary instance initialization parameter
https://prutser.wordpress.com/2011/06/13/password-file-maintenance-in-a-data-guard-environment/ - Moving password file from
primary to standby
service name
A logical representation of a database, which is the way a database is presented to clients. (A database can be presented as multiple services and a service can be implemented as multiple database instances. The service name is a string that is the global database name, that is, a name comprising the database name and domain name, entered during installation or database creation. If you are not sure what the global database name is, you can obtain it from the value of the SERVICE_NAMES parameter in the initialization parameter file.)
The service name is included in the connect data part of the connect descriptor.
connect data
A portion of the connect descriptor that defines the destination database service name or Oracle System Identifier (SID). In the following example, SERVICE_NAME defines a database service called sales.us.example.com:
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521)
(CONNECT_DATA=
(SERVICE_NAME=sales.us.example.com)))
connect descriptor
A specially formatted description of the destination for a network connection. A connect descriptor contains destination service and network route information.
The destination service is indicated by using its service name for Oracle9i or Oracle8i databases or its Oracle System Identifier (SID) for Oracle release 8.0 databases. The network route provides, at a minimum, the location of the listener through use of a network address
connect identifier
A connect descriptor or a name that maps to a connect descriptor. A connect identifier can be a net service name, database service name, or net service alias. Users initiate a connect request by passing a user name and password along with a connect identifier in a connect string for the service to which they want to connect:
CONNECT username@connect_identifier
connect string
Information the user passes to a service to connect, such as user name, password, and connect identifier:
CONNECT username@net_service_name
connect-time failover
A client connect request is forwarded to a another listener if a listener is not responding. Connect-time failover is enabled by service registration, because the listener knows if an instance is running to attempting a connection.
Choosing a Strategy for Naming Duplicate Files
When duplicating a database, RMAN generates names for the duplicate database files. If the destination host uses the same directory structure as the source host, then you can use the same names for the duplicate database files that you used for the source database files. In this case, you do not need to rename the duplicate files, but you do have to specify the NOFILENAMECHECK option on the DUPLICATE command
what is use of NOFILENAMECHECK option on the DUPLICATE command
if NOFILENAMECHECK check is specified , then then whatever the datafilenames is present in source database same datafile names gets copied to destination database provided both directory structure of source and destination database should be same.
If the hosts use different directory structures, or if they use the same structure but you want to name the duplicate files differently, then decide how to generate the names for the duplicate database files. Specifically, decide how to name the control files, datafiles, online redo log files, and tempfiles.
RMAN supports the following strategies for generating names for duplicate files:
Specify the SPFILE clause on the DUPLICATE command to set all necessary parameters involving filenames, with the exception of DB_FILE_NAME_CONVERT
Oracle recommends this strategy because it is simplest. When you execute DUPLICATE ... SPFILE, RMAN either restores the server parameter file from a backup or copies it from an active database. RMAN updates the initialization parameter values in the copied server parameter file based on the SPFILE PARAMETER_VALUE_CONVERT and SPFILE SET values (in this order). RMAN then restarts the auxiliary instance with the server parameter file.
if you use initialization paramter , then You can set the parameters in the initialization parameter file on the duplicate instance, specify the LOGFILE and DB_FILE_NAME_CONVERT clauses of the DUPLICATE command, or issue SET and CONFIGURE commands. You can combine any of these options to produce the desired effect.
SPFILE ... PARAMETER_VALUE_CONVERT 'string_pattern'
Specifies conversion strings for initialization parameters whose values specify path names, with the exception of the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT parameters. The primary purpose of PARAMETER_VALUE_CONVERT is so that you can set a collection of initialization parameters and avoid explicitly setting them one by one.
SPFILE ... SET 'string_pattern'
Sets the specified initialization parameters to the specified values. You can use SET to set the LOG_FILE_NAME_CONVERT parameter for the online redo logs.
DB_FILE_NAME_CONVERT 'string_pattern'
Specifies a rule for creating the filenames for duplicate datafiles and tempfiles. Note that DB_FILE_NAME_CONVERT specified on the DUPLICATE command overrides the initialization parameter DB_FILE_NAME_CONVERT if it is set in the initialization parameter file.
NOFILENAMECHECK
Prevents RMAN from checking whether the source database datafiles and online redo logs files share the same names as the duplicated files. This option is necessary when you are creating a duplicate database in a different host that has the same disk configuration, directory structure, and filenames as the host of the source database. If duplicating a database on the same host as the source database, then make sure that NOFILENAMECHECK is not set.
Example 23-1 Using the SPFILE Clause to Name Duplicate Files
DUPLICATE TARGET DATABASE TO dup1
FROM ACTIVE DATABASE
DB_FILE_NAME_CONVERT '/disk1','/disk2'
SPFILE
PARAMETER_VALUE_CONVERT '/disk1', '/disk2'
SET LOG_FILE_NAME_CONVERT '/disk1','/disk2'
SET SGA_MAX_SIZE '200M'
SET SGA_TARGET '125M';
shows a DUPLICATE command that uses the SPFILE clause to name duplicate files. The PARAMETER_VALUE_CONVERT option substitutes /disk2 for /disk1 in all initialization parameters that specify filenames (with the exception of DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT). The SET LOG_FILE_NAME_CONVERT clause substitutes /disk2 for /disk1 in the filenames of the online redo logs of the duplicate database. The DB_FILE_NAME_CONVERT option replaces /disk1 with /disk2 in the names of the duplicate datafiles and tempfiles.
Preparing the Auxiliary Instance
Step 1: Create an Oracle Password File for the Auxiliary Instance
A password file is required for the auxiliary instance only if one of the following conditions is true:
You use the RMAN client on a host other than the destination host.
You duplicate from an active database.
Note:
A password file is not required for backup-based duplication. You can use operating system authentication for the auxiliary connection when duplicating to the same host as the source database.
When using the FROM ACTIVE DATABASE option, the source database instance, which is the database instance to which RMAN is connected as TARGET, connects directly to the auxiliary database instance. This connection requires a password file with the same SYSDBA password. You can create the password file manually, making sure to use the same SYSDBA password as the source database. You may want to create the password file with a single password so you can start the auxiliary instance and enable the source database to connect to it.
===========
alter database backup controlfile to trace;
sqlplus sys/active@DG_ACTIVE as sysdba
orapwd file=orapwactive password=oracle entries=10 force=y ignorecase=y
Example 2-70 Duplicating from an Active Database
Assume that you want to create a test database from database prod1 on a new host. The new host has the same directory structure as the source host, so the files in the duplicate database can use the same names as the files in the source database. You want to create the database without using RMAN backups and allow prod1 to remain open during the duplication.
If prod1 uses a server parameter file, then you can create an initialization parameter file on the destination host that contains only the DB_NAME parameter set to an arbitrary value. Before starting the auxiliary instance you should create a password file that has the same SYSDBA password as the source database. Afterward, start the auxiliary instance.
By default, RMAN does not duplicate the password file when creating a duplicate database that is not a standby database. The PASSWORD FILE option specifies that RMAN should copy the password file to the destination host. If you want the duplicate database to contain all the passwords available on your source database, then use the PASSWORD FILE option.
You do not need to configure auxiliary channels because RMAN uses the normal channels configured on the source database to copy the database files. Start the RMAN client, connect to the source and auxiliary database instances, and duplicate the database as follows:
No comments:
Post a Comment