Showing posts with label Oracle12c. Show all posts
Showing posts with label Oracle12c. Show all posts

Monday, September 7, 2020

Lock Account Automatically with INACTIVE_ACCOUNT_TIME


Lock Account Automatically with  INACTIVE_ACCOUNT_TIME



Introduction


In Oracle 12.2 Release We can use the INACTIVE_ACCOUNT_TIME resource parameter in profile to automatically lock the account of a database user who has not logged in to the database instance in a specified number of days.In Production database or Testing database or Development database


1. By default, it is set to UNLIMITED.

2. The minimum setting is 15 and the maximum is 24855.



SQL> select RESOURCE_NAME,limit from dba_profiles where profile='DEFAULT';

 

RESOURCE_NAME                               LIMIT

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

COMPOSITE_LIMIT                                UNLIMITED

SESSIONS_PER_USER                            UNLIMITED

CPU_PER_SESSION                             UNLIMITED

CPU_PER_CALL                                   UNLIMITED

LOGICAL_READS_PER_SESSION                   UNLIMITED

LOGICAL_READS_PER_CALL                      UNLIMITED

IDLE_TIME                                        UNLIMITED

CONNECT_TIME                                UNLIMITED

PRIVATE_SGA                                     UNLIMITED

FAILED_LOGIN_ATTEMPTS                       10

PASSWORD_LIFE_TIME                          180

PASSWORD_REUSE_TIME                         UNLIMITED

PASSWORD_REUSE_MAX                          UNLIMITED

PASSWORD_VERIFY_FUNCTION                    NULL

PASSWORD_LOCK_TIME                          1

PASSWORD_GRACE_TIME                         7

INACTIVE_ACCOUNT_TIME                       UNLIMITED ----------- > This is the resource_name introduced in oracle 12.2.

 

17 rows selected.

 


To make an account lock automatically after 30 days of inactivity, Create a profile by setting INACTIVE_ACCOUNT_TIME to 30 and Set the profile to that user.


 

   CREATE PROFILE "ENDUSERINACTIVE"

    LIMIT

         COMPOSITE_LIMIT UNLIMITED

         SESSIONS_PER_USER UNLIMITED

         CPU_PER_SESSION UNLIMITED

         CPU_PER_CALL UNLIMITED

         LOGICAL_READS_PER_SESSION UNLIMITED

         LOGICAL_READS_PER_CALL UNLIMITED

         IDLE_TIME UNLIMITED

         CONNECT_TIME UNLIMITED

         PRIVATE_SGA UNLIMITED

         FAILED_LOGIN_ATTEMPTS 10

         PASSWORD_LIFE_TIME 1552000/86400

         PASSWORD_REUSE_TIME UNLIMITED

         PASSWORD_REUSE_MAX UNLIMITED

         PASSWORD_VERIFY_FUNCTION NULL

         PASSWORD_LOCK_TIME 86400/86400

         PASSWORD_GRACE_TIME 604800/86400

         INACTIVE_ACCOUNT_TIME 30;

 

SQL>  select RESOURCE_NAME,limit from dba_profiles where profile='ENDUSERINACTIVE' and resource_name='INACTIVE_ACCOUNT_TIME';

 

RESOURCE_NAME                               LIMIT

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

INACTIVE_ACCOUNT_TIME                       30

 

SQL> CREATE USER chaitanya identified by chaitanya123 profile ENDUSERINACTIVE;

 

User created.


