Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Thursday, July 28, 2022

All Explaination

 http://dbaparadise.com/2021/01/what-is-local-undo-mode/

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

Four Ways to Startup or Shutdown Your 19c Database:

There you have the 4 tools: SQLPLUS, RMAN, Cloud Control, SRVCTL!

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

What Is Local Undo Mode:

12c database (release 1)>>shared undo mode>>undo tablespace was shared by all the PDBs within the same CDB, meaning there was only one UNDO tablespace for the instances.

with 12cR2, the local undo mode was introduced>>each PDB has their own UNDO tablespaces.This is required by a few Oracle features, ie. hot cloning.

Here are some of features that I came across, that require local undo mode: PDB hot cloning, creating refreshable PDBs, near zero downtime PDB relocation, proxy PDBs.

If the database (the CDB) is created with DBCA, then local undo mode is the default mode. If the database (the CDB) is created with the CREATE DATABASE statement, then shared undo mode is the default.

In the latter case, you need to use the undo_mode_clause and specify LOCAL UNDO ON explicitly, if you want to create a database with local undo mode.

How to determine what undo mode the database is in? The answer is in the database_properties view

col property_name for A20

col property_value for A20

 select property_name, property_value  from database_properties where property_name like '%UNDO%';

Another method:

select con_id, tablespace_name from cdb_tablespaces where contents like '%UNDO%' order by 1;

How to switch to local undo mode?

it requires an outage.

sqlplus / as sysdba

shutdown immediate;

startup upgrade

 alter database local undo on;

 shutdown immediate;

startup;

To switch to shared undo mode

sqlplus / as sysdba

shutdown immediate;

startup upgrade;

alter database local undo off;

 shutdown immediate;

startup;

Note that the local undo tablespace inside the PDBs will not be dropped by Oracle and it will not be used either. For clarity purposes it is recommended to drop them manually after you switch the database to shared undo mode.

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

MAX_PDBS parameter:

Introduced in 12cR2.

To limit the number of pluggable databases (PDBs) one can create in a CDB or in an application root container. 

the PDB$SEED, Application Seed and Application Root are ignored from the count.

By default this parameter’s value is 4098

Why would you want to limit the number of PDBs a user can create in the CDB?

One of the reasons is licensing!

In 12c version you can have 1 user created PDB, without paying for the Multitenant option. In 19c you can have up to 3 user created PDBs in a CDB, without paying for the Multitenant option.

Once the parameter is set, if you will try to create another PDB, by accident, you will receive an error: ORA-65010: maximum number of pluggable databases created.

alter system set MAX_PDBS=3 scope=both;

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

How To Use Datapump Between Different Database Releases:

What if the source database is 12.2 and the target database version is 11.2?>> Use Vesion version=12.1

What if the versions are the same, but the compatible parameter of the target database is lower?

Once you find out the target version/compatible parameter, running a datapump export job with the appropriate version will be easy, as Oracle is providing you with an export datapump parameter called VERSION to facilitate this process.

An export datapump dumpfile created by a lower version of Oracle will always be compatible with a higher version of Oracle.

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

active duplicate :

Duplicating from an active database doesn’t require any RMAN backup to be taken from the source database. Actually, it reads all database structure from the source database that needs to be mounted or opened during the duplication.Although this method seems easy as we don’t need to backup source database or make it accessible for auxiliary instance anymore, it has its own disadvantages as well.

Two big disadvantages of the ACTIVE database duplication method are:

Negative performance impact on the source database. This impact applies to the whole duplication time.

High network traffic on the connection between the source and target databases.

 RMAN>run{

            DUPLICATE TARGET DATABASE TO HRPRD

            FROM ACTIVE DATABASE;

           }

1- Prepare auxiliary instance HRPRD1 on prd-db-01:

2- Enable status registration for HRPRD1 to run LISTENER:

3- Add following TNS entries to BOTH auxiliary and target tnsnames.ora file:

4- Ceate a password file for auxiliary instance HRPRD1 on prd-db-01:

5- Test connectivity to auxiliary and target instances from BOTH hosts using TNS:

6- On the auxiliary host, start RMAN and run the DUPLICATE command:

7- When step 6 finishes successfully, start HRPRD database using srvctl. You need to enable the second thread as well:

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

