Bo's Oracle Station

查看: 3380|回复: 0

活动第27次(2018-06-13星期三)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2018-6-13 19:19:37 | 显示全部楼层 |阅读模式
TRANSPORTABLE DATABASE
从windows那边,考过来的两个文本:
其中的参数文件
  1. grep -v '^\^'  initorcl.ora  | grep -v '^同时,在LINUX这边建一下该建的目录:

  2. [code]mkdir -p /u01/app/oracle/fast_recovery_area
复制代码
同时,在LINUX这边建一下该建的目录:

  1. mkdir -p /u01/app/oracle/fast_recovery_area
复制代码
  1. mkdir -p /u01/app/oracle/admin/winorcl/adump
复制代码

最终修改过的initorcl.ora:

  1. control_files            = '/u01/app/oracle/oradata/winorcl/control01.dbf','/u01/app/oracle/oradata/winorcl/control02.dbf','/u01/app/oracle/oradata/winorcl/control03.dbf'
  2.   db_recovery_file_dest    = '/u01/app/oracle/fast_recovery_area'
  3.   db_recovery_file_dest_size= 4G
  4.   audit_file_dest          = '/u01/app/oracle/admin/winorcl/adump'
  5.   db_name                  = 'orcl'
  6.   remote_login_passwordfile= 'EXCLUSIVE'
  7.   db_domain                = 'example.com'
  8.   dispatchers              = '(PROTOCOL=TCP) (SERVICE=orclXDB)'
  9.   processes                = 800
  10.   nls_language             = 'SIMPLIFIED CHINESE'
  11.   nls_territory            = 'CHINA'
  12.   memory_target            = 2048M
  13.   db_block_size            = 8192
  14.   compatible               = '11.2.0.0.0'
  15.   undo_tablespace          = 'UNDOTBS1'
  16.   audit_trail              = 'OS'
  17.   open_cursors             = 400
复制代码

有了参数 文件之后,启动到nomount:
  1. [oracle@station87 dbs]$ sqlplus /nolog

  2. SQL*Plus: Release 11.2.0.1.0 Production on Thu Jun 14 03:30:00 2018

  3. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  4. SQL> conn / as sysdba
  5. Connected to an idle instance.
  6. SQL> startup
  7. ORACLE instance started.

  8. Total System Global Area 2042241024 bytes
  9. Fixed Size                    1337548 bytes
  10. Variable Size                 1124075316 bytes
  11. Database Buffers          905969664 bytes
  12. Redo Buffers                   10858496 bytes
  13. ORA-00205: error in identifying control file, check alert log for more info

复制代码

接下来,编辑控制文件创建脚本:

  1. CREATE CONTROLFILE REUSE SET DATABASE orcl RESETLOGS  NOARCHIVELOG
  2.     MAXLOGFILES 16
  3.     MAXLOGMEMBERS 3
  4.     MAXDATAFILES 100
  5.     MAXINSTANCES 8
  6.     MAXLOGHISTORY 292
  7. LOGFILE
  8.   GROUP 1 '/u01/app/oracle/oradata/winorcl/redo01.log'  SIZE 50M BLOCKSIZE 512,
  9.   GROUP 2 '/u01/app/oracle/oradata/winorcl/redo02.log'  SIZE 50M BLOCKSIZE 512,
  10.   GROUP 3 '/u01/app/oracle/oradata/winorcl/redo03.log'  SIZE 50M BLOCKSIZE 512
  11. DATAFILE
  12.   '/u01/app/oracle/oradata/winorcl/system01.dbf',
  13.   '/u01/app/oracle/oradata/winorcl/sysaux01.dbf',
  14.   '/u01/app/oracle/oradata/winorcl/undotbs1.dbf',
  15.   '/u01/app/oracle/oradata/winorcl/users01.dbf',
  16.   '/u01/app/oracle/oradata/winorcl/example01.dbf',
  17.   '/u01/app/oracle/oradata/winorcl/tbszhs01.dbf'
  18. CHARACTER SET ZHS16GBK
  19. ;
复制代码


控制文件创建完, 不完全恢复也做完之后,还要做以下两个操作:
  1. SHUTDOWN IMMEDIATE
  2. STARTUP UPGRADE PFILE='C:\DATA\INIT_00T51J1H_1_0.ORA'
  3. @@ ?/rdbms/admin/utlirp.sql
  4. SHUTDOWN IMMEDIATE
  5. STARTUP PFILE='C:\DATA\INIT_00T51J1H_1_0.ORA'
  6. -- The following step will recompile all PL/SQL modules.
  7. -- It may take serveral hours to complete.
  8. @@ ?/rdbms/admin/utlrp.sql