If you try to give a value less than 15, it will throw error like – ORA-02377: invalid profile limit INACTIVE_ACCOUNT_TIME

 

   CREATE PROFILE "ENDUSERINACTIVE"

    LIMIT

         COMPOSITE_LIMIT UNLIMITED

         SESSIONS_PER_USER UNLIMITED

         CPU_PER_SESSION UNLIMITED

         CPU_PER_CALL UNLIMITED

         LOGICAL_READS_PER_SESSION UNLIMITED

         LOGICAL_READS_PER_CALL UNLIMITED

         IDLE_TIME UNLIMITED

         CONNECT_TIME UNLIMITED

         PRIVATE_SGA UNLIMITED

         FAILED_LOGIN_ATTEMPTS 10

         PASSWORD_LIFE_TIME 15552000/86400

         PASSWORD_REUSE_TIME UNLIMITED

         PASSWORD_REUSE_MAX UNLIMITED

         PASSWORD_VERIFY_FUNCTION NULL

         PASSWORD_LOCK_TIME 86400/86400

         PASSWORD_GRACE_TIME 604800/86400

         INACTIVE_ACCOUNT_TIME 10;

 

   CREATE PROFILE "ENDUSERINACTIVE"

*

ERROR at line 1:

ORA-02377: invalid profile limit INACTIVE_ACCOUNT_TIME


Note: Info On Lock Acoount Automatically with INACTIVE_ACCOUNT_TIME it may be differ in your environment like production,testing ,development and naming conventions etc



THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME OR SUBSCRIBE ME

 

Tuesday, July 28, 2020

ORACLE 12C MULTITENANT ARCHITECTURE



ORACLE 12C MULTITENANT ARCHITECTURE :
---------------------------------------------------------------


Pluggable Databases (PDBs) is new in Oracle Database 12c Release 1 . You can have many pluggable databases inside a single Oracle Database and single instance



chaitanyaoracledbablog


Following factors will save using Multitenant Architecture
-------------------------------------------------------------------------

Reduce Total Cost of Operation
Administration costs
Operations costs
Data center costs
Storage costs
Contingency costs
Improve Functionalities
Resource utilization
Manageability
Integration
Service management
simplify patching and upgrade of Oracle Database


in oracle 11g Architecture----->schema---->database

3 databases --->3 licenses --->3 patching-----> additional monitoring---->  space/performance/backups-----> 3 instance

hr

sales

finance


One single Instance -----> multiple tenants

CDB$root- root container - Primary db - with single instance
pluggable container databases. - 256 - tenants

redo , controlfiles,system dictionary data, one time patching
one license,segregated roles(cdb_dba,pdb_dba)


Default with every root container , will have a seed database PDB$SEED
template to create pdb databases - read-only

Pdb to be started manually after root container started.
PDB - Default will be in mount stage

sql>alter pluggable database hrpdb open;

Using dbca - will create container and pluggable databases.

$dbca  - database configuration assistant.

create database
choose - Global Database Name : prod.chaitanyaodb.com
Create as container database
pdbhr
delete database
manage pluggable database
create/unplug/delete

Verify - 12c is multi-tenant Option

SQL> show parameter enable_pluggable
true

Use option create pluggable container db
while runInstaller -


Creating Pluggable database
----------------------------
$dbca
One Container Database
    Multiple Pluggable Database - 253

One database - multiple schemas till 11g
now 12c - One container database  - multiple databases


CDB - root container
PDB - Pluggable Database
    When you install
        will have default one root container database
        with default one pdb$seed template

PDB$SEED - read only mode - Template database
    using we can create -New  Pluggable Database


sql>show con_name
sql>show con_id

    For root container database - CDB$root

List of Container - v$containers

SQL> COLUMN NAME FORMAT A8
SELECT NAME, CON_ID, DBID, CON_UID, GUID FROM V$CONTAINERS ORDER BY CON_ID;




SQL> select name,open_mode from v$pdbs;

NAME     OPEN_MODE
-------- ----------
PDB$SEED READ ONLY
PDB_DB2  MOUNTED
PDB67    MOUNTED
PDB10    MOUNTED


12c - Cloud Technology
    Multinenant Feature.

    Root - Container Database -  Metadata
        Multiple Pluggable Database-253
            user metadata/user data


Four Methods:
---------------

Create a new PDB from the seed
Plug non cdb in a cdb as pdb
Clone a PDB from another PDB of the same CDB
Plug an unplugged PDB into another CDB.