pdb restricted mode.

Here we use OPEN FORCE to leave restricted mode and go back to normal READ WRITE.

alter pluggable database ORCLPDB open force;

https://dbalifeeasy.com/category/oracle/cdbpdb/

Under the guidance of Oracle Support for specific purpose, the following instructions can be followed to open seed database “PDB$SEED” in “READ WRITE” mode.

Set hidden parameter “_oracle_script” at session level

SQL> alter session set "_oracle_script"=TRUE;

https://dbalifeeasy.com/2018/01/22/how-to-remove-pdb-from-restricted-mode/

SQL> select INST_ID,NAME,OPEN_MODE,RESTRICTED 

     from gv$pdbs order by 1,2;

Check PDB_PLUG_IN_VIOLATIONS.

select status, message, action 

     from   pdb_plug_in_violations 

     where  status !='RESOLVED';

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

 

 

Sunday, July 24, 2022

mod_wl_ohs.conf file – Oracle APPS 12.2

Basic use of the file (Text Based) is for redirecting the http requests to the concerned Managed/admin server for particular context root.

If in your environment any one says i am trying to hit Test and it goes to Prod/some where you need to lookout here first.

Entry would look like below :

<IfModule weblogic_module> 

<Location path>            

SetHandler weblogic-handler

WebLogicHost host

WeblogicPort port

</Location>

</IfModule>

Saturday, July 23, 2022

Friday, July 22, 2022

R12 E-Business Suite Concurrent Processing Script Cpadmin.sh Command Line Utility Which Consolidates Existing CP Tools Into A Single Menu-Based Shell Script (Doc ID 2319585.1)


R12 E-Business Suite Concurrent Processing Script Cpadmin.sh Command Line Utility Which Consolidates Existing CP Tools Into A Single Menu-Based Shell Script (Doc ID 2319585.1)

ADOP CUTOVER (Reducing Time):

What can I do to reduce the time required for cutover?

It is important to distinguish between the time needed for the whole cutover phase, and the downtime period within the phase.

The actual downtime (during which users cannot log in) is significantly shorter than the whole phase.

To help reduce the overall time taken by cutover, you can do three things:

  • Run the finalize phase explicitly, to obviate the need for cutover to do so.
  • Shut down the concurrent managers before running cutover, to avoid having to wait for concurrent requests to complete. Alternatively, ensure no long-running concurrent jobs are submitted while a patching cycle is in progress.
  • Ensure you are using the maximum number of parallel workers your system will support.

How To Run An Empty Patching Cycle Without Applying A Patch? (Doc ID 2316218.1)

 GOAL:

On: 12.2 version, Online Patching 

Can a cutover be run, from fs1 to fs2 outside of patching cycle? For testing purposes, without applying any patch, can a cutover to switch filesystem from fs1 to fs2?

How to execute empty patching cycle, without applying any patch?

SOLUTION:

The syntax to run an empty patch cycle is:

Quick Version:

$ cd <EBS_ROOT>

$ source EBSapps.env run

$ adop phase=prepare,finalize,cutover

$ source EBSapps.env run

$ adop phase=cleanup

Complete Version:

$ cd <EBS_ROOT>

$ source EBSapps.env run

$ adop phase=prepare

$ adop phase=actualize_all

$ adop phase=finalize finalize_mode=full

$ adop phase=cutover

$ source EBSapps.env run

$ adop phase=cleanup cleanup_mode=full

Thursday, July 21, 2022

Oracle 11G New Features




http://www.oracle-base.com/articles/11g/Articles11g.php

Troubleshooting: CRS fails to start:

Run flashgrid-cluster command to confirm that all nodes are up and no nodes are shown as Inaccessible.

Kill all ohasd.bin reboot processes on the database nodes where CRS fails to start:

ps -ef | grep "ohasd.bin reboot" | grep -v grep | awk '{print $2}' | xargs kill -9

Start CRS: crsctl start crs -wait



https://blog.pythian.com/services-not-starting-automatically-with-crs-after-reboot/

http://www.dba-oracle.com/t_rac_crs_start_failure.htm

http://www.dbaref.com/troubleshooting-rac-issues/howtotroubleshootgridinfrastructurestartupissues

