Oracle database 10.2.0.4 upgrade to 10.2.0.5

Source: Internet
Author: User
Tags sqlplus

An Invoice development test library Upgrade       pre-upgrade preparation, this upgrade is only a test environment database upgrade, so there is no one months in advance to obtain the system, database statistics, Machine performance ratio to speed up the upgrade, just clean up the following information 01. Truncate sys.aud$ base table: Sql>truncate table sys. aud$;02. Cleaning up the DBA Recycle Bin: sql>purge dba_recyclebin;1. Start of upgrade, first disconnect the middleware application for the test environment before upgrading view native oracle_home[[email  protected]_10 ~]$ echo  $ORACLE _home/opt/product/10.2.0/db_12.10.2.0.5 Patch P8202632_10205_ Linux-x86-64.zip into the/oinstall directory [[email protected]_10 ~]# cd /oinstall/[[email  protected]_10 oinstall]# unzip p8202632_10205_linux-x86-64.zip   after the decompression is complete, and then give the appropriate permissions, Disk1 for 10.2.0.5 's unzipped patch directory [[email protected]_10 ~]# chown -r oracle:oinstall   /oinstall/[[email protected]_10 oinstall]# ls -al total 1221952drwxr-xr-x   5 oracle oinstall       4096 Apr 29   2010 disk1-rw-r--r--  1 oracle oinstall 1249857866 nov 22 17:24 P8202632_10205_LINUX-X86-64.ZIP3. Determining the current database version sql> select * from v$version ; BANNER--------------------------------------------------------------------------------Oracle database  10g enterprise edition release 10.2.0.4.0 - 64bit productionpl/sql  Release 10.2.0.4.0 - ProductionCORE    10.2.0.4.0       productiontns for linux: version 10.2.0.4.0 - productionnlsrtl  version 10.2.0.4.0 - production5. To make a backup before upgrading, back up the database software and data files, the weight of backup 01. Database Software with tar  Command Backup (slightly) 02. The database itself is backed up using Rman (slightly) 03. Start stopping the appropriate service after the backup is complete Instance  sql>shutdown immediatelistener    $lsnrctl  stopEM         $emctl  stop  Dbconsole6. Start the installation of patches, first to the root user to enter the graphical interface [[email protected]_10 ~]# xhost +[[email protected] _10 ~]# su - oracle[[email protected]_10 ~]$ cd /oinstall/[[email protected]_10 oinstall]$  cd disk1/[[email protected]_10 disk1]$ lsinstall  patch_note.htm   Response  runinstaller  stage start installing patches [[email protected]_10 disk1]$ ./ runinstaller                      .                       graphical installation, consistent with the installation of Oracle software, ignoring the installation process here                       .                       .7. After the installation is complete, start the database in upgrade mode and upgrade the data dictionary Sql>startup upgradesql> select status from  v$instance; STATUS------------------------Open migrate confirm that at this point the instance status is Open migrate ()    upgrading a large version of the database, or a large patch, you always need to upgrade the data dictionary of the existing database. The reason for upgrading data fields is because as the ORACLE version is upgraded, the properties of some objects need to be changed in order to ensure the integrity and validity of the system's data dictionaries. These changes are in the upgrade script $oracle_home/rdbms/admin/catupgrd.sql. When you start the database in upgrade mode, you can see the appropriate action when you start to upgrade the data dictionary Sql>@/opt/product/10.2.0/db_1/rdbms/catupgrd.sql upgrade the data dictionary Pl/sql procedure  successfully completed. Type created. Grant succeeded. Package created. No errors. Table created.pl/sql procedure successfully completed. View created. synonym  Created. Further verify the Catupgrd.sql effect, after upgrading the data dictionary, Sqlplus will appear below the following information timestamp--------------------------------------------------------- -----------------------comp_timestamp rul        2012-11-23  06:56:47dbua_timestamp rul        valid        2012-11-23 06:56:47comp_timestamp upgrd_end  2012-11-23 06:58:01. oracle database 10.2 upgrade status utility            11-23-2012 06:58:01.Component                                  STATUS         VERSION  HH:MM: ssoracle database server                     VALID      10.2.0.5.0   00:07:52JServer JAVA Virtual Machine               VALID      10.2.0.5.0   00:00:56oracle xdk                                 valid       10.2.0.5.0  00:00:23oracle database java packages              VALID      10.2.0.5.0   00:00:12oracle text                                valid       10.2.0.5.0  00:00:18Oracle XML Database                         valid      10.2.0.5.0  00:02:02oracle workspace  Manager                   valid      10.2.0.5.0  00:00:36oracle data mining                          valid      10.2.0.5.0  00:00:15olap analytic workspace                     VALID      10.2.0.5.0  00:00:16OLAP Catalog                                VALID       10.2.0.5.0  00:00:42oracle olap api                             Valid      10.2.0.5.0  00:00:31oracle intermedia                          valid       10.2.0.5.0  00:02:21Spatial                                     VALID       10.2.0.5.0  00:01:32oracle expression filter                   VALID       10.2.0.5.0  00:00:06oracle enterprise manager                  VALID       10.2.0.5.0  00:00:30oracle&nbsP rule manager                        VALID      10.2.0.5.0   00:00:06.total upgrade time: 00:20:01doc>############################################# ######################### #DOC >###################################################################### #DOC >DOC>   The above PL/SQL lists the SERVER components  in the upgradeddoc>   database, along with their current  Version and status. Doc>doc>   please review the status and version columns  and look fordoc>   any errors in the spool log  file.  If there are errors in the spoolDOC>   File, or any components are not valid or not the current  version,doc>   consult the oracle database upgrade guide  for troubleshootingdoc>   recommendations. doc>doc>   next shutdown immediate, restart for normal  operation, and thendoc>   run utlrp.sql to recompile any  Invalid application objects. doc>doc>###################################################################### #DOC >################## #################################################### #8. Restart the database again sql> shutdown immediate                SQL> startupORACLE  Instance started.9. Compiling invalid object Scripts Utlrp.sqlutlrp.sql scripts can be executed in the state of the database run to compile, invalid objects in the database, Oracle recommends that the database be migrated, upgraded, Run the Utlrp.sql again after demotion to compile the invalid object. To SySDBA Login to execute the script [[email protected]_10 ~]$ sqlplus / as sysdbasql> @/opt/ product/11.2.0/db_1/rdbms/admin/ Utlrp.sqltimestamp--------------------------------------------------------------------------------Comp_ timestamp utlrp_bgn  2012-11-23 07:04:44doc>   the following  pl/sql block invokes utl_recomp to recompile invaliddoc>    objects in the database. recompilation time is proportional to  Thedoc>   number of invalid objects in the database, so  this command may takedoc>   a long time to execute  on a database with a large number of invalidDOC>    objects. doc>doc>   use the following queries to track  recompilation progress:doc>doc>   1. query returning the number  of invalid objects remaining. thisdoc>      number  should decrease with time. Doc>         select count (*)  FROM obj$  where status in  (4, 5, 6);D oc>doc>   2. query  Returning the number of objects compiled so far. this numberdoc >      should increase with time. Doc>         select count (*)  FROM UTL_RECOMP_ Compiled;doc>doc>   this script automatically chooses serial or  parallel recompilationdoc>   based on the number of cpus  available  (Parameter cpu_count)  multiplieddoc>   by the number of  threads per CPU  (PARAMETER PARALLEL_THREADS_PER_CPU). Doc>   on rac, this number is added across all rac  nodes. doc>doc>   utl_recomp uses dbms_scheduler to create jobs  for paralleldoc>   recompilation. jobs are created without  instance affinity so that theydoc>   can migrate across  rac nodes. use the following queries to verifydoc>    Whether utl_recomp jobs are being created and run correctly:doc>doc >   1. Query showing jobs created by UTL_RECOMPDOC>         &nbsp select job_name from dba_scheduler_jobsdoc>             WHERE job_name like  ' utl_recomp_slave_% ';D oc>doc>    2. Query showing UTL_RECOMP jobs that are runningDOC>          select job_name from dba_scheduler_running_jobsdoc >            where job_name like   ' utl_recomp_slave_% ';D oc> #PL/sql procedure successfully completed. TIMESTAMP--------------------------------------------------------------------------------comp_timestamp  Utlrp_end  2012-11-23 07:05:46pl/sql procedure successfully completed. Doc> the following query reports the number of objects that  have compileddoc> with errors  (objects that compile with errors have status set to 3  indoc> obj$) . if the number is higher than expected,  Please examine the errordoc> messages reported with each object   (using show errors)  to see if theydoc> point to system  misconfiguration or resource constraints that must bedoc> fixed  before attempting to recompile these objects. doc> #OBJECTS  with errors-------------------                   0doc> the following query reports  the number of errors caught duringdoc> recompilation. if this  number is non-zero, please query&nbSp;the errordoc> messages in the table utl_recomp_errors to see  if any of these errorsDOC> are due to misconfiguration  or resource constraints that must bedoc> fixed before objects  Can compile successfully. doc> #ERRORS  during recompilation---------------------------                            0PL/SQL procedure successfully completedSQL> shutdown   Immediatedatabase closed. Database dismounted. Oracle instance shut down. Sql> startuporacle instance started. total system global area 7516192768 bytesfixed size                   2107936 bytesvariable size             1258292704 bytesDatabase Buffers          6241124352 bytesRedo Buffers                14667776 bytesdatabase mounted. database opened. sql> select * from v$version; BANNER--------------------------------------------------------------------------------Oracle database  10g Enterprise Edition Release 10.2.0.5.0 - 64biPL/SQL Release  10.2.0.5.0 - productioncore    10.2.0.5.0       Productiontns for linux: version 10.2.0.5.0 - productionnlsrtl version  10.2.0.5.0 - production end of the upgrade, the initial completion of the work


This article is from the "O Record" blog, so be sure to keep this source http://evils798.blog.51cto.com/8983296/1420908

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.