复制代码


附上在目的地转换的脚本(我们已经在windows源上做了,以下脚本不需要做):
  1. RUN {
  2.   CONVERT
  3.   FROM PLATFORM 'Microsoft Windows IA (32-bit)'
  4.   PARALLELISM 1
  5. DATAFILE 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF' FORMAT 'C:\DATA\DATA_D-ORCL_I-1347195613_TS-SYSTEM_FNO-1_08T51J1H'
  6. DATAFILE 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF' FORMAT 'C:\DATA\DATA_D-ORCL_I-1347195613_TS-SYSAUX_FNO-2_09T51J20'
  7. DATAFILE 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF' FORMAT 'C:\DATA\DATA_D-ORCL_I-1347195613_TS-EXAMPLE_FNO-5_0AT51J2G'
  8. DATAFILE 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF' FORMAT 'C:\DATA\DATA_D-ORCL_I-1347195613_TS-UNDOTBS1_FNO-3_0BT51J2J'
  9. DATAFILE 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\TBSZHS.DBF' FORMAT 'C:\DATA\DATA_D-ORCL_I-1347195613_TS-TBSZHS_FNO-6_0CT51J2M'
  10. DATAFILE 'C:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF' FORMAT 'C:\DATA\DATA_D-ORCL_I-1347195613_TS-USERS_FNO-4_0DT51J2N'
  11. ; }
复制代码
  1. [oracle@station87 ~]$ sqlplus /nolog

  2. SQL*Plus: Release 11.2.0.1.0 Production on Thu Jun 14 03:45:13 2018

  3. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  4. SQL> conn / as sysdba
  5. Connected.
  6. SQL> @control11d.sql

  7. Control file created.

  8. SQL> select   open_mode from v$database;

  9. OPEN_MODE
  10. ------------------------------------------------------------
  11. MOUNTED

  12. SQL> recover database until cancel using backup controlfile;
  13. ORA-00279: change 1272917 generated at 06/09/2018 18:21:25 needed for thread 1
  14. ORA-00289: suggestion :
  15. /u01/app/oracle/fast_recovery_area/ORCL/archivelog/2018_06_14/o1_mf_1_18_%u_.arc
  16. ORA-00280: change 1272917 for thread 1 is in sequence #18


  17. Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

  18. ORA-00308:

  19. 接下来的工序一般是换dbid和改名字,建议使用nid命令(如过只改名字,建议自己写带有 set的create control脚本):

  20. [code]nid TARGET=sys/oracle_4U  DBNAME=winorcl