https://www.thegeekdiary.com/troubleshooting-oracle-rac-node-evictions-reboots-11-2-and-above/

How to Troubleshoot Grid Infrastructure Startup Issues [ID 1050908.1]

Grid Infrastructure clusterware startup sequence, please refer to note 1053147.1

http://blog.itpub.net/21980353/viewspace-2141629/

https://dbamarco.wordpress.com/tag/clusters-2/


https://www.hhutzler.de/blog/troubleshooting-clusterware-startup-problems/

OCR / Vote disk Maintenance Operations: (ADD/REMOVE/REPLACE/MOVE) (Doc ID 428681.1)

OCR / Vote disk Maintenance Operations: (ADD/REMOVE/REPLACE/MOVE) (Doc ID 428681.1)

Rename Diskgroup having OCR , Vote File , ASM SPILE (Doc ID 1335975.1)

Move OCR , Vote File , ASM SPILE to new Diskgroup (Doc ID 1638177.1)

 Move OCR , Vote File , ASM SPILE to new Diskgroup (Doc ID 1638177.1)


Basic steps to move to  the new diskgroup :

1) Create New diskgroup(CRS) with suitable redundancy for OCR and Voting files.

2) Ensure that the new diskgroup is mounted on all cluster nodes.

3) Move OCR and Vote file from <Current diskgroup> to <CRS>.

4) Change ASM SPFILE location from <current diskgroup> to <CRS> Diskgroup.

5) Mount new <CRS> diskgroup in all nodes and restart CRS in all Nodes to Startup CRS using New SPFILE from <CRS> Diskgroup.

6) Verify mount of disks and diskgroups.

7) Ensure ALL Cluster Resources are started successfully .

8)  Modify OCR backup location

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

EXAMPLES: Detailed steps with commands to rename the diskgroup :

1) Create New CRS diskgroup

Login as SYSASM using SQLPLUS into ASM instance on one node and run below command:

Sample Command:

SQL> create diskgroup CRS normal redundancy disk 'ORCL:DISK4' ,'ORCL:DISK5' ,'ORCL:DISK6'

attribute 'compatible.rdbms'='11.2.0.0', 'compatible.asm'='11.2.0.0';

Diskgroup created.

Make sure the diskgroup is mounted on all the nodes.

NOTE:

If the diskgroup you are moving the OCR to is not online on all nodes, then the ocr.loc file on those nodes where the Diskgroup is not online will not be updated.

This will prevent CRS from restarting on those nodes that the diskgroup is not online.  And the ocr.loc file may need manual intervention.

2)Ensure that the new diskgroup is mounted on all cluster nodes:

SQL> alter diskgroup CRS mount;

SQL> select name, state, type from v$asm_diskgroup;

3) Move OCR and Vote file from <Current diskgroup> to <CRS>

$ORACLE_HOME/bin/bin/ocrconfig -add +CRS

$ORACLE_HOME/bin/bin/ocrconfig -delete +DATA

$ORACLE_HOME/bin/crsctl replace votedisk +CRS

Sample Command Output:

[root@test ~]# $ORACLE_HOME/bin/ocrconfig -add +CRS

[root@test ~]# $ORACLE_HOME/bin/ocrconfig -delete +DATA

[grid@test ~]# $ORACLE_HOME/bin/crsctl replace votedisk +CRS

Successful addition of voting disk 9d351cfdbef64facbfe2d1519880ef33.

Successful addition of voting disk 302c23b19e864f92bfa68eda9045e5cc.

Successful addition of voting disk 6eeca4920acb4f8fbf6ec5a4e2b8ea7b.

Successful deletion of voting disk 32f7d65cf17d4fa3bf2932998251635f.

Successful deletion of voting disk 10c31fb0891d4f5abfb38ef34cd49f4d.

Successful deletion of voting disk 7d6f7d6480554f01bfc2621a3adb8f5f.

Successfully replaced voting disk group with +CRS.

CRS-4266: Voting file(s) successfully replaced

[root@test ~]# $ORACLE_HOME/bin/crsctl query css votedisk

## STATE File Universal Id File Name Disk group

-- ----- ----------------- --------- ---------