Note : When we start the CDB, the PDB will be default in Mount mode.

sql>select con_id,cdb,name,con_dbid,open_mode from v$database;

    CON_ID CDB NAME        CON_DBID OPEN_MODE
---------- --- --------- ----------
         0 YES PROD       246685968 READ WRITE

sql>select name,open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           READ WRITE
PDB5                           READ WRITE
PDB8                           READ WRITE


How to connect to a PDB?
SQL> alter session set container=CDB$root;

sql>show con_id
sql>show con_name

SQL> alter session set container=ptgdb;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
pbnk

CDB$root - system tablespace contain oracle supplied system related dictionary data.

PDB - system tablespace contain user metadata of PDB Database.


SQL> select pdb_name,status from cdb_pdbs;
 

cdb_pdbs - list of all pdbs
cdb_tablespaces - list of all pdb tablespaces
cdb_data_files
cdb_users

To shutdown the PDB
--------------------
sql>select name,open_mode from v$pdbs;
sql>alter pluggable database hrdb close immediate;

sQL> select name,open_mode from v$pdbs;
sql>alter pluggable database hrdb open;


To open all the PDB's
sql>alter pluggable database all open;

-------------------------------
COLUMN NAME FORMAT A8
SELECT NAME, CON_ID, DBID, CON_UID, GUID FROM V$CONTAINERS ORDER BY CON_ID;



Using DBCA- Database Configuration Assistant
-------------------------------------------
$dbca
    manage pluggable databases
        unplug pdb database
             select pdb name
                location

sql>
CREATE PLUGGABLE DATABASE salesdb
 ADMIN USER sadmin IDENTIFIED BY s123
 ROLES=(CONNECT);




COLUMN NAME FORMAT A8

SELECT NAME, CON_ID, DBID, CON_UID, GUID FROM V$CONTAINERS ORDER BY CON_ID;


COLUMN PDB_NAME FORMAT A15
 
SELECT PDB_ID, PDB_NAME, STATUS FROM DBA_PDBS ORDER BY PDB_ID;

SELECT NAME FROM V$SYSTEM_PARAMETER
  WHERE ISPDB_MODIFIABLE = 'TRUE'
  ORDER BY NAME;

Finding history on PDB and CDB
``````````````````````````````
COLUMN DB_NAME FORMAT A10
COLUMN CON_ID FORMAT 999
COLUMN PDB_NAME FORMAT A15
COLUMN OPERATION FORMAT A16
COLUMN OP_TIMESTAMP FORMAT A10
COLUMN CLONED_FROM_PDB_NAME FORMAT A15
 
SELECT DB_NAME, CON_ID, PDB_NAME, OPERATION, OP_TIMESTAMP, CLONED_FROM_PDB_NAME
  FROM CDB_PDB_HISTORY
  WHERE CON_ID > 2
  ORDER BY CON_ID;

creating users and how to connect to oracle12c containerand pluggable databases in multitenant environment

chaitanyaoracledbablog



two types of multitenant database users-----> common user and local user

Creating Common User : A common user is created in root cdb common user can connect to root cdb and all pdb's including future pdb's which you may plug
-------------------
SQL> create user c##chaitanya identified by chai123 container=all;

User created.

SQL> grant connect,resorces to c##chaitanya;

SQL> conn c##chaitanya/chai123 

Creating Local user - : A local user is created in a pdb database and he can connect and has priveleges in that pdb only
----------------------------
SQL> alter session set container=salesdb;

Session altered.

SQL> create user abhiram  identified by abhi123 quota 50m on users;

User created.

 SQL> grant connect,resorce to abhiram;


To connect a pluggable database salesdb as abhiram user you have to connect through e2 connect method or through TNS names to connect through e2 connect

SQL> conn abhiram/abhi123@192.168.50.100/salesdb


to connect throug TNS names you have to add entry in the TNSNames.ora file

open TNSNames.ora file add the following entry 

$cd

$ORACLE_HOME/network/admin

$ vi tnsnames.ora

salesdb=
(DESCRIPTION =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)
(HOST=192.168.50.100)(PORT=1521))
)
(CONNECT_DATA=
(SERVICE_NAME=salesdb)
)
)
now to connect 

$ sqlplus abhiram/abhi123@salesdb

creating pluggable databases from seed
---------------------------------------


lets create a pluggable database salesdb we will place the datafiles in the directory

/u02/oracle/salesdb/salesdb1 directory

create the directory

$ mkdir -p /u02/oracle/salesdb/salesdb1

$ sqlplus '/as sysdba'

sql> create pluggable database salesdb1 admin user salesdb1admin
     identified by saledb1123
     storage (maxsize 2g max_shared_temp_size 100m)
     default tablespace users
     datafile '/u02/oracle/salesdb/salesdb1/user01.dbf'
     size 250 m autoextend on
     file_name_convert= ('/u02/oracle/salesdb/pdbseed/','/u02/oracle/salesdb/salesdb1/')



Note: here salesdb=source
           salesdb1=clone

cloning an existing pluggable database
---------------------------------------


let us clone the local pluggable database salesdb1 to salesdb2

first create the directory to hold salesdb2 datafiles

$mkdir -p /u02/oracle/salesdb/salesdb2

sqlplus to connect the root

sqlplus '/as sysdba'

sql> alter pluggable database salesdb1 close;
sql> create pluggable database salesdb2 from salesdb1 file_name_convert= ('/u02/oracle/salesdb/salesdb1/,',' /u02/oracle/salesdb/salesdb2/') 
   storage (maxsize 2g max_shared_temp_size 100m);
 
sql>pluggable database created


Unplugging and Plugging database from cdb to another cdb
---------------------------------------------------------

step 1: connect to salesdb databse

      $ export ORACLE_SID= salesdb
      $sqlplus '/as sysdba'

step2: close the pluggable database salesdb2

     sql> alter pluggable database salesdb2 close;

step 3: alter pluggable database salesdb2 
        unplug into '/u02/oracle/salesdb/salesdb2.xml;

step 4: create target directory

      $ mkdir -p /u01/oracle/salesdb_moved

step 5: connect to cdb 'orcl'

     $ export ORACLE_SID =ORCL
    
    sqlplus '/as sysdba'
  
step 6: start the target cdb

      sql> startup

step 7: create pluggable database salesdb_moved using '/u02/oracle/salesdb2.xml' move file_name_convert=('/u02/oracle/salesdb/salesdb2/',' /u01/oracle/salesdb_moved/')
         storage (maxsize 2g max_shared_temp_size 100m);
     
     pluggable database created

sql> show pdbs

  conn_id   ---> 2  conn_name--->pdb$seed   open mode restricted-----> read only no

  conn_id------->3 conn_name---->salespdb  open mode restricted -----> mounted

 conn_id-------> 4 conn_name---->salesdb_moved  open mode restricted ----> mounted

step 8 :  openthe pluggable database salesdb_moved

      sql > alter pluggable database salesdb_moved open;

--------

CDB$root - Root Container
System  -  common for all schemas
redo    -  common
undo    -
SGA + PGA
BG Processes

PDB Databases - Max - 253
Pluggable Database - Schema1,schema3 - tablespace -datafile
Pluggable Database - Schema2,schema4 - tablespace -datafile


Note: oracle 12c multitenant architecture info it may be differ from your environment like production,development,testing,and directory structure ,db names etc




THANKING YOU FOR VIEWING MY BLOG FOR MORE UPDATES FOLLLOW ON MY BLOG

Monday, July 27, 2020

ORACLE 11G TO 12C DATABASE UPGRADE MANUALLY


ORACLE 11G TO 12C DATABASE UPGRADE MANUALLY
-----------------------------------------------------------------------------




