Escolar Documentos
Profissional Documentos
Cultura Documentos
document
Step 1: Upgrade Path for Oracle Database to Oracle 12c Release 1 (12.1)
We can directly upgrade to new release 12C as we are on 11.2.0.3
Ensure that all database components/objects provided by Oracle are VALID in the source
database prior to starting the upgrade.
Run the Pre-Upgrade Information Tool from the environment of the database that will be
upgraded.
Step 1:
Copy preupgrd.sql and utluppkg.sql from the Oracle Database 12c Release 1 (12.1)
$ORACLE_HOME/rdbms/admin to $ORACLE_HOME/rdbms/admin directory of the
source Oracle Home(11.2.0.3).
Step 2:
* Run the new Pre-Upgrade Information Tool
SQL> @$ORACLE_HOME/rdbms/admin/preupgrd.sql
preupgrade.log, preupgrade_fixups.sql and postupgrade_fixups.sql files are created in
$ORACLE_HOME/cfgtoollogs/$ORACLE_SID/preupgrade/, which is under the source
database ORACLE_HOME (11.2.0.3) to be upgraded.
Review the preupgrade.log and take necessary actions.
The default time zone file shipped with the Oracle 12c Release 1 is version 18.
Need to do Timezone update after upgrade.
4.4 Optimizer Statistics
$ sqlplus "/as sysdba"
SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
4.5 Verify That Materialized View Refreshes Have Completed Before Upgrading
Before upgrading Oracle Database, you must wait until all materialized views have completed
refreshing.
Run the following query to determine if there are any materialized view refreshes still in
progress:
SQL> select s.obj#,o.obj#,s.containerobj#,lastrefreshdate,pflags,xpflags,o.name,o.owner#,
bitand(s.mflags, 8) from obj$ o, sum$ s
where o.obj# = s.obj# and o.type# = 42 AND bitand(s.mflags, 8) = 8;
2
no rows selected
No Action required.
4.6 Ensure That No Files Need Media Recovery Before Upgrading
Make ensure that there are no files requiring media recovery by executing the following query .
SQL> SELECT * FROM v$recover_file;
4.7 Ensure That No Files Are in Backup Mode Before Upgrading
Execute the following query to verify that No Files in backup mode when upgrading Oracle
Database
SQL> SELECT * FROM v$backup WHERE status != 'NOT ACTIVE';
2. If the query in the previous step returns any rows, then issue the following
statements:
SQL> SELECT local_tran_id FROM dba_2pc_pending;
SQL> EXECUTE dbms_transaction.purge_lost_db_entry('');
SQL> COMMIT;
4.9 Purge the Database Recycle Bin Before Upgrading :
dbms_scheduler.disable('SM$CLEAN_AUTO_SPLIT_MERGE');
dbms_scheduler.disable('RSE$CLEAN_RECOVERABLE_SCRIPT');
dbms_scheduler.disable('BSLN_MAINTAIN_STATS_JOB');
dbms_scheduler.disable('DRA_REEVALUATE_OPEN_FAILURES');
dbms_scheduler.disable('ORA$AUTOTASK_CLEAN');
dbms_scheduler.disable('PURGE_LOG ');
dbms_scheduler.disable('ORACLE_OCM.MGMT_CONFIG_JOB');
dbms_scheduler.disable('ORACLE_OCM.MGMT_STATS_CONFIG_JOB');
dbms_scheduler.disable('EXFSYS.RLM$SCHDNEGACTION');
dbms_scheduler.disable('EXFSYS.RLM$EVTCLEANUP');
Ensure the users SYS and SYSTEM have 'SYSTEM' as their default tablespace.
You must have sufficient space in the 'SYSTEM' tablespace or set extents to unlimited.
SQL> SELECT username, default_tablespace
FROM dba_users
WHERE username in ('SYS','SYSTEM');
Note the location of datafiles, redo logs and control files. Also take a backup of all configuration
files like listener.ora, tnsnames.ora, etc. from $ORACLE_HOME.
SQL> SELECT name FROM v$controlfile;
SQL> SELECT file_name FROM dba_data_files;
SQL> SELECT group#, member FROM v$logfile;
4.13 Drop Oracle 12c Release 1 supplied users and roles ,if exist in the source
database
Run the preupgrade tool to check for the existence of any users or roles in the
source database that use the same names.
No Users/Roles reported.
4.14 Review and Remove any unnecessary hidden/underscore parameters
I Hardware Requirements:
1) Minimum Hardware Requirement
a) Ensure that our system meets the following Physical Memory
requirements:
Minimum: 1 GB of RAM
Recommended: 2 GB of RAM or more. So, kindly provide initially
16GB of RAM.
b) Swap disk space proportional to the system's physical memory as follows:
RAM
Swap Space
Between 1 GB and 2
GB
Between 2 GB and 16 GB
More than 16 GB
16 GB
So, kindly keep the swap space as 16GB as we are initially requesting 16GB
of RAM
NOTE: Further RAM and swap space may be required to tune/improve
RDBMS performance.
c) We need 10GB of space for /tmp and /var mount points.
d) Need 50GB of local disk space for database software files.This
mount point will be the shelter for oracle home
II Software:
1. Certified Linux Operating Systems
i) Oracle Linux 5 Update 6 or higher
ii) Red Hat Enterprise Linux 5 Update 6 or higher
NOTE: At present all CGF server are Red Hat Enterprise Linux
servers.So,better to go with RHEL 5.6 above.
Current production OS version is as below.
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Kernel \r on an \m
2) Oracle recommends that you install the Linux operating system with the
default software packages (RPMs) and do not customize the RPMs during
installation.
3) Linux Kernel Requirements
Red Hat Enterprise Linux 5 Update 6 2.6.18-238.0.0.0.1.el5 or later
4) Required OS Components (per Release Notes, and Install Guide)
We need to make sure the below RPMs are installed on RHEL 5 server.Those
RPMs which are missing Linux team need to install them.
1.
2.
3.
4.
binutils-2.17.50.0.6 (x86_64)
compat-libstdc++-33-3.2.3 (x86_64)
glibc-2.5-58 (x86_64)
ksh <== any version of ksh is acceptable
5. libaio-0.3.106 (x86_64)
6. libgcc-4.1.2 (x86_64)
7. libstdc++-4.1.2 (x86_64)
8. libXext-1.0.1 (x86_64)
9. libXtst-1.0.1 (x86_64)
10. libX11-1.0.3 (x86_64)
11. libXau-1.0.1 (x86_64)
12. libXi-1.0.1 (x86_64)
13. make-3.81 (x86_64)
14. gcc-4.1.2 (x86_64)
15. gcc-c++-4.1.2 (x86_64)
16. glibc-devel-2.5-58 (x86_64)
17. libaio-devel-0.3.106 (x86_64)
18. libstdc++-devel-4.1.2 (x86_64)
19. sysstat-7.0.2 (x86_64)
20. vnc-server
Customers wishing to install the Oracle Database 12.1 32-bit Client
software should also install these packages:
1. compat-libstdc++-33-3.2.3 (i386)
2. glibc-2.5-58 (i386)
3. glibc-devel-2.5-58 (i386)
4. libaio-0.3.106 (i386)
5. libaio-devel-0.3.106 (i386)
6. libgcc-4.1.2 (i386)
7. libstdc++-4.1.2 (i386)
8. libXext-1.0.1 (i386)
9. libXtst-1.0.1 (i386)
10. libX11-1.0.3 (i386)
11. libXau-1.0.1 (i386)
12. libXi-1.0.1 (i386)
NOTE: Several RPMs will be required as prerequisites to those listed
in section 4 as per this document:
glibc-headers (x86-64)
kernel-headers (x86-64)
III Environment:
1) Below are the Minimum Recommended Kernel Parameter settings required
for Database Software Installation. Modify your kernel settings in
/etc/sysctl.conf as follows.
kernel.shmall = 1/2 of physical memory in pages, this will be the value
2097152.
kernel.shmmax = 1/2 of physical memory in bytes. This would be the value
2147483648 for a system with 4GB of physical RAM.
soft
hard
soft
hard
soft
hard
nproc 2047
nproc 16384
nofile 1024
nofile 65536
stack 10240
stack at least 10240, at most 32768
NOTE: When the limits.conf file is changed, these changes take effect
immediately. However, if the oracle users are logged in, then these
changes do not take effect until you log these users out and log them
back in. You must do this before you use these accounts for installation.
3) Verify the latest version of PAM is loaded, then add or edit the following
line in the /etc/pam.d/login file, if it does not already exist:
session required pam_limits.so
4) Verify the current ulimits, and raise if needed. This can be done many
ways...adding the following lines to /etc/profile is the recommended
method:
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -u 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
5) The hostname command should return the fully qualified hostname as
shown below:
hostname.domainname
Once all the above requirements are done then we are fine with
running runInstaller to install the 12C database software.
Step1:
Once you are ready with the installation then take a vnc session and then run the
runInstaller.
Step2:
Once you ran the runInstaller then you will get a GUI which will lead you to install
the 12c software.
Kindly uncheck the check box as we no need to receive any security updates via My
Oracle Support.
Click on Yes button and then proceed with installation by clicking on Next
Step3:
Step4:
Based upon your requriement kindly select the option.For AGUK we need to select
first option as we are not having RAC instances.
Step5:
Step6:
Step7:
Kindly provide appropriate values for Oracle base and Oracle home.The above
values are just examples for CRPUK.
Step8:
Now make sure the appropriate group values are present ot not.
Step9:
Even though after setting appropriate values in /etc/sysctl.conf file we are getting
the above Warnings.So,kindly click on Fix & Check Again button.This will lead you to
the below screen shot.
Kindly go to the above location on the server and run the runfixup.sh script as root
user.
Step10:
Once done kindly click on OK.Then it will lead you to the below screen shot.
Then again come to Verification Result tab and check the Ignore All as shown in
the below screen shot.
Step11:
Step12:
Now please run the script root.sh in the above mentioned location as a root user as
shown below.
Step13:
Thats the end of the successful installation of 12c DB oracle home software alone.
NOTE: Now we need to perform Upgrade tasks to upgrade our databases from
11gR2 to 12.1
- ORACLE_BASE
- ORACLE_HOME
- PATH, LD_LIBRARY_PATH and SHLIB_PATH
$ export ORACLE_HOME=<location of Oracle 12.1>
$ export PATH=$ORACLE_HOME/bin:$PATH
$ export ORACLE_BASE=<Oracle_Base set during installation>
The oratab file points to the Oracle home for Oracle Database 12c
ORACLE_SID
ORACLE_HOME
PATH
TNS_ADMIN
5. Log in to the system as the owner of the Oracle home under the new Oracle Database
12c.
6. From the ORACLE_HOME/rdbms/admin directory, start SQL*Plus.
7. Connect to the database to be upgraded using an account with DBA privileges:
SQL> CONNECT / AS SYSDBA
6 -l $ORACLE_HOME/diagnostics
11. The upgraded database is shut down after running catctl.pl. Restart the instance to
reinitialize the system parameters for normal operation.
SQL> STARTUP
12. Important: The catuppst.sql script is run as part of the upgrade unless the upgrade
returns errors during the process. Check the log file for "Rem BEGIN catuppst.sql" to
verify that catuppst.sql ran during the upgrade process.
The log file catuppst0.log will be generated with the results of the post
upgrade.
13. Run catcon.pl to invoke utlrp.sql to recompile any remaining stored PL/SQL and
Java code. Use the following syntax:
$ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlrp -d '''.'''
utlrp.sql
The log file utlrp0.log is generated with the results of the recompilations.
14. Run postupgrade_fixups.sql.
spool to the admin directory
SQL> SPOOL postupgrade.log
Run the postupgrade_fixups.sql
SQL> SPOOL OFF
15. Run utlu121s.sql to verify that all issues have been fixed.
SQL> @rdbms/admin/utlu121s.sql
16. Verify that all expected packages and classes are valid. (This step assumes that you
previously ran preupgrd.sql before starting the upgrade.)
17.
3.1 Set Environment Variables on Linux and UNIX Systems After Manual
Upgrades
3.2Set oratab and Scripts to Point to the New Oracle Location After
Upgrading Oracle Database
Add this entry in oratab.
FOCRPUK:/focrpukdb/product_12c/oracle/12.1.0:N
3.6 Upgrade the Time Zone File Version After Upgrading Oracle Database
If the Pre-Upgrade Information Tool instructed you to upgrade the time zone files after
completing the database upgrade, then use the DBMS_DST PL/SQL package to upgrade the
time zone file.
If you are using an initialization parameter file, then complete the following steps:
1. Shut down the instance if it is running:
2. SQL> SHUTDOWN IMMEDIATE
3. Edit the initialization parameter file to set or change the value of the COMPATIBLE
initialization parameter.
COMPATIBLE = 12.1.0
3.10
SHUTDOWN IMMEDIATE;
STARTUP UPGRADE;
alter system set MAX_STRING_SIZE=EXTENDED;
@?/rdbms/admin/utl32k.sql
SHUTDOWN IMMEDIATE;
STARTUP;
3.11 Shedule the DBMS_SCHEDULER_JOBS After upgrad.
execute dbms_scheduler.enable('SM$CLEAN_AUTO_SPLIT_MERGE');
execute dbms_scheduler.enable('RSE$CLEAN_RECOVERABLE_SCRIPT');
execute dbms_scheduler.enable('BSLN_MAINTAIN_STATS_JOB');
execute dbms_scheduler.enable('DRA_REEVALUATE_OPEN_FAILURES');
execute dbms_scheduler.enable('ORA$AUTOTASK_CLEAN');
execute dbms_scheduler.enable('PURGE_LOG ');
execute dbms_scheduler.enable('ORACLE_OCM.MGMT_CONFIG_JOB');
execute dbms_scheduler.enable('ORACLE_OCM.MGMT_STATS_CONFIG_JOB');