1. ONLINE 9d351cfdbef64facbfe2d1519880ef33 (ORCL:DISK4) [CRS]

2. ONLINE 302c23b19e864f92bfa68eda9045e5cc (ORCL:DISK5) [CRS]

3. ONLINE 6eeca4920acb4f8fbf6ec5a4e2b8ea7b (ORCL:DISK6) [CRS]

Located 3 voting disk(s).

[root@test ~]# $ORACLE_HOME/bin/ocrcheck

Status of Oracle Cluster Registry is as follows :

Version : 3

Total space (kbytes) : 262120

Used space (kbytes) : 2804

Available space (kbytes) : 259316

ID : 1778064925

Device/File Name : +CRS

Device/File integrity check succeeded

Device/File not configured

Device/File not configured

Device/File not configured

Device/File not configured

Cluster registry integrity check succeeded

Logical corruption check succeeded

4) Change ASM SPFILE location from <Current diskgroup> to <CRS> Diskgroup.

Login as SYSASM using SQLPLUS into ASM instance on one node and run below commands:

SQL> create pfile='/tmp/init/init' from spfile;

SQL> create spfile='+CRS' from pfile='/tmp/init/init';

Now GPNPTOOL will get updated with new ASM SPFILE location.

That can be verified by below command :  (As grid user or root)

$ORACLE_HOME/bin/gpnptool get

5)Mount diskgroup in all RAC nodes:

SQL> alter diskgroup CRS mount;

Restart CRS in all nodes to startup CRS using new SPFILE from <CRS> diskgroup :

$> crsctl stop crs

$> crsctl start crs 

6) Verify the mount of the diskgroup and its disks:

SQL> set line 1000

SQL> set pages 599

SQL> col path format a30

SQL> select name,path,group_number,header_status,total_mb,free_mb from v$asm_disk;

NAME PATH GROUP_NUMBER HEADER_STATU TOTAL_MB FREE_MB

------------------------------ ------------------------------ ------------ ------------ ---------- ----------

DATA1 ORCL:DATA1 2 MEMBER 15109 9982

DATA2 ORCL:DATA2 2 MEMBER 15109 9982

DATA3 ORCL:DATA3 1 MEMBER 15109 9982

DATA4 ORCL:DATA4 3 MEMBER 15109 9982

DISK4 ORCL:DISK4 3 MEMBER 860 576

DISK5 ORCL:DISK5 3 MEMBER 668 376

DISK6 ORCL:DISK6 3 MEMBER 668 372

SQL> select name,state,usable_file_mb,total_mb,free_mb,required_mirror_free_mb from v$asm_diskgroup;

NAME STATE USABLE_FILE_MB TOTAL_MB FREE_MB REQUIRED_MIRROR_FREE_MB

------------------------------ ----------- -------------- ---------- ---------- -----------------------

DATA MOUNTED 9982 15109 9982 0

CRS MOUNTED 552 2448 1400 296

7) Ensure ALL Cluster resources are started successfully using below sample commands :

$ORACLE_HOME/bin/crsctl stat res -init -t

$ORACLE_HOME/bin/crsctl check cluster -all

$ORACLE_HOME/bin/crsctl stat res -t 

8) Modify the backup location for the OCR

ocrconfig -backuploc <new location>


https://dbaclass.com/article/how-to-move-voting-disk-to-another-asm-disk/

12c-asm-new-features:

 12c Database : ASM Enhancements : Password files in ASM Disk group

ASM version 11.2 allowed ASM spfile to be placed in a disk group.

In 12c we can also put ASM password file in an ASM disk group.

ASM : ASMCMD in 12c:

New ASMCMD commands, now ASMCMD has the ability to do password file management, patches on asm instances, and version

pwcopy Copies a password file to the specified location. pwcreate Creates a password file at the specified location. pwdelete Deletes a password file at the specified location. pwget Returns the location of the password file. pwmove […]

12c Database : ASM Enhancements : OCR backup to disk group

Oracle Cluster Registry (OCR) backup in ASM disk group

Before to 12c the ocr backup is located in the master node local disk at GRID_HOME/cdata/backup, but if OCR is corrupted and you have to restore you will need to find the master node and initiate the restore option.

Storing the OCR backup in an […]

Tuesday, July 12, 2022