复制代码

  1. [oracle@station87 ~]$ nid TARGET=sys/oracle_4U  DBNAME=winorcl

  2. DBNEWID: Release 11.2.0.1.0 - Production on Thu Jun 14 04:09:46 2018

  3. Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

  4. Connected to database ORCL (DBID=1347195613)

  5. NID-00121: Database should not be open


  6. Change of database name failed during validation - database is intact.
  7. DBNEWID - Completed with validation errors.

  8. [oracle@station87 ~]$ sqlplus /nolog

  9. SQL*Plus: Release 11.2.0.1.0 Production on Thu Jun 14 04:09:58 2018

  10. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  11. SQL> conn / as sysdba
  12. Connected.
  13. SQL> shutdown immediate
  14. Database closed.
  15. Database dismounted.
  16. ORACLE instance shut down.
  17. SQL> startup mount
  18. ORACLE instance started.

  19. Total System Global Area 2042241024 bytes
  20. Fixed Size                    1337548 bytes
  21. Variable Size                 1174406964 bytes
  22. Database Buffers          855638016 bytes
  23. Redo Buffers                   10858496 bytes
  24. Database mounted.
  25. SQL> exit
  26. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
  27. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  28. [oracle@station87 ~]$ nid TARGET=sys/oracle_4U  DBNAME=winorcl

  29. DBNEWID: Release 11.2.0.1.0 - Production on Thu Jun 14 04:10:37 2018

  30. Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

  31. Connected to database ORCL (DBID=1347195613)

  32. Connected to server version 11.2.0

  33. Control Files in database:
  34.     /u01/app/oracle/oradata/winorcl/control01.dbf
  35.     /u01/app/oracle/oradata/winorcl/control02.dbf
  36.     /u01/app/oracle/oradata/winorcl/control03.dbf

  37. Change database ID and database name ORCL to WINORCL? (Y/[N]) => Y

  38. Proceeding with operation
  39. Changing database ID from 1347195613 to 2126894910
  40. Changing database name from ORCL to WINORCL
  41.     Control File /u01/app/oracle/oradata/winorcl/control01.dbf - modified
  42.     Control File /u01/app/oracle/oradata/winorcl/control02.dbf - modified
  43.     Control File /u01/app/oracle/oradata/winorcl/control03.dbf - modified
  44.     Datafile /u01/app/oracle/oradata/winorcl/system01.db - dbid changed, wrote new name
  45.     Datafile /u01/app/oracle/oradata/winorcl/sysaux01.db - dbid changed, wrote new name
  46.     Datafile /u01/app/oracle/oradata/winorcl/undotbs1.db - dbid changed, wrote new name
  47.     Datafile /u01/app/oracle/oradata/winorcl/users01.db - dbid changed, wrote new name
  48.     Datafile /u01/app/oracle/oradata/winorcl/example01.db - dbid changed, wrote new name
  49.     Datafile /u01/app/oracle/oradata/winorcl/tbszhs01.db - dbid changed, wrote new name
  50.     Datafile /u01/app/oracle/oradata/temp01.db - dbid changed, wrote new name
  51.     Control File /u01/app/oracle/oradata/winorcl/control01.dbf - dbid changed, wrote new name
  52.     Control File /u01/app/oracle/oradata/winorcl/control02.dbf - dbid changed, wrote new name
  53.     Control File /u01/app/oracle/oradata/winorcl/control03.dbf - dbid changed, wrote new name
  54.     Instance shut down

  55. Database name changed to WINORCL.
  56. Modify parameter file and generate a new password file before restarting.
  57. Database ID for database WINORCL changed to 2126894910.
  58. All previous backups and archived redo logs for this database are unusable.
  59. Database is not aware of previous backups and archived logs in Recovery Area.
  60. Database has been shutdown, open database with RESETLOGS option.
  61. Succesfully changed database name and ID.
  62. DBNEWID - Completed succesfully.

  63. [oracle@station87 ~]$
复制代码

再下一道工序,一般是升级GI和DB:
升级DB之前要先升级GI:
请务必确保安装grid的那个用户,能够执行以下命令:
  1. [oracle@station90 grid]$ crs_stat -t
  2. Name           Type           Target    State     Host        
  3. ------------------------------------------------------------
  4. ora.DATA.dg    ora....up.type ONLINE    ONLINE    station90   
  5. ora.FRA.dg     ora....up.type ONLINE    ONLINE    station90   
  6. ora....ER.lsnr ora....er.type ONLINE    ONLINE    station90   
  7. ora.asm        ora.asm.type   ONLINE    ONLINE    station90   
  8. ora.cssd       ora.cssd.type  ONLINE    ONLINE    station90   
  9. ora.diskmon    ora....on.type ONLINE    ONLINE    station90   
  10. ora.orcl.db    ora....se.type ONLINE    ONLINE    station90  
复制代码

a.png

选目录时候,绝对不能覆盖/u01/app/oracle/product/11.2.0/grid:
b.png

c.png


执行rootupgrade.sh的过程:
  1. [root@station90 桌面]# /u01/app/oracle/product/11.2.0.3/grid/rootupgrade.sh
  2. Performing root user operation for Oracle 11g

  3. The following environment variables are set as:
  4.     ORACLE_OWNER= oracle
  5.     ORACLE_HOME=  /u01/app/oracle/product/11.2.0.3/grid

  6. Enter the full pathname of the local bin directory: [/usr/local/bin]:
  7. The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)
  8. [n]: y
  9.    Copying dbhome to /usr/local/bin ...
  10. The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
  11. [n]: y
  12.    Copying oraenv to /usr/local/bin ...
  13. The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
  14. [n]: y
  15.    Copying coraenv to /usr/local/bin ...

  16. Entries will be added to the /etc/oratab file as needed by
  17. Database Configuration Assistant when a database is created
  18. Finished running generic part of root script.
  19. Now product-specific root actions will be performed.
  20. Using configuration parameter file: /u01/app/oracle/product/11.2.0.3/grid/crs/install/crsconfig_params
  21. Creating trace directory

  22. 已成功升级 ASM 配置。

  23. Creating OCR keys for user 'oracle', privgrp 'oinstall'..
  24. Operation successful.
  25. LOCAL ONLY MODE
  26. Successfully accumulated necessary OCR keys.
  27. Creating OCR keys for user 'root', privgrp 'root'..
  28. Operation successful.
  29. CRS-4664: Node station90 successfully pinned.
  30. Replacing Clusterware entries in upstart
  31. Replacing Clusterware entries in upstart

  32. station90     2018/06/13 21:05:48     /u01/app/oracle/product/11.2.0.3/grid/cdata/station90/backup_20180613_210548.olr

  33. station90     2013/05/23 09:12:57     /u01/app/oracle/product/11.2.0/grid/cdata/station90/backup_20130523_091257.olr
  34. Successfully configured Oracle Grid Infrastructure for a Standalone Server
  35. [root@station90 桌面]#