SUMMARY ORACLE 11.2.0.4 TO 12.1.0.1 UPGRADE MANUALLY
----------------------------------------------------------------------------------------

PREPARE FOR UPGARDE:
-------------------------------------

1)Take the database backup via Rman

2)Take oracle_home,orainventory backup via os level copy

3)Run the utlrp.sql script to validate the invalid objects

4)exec dbms_stats.gather_database_stats;

5)exec dbms_stats.gather_dictinary_stats;

6)exec dbms_stats.gather_fixed_object_stats;


INSTALL 12.1.0.1:
------------------------

1)Download and Install 12.1.0.1 into a a different Oracle_home location

2)Run the pre_update tility which resides under 12.1.0.1 home

     12.1.0.1_home/rdbms/admin/preupgrad.sql

3)Review and fix all the issues reported via above script

4)Shutdown the Database, Listener.EMC(Enterprise manager)


START THE UPGRADE:
---------------------------------

1)Copy DBS and Network Folder from old ORACLE_HOME to new ORACLE_HOME

2)Set environmental variable old ORACLE_HOME to new ORACLE_HOME loaction

3)Start up the Database in startup upgarde mode

4)Run the upgarde utilitywhich upgrades the database exit from sqlplus

    cd $ ORACLE_HOME/rdbms/admin
       $ ORACLE_HOME/perl/bin/perl catctl.pl catupgrad.sql


POST UPGRADE STEPS:
-----------------------------

1)Start up the Database Normally make sure its started with 12.1.0.1 ORACLE_HOME

2)Run the utlrp.sql script to validate the invalidobject

3)Run the post- update script 

  12.1.0.1_home/rdbms/admin/utlu121s.sql

  12.1.0.1_home/rdbms/admin/catuppst.sql

  12.1.0.1_home/rdbms/admin/utlu121s.sql 

4) Check the Component status
   
   sql>select comp_name,status,substr(vesrion,1,10) as version from dba_registry;

5)Change the Compatibilty parameter to 12.1.0.1

  sql>alter system set compatibile= '12.1.0.1.0' scope= spfile;

6)Check the vesrion details

  sql>select comp_name,version,status from dba_resgistry;


CLEAN UP PROCESS:
------------------------------

1)Update the new oracle_home under /etc/oratabfile

2)Uninstall the old_home

3)Take a fresh backup of Database post upgrade



Note: Upgrade only for the binaries not for the data


NOW LETS START WITH THE PROCESS :
-----------------------------------------------------------


$ ps - ef | grep pmon

$ sqlplus '/as sysdba'

sql> starup

Oracle instance started 

Database Opened

sql> select name,open_mode from v$database;

   name--->proddb

   open_mode---->read,write

sql>exit

$ rman target /

RMAN> list backup of database summary;

RMAN> show all;

Configure channnel device type to disk  '/u02/backup/proddb_%U';

RMAN>exit

$ df -h

 for eg    /u02 is filled with 80% ofthe disk 

  so available space in /u03


$ mkdir - p /u03/backup        ( we cretaed a directory backup in u03 location bcoz space is available)

$ rman target /

RMAN> configure channel device type disk format '/u03/backup/proddb_%U';

RMAN> congigure channel device type disk format '/u03/backup/proddb_%U';

   Rman parameters successfully configured

RMAN> show all;

RMAN> backup database;

RMAN>exit

$ sqlplus  '/as sysdba ' 

sql> exec dbms_stas.gather_database_stats;

open a terminal login as oracle user execeute second script

sql>exec dbms_stats.gather_dictionary_stats;

and next open another new terminal login as a oracle user and execute the third script

sql>exec dbms_stas.gather_fixed_object_stats;

once the script is complted close the terminal and have an error in the scripts do it again and run the script

after that 12c binaries and into different location already 12c database downloaded inthe /u03 location