Oracle RAC VIP and SCAN IPs

 VIPs:

A VIP is a Virtual IP address, and should be defined in DNS and not assigned to any host or interface.When you install GRID/ASM home, you'll specify the VIP names that were assigned in DNS. When Oracle Clusterware starts up, it will assign a VIP to each node in the cluster. The idea is, if a node goes down (crashes), clusterware can immediately re-assign that VIP to a new (surviving) node. This way, you avoid TCP timeout issues.

SCAN:

A SCAN (Single Client Access Name) is a special case of VIP. The SCAN should also be defined in DNS, and not assigned to any host or interface. There should be three IPs associated with the SCAN name in DNS, and the DNS entry should be defined so that one of the three IPs is returned each time DNS is queried, in a round robin fashion.

At clusterware startup time, each of the three VIPs that make up the SCAN will be assigned to a different node in the cluster. (Except in the special case of a two node cluster, one of the nodes wil have a 2 SCAN VIPs assigned to it.) The point of the SCAN, is that no matter how many nodes are added to or removed from the cluster, all the Net Service Name definitions in your tnsnames.ora (or LDAP equivalent) will not need to ever change, because they all refer to the SCAN, which doesn't change, regardless of how many node additions or drops are made to the cluster.


For example, in the three node cluster, you may have:


Physical and virtual hostnames/IPs assigned as follows:


Hostname    Physical IP    Virtual hostnmae   Virtual IP

rac1        10.1.1.1       rac1-vip           10.1.1.4

rac2        10.1.1.2       rac2-vip           10.1.1.5

rac3        10.1.1.3       rac3-vip           10.1.1.6

Additionally, you may have the SCAN defined as: rac-scan with three IPs, 10.1.1.7, 10.1.1.8, 10.1.1.9. Again, the DNS definition would be defined so those IPs are served up in a round robin order.

Note that the SCAN VIPs, Host VIPs, and the Physical IPs are all in the same subnet.

Finally, though you didn't ask about it, to complete the picture, you'd also need one private, non-routable IP assigned per host, and that IP would be associated with the private interconnect. So, you may have something like:

rac1-priv  172.16.1.1

rac2-priv  172.16.1.2

rac3-priv  172.16.1.3

Note that the '-priv' addresses should not be in DNS, only in the /etc/hosts file of each host in the RAC cluster. (They are private, non-routable, and only clusterware will ever know about or use those addresses, so adding to DNS doesn't make sense.)

Note also, that '-priv' and physical IP/hostname definitions should go in /etc/hosts, and the physical IPs and VIPs should be in DNS. So, physical IPs in both DNS and /etc/hosts, VIPs only in DNS, '-priv' addresses only in /etc/hosts.


https://stackoverflow.com/questions/30219464/oracle-rac-vip-and-scan-ips

http://oracledbadmins.blogspot.com/2016/06/f.html


Friday, July 1, 2022

FORCE LOGGING Mode in Oracle:

 Force = even if someone says nologging, then we will log the *normal* redo information

=In Force logging mode Oracle database must write the redo records even when NOLOGGING is used with DDL Statements.

=It will force the write of REDO records even when no-logging is specified.

=If we write the NOLOGGING option with DDLs command then our database will not generate redo for that DDLs but in case of Dataguard or media recovery has negative impact of it. So before implement Dataguard or standby server we need to enable the FORCE LOGGING mode of the Oracle Database.So every changes should be recorded and updated in standby server while syncing.

  • Force Logging is enable at tablespace and database level.
  • Force logging option is by default there for undo tablespace.
  • Force logging is not applicable for TEMP tablespace.

Suplemental = we log *more* than the normal redo information into the redo logs so that GG has more to work with.

NOLOGGING can be used to minimize the amount of redo generated by Oracle. Only the following operations can make use of nologging:

SQL*Loader in direct mode

INSERT /*+APPEND*/ ...

CTAS

ALTER TABLE statements (move/add/split/merge partitions)

CREATE INDEX

ALTER INDEX statements (move/add/split/merge partitions)

starting with 18c you have 2 more possibilities 

STANDBY NOLOGGING FOR LOAD PERFORMANCE
STANDBY NOLOGGING FOR DATA AVAILABILITY