复制代码
在原处重装数据库服务器软件,之前把/u01/app/oraInventory/ContentsXML/inventory.xml从:

  1. <?xml version="1.0" standalone="yes" ?>
  2. <!-- Copyright (c) 1999, 2011, Oracle. All rights reserved. -->
  3. <!-- Do not modify the contents of this file by hand. -->
  4. <INVENTORY>
  5. <VERSION_INFO>
  6.    <SAVED_WITH>11.2.0.3.0</SAVED_WITH>
  7.    <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
  8. </VERSION_INFO>
  9. <HOME_LIST>
  10. <HOME NAME="Ora11g_gridinfrahome1" LOC="/u01/app/oracle/product/11.2.0/grid" TYPE="O" IDX="1"/>
  11. <HOME NAME="OraDb11g_home1" LOC="/u01/app/oracle/product/11.2.0/dbhome_1" TYPE="O" IDX="2"/>
  12. <HOME NAME="Ora11g_gridinfrahome2" LOC="/u01/app/oracle/product/11.2.0.3/grid" TYPE="O" IDX="3"/>
  13. </HOME_LIST>
  14. <COMPOSITEHOME_LIST>
  15. </COMPOSITEHOME_LIST>
  16. </INVENTORY>
复制代码
编辑为:
  1. <?xml version="1.0" standalone="yes" ?>
  2. <!-- Copyright (c) 1999, 2011, Oracle. All rights reserved. -->
  3. <!-- Do not modify the contents of this file by hand. -->
  4. <INVENTORY>
  5. <VERSION_INFO>
  6.    <SAVED_WITH>11.2.0.3.0</SAVED_WITH>
  7.    <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
  8. </VERSION_INFO>
  9. <HOME_LIST>
  10. <HOME NAME="Ora11g_gridinfrahome2" LOC="/u01/app/oracle/product/11.2.0.3/grid" TYPE="O" IDX="3"/>
  11. </HOME_LIST>
  12. <COMPOSITEHOME_LIST>
  13. </COMPOSITEHOME_LIST>
  14. </INVENTORY>
复制代码