login in as oracle user  ( 12 c database  (binaries) unzip one by one 12c release 1 software after that we have to create a oraclehome directory in /u03 after unzipped 
 create a directory database folder in the softwares directory 


Note : old oracle_home    /u02/oracle/11.2.0.4/db_home
       new oracle_home    /u03/oracle/12.1.0.1/db_home

$ df -h

/u02
/u03

$ cd /u03/
 ls
  we will find folders backup  lost+fount  softwares

 $ cd softwares /
$ ls -lrth

linuxamd64_12c_database_1of2.zip
linuxamd64_12c_database_2of2.zip

$ unzip linuxamd64_12c_database_1of2.zip
$ unzip linuxamd64_12c_database_2of2.zip

$ df -h
  $ env |grep ORA

ORACLE_SID = proddb

ORACLE_HOME =/u02/oracle/11.2.0.4/db_home


$ mkdir -p /u03/oracle/12.1.0.1/db_home

$ cd softwares

$ ls 

database 

$ softwares] cd database

ls
 
runInstaller

$ ./runInstaller

  ( Oracle Installer 12c window is starting before getting into installation 12c one thing i have to tell that 12c is a multitenant architecture we have cdb and pdb concept will come on 12c and we are installing only binaries that is install database software only  after that login as a root user run that root.sh script back to the first terminal env it shows the old loaction we have to go the sql prompt login as sysdba go to the oracle home loaction rdbms/admin/preupgrad.sql run the procedure all the prechecks  before upgrade we have to check the log preupgradation utility once the run preupgrad utility go to the sql plus)

-----> Insatll database software only

------>single Instance database installation 

------> go with enterprise edition 

         oracel_base : /u03/oracle/oraclebase

         software location :/u03/oracle/12.1.0.1/db_home
      
         click on --->next
     
        select dba --->all

        click on --->install on your server

Open a new terminal

 login as root user

and execute the root.sh scripts

# /u03/oracle/12.1.0.1/db_home/root.sh

after execucting this script 12 c installatioin is done

$ env |grep ORA

 ORACLE_SID = proddb
 ORACLE_HOME= /u02/oracle/11.2.0.4/db_home

sqlplus '/as sysdba

sql> @ /u03/oracle/12.1.0.1/db_home/rdbms/admin/preupgrad.sql

(preupgrade  pre execute is complete some errors and warnings we have go to the logs and check the errors and warnings)

$ cat /u02/oracle/11.2.0.4/db_home/cfgtoollogs/proddb/preupgrad/preupgrad.log

$ sqlplus '/as sysdba'

sql> alter system set process = 300 scope =spfile;

sql>execute dbms_preup.purge_recyclebin_fixup;

sql>pl/sql procedure suceesfully completed

sql >shutdown immediate 

sql> startup

  database opened

sql> @/u03/oracle/12.1.0.1/db_home/rdbms/admin/preupgrad.sql

sql> exit

$ cat /u02/oracle/11.2.0.4/db_home/cfgtoollogs/proddb/preupgrade/preupgrade.log

(Return the preupgrad utility once again and resolve the errors and warnings and see the log file there is no error in the log look at the log file and found 0 errors)

sqlplus '/as sysdba'

 shutdown immediate
exit

ps -ef | grep pmon

ps -ef| grep tns

$ env |grep ora

ORACLE_SID = proddb

ORACLE_HOME ='/u02/oracle/11.2.04/db_home

