Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Tuesday, October 13, 2020

Rman related question/answer:

 Difference between using recovery catalog and control file?

Old backup information in control file will be lost When new incarnation happens but it will be preserved in recovery catalog.

Scripts can be stored in recovery catalog. Recovery catalog is central and can have information of many databases.

What is the use of crosscheck command in RMAN?

Crosscheck will be useful to check whether the catalog information is intact with OS level information.

What are the differences between crosscheck and validate commands?

Validate command is to examine a backup set and report whether it can be restored. RMAN scans all of the backup pieces in the specified backup sets and looks at the checksum to verify that the contents are intact so that backup can be successfully restored if necessary.

Crosscheck command is to verify the status of backups and copies recorded in the RMAN repository against media such as disk or tape. The crosscheck command only processes files created on the same device type as the channel running crosscheck.

What is the difference between backup set and backup piece?

Backup set is logical. Backup piece is physical.

What is obsolete backup and expired backup?

Expired means that the backup piece or backup set is not found in the backup destination.

Obsolete means the backup piece is still available, but it is no longer needed. The backup piece is no longer needed since RMAN has been configured to no longer need this piece after so many days have elapsed, or so many backups have been performed.

Difference between auxiliary channel and maintenance channel?

New features in Oracle 12c RMAN?

New features in Oracle 11g RMAN?

What is the use of nofilenamecheck in RMAN ?

When NOFILENAMECHECK is used with the DUPLICATE command, RMAN does not validate the filenames during restoration. If the primary database and the standby database are on the same host, The DUPLICATE NOFILENAMECHECK option should not be used.

Do we need to shutdown db to change block change tracking file?

No.

What are all the  database file's that RMAN cannot backup ?

RMAN cannot take backup of the pfile, redo logs, tns or network configuration files, password files, external tables and the contents of the Oracle home files.

Can I take RMAN backup when the database is down ?

No, we can take RMAN backup only when the target database is open or in mount stage.

Wednesday, October 7, 2020

Unplugging/Plugging PDB:

 In multitenant environment, a PDB can unplug from a CDB and then plug it into another CDB.Once PDB is unplugged, it needs to be dropped from CDB as it become unusable in this CDB.Same PDB can be plugged back into the same CDB.

Unplugging PDB:

==================

Connect to PDB using sqlplus and list the location of all the datafiles of PDB which is going to unplugged.


sql>sqlplus "/ as sysdba"

sql>alter session set container=pdb1;

sql>select file_name from dba_data_files;


Close PDB:

========== 

sql>alter pluggable database pdb1 close immediate;


Unplug PDB:

===========

sql> alter pluggable database pdb1 unplug into '/u01/pdb1_db.xml';


Complete path is needed to specify which would created during this process and will contain information about this PDB. Same xml would be used during plugging into CDB.


Copy Datafile:

===============

Copy the datafiles listed in the above step to the host of CDB where we want to plug.Also copy xml file.


Drop unplugged PDB:

===================

sql>drop pluggable database pdb1 keep datafiles;


**We can skip this step, if plugging PDB on a different host.

KEEP DATAFILES clause used with drop command so that datafile dont get dropped and can be re-used id plugging in the same CDB.


Plugging PDB:

================

This would be in destination.Compatibility of PDB should be checked against CDB where it will be plugged in.

Below codes can be used, O/p should be Yes to go ahead further:

SET SERVEROUTPUT ON

DECLARE

compatible CONSTANT VARCHAR2(3) :=

CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY(

pdb_descr_file => '/u01/pdb1_db.xml',

pdb_name       => 'PDB1')

WHEN TRUE THEN 'YES'

ELSE 'NO'

END;

BEGIN

DBMS_OUTPUT.PUT_LINE(compatible);

END;

Plug in PDB in target CDB:

============================

Datafiles location on the destination host/CDB can be same or different. If location is same, we don’t need to do anything, otherwise we will need to use FILE_NAME_CONVERT option of CREATE PLUGGABLE DATABASE command to specify the new location of the datafiles. 

sql> create pluggable database pdb1 using '/u01/pdb1_db.xml'  copy file_name_convert=('/u01/app/pdb1','/u01/db/pdb1');

sql> alter pluggable database pdb1 open;

***COPY keyword is default to be used to copy files to the new destination. If destination is same as source, specify NOCOPY.

If you have copied datafiles on a different location on the destination, you will need to edit .xml file to specify the location where you have copied the datafiles so that during plugging in phase, datafiles can be searched at this location.

Tuesday, September 22, 2020

All about Autoconfig in oracle application:

 adautocfg.sh >> Call adconfig.sh which further call adconfig.pl.

adtmplreport.sh>>

[applmgr3@ ~]$ cd $AD_TOP/bin

[applmgr3@1 bin]$ ls adtmplreport.sh

[applmgr3@ bin]$ adtmplreport.sh contextfile=$CONTEXT_FILE target=/u03/applmgr3/inst/apps/PROD_xxx/ora/10.1.3/Apache/Apache/conf/httpd.conf.

adclonectx.pl >>To retrieve the applications tier context file ( if it is lost or deleted accidentally) , execute the following command on the applications tier :

perl <COMMON_TOP>/clone/bin/adclonectx.pl retrieve

adbldxml.sh >>Creates the Applications context file, e.g. .xml

adchkcfg.sh >>script at $AD_TOP/bin. This script will run autoconfig in test mode and create the difference file which tells us what is going to change, when u actually run autoconfig.

This script is used for analysis purpose. It generates a report that shows differences between the original configuration files and the AutoConfig generated configuration files. 

Autoconfig will run in 3 phases.

1.INIT     – Instantiate the drivers and templates

2.SETUP   – Fill the templated with values from xml and create files

3.PROFILE  – Update the profile values in database.

Log/Files Location:

$INST_TOP/appl/admin >> context file location.

$INST_TOP/admin/log  >> autoconfig log file.

Restore a autoconfig :

Partially. Adconfig will create a restore script at $INST_TOP/admin/out/. This restore.sh will copy the backed up files before autoconfig run to its original locations. But the profile values updated in the database can’t be restored back.

Customization:

The way to do customization was to insert custom code between the BeginCustomization and End Customization blocks in the XML file.

It was difficult todocument and keep track of the customizations that were made. Now Oracle hascome up with a better way to manage and maintain customizations.

Create the custom directory in $PROD_TOP/admin/template

$AD_TOP/bin/adtmplreport.sh contextfile=/appl/admin/.xml

target=$FND_TOP/admin/template/appsweb.cfg

The above command would return "$FND_TOP/admin/template/forms_web_1012_cfg.tmp", means

the "appsweb.cfg" file was created from the source Autoconfig template $FND_TOP/admin/template/forms_web_1012_cfg.tmp.

Copy the "forms_web_1012_cfg.tmp" into custom directory created earlier  and then edit it to your requirements

Copy the template $FND_TOP/admin/template/forms_web_1012_cfg.tmp  to  $FND_TOP/admin/template/custom