做一些删除操作,以下命令供参考:
  1. [root@station90 桌面]# su - oracle
  2. [oracle@station90 ~]$ crs_stat -t
  3. Name           Type           Target    State     Host        
  4. ------------------------------------------------------------
  5. ora.DATA.dg    ora....up.type ONLINE    ONLINE    station90   
  6. ora.FRA.dg     ora....up.type ONLINE    ONLINE    station90   
  7. ora....ER.lsnr ora....er.type ONLINE    ONLINE    station90   
  8. ora.asm        ora.asm.type   ONLINE    ONLINE    station90   
  9. ora.cssd       ora.cssd.type  ONLINE    ONLINE    station90   
  10. ora.diskmon    ora....on.type OFFLINE   OFFLINE               
  11. ora.evmd       ora.evm.type   ONLINE    ONLINE    station90   
  12. ora.ons        ora.ons.type   OFFLINE   OFFLINE               
  13. ora.orcl.db    ora....se.type ONLINE    ONLINE    station90   
  14. [oracle@station90 ~]$ exit
  15. logout
  16. [root@station90 桌面]# cd /u01/app/oracle
  17. [root@station90 oracle]# ls
  18. admin        checkpoints  diag                 man_recovery_area      oradata  station90
  19. cfgtoollogs  Clusterware  flash_recovery_area  man_recovery_area.11g  product
  20. [root@station90 oracle]# cd product/
  21. [root@station90 product]# ls
  22. 11.2.0  11.2.0.3
  23. [root@station90 product]# cd 11.2.0
  24. [root@station90 11.2.0]# ls
  25. dbhome_1  grid
  26. [root@station90 11.2.0]# rm -rf grid
  27. [root@station90 11.2.0]# ln -s /u01/app/oracle/product/11.2.0.3/grid/ ./
  28. [root@station90 11.2.0]# ls
  29. dbhome_1  grid
  30. [root@station90 11.2.0]# su - oracle
  31. [oracle@station90 ~]$ crs_stat -t
  32. Name           Type           Target    State     Host        
  33. ------------------------------------------------------------
  34. ora.DATA.dg    ora....up.type ONLINE    ONLINE    station90   
  35. ora.FRA.dg     ora....up.type ONLINE    ONLINE    station90   
  36. ora....ER.lsnr ora....er.type ONLINE    ONLINE    station90   
  37. ora.asm        ora.asm.type   ONLINE    ONLINE    station90   
  38. ora.cssd       ora.cssd.type  ONLINE    ONLINE    station90   
  39. ora.diskmon    ora....on.type OFFLINE   OFFLINE               
  40. ora.evmd       ora.evm.type   ONLINE    ONLINE    station90   
  41. ora.ons        ora.ons.type   OFFLINE   OFFLINE               
  42. ora.orcl.db    ora....se.type ONLINE    ONLINE    station90   
  43. [oracle@station90 ~]$ . oraenv
  44. ORACLE_SID = [orcl] ?
  45. The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is /u01/app/oracle
  46. [oracle@station90 ~]$ sqlplus /nolog

  47. SQL*Plus: Release 11.2.0.1.0 Production on Wed Jun 13 21:08:51 2018

  48. Copyright (c) 1982, 2009, Oracle.  All rights reserved.

  49. SQL> conn / as sysdba
  50. Connected.
  51. SQL> select  open_mode from v$database;

  52. OPEN_MODE
  53. --------------------
  54. READ WRITE

  55. SQL> shutdown immediate
  56. Database closed.
  57. Database dismounted.
  58. ORACLE instance shut down.
  59. SQL> exit
  60. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
  61. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  62. and Real Application Testing options
  63. [oracle@station90 ~]$ exit
  64. logout
  65. [root@station90 11.2.0]# vim /u01/app/oraInventory/
  66. backup/                  install.platform         oraInstaller.properties  orainstRoot.sh           
  67. ContentsXML/             logs/                    oraInst.loc              oui/                     
  68. [root@station90 11.2.0]# vim /u01/app/oraInventory/ContentsXML/
  69. comps.xml      inventory.xml  libs.xml      
  70. [root@station90 11.2.0]# vim /u01/app/oraInventory/ContentsXML/inventory.xml
  71. [root@station90 11.2.0]# vim /u01/app/oraInventory/ContentsXML/inventory.xml
  72. [root@station90 11.2.0]# cd /u01/app/
  73. [root@station90 app]# ls
  74. oracle  oraInventory
  75. [root@station90 app]# cd oracle/
  76. [root@station90 oracle]# ls
  77. admin        checkpoints  diag                 man_recovery_area      oradata  station90
  78. cfgtoollogs  Clusterware  flash_recovery_area  man_recovery_area.11g  product
  79. [root@station90 oracle]# cd product/
  80. [root@station90 product]# ls
  81. 11.2.0  11.2.0.3
  82. [root@station90 product]# cd 11.2.0
  83. [root@station90 11.2.0]# ls
  84. dbhome_1  grid
  85. [root@station90 11.2.0]# su - oracle
  86. [oracle@station90 ~]$ pwd
  87. /home/oracle
  88. [oracle@station90 ~]$ cd /u01/app/oracle/
  89. [oracle@station90 oracle]$ ls
  90. admin        checkpoints  diag                 man_recovery_area      oradata  station90
  91. cfgtoollogs  Clusterware  flash_recovery_area  man_recovery_area.11g  product
  92. [oracle@station90 oracle]$ cd product/
  93. [oracle@station90 product]$ ls
  94. 11.2.0  11.2.0.3
  95. [oracle@station90 product]$ cd 11.2.0
  96. [oracle@station90 11.2.0]$ ls
  97. dbhome_1  grid
  98. [oracle@station90 11.2.0]$ cd dbhome_1/
  99. [oracle@station90 dbhome_1]$ ls
  100. apex         csmig        dv                   inventory  log      ons          perl       sqldeveloper                utl
  101. assistants   css          emcli                j2ee       md       OPatch       plsql      sqlj                        wwg
  102. bin          ctx          EMStagePatches_orcl  javavm     mesg     opmn         precomp    sqlplus                     xdk
  103. ccr          cv           has                  jdbc       mgw      oracore      racg       srvm
  104. cdata        dbs          hs                   jdev       network  oraInst.loc  rdbms      station90.example.com_orcl
  105. cfgtoollogs  dc_ocm       ide                  jdk        nls      ord          relnotes   sysman
  106. clone        deinstall    install              jlib       oc4j     oui          root.sh    timingframework
  107. config       demo         install.platform     ldap       odbc     owb          scheduler  ucp
  108. crs          diagnostics  instantclient        lib        olap     owm          slax       uix
  109. [oracle@station90 dbhome_1]$ cd dbs
  110. [oracle@station90 dbs]$ ls
  111. hc_DBUA0.dat  hc_rcat.dat  initorcl.ora  orapwemrep  orapwrcat        spfilercat.ora
  112. hc_orcl.dat   init.ora     lkORCL        orapworcl   spfileemrep.ora
  113. [oracle@station90 dbs]$ cp initorcl.ora orapworcl spfilercat.ora  orapwrcat  /home/oracle/
  114. [oracle@station90 dbs]$ cd ..
  115. [oracle@station90 dbhome_1]$ ls
  116. apex         csmig        dv                   inventory  log      ons          perl       sqldeveloper                utl
  117. assistants   css          emcli                j2ee       md       OPatch       plsql      sqlj                        wwg
  118. bin          ctx          EMStagePatches_orcl  javavm     mesg     opmn         precomp    sqlplus                     xdk
  119. ccr          cv           has                  jdbc       mgw      oracore      racg       srvm
  120. cdata        dbs          hs                   jdev       network  oraInst.loc  rdbms      station90.example.com_orcl
  121. cfgtoollogs  dc_ocm       ide                  jdk        nls      ord          relnotes   sysman
  122. clone        deinstall    install              jlib       oc4j     oui          root.sh    timingframework
  123. config       demo         install.platform     ldap       odbc     owb          scheduler  ucp
  124. crs          diagnostics  instantclient        lib        olap     owm          slax       uix
  125. [oracle@station90 dbhome_1]$ cd network/
  126. [oracle@station90 network]$ cd admin/
  127. [oracle@station90 admin]$ ls
  128. listener.ora  samples  shrept.lst  tnsnames.ora
  129. [oracle@station90 admin]$ cp tnsnames.ora  /home/oracle/
  130. [oracle@station90 admin]$
  131. [oracle@station90 admin]$ exit
  132. logout
  133. [root@station90 11.2.0]# ls
  134. dbhome_1  grid
  135. [root@station90 11.2.0]# rm -rf dbhome_1/
  136. [root@station90 11.2.0]#