( We need to copy the spfile and network/admin listener & Tns files to 12.1.0.1 home location

 11.2.0.4-----> db_home/dbs----> spfile  copy ----> new loaction 12.1.0.1 /u03/db_home/dbs 
    11.2.0.4------->  db_home/network/admin----> tnsnames.ora listener.ora  shrept.lst copy all files to new location  --->12.1.0.1 /u03/db_home/network/admin 

(copy the dbs and network folder from old oracle_home 11gto new oracle_home 12c location let us check the directory /u03 whether the files are copied or not)

ORACLE_SID = proddb

ORACLE_HOME ='/u02/oracle/11.2.04/db_home

$cd  u02/oracle/11.2.0.4/db_home/dbs

$ ls -lrth
 
$ cp * /u03/oracle/12.1.0.1/db_home/dbs/

ls -lrth /u03/oracle/12.1.0.1/db_home/dbs/

$ cd /u02/oracle/11.2.0.4/db_home/network/admin/

$ ls -lrt

$ cp * /u03/oracle/12.1.0.1/db_home/network/admin/

$ ls -lrth u03/oracle/12.1.0.1/db_home/network/admin/

 tnsnames.ora, listener.ora ,shrept.lst

$ env |grep ORA

ORACLE_SID = proddb

ORACLE_HOME ='/u02/oracle/11.2.04/db_home

$ export ORACLE_HOME ='/u03/oracle/12.1.0.1/db_home

(Till now we will not change environment till its pointing to oracle home 11204 so set the export oracle_home and  oraclepath after that once again check now its pointing to 12c home)

$ echo $ path
$ /usr/lib64/qt_3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/u03/oracle/11204/db_home/bin

$ export path= /usr/lib64/qt_3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/u03/oracle/12101/db_home/bin

$ env |grep ORA

ORACLE_SID = proddb
ORACLE_HOME =/u03/oracle/12.1.0.1/db_home

sqlplus '/as sysdba'

release version it showing while opening database 12.1.0.1.0

exit

$ lsnrctl

$ rman

exit

$ env |grep ORA


ORACLE_SID = proddb
ORACLE_HOME =/u03/oracle/12.1.0.1/db_home

sqlplus '/as sysdba'

sql>startup upgrade

sql> select instance_name,status from v$instance;

instance_name--> proddb
status----->open migrate

exit

cd $ oracle_home/rdbms/admin

$ pwd

/u03/oracle/12.1.0.1/db_home/rdbms/admin

$ ORACLE_HOME/perl/bin/perl catctl.pl

catupgrd.sql

$ ps -ef |grep pmon 

env |grep ORA

ORACLE_SID = proddb
ORACLE_HOME =/u03/oracle/12.1.0.1/db_home

sqlplus '/as sysdba'

sql> startup

sql> select name,open_mode from v$database;

name---> proddb
open_mode--->read,write


sql> @?/rdbms/admin/utlrp.sql

pl/sql procedure sucessfully completed

sql> @?/rdbms/admin/catuppst.sql

sql> @?/rdbms/admin/utlul21s.sql

check the component status


sql> set lines 999;

 col comp_name for a60;

/

sql> select comp_name,status,substr(version,1,10)as vesrsion from dba_regsistry;

sql> show parameter compatible;
 compatible  11.2.0.4.0

sql> alter system set compatible= '12.1.0.1.0' scope=spfile;

sql> select comp_name,vesrion,status from dba_registry;

bounce the database

sql> shut immediate

exit

sqlplus '/as sysdba'

sql> select name,open_mode from v$database;

name---> proddb
open_mode--->reda,write

exit

$ vi /etc/oratab

proddb: /u03/oracle/12.1.0.1/db_home:n

(just remove the old oracle home to new oracle home)

cat etc/oratab

proddb: /u03/oracle/12.1.0.1/db_home:n

vi bash_profile

after that execute the bash profile

..bash_profile


export oracle_home= '/u03/oracle/12.1.0.1/db_home 

env | grep ORA

ORACLE_SID = proddb
ORACLE_HOME =/u03/oracle/12.1.0.1/db_home


Note: Upgrading 11g to 12c info on it may be differ from your environment like production,testing ,development. and directory structure etc 



THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW MY SITE  
https://chaitanyaoracledba.blogspot.com/









 

 






     
     



ITIL Process

ITIL Process Introduction In this Blog i am going to explain  ITIL Process, ITIL stands for Information Technology Infrastructure Library ...