Saturday, 19 September 2020

RMAN Incremental Backup Script

 dt=`date +"%d.%m.%Y"`

rman <<EOF

        spool msglog to '/backup/RMAN/logs/rman_INC_ORAPROD$dt.log'

        connect target /

delete noprompt archivelog all completed before 'sysdate-8';

run {

allocate channel c1 type disk;

BACKUP FORMAT '/backup/RMAN/INC/ORAPRODctrl_%s_%p_%t.rman' CURRENT CONTROLFILE;

RELEASE CHANNEL c1;

allocate channel c1 type disk;

allocate channel c2 type disk;

BACKUP  AS COMPRESSED BACKUPSET  INCREMENTAL LEVEL 1 TAG ORAPROD_BACKUP_LEVEL1 FILESPERSET 4 FORMAT '/backup/RMAN/INC/ORAPROD_%s_%p_%t.rman' DATABASE;

RELEASE CHANNEL c1;

RELEASE CHANNEL c2;

allocate channel c1 type disk;

allocate channel c2 type disk;

BACKUP  as compressed backupset FILESPERSET 5 FORMAT '/backup/RMAN/INC/ORAPROD_ARC_%s_%p_%t.rman' ARCHIVELOG ALL skip inaccessible;

RELEASE CHANNEL c1;

RELEASE CHANNEL c2;

allocate channel c1 type disk;

copy current controlfile to '/backup/RMAN/INC/ORAPRODcontrol.rman';

RELEASE CHANNEL c1;

}

EXIT;

EOF

RMAN Full Backup Script

dt=`date +"%d.%m.%Y"`

rman <<EOF

       spool msglog to '/backup/RMAN/logs/rman_level0_oraprod$dt.log'

        connect target /

        crosscheck archivelog all;

run

{

        allocate channel c1 type disk;

        allocate channel c2 type disk;

BACKUP as compressed backupset INCREMENTAL LEVEL=0 TAG ORAROD_LEVEL0 FILESPERSET 3

FORMAT '/backup/RMAN/FULL/ORAPROD_%s_%p_%t.rman'   DATABASE;

sql 'alter system archive log current';

RELEASE CHANNEL c1;

RELEASE CHANNEL c2;


allocate channel c1 type disk;

BACKUP

FORMAT '/backup/RMAN/FULL/ORAPRODctrl_%s_%p_%t.rman'

CURRENT CONTROLFILE;

RELEASE CHANNEL c1;

allocate channel c1 type disk;

allocate channel c2 type disk;

BACKUP  as compressed backupset FILESPERSET 5

FORMAT '/backup/RMAN/FULL/ORAPROD_ARC_%s_%p_%t.rman'

ARCHIVELOG ALL skip inaccessible;

RELEASE CHANNEL c1;

RELEASE CHANNEL c2;

allocate channel c1 type disk;

copy current controlfile to '/backup/RMAN/FULL/ORAPRODcontrol.rman';

RELEASE CHANNEL c1;

}

EXIT;

EOF



RC-50013: Fatal: Instantiate driver did not complete successfully

Running  perl adcfgclone.pl  dbTier  on target , got below error

AutoConfig could not successfully execute the following scripts:

Directory: /database/oracle/db/tech_st/11.2.0/perl/bin/perl -I /database/oracle/db/tech_st/11.2.0/perl/lib/5.8.3 -I /database/oracle/db/tech_st/11.2.0/perl/lib/site_perl/5.8.3 -I /database/oracle/db/tech_st/11.2.0/appsutil/perl /database/oracle/db/tech_st/11.2.0/appsutil/clone

ouicli.pl   INSTE8_APPLY 255


Solution:  Backup the previous /etc/oraInventory and created the new one

     # mv oraInventory  oraInventory_old

     # mkdir -p oraInventory

     $ perl adcfgclone.pl dbTier


     Database clone completed successfully



Sunday, 13 September 2020

Assign IDCS Group to IDCS User

Assign the IDCS User created in my previous blog to IDCS_DevelopmentGrouo to grant full access in DevelopmnetCompartment


OCI

     -Identity

            -Federation

                    -Identity Provider Details (OracleIdentityCloudService)

                            -Users

                                    -User Details


    Click on Add to IDCS Group


 

MAP IDCS Group and OCI Group

Map the IDCS Group and OCI Group to provide  the permissions  granted to the OCI group

OCI -  
        -Identity 
                      - Federation 

                                        -Identity Provider Details (OracleIdentityCloudService)                                                     - Group Mappings



Click on Add Mappings


Select  IDCS_DevelopmentGroup  from drop down for IDENTITY PROVIDER GROUP and DevelopmentGroup for OCI GROUP

Click on Add Mappings

 The mapping displayed as



Create IDCS Group in OCI

 OCI - Identity - Federation - Identity Provider Details (OracleIdentityCloudService)


Click on Create IDCS Group

In my case Name is IDCS_DevelopmentGroup and Description "IDCS Group for Development Group" 




 Click on Create

 Now Group will be created with below information





Create Policy in OCI

Policy is required to give Group permission in the Compartment

In my case  Group =DevelopmentGroup

        Compartment=DevelopmentCompartment 

Both Group and Compartment were created in my previous blog. For details, how to create Group and Compartment refer my previous blog.

OCI - Identity - Policies

Click on Create Policy  


Provide the Policy Name , in my case it is PolicyDevelopment  and Description "Policy to give DevelopmentGroup permission in DevelopmentCompartment"

Enter the Statement in Policy Builder. It will provide access based on this statement.

The statement  "Allow group DevelopmentGroup to manage all-resources in compartment DevelopmentCompartment"    Grants  full permissions on the Development compartment



 Click on Create 


Create Group in OCI

 Identity - Groups


Click on Create Group

Provide Name,in my case it is DevelopmentGroup along with  description


Click on Group  to create it.

Create Compartments in OCI

Identity  -  Compartments


Provide Name , in my case , provided "Development" along with a valid description to tell the usage of the compartment

In PARENT COMPARTMENT,  select the root compartment  or the name of  child compartment, where you want to create it

Click on "Create Compartment"



Assign Cloud Account Administrator Role

Once you created the user  using Identity - Federation - Create user.  You need to assign the roles to access the OCI resources . Follow the below steps to assign the "Cloud Account Administrator Role".

In the Create user section, we can see the created user. Click on the user, it will open the another window, where you can assign the roles. 

Click on Manage Roles


Select the check box to assign Cloud Account Administrator Role and click on Apply Role Setting



Create a Cloud Administrator user in OCI

1. Login to Oracle Cloud

2. Select Identity - Federation

     

3. Click on OracleIdentityCloudService



4. 


5. Create user

  Provide all the relevant information to create it


After creating the user, follow the Email Instruction / Copy Instruction to rest the password to sign in to the Oracle Cloud Console