复制代码

11.2.0.3的db软件就安装在原处:
d.png

  1. ###########
  2.     startup upgrade   //其实就是禁用新特性
  3.     spool filename.log
  4.     @utlu112i.sql
  5.     @catupgrd.sql
  6.     自动shutdown immediate
  7.     startup
  8.     @utlu112s.sql
  9.     @catuppst.sql
  10.     @utlrp.sql   2h
复制代码
catupgr.sql执行完:
  1. ......
  2. DOC>   component upgrade are also listed.
  3. DOC>
  4. DOC>   Please review the status and version columns and check the details
  5. DOC>   any errors in the spool log file.  If there are errors in the spool
  6. DOC>   file, or any components are not VALID or not the current version,
  7. DOC>   consult the Oracle Database Upgrade Guide for troubleshooting
  8. DOC>   recommendations.
  9. DOC>
  10. DOC>#######################################################################
  11. DOC>#######################################################################
  12. DOC>#
  13. SQL> Rem =====================================================================
  14. SQL> Rem Index Creation for Bootstrap Objects. utlmmig will shutdown the
  15. SQL> Rem database.
  16. SQL> Rem DB must be restarted after this script.
  17. SQL> Rem For 11.2 patch upgrades, utlmmig.sql is not run, but the database
  18. SQL> Rem is shutdown via catupshd.sql.
  19. SQL> Rem =====================================================================
  20. SQL>
  21. SQL> SELECT version_script FROM DUAL;

  22. VERSION_SCRIPT
  23. --------------------------------------------------------------------------------
  24. 1102000

  25. 1 row selected.

  26. SQL>
  27. SQL> COLUMN mig_name NEW_VALUE mig_file NOPRINT;
  28. SQL> SELECT version_script AS mig_name FROM DUAL;




  29. 1 row selected.

  30. SQL>
  31. SQL> VARIABLE utl_name VARCHAR2(50)
  32. SQL> COLUMN :utl_name NEW_VALUE utl_file NOPRINT;
  33. SQL>
  34. SQL> BEGIN
  35.   2     IF '&&mig_file' = '1102000' THEN
  36.   3        :utl_name := 'catupshd.sql';
  37.   4     ELSE
  38.   5        :utl_name := 'utlmmig.sql';
  39.   6     END IF;
  40.   7  END;
  41.   8  /
  42. old   2:    IF '&&mig_file' = '1102000' THEN
  43. new   2:    IF '1102000' = '1102000' THEN

  44. PL/SQL procedure successfully completed.

  45. SQL> drop version_script;   -- no longer needed
  46.   2  
  47. SQL> SELECT :utl_name FROM DUAL;




  48. 1 row selected.

  49. SQL> @@&utl_file
  50. SQL> Rem
  51. SQL> Rem $Header: catupshd.sql 12-jul-2007.07:16:44 rburns Exp $
  52. SQL> Rem
  53. SQL> Rem catupshd.sql
  54. SQL> Rem
  55. SQL> Rem Copyright (c) 2007, Oracle. All rights reserved.
  56. SQL> Rem
  57. SQL> Rem    NAME
  58. SQL> Rem      catupshd.sql - CATalog UPgrade SHutDown
  59. SQL> Rem
  60. SQL> Rem    DESCRIPTION
  61. SQL> Rem      This script shuts down the database at the conclusion of
  62. SQL> Rem      upgrades that do not run utlmmig.sql, which also does a shutdown.
  63. SQL> Rem
  64. SQL> Rem    NOTES
  65. SQL> Rem      Invoked from catupend.sql
  66. SQL> Rem
  67. SQL> Rem    MODIFIED   (MM/DD/YY)
  68. SQL> Rem    rburns      07/12/07 - final upgrade shutdown
  69. SQL> Rem    rburns      07/12/07 - Created
  70. SQL> Rem
  71. SQL>
  72. SQL> shutdown immediate
  73. Database closed.
  74. Database dismounted.
  75. ORACLE instance shut down.
  76. SQL>
  77. SQL>
  78. SQL> DOC
  79. DOC>#######################################################################
  80. DOC>#######################################################################
  81. DOC>
  82. DOC>   The above sql script is the final step of the upgrade. Please
  83. DOC>   review any errors in the spool log file. If there are any errors in
  84. DOC>   the spool file, consult the Oracle Database Upgrade Guide for
  85. DOC>   troubleshooting recommendations.
  86. DOC>
  87. DOC>   Next restart for normal operation, and then run utlrp.sql to
  88. DOC>   recompile any invalid application objects.
  89. DOC>
  90. DOC>   If the source database had an older time zone version prior to
  91. DOC>   upgrade, then please run the DBMS_DST package.  DBMS_DST will upgrade
  92. DOC>   TIMESTAMP WITH TIME ZONE data to use the latest time zone file shipped
  93. DOC>   with Oracle.
  94. DOC>
  95. DOC>#######################################################################
  96. DOC>#######################################################################
  97. DOC>#
  98. SQL>
  99. SQL> Rem Set errorlogging off
  100. SQL> SET ERRORLOGGING OFF;
  101. SQL>
  102. SQL> REM END OF CATUPGRD.SQL
  103. SQL>
  104. SQL> REM bug 12337546 - Exit current sqlplus session at end of catupgrd.sql.
  105. SQL> REM                This forces user to start a new sqlplus session in order
  106. SQL> REM                to connect to the upgraded db.
  107. SQL> exit
  108. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  109. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  110. and Real Application Testing options
  111. [oracle@station90 ~]$
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-21 21:41 , Processed in 0.150151 second(s), 27 queries .

快速回复 返回顶部 返回列表