DB upgrade 11.2.0.4 to 12.1.0.1


  • Open oracle database

            [root@oracle ~]# su – oracle
            [oracle@oracle ~]$ export ORACLE_SID=orcl
            [oracle@oracle ~]$ sqlplus / as sysdba

            SQL*Plus: Release 11.2.0.4.0 Production on Sat Apr 18 13:37:36 2015
            Copyright (c) 1982, 2013, Oracle.  All rights reserved.
            Connected to an idle instance.

            SQL> startup

            ORACLE instance started.
            Total System Global Area  835104768 bytes

            Fixed Size                     2257840 bytes
            Variable Size                507513936 bytes
            Database Buffers         322961408 bytes
            Redo Buffers                2371584 bytes

            Database mounted.
            Database opened.

  • Check the listener if not started start the listener

            [oracle@oracle ~]$ lsnrctl status

            LSNRCTL for Linux: Version 11.2.0.4.0 – Production on 18-APR-2015 13:44:05
            Copyright (c) 1991, 2013, Oracle.  All rights reserved.
            Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

            STATUS of the LISTENER
            ———————–

            Alias                        LISTENER
            Version                   TNSLSNR for Linux: Version 11.2.0.4.0 – Production
            Start Date              18-APR-2015 13:42:59
            Uptime                   0 days 0 hr. 1 min. 7 sec
            Trace Level            off
            Security                  ON: Local OS Authentication
            SNMP                     OFF

            Listener Parameter File   /u01/app/oracle/product/11.2.4/network/admin/listener.ora
            Listener Log File         /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
            Listening Endpoints Summary…

            (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
            (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
            Services Summary…

            Service “orcl” has 1 instance(s).
            Instance “orcl”, status READY, has 1 handler(s) for this service…

            Service “orclXDB” has 1 instance(s).
            Instance “orcl”, status READY, has 1 handler(s) for this service…

            The command completed successfully

  •  Create the path for 12c database software

            [oracle@oracle ~]$ mkdir -p /u01/app/oracle/product/12.1.0/

  •  To run the oracle 12c database software

            [root@oracle ~]# xhost +

            access control disabled, clients can connect from any host

            [root@oracle ~]# su – oracle
            [oracle@oracle ~]$ cd /u01/12c/database/
            [oracle@oracle database]$ ll
            total 32

            drwxrwxrwx  4 oracle oinstall 4096 Apr 18 11:52 install
            drwxrwxrwx  2 oracle oinstall 4096 Apr 18 11:47 response
            drwxrwxrwx  2 oracle oinstall 4096 Apr 18 11:47 rpm
            -rwxrwxrwx  1 oracle oinstall 7808 May 25  2013 runInstaller
            drwxrwxrwx  2 oracle oinstall 4096 Apr 18 11:47 sshsetup
            drwxrwxrwx 14 oracle oinstall 4096 Apr 18 11:52 stage
            -rwxrwxrwx  1 oracle oinstall  500 Jun 10  2013 welcome.html

            [oracle@oracle database]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/
            [oracle@oracle database]$ ./runInstaller

63

64

65

66

67

68

69

70

71

72

73

  • Run the root.sh script in root user

            [root@oracle ~]# /u01/app/oracle/product/12.1.0/root.sh

            Performing root user operation for Oracle 12c
            The following environment variables are set as:
            ORACLE_OWNER= oracle
            ORACLE_HOME=  /u01/app/oracle/product/12.1.0

            Enter the full pathname of the local bin directory: [/usr/local/bin]:
            The contents of “dbhome” have not changed. No need to overwrite.
            The contents of “oraenv” have not changed. No need to overwrite.
            The contents of “coraenv” have not changed. No need to overwrite.
            Entries will be added to the /etc/oratab file as needed by
            Database Configuration Assistant when a database is created
            Finished running generic part of root script.
            Now product-specific root actions will be performed.

75

  • To set the oracle environment

            [root@oracle ~]# . oraenv
            ORACLE_SID = [oracle] ? orcl

            The Oracle base remains unchanged with value /u01/app/oracle
            Check the oracle enterprise manager if its running stop the enterprise manager

            [oracle@oracle ~]$ emctl status dbconsole

            Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
            Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
            https://oracle:1158/em/console/aboutApplication
            Oracle Enterprise Manager 11g is not running.

            [oracle@oracle ~]$ emctl stop dbconsole
            Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
            Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
            https://oracle:1158/em/console/aboutApplication
            Stopping Oracle Enterprise Manager 11g Database Control …

            Cannot determine Oracle Enterprise Manager 11g Database Control process.
            /u01/app/oracle/product/11.2.4/oracle_orcl/emctl.pid does not exist.

  • Log in to the sqlplus

            [oracle@oracle ~]$ sqlplus / as sysdba

            SQL*Plus: Release 11.2.0.4.0 Production on Sat Apr 18 15:02:05 2015
            Copyright (c) 1982, 2013, Oracle.  All rights reserved.
            Connected to:
            Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
            With the Partitioning, OLAP, Data Mining and Real Application Testing options

  • Run the script for remove the enterprise manager

            SQL> @/u01/app/oracle/product/12.1.0/rdbms/admin/emremove.sql;

            old  69:     IF (upper(‘&LOGGING’) = ‘VERBOSE’)
            new  69:     IF (upper(‘VERBOSE’) = ‘VERBOSE’)

            PL/SQL procedure successfully completed.

            SQL> exit
            Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit
            Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

            [oracle@oracle ~]$

  • Stop the listener and add the new listener and check the listener status
  • [oracle@oracle ~]$ lsnrctl stop

            LSNRCTL for Linux: Version 11.2.0.4.0 – Production on 18-APR-2015 15:05:54
            Copyright (c) 1991, 2013, Oracle.  All rights reserved.
            Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
            The command completed successfully

            [oracle@oracle database]$ /u01/app/oracle/product/12.1.0/bin/netca
            [oracle@oracle ~]$ lsnrctl status

            LSNRCTL for Linux: Version 11.2.0.4.0 – Production on 18-APR-2015 15:09:57
            Copyright (c) 1991, 2013, Oracle.  All rights reserved.
            Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)))
            STATUS of the LISTENER
            ————————

            Alias                        LISTENER
            Version                   TNSLSNR for Linux: Version 12.1.0.1.0 – Production
            Start Date               18-APR-2015 15:09:38
            Uptime                    0 days 0 hr. 0 min. 19 sec
            Trace Level             off
            Security                  ON: Local OS Authentication
            SNMP                      OFF

            Listener Parameter File   /u01/app/oracle/product/12.1.0/network/admin/listener.ora
            Listener Log File         /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
            Listening Endpoints Summary…

            (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
            (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

            The listener supports no services
            The command completed successfully

            [oracle@oracle ~]$

  • Start the upgrade utility

            [oracle@oracle database]$ /u01/app/oracle/product/12.1.0/bin/dbua

81

82

83

84

85

86

87

88

  • Check the listener status

            [oracle@oracle ~]$ lsnrctl start

            LSNRCTL for Linux: Version 12.1.0.1.0 – Production on 21-JUL-2015 08:21:12
            Copyright (c) 1991, 2013, Oracle.  All rights reserved.
            Starting /u01/app/oracle/product/12.1.0/bin/tnslsnr: please wait…

            TNSLSNR for Linux: Version 12.1.0.1.0 – Production
            System parameter file is /u01/app/oracle/product/12.1.0/network/admin/listener.ora
            Log messages written to /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml

            Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
            Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
            Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle)(PORT=1521)))

            STATUS of the LISTENER
            ————————

            Alias                        LISTENER
            Version                   TNSLSNR for Linux: Version 12.1.0.1.0 – Production
            Start Date               21-JUL-2015 08:21:15
            Uptime                    0 days 0 hr. 0 min. 0 sec
            Trace Level             off
            Security                   ON: Local OS Authentication
            SNMP                      OFF

            Listener Parameter File   /u01/app/oracle/product/12.1.0/network/admin/listener.ora
            Listener Log File         /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
            Listening Endpoints Summary…

            (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle)(PORT=1521)))
            (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

            The listener supports no services
            The command completed successfully

91

92

93

94

95

96

97

98

99

100

101

102

103

104

  • Check the database version in sql prompt

            [oracle@oracle ~]$[oracle@oracle ~]$ sqlplus / as sysdba

            SQL*Plus: Release 12.1.0.1.0 Production on Tue Jul 21 08:28:36 2015
            Copyright (c) 1982, 2013, Oracle.  All rights reserved.
            Connected to:
            Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 – 64bit
            Production With the Partitioning, OLAP, Advanced Analytics and Real
            Application Testing opt
            SQL> select name,cdb,open_mode from v$database;

            NAME      CDB OPEN_MODE
            ORCL      NO  READ WRITE

            SQL> select instance_name,host_name,version,status from v$instance;

            INSTANCE_NAME   HOST_NAME   VERSION     STATUS
            Orcl                                  oracle                12.1.0.1.0        OPEN

  • Check compatible version its show old version so manually change the version

            SQL> show parameter compatible

            NAME                                   TYPE        VALUE
            compatible                           string      11.2.0.0.0
            noncdb_compatible           boolean     FALSE

            SQL> ALTER SYSTEM SET COMPATIBLE=’12.1.0.1.0′ SCOPE=SPFILE;
            System altered.
            SQL> SHUT IMMEDIATE;

            Database closed.
            Database dismounted.
            ORACLE instance shut down.

            SQL> STARTUP
            ORACLE instance started.
            Total System Global Area     835104768 bytes
            Fixed Size                                2293880 bytes
            Variable Size                           574623624 bytes
            Database Buffers                   255852544 bytes
            Redo Buffers                          2334720 bytes

            Database mounted.
            Database opened.

            SQL> show parameter compatible

            NAME                                 TYPE        VALUE
            Compatible                           string      12.1.0.1.0
            noncdb_compatible          boolean     FALSE

  • Finally deinstall the old version of the oracle database software

            [oracle@oracle ~]$ cd /u01/app/oracle/product/11.2.4/deinstall/
            [oracle@oracle deinstall]$ ll

            total 92

            -rwxrwxrwx 1 oracle oinstall  9780 May 10  2011 bootstrap.pl
            -rwxrwxrwx 1 oracle oinstall  9653 Apr 16 08:23 deinstall
            -rwxrwxrwx 1 oracle oinstall 18841 Jan 29  2013 deinstall.pl
            -rwxrwxrwx 1 oracle oinstall  3466 Aug 18  2010 deinstall.xml
            drwxrwxrwx 2 oracle oinstall  4096 Apr 16 08:05 jlib
            -rwxrwxrwx 1 oracle oinstall   409 Aug 18  2010 readme.txt
            drwxrwxrwx 2 oracle oinstall  4096 Apr 16 08:05 response
            -rwxrwxrwx 1 oracle oinstall 32343 Dec 16  2009 sshUserSetup.sh

            [oracle@oracle deinstall]$ ./deinstall

            Checking for required files and bootstrapping …
            Please wait …
            Location of logs /tmp/deinstall2015-04-18_03-41-19PM/logs/

            ############ ORACLE DEINSTALL & DECONFIG TOOL START ############
            ########### CHECK OPERATION START ##########
            ## [START] Install check configuration ##

            Checking for existence of the Oracle home location /u01/app/oracle/product/11.2.4
            Oracle Home type selected for deinstall is: Oracle Single Instance Database
            Oracle Base selected for deinstall is: /u01/app/oracle
            Checking for existence of central inventory location /u01/app/oraInventory
            Checking for sufficient temp space availability on node(s) : ‘oracle’

            ## [END] Install check configuration ##
            Network Configuration check config START
            Network de-configuration trace file location: /tmp/deinstall2015-04-18_03-41-19PM
            /logs/netdc_check2015-04-18_03-47-24-PM.log

            Specify all Single Instance listeners that are to be de-configured [LISTENER]:
            Network Configuration check config END
            Database Check Configuration START

            Database de-configuration trace file location: /tmp/deinstall2015-04-18_03-41-19PM
            /logs/databasedc_check2015-04-18_04-05-10-PM.log

            Use comma as separator when specifying list of values as input
            Specify the list of database names that are configured in this Oracle home [orcl]:

            ###### For Database ‘orcl’ ######
            Single Instance Database
            The diagnostic destination location of the database: /u01/app/oracle/diag/rdbms/orcl
            Storage type used by the Database: FS
            Database file location: /u01/app/oracle/oradata/orcl,/u01/app/oracle
            /flash_recovery_area/orcl
            Fast recovery area location: /u01/app/oracle/flash_recovery_area/ORCL
            database spfile location: /u01/app/oracle/product/11.2.4/dbs/spfileorcl.ora

            The details of database(s) orcl have been discovered automatically.
            Do you still want to modify the details of orcl database(s)? [n]:

            Database Check Configuration END
            Enterprise Manager Configuration Assistant START

            EMCA de-configuration trace file location: /tmp/deinstall2015-04-18_03-41-19PM
            /logs/emcadc_check2015-04-18_04-05-22-PM.log

            Checking configuration for database orcl
            Enterprise Manager Configuration Assistant END
            Oracle Configuration Manager check START
            OCM check log file location : /tmp/deinstall2015-04-18_03-41-19PM/logs//ocm_check971.log
            Oracle Configuration Manager check END

            ########## CHECK OPERATION END ##########
            ########## CHECK OPERATION SUMMARY ##########

            Oracle Home selected for deinstall is: /u01/app/oracle/product/11.2.4
            Inventory Location where the Oracle home registered is: /u01/app/oraInventory
            Following Single Instance listener(s) will be de-configured: LISTENER
            The following databases were selected for de-configuration : orcl
            Database unique name : orcl
            Storage used : FS

            Will update the Enterprise Manager configuration for the following database(s): orcl
            No Enterprise Manager ASM targets to update
            No Enterprise Manager listener targets to migrate
            Checking the config status for CCR
            Oracle Home exists with CCR directory, but CCR is not configured
            CCR check is finished
            Do you want to continue (y – yes, n – no)? [n]: y

            A log of this session will be written to:
            ‘/tmp/deinstall2015-04-18_03-41-19PM/logs/deinstall_deconfig2015-04-18_03-47-16-PM.out’

            Any error messages from this session will be written to:
            ‘/tmp/deinstall2015-04-18_03-41-19PM/logs/deinstall_deconfig2015-04-18_03-47-16-PM.err’

            ########## CLEAN OPERATION START ##########
            Enterprise Manager Configuration Assistant START

            EMCA de-configuration trace file location:
            /tmp/deinstall2015-04-18_03-41-19PM/logs/emcadc_clean2015-04-18_04-05-22-PM.log

            Updating Enterprise Manager Database Control configuration for database orcl
            Updating Enterprise Manager ASM targets (if any)
            Updating Enterprise Manager listener targets (if any)
            Enterprise Manager Configuration Assistant END

            Database de-configuration trace file location:
            /tmp/deinstall2015-04-18_03-41-19PM/logs/databasedc_clean2015-04-18_04-05-52-PM.log

            Database Clean Configuration START orcl
            This operation may take few minutes.
            Database Clean Configuration END orcl
            Network Configuration clean config START

            Network de-configuration trace file location:
            /tmp/deinstall2015-04-18_03-41-19PM/logs/netdc_clean2015-04-18_04-07-47-PM.log

            De-configuring Single Instance listener(s): LISTENER
            De-configuring listener: LISTENER
            Stopping listener: LISTENER
            Listener stopped successfully.
            Deleting listener: LISTENER
            Listener deleted successfully.
            Listener de-configured successfully.
            De-configuring backup files…
            Backup files de-configured successfully.
            The network configuration has been cleaned up successfully.
            Network Configuration clean config END

            Oracle Configuration Manager clean START
            OCM clean log file location : /tmp/deinstall2015-04-18_03-41-19PM/logs//ocm_clean971.log
            Oracle Configuration Manager clean END
            Setting the force flag to false
            Setting the force flag to cleanup the Oracle Base

            Oracle Universal Installer clean START
            Detach Oracle home ‘/u01/app/oracle/product/11.2.4’ from the central inventory on the
            local node : Done

            Delete directory ‘/u01/app/oracle/product/11.2.4’ on the local node : Done
            Delete directory ‘/u01/app/oraInventory’ on the local node : Done
            Delete directory ‘/u01/app/oracle’ on the local node : Done

            Oracle Universal Installer cleanup was successful.
            Oracle Universal Installer clean END
            ## [START] Oracle install clean ##

            Clean install operation removing temporary directory
            ‘/tmp/deinstall2015-04-18_03-41-19PM’ on node ‘oracle’

            ## [END] Oracle install clean ##
            ########## CLEAN OPERATION END ##########

            ########## CLEAN OPERATION SUMMARY ##########

            Updated Enterprise Manager configuration for database orcl
            Successfully de-configured the following database instances : orcl
            Following Single Instance listener(s) were de-configured successfully: LISTENER
            Cleaning the config for CCR
            As CCR is not configured, so skipping the cleaning of CCR configuration
            CCR clean is finished

            Successfully detached Oracle home ‘/u01/app/oracle/product/11.2.4’ from the central
            inventory on the local node.

            Successfully deleted directory ‘/u01/app/oracle/product/11.2.4’ on the local node.
            Successfully deleted directory ‘/u01/app/oraInventory’ on the local node.
            Successfully deleted directory ‘/u01/app/oracle’ on the local node.
            Oracle Universal Installer cleanup was successful.

            Run ‘rm -rf /etc/oraInst.loc’ as root on node(s) ‘oracle’ at the end of the session.
            Run ‘rm -rf /opt/ORCLfmap’ as root on node(s) ‘oracle’ at the end of the session.
            Run ‘rm -rf /etc/oratab’ as root on node(s) ‘oracle’ at the end of the session.

            Oracle deinstall tool successfully cleaned up temporary directories.
            #######################################################################
            ############# ORACLE DEINSTALL & DECONFIG TOOL END #############

 

 

 

 

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *