11GR2 DATAGUARD环境下的DATABASE升级(11.2.0.2升级到11.2.0.3)(3)

11GR2 DATAGUARD环境下的DATABASE升级(11.2.0.2升级到11.2.0.3)(1)

http://luoping.blog.51cto.com/534596/988073

11GR2 DATAGUARD环境下的DATABASE升级(11.2.0.2升级到11.2.0.3)(2)

http://luoping.blog.51cto.com/534596/988108

11GR2 DATAGUARD环境下的DATABASE升级(11.2.0.2升级到11.2.0.3)(3)

http://luoping.blog.51cto.com/534596/988024

升级完成后我们再次执行dbupgrade脚本

 
 
  1. SQL> @/home/oracle/rs/sql/dbupgdiag 
  2.  
  3. Enter location for Spooled output
  4.  
  5.  
  6. 11_Sep_2012_0741    .log 
  7.  
  8. htz_ 
  9. SP2-0606: Cannot create SPOOL file "0/db_upg_diag_htz_11_Sep_2012_0741.log" 
  10.  
  11.  
  12.  
  13.                           *** Start of LogFile *** 
  14.  
  15.   Oracle Database Upgrade Diagnostic Utility       09-11-2012 07:41:41 
  16.  
  17. =============== 
  18. Hostname 
  19. =============== 
  20.  
  21. 11g 
  22.  
  23. =============== 
  24. Database Name 
  25. =============== 
  26.  
  27. HTZ 
  28.  
  29. =============== 
  30. Database Uptime 
  31. =============== 
  32.  
  33. 07:28 11-SEP-12 
  34.  
  35. ================= 
  36. Database Wordsize 
  37. ================= 
  38.  
  39. This is a 64-bit database 
  40.  
  41. ================ 
  42. Software Version 
  43. ================ 
  44.  
  45. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
  46. PL/SQL Release 11.2.0.3.0 - Production 
  47. CORE    11.2.0.3.0      Production 
  48. TNS for Linux: Version 11.2.0.3.0 - Production 
  49. NLSRTL Version 11.2.0.3.0 - Production 
  50.  
  51. ============= 
  52. Compatibility 
  53. ============= 
  54.  
  55. Compatibility is set as 11.2.0.0.0 
  56.  
  57. ================ 
  58. Archive Log Mode 
  59. ================ 
  60.  
  61. Database log mode              Archive Mode 
  62. Automatic archival             Enabled 
  63. Archive destination            /u01/app/oracle/arch/htz/ 
  64. Oldest online log sequence     98 
  65. Next log sequence to archive   100 
  66. Current log sequence           100 
  67.  
  68. ================ 
  69. Auditing Check 
  70. ================ 
  71.  
  72.  
  73. NAME                                 TYPE        VALUE 
  74. ------------------------------------ ----------- ------------------------------ 
  75. audit_file_dest                      string      /u01/app/oracle/admin/htz/adum 
  76.                                                  p 
  77. audit_sys_operations                 boolean     FALSE 
  78. audit_syslog_level                   string 
  79. audit_trail                          string      DB 
  80.  
  81. ================ 
  82. Cluster Check 
  83. ================ 
  84.  
  85. NAME                                 TYPE        VALUE 
  86. ------------------------------------ ----------- ------------------------------ 
  87. cluster_database                     boolean     FALSE 
  88. cluster_database_instances           integer     1 
  89.  
  90. DOC>################################################################ 
  91. DOC> 
  92. DOC> If CLUSTER_DATABASE is set to TRUE, change it to FALSE before 
  93. DOC> upgrading the database 
  94. DOC> 
  95. DOC>################################################################ 
  96. DOC># 
  97.  
  98. =========================================== 
  99. Tablespace and the owner of the aud$ table 
  100. =========================================== 
  101.  
  102. OWNER        TABLESPACE_NAME 
  103. ------------ ------------------------------ 
  104. SYS          SYSTEM 
  105.  
  106. ============================================================================ 
  107. count of records in the sys.aud$ table where dbid is null- Standard Auditing 
  108. ============================================================================ 
  109.  
  110.  
  111.          0 
  112.  
  113.  
  114. ============================================================================================ 
  115. count of records in the system.aud$ when dbid is null, Std Auditing with OLS or DV installed 
  116. ============================================================================================ 
  117. select count(*) from system.aud$ where dbid is null 
  118.                             * 
  119. ERROR at line 1: 
  120. ORA-00942: table or view does not exist 
  121.  
  122.  
  123.  
  124.  
  125. ============================================================================= 
  126. count of records in the sys.fga_log$ when dbid is null, Fine Grained Auditing 
  127. ============================================================================= 
  128.  
  129.          0 
  130.  
  131.  
  132.  
  133. ========================================== 
  134. Oracle Label Security is installed or not 
  135. ========================================== 
  136.  
  137. Oracle Label Security is NOT installed at database level 
  138.  
  139. ================ 
  140. Number of AQ Records in Message Queue Tables 
  141. ================ 
  142.  
  143. SYS - ALERT_QT - 0 
  144. SYS - AQ$_MEM_MC - 0 
  145. SYS - AQ_EVENT_TABLE - 0 
  146. SYS - AQ_PROP_TABLE - 0 
  147. SYS - KUPC$DATAPUMP_QUETAB - 0 
  148. SYS - SCHEDULER$_EVENT_QTAB - 0 
  149. SYS - SCHEDULER$_REMDB_JOBQTAB - 0 
  150. SYS - SCHEDULER_FILEWATCHER_QT - 0 
  151. SYS - SYS$SERVICE_METRICS_TAB - 0 
  152. SYSMAN - MGMT_LOADER_QTABLE - 0 
  153. SYSMAN - MGMT_NOTIFY_INPUT_QTABLE - 0 
  154. SYSMAN - MGMT_NOTIFY_QTABLE - 0 
  155. SYSMAN - MGMT_PAF_MSG_QTABLE_1 - 0 
  156. SYSMAN - MGMT_PAF_MSG_QTABLE_2 - 0 
  157. SYSMAN - MGMT_TASK_QTABLE - 27 
  158. SYSTEM - DEF$_AQCALL - 0 
  159. SYSTEM - DEF$_AQERROR - 0 
  160. WMSYS - WM$EVENT_QUEUE_TABLE - 0 
  161.  
  162. ================ 
  163. Time Zone version 
  164. ================ 
  165.  
  166.  
  167.         14 
  168.  
  169. ================ 
  170. Local Listener 
  171. ================ 
  172.  
  173.  
  174.  
  175.  
  176. ================ 
  177. Default and Temporary Tablespaces By User 
  178. ================ 
  179.  
  180.  
  181. USERNAME                     TEMPORARY_TABLESPACE   DEFAULT_TABLESPACE 
  182. ---------------------------- ---------------------- ---------------------- 
  183. SYS                          TEMP                   SYSTEM 
  184. SYSTEM                       TEMP                   SYSTEM 
  185. SCOTT                        TEMP                   USERS 
  186. OUTLN                        TEMP                   SYSTEM 
  187. MGMT_VIEW                    TEMP                   SYSTEM 
  188. FLOWS_FILES                  TEMP                   SYSAUX 
  189. MDSYS                        TEMP                   SYSAUX 
  190. ORDSYS                       TEMP                   SYSAUX 
  191. EXFSYS                       TEMP                   SYSAUX 
  192. DBSNMP                       TEMP                   SYSAUX 
  193. WMSYS                        TEMP                   SYSAUX 
  194. APPQOSSYS                    TEMP                   SYSAUX 
  195. APEX_030200                  TEMP                   SYSAUX 
  196. OWBSYS_AUDIT                 TEMP                   SYSAUX 
  197. ORDDATA                      TEMP                   SYSAUX 
  198. CTXSYS                       TEMP                   SYSAUX 
  199. ANONYMOUS                    TEMP                   SYSAUX 
  200. SYSMAN                       TEMP                   SYSAUX 
  201. XDB                          TEMP                   SYSAUX 
  202. ORDPLUGINS                   TEMP                   SYSAUX 
  203. OWBSYS                       TEMP                   SYSAUX 
  204. SI_INFORMTN_SCHEMA           TEMP                   SYSAUX 
  205. OLAPSYS                      TEMP                   SYSAUX 
  206. ORACLE_OCM                   TEMP                   USERS 
  207. XS$NULL                      TEMP                   USERS 
  208. MDDATA                       TEMP                   USERS 
  209. DIP                          TEMP                   USERS 
  210. APEX_PUBLIC_USER             TEMP                   USERS 
  211. SPATIAL_CSW_ADMIN_USR        TEMP                   USERS 
  212. SPATIAL_WFS_ADMIN_USR        TEMP                   USERS 
  213.  
  214.  
  215. ================ 
  216. Component Status 
  217. ================ 
  218.  
  219. Comp ID Component                          Status    Version        Org_Version    Prv_Version 
  220. ------- ---------------------------------- --------- -------------- -------------- -------------- 
  221. AMD     OLAP Catalog                       VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  222. APEX    Oracle Application Express         VALID     3.2.1.00.12 
  223. APS     OLAP Analytic Workspace            VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  224. CATALOG Oracle Database Catalog Views      VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  225. CATJAVA Oracle Database Java Packages      VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  226. CATPROC Oracle Database Packages and Types VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  227. CONTEXT Oracle Text                        VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  228. EM      Oracle Enterprise Manager          VALID     11.2.0.3.0     11.2.0.2.0 
  229. EXF     Oracle Expression Filter           VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  230. JAVAVM  JServer JAVA Virtual Machine       VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  231. ORDIM   Oracle Multimedia                  VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  232. OWB     OWB                                VALID     11.2.0.2.0 
  233. OWM     Oracle Workspace Manager           VALID     11.2.0.3.0     11.2.0.2.0 
  234. RUL     Oracle Rules Manager               VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  235. SDO     Spatial                            VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  236. XDB     Oracle XML Database                VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  237. XML     Oracle XDK                         VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  238. XOQ     Oracle OLAP API                    VALID     11.2.0.3.0     11.2.0.2.0     11.2.0.2.0 
  239.  
  240.  
  241.  
  242. ====================================================== 
  243. List of Invalid Database Objects Owned by SYS / SYSTEM 
  244. ====================================================== 
  245.  
  246.  
  247. Number of Invalid Objects 
  248. ------------------------------------------------------------------ 
  249. There are no Invalid Objects 
  250.  
  251. DOC>################################################################ 
  252. DOC> 
  253. DOC> If there are no Invalid objects below will result in zero rows
  254. DOC> 
  255. DOC>################################################################ 
  256. DOC># 
  257.  
  258.  
  259. no rows selected 
  260.  
  261.  
  262. ================================ 
  263. List of Invalid Database Objects 
  264. ================================ 
  265.  
  266.  
  267. Number of Invalid Objects 
  268. ------------------------------------------------------------------ 
  269. There are no Invalid Objects 
  270.  
  271. DOC>################################################################ 
  272. DOC> 
  273. DOC> If there are no Invalid objects below will result in zero rows
  274. DOC> 
  275. DOC>################################################################ 
  276. DOC># 
  277.  
  278.  
  279. no rows selected 
  280.  
  281.  
  282. ====================================================== 
  283. Count of Invalids by Schema 
  284. ====================================================== 
  285.  
  286. ============================================================== 
  287. Identifying whether a database was created as 32-bit or 64-bit 
  288. ============================================================== 
  289.  
  290. DOC>########################################################################### 
  291. DOC> 
  292. DOC> Result referencing the string 'B023' ==> Database was created as 32-bit 
  293. DOC> Result referencing the string 'B047' ==> Database was created as 64-bit 
  294. DOC> When String results in 'B023' and when upgrading database to 10.2.0.3.0 
  295. DOC> (64-bit) , For known issue refer below articles 
  296. DOC> 
  297. DOC> Note 412271.1 ORA-600 [22635] and ORA-600 [KOKEIIX1] Reported While 
  298. DOC>               Upgrading Or Patching Databases To 10.2.0.3 
  299. DOC> Note 579523.1 ORA-600 [22635], ORA-600 [KOKEIIX1], ORA-7445 [KOPESIZ] and 
  300. DOC>              OCI-21500 [KOXSIHREAD1] Reported While Upgrading To 11.1.0.6 
  301. DOC> 
  302. DOC>########################################################################### 
  303. DOC># 
  304.  
  305.  
  306. Metadata Initial DB Creation Info 
  307. -------- ----------------------------------- 
  308. B047     Database was created as 64-bit 
  309.  
  310. =================================================== 
  311. Number of Duplicate Objects Owned by SYS and SYSTEM 
  312. =================================================== 
  313.  
  314. Counting duplicate objects .... 
  315.  
  316.  
  317.   COUNT(1) 
  318. ---------- 
  319.          4 
  320.  
  321. ========================================= 
  322. Duplicate Objects Owned by SYS and SYSTEM 
  323. ========================================= 
  324.  
  325. Querying duplicate objects .... 
  326.  
  327.  
  328. OBJECT_NAME                              OBJECT_TYPE                              SUBOBJECT_NAME                  OBJECT_ID 
  329. ---------------------------------------- ---------------------------------------- ------------------------------ ---------- 
  330. AQ$_SCHEDULES                            TABLE                                                                         5701 
  331. AQ$_SCHEDULES_PRIMARY                    INDEX                                                                         5702 
  332. DBMS_REPCAT_AUTH                         PACKAGE                                                                       8568 
  333. DBMS_REPCAT_AUTH                         PACKAGE BODY                                                                 12144 
  334.  
  335. DOC> 
  336. DOC>################################################################################ 
  337. DOC> 
  338. DOC> If any objects found please follow below article. 
  339. DOC> Note 1030426.6 How to Clean Up Duplicate Objects Owned by SYS and SYSTEM schema 
  340. DOC> Read the Exceptions carefully before taking actions. 
  341. DOC> 
  342. DOC>################################################################################ 
  343. DOC># 
  344.  
  345. ======================== 
  346. Password protected roles 
  347. ======================== 
  348.  
  349. DOC> 
  350. DOC>################################################################################ 
  351. DOC> 
  352. DOC> In version 11.2 password protected roles are no longer enabled by default so if 
  353. DOC> an application relies on such roles being enabled by default and no action is 
  354. DOC> performed to allow the user to enter the password with the set role command, it 
  355. DOC> is recommended to remove the password from those roles (to allow for existing 
  356. DOC> privileges to remain available). For more information see: 
  357. DOC> 
  358. DOC> Note 745407.1 : What Roles Can Be Set as Default for a User
  359. DOC> 
  360. DOC>################################################################################ 
  361. DOC># 
  362.  
  363. Querying for password protected roles .... 
  364.  
  365.  
  366. Password protected Role        Assigned by default to user 
  367. ------------------------------ ------------------------------ 
  368. OWB$CLIENT                     OWBSYS 
  369.  
  370. ================ 
  371. JVM Verification 
  372. ================ 
  373.  
  374.  
  375. ================================================ 
  376. Checking Existence of Java-Based Users and Roles 
  377. ================================================ 
  378.  
  379. DOC> 
  380. DOC>################################################################################ 
  381. DOC> 
  382. DOC> There should not be any Java Based users for database version 9.0.1 and above. 
  383. DOC> If any users found, it is faulty JVM. 
  384. DOC> 
  385. DOC>################################################################################ 
  386. DOC># 
  387.  
  388.  
  389. User Existence 
  390. --------------------------- 
  391. No Java Based Users 
  392.  
  393. DOC> 
  394. DOC>############################################################### 
  395. DOC> 
  396. DOC> Healthy JVM Should contain Six Roles. 
  397. DOC> If there are more or less than six role, JVM is inconsistent. 
  398. DOC> 
  399. DOC>############################################################### 
  400. DOC># 
  401.  
  402.  
  403. Role 
  404. ------------------------------ 
  405. There are 6 JAVA related roles 
  406.  
  407. Roles 
  408.  
  409.  
  410. ROLE 
  411. ------------------------------ 
  412. JAVA_DEPLOY 
  413. JAVAUSERPRIV 
  414. JAVAIDPRIV 
  415. JAVASYSPRIV 
  416. JAVADEBUGPRIV 
  417. JAVA_ADMIN 
  418.  
  419. ========================================= 
  420. List of Invalid Java Objects owned by SYS 
  421. ========================================= 
  422.  
  423. There are no SYS owned invalid JAVA objects 
  424.  
  425. DOC> 
  426. DOC>################################################################# 
  427. DOC> 
  428. DOC> Check the status of the main JVM interface packages DBMS_JAVA 
  429. DOC> and INITJVMAUX and make sure it is VALID. 
  430. DOC> 
  431. DOC> If there are no Invalid objects below will result in zero rows
  432. DOC> 
  433. DOC>################################################################# 
  434. DOC># 
  435.  
  436.  
  437. no rows selected 
  438.  
  439.  
  440. DOC> 
  441. DOC>################################################################# 
  442. DOC> 
  443. DOC> If the JAVAVM component is not installed in the database (for 
  444. DOC> example, after creating the database with custom scripts), the 
  445. DOC> next query will report the following error: 
  446. DOC> 
  447. DOC>   select dbms_java.longname('foo'"JAVAVM TESTING" from dual 
  448. DOC>   * 
  449. DOC>   ERROR at line 1: 
  450. DOC>   ORA-00904: "DBMS_JAVA"."LONGNAME": invalid identifier 
  451. DOC> 
  452. DOC> If the JAVAVM component is installed, the query should succeed 
  453. DOC> with 'foo' as result. 
  454. DOC> 
  455. DOC>################################################################# 
  456. DOC># 
  457.  
  458.  
  459. JAVAVM TESTING 
  460. --------------- 
  461. foo 
  462.  
  463.  
  464.                             *** End of LogFile *** 

到这里主库升级完成。

10 关闭备库与停监听

 
  
  1. SQL> shutdown abort; 
  2. ORACLE instance shut down. 
  3. SQL> exit 
  4. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production 
  5. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  6. [oracle@11gdg admin]$ lsnrctl stop 
  7.  
  8. LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 10-SEP-2012 10:31:12 
  9.  
  10. Copyright (c) 1991, 2010, Oracle.  All rights reserved. 
  11.  
  12. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.31)(PORT=1521))) 
  13. The command completed successfully 
  14. #修改相关的文件
  15. [oracle@11gdg ~]$ tail -1 /etc/oratab
    htz:/u01/app/oracle/product/11.2.0/db_2:N
  16.  
  17. [oracle@11gdg admin]$ cp /u01/app/oracle/product/11.2.0/db_1/dbs/* /u01/app/oracle/product/11.2.0/db_2/dbs/ 
  18. [oracle@11gdg admin]$ cp -r /u01/app/oracle/product/11.2.0/db_1/network/admin/*  /u01/app/oracle/product/11.2.0/db_2/network/admin/ 
  19. [oracle@11gdg ~]$ cat .bash_profile 
  20. # .bash_profile 
  21.  
  22. # Get the aliases and functions 
  23. if [ -f ~/.bashrc ]; then 
  24.         . ~/.bashrc 
  25. fi 
  26.  
  27. User specific environment and startup programs 
  28.  
  29. PATH=$PATH:$HOME/bin 
  30.  
  31. export PATH 
  32. export ORACLE_SID=htz 
  33. export ORACLE_BASE=/u01/app/oracle 
  34. export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_2 
  35. export PATH=$ORACLE_HOME/bin:$PATH:$ORACLE_HOME/OPatch 
  36. stty erase ^h 
  37. set -o vi 
  38. export DISPLAY=192.168.100.1:0.0 
  39. export SHELL_HOME=$HOME/rs 
  40. export PATH=$PATH:$SHELL_HOME/bin:$SHELL_HOME/dbmonitor:$SHELL_HOME/asm:$SHELL_HOME/rman:$SHELL_HOME/tune:$SHELL_HOME/dump:$SHELL_HOME/event 
  41. export TRACE=/u01/app/oracle/diag/rdbms/htzb/htz/trace 
  42.  
  43.  
  44. [oracle@11gdg ~]$ lsnrctl start 
  45.  
  46. LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 10-SEP-2012 10:32:30 
  47.  
  48. Copyright (c) 1991, 2011, Oracle.  All rights reserved. 
  49.  
  50. Starting /u01/app/oracle/product/11.2.0/db_2/bin/tnslsnr: please wait... 
  51.  
  52. TNSLSNR for Linux: Version 11.2.0.3.0 - Production 
  53. System parameter file is /u01/app/oracle/product/11.2.0/db_2/network/admin/listener.ora 
  54. Log messages written to /u01/app/oracle/diag/tnslsnr/11gdg/listener/alert/log.xml 
  55. Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.31)(PORT=1521))) 
  56.  
  57. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.31)(PORT=1521))) 
  58. STATUS of the LISTENER 
  59. ------------------------ 
  60. Alias                     LISTENER 
  61. Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production 
  62. Start Date                10-SEP-2012 10:32:30 
  63. Uptime                    0 days 0 hr. 0 min. 0 sec 
  64. Trace Level               off 
  65. Security                  ONLocal OS Authentication 
  66. SNMP                      OFF 
  67. Listener Parameter File   /u01/app/oracle/product/11.2.0/db_2/network/admin/listener.ora 
  68. Listener Log File         /u01/app/oracle/diag/tnslsnr/11gdg/listener/alert/log.xml 
  69. Listening Endpoints Summary... 
  70.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.31)(PORT=1521))) 
  71. Services Summary... 
  72. Service "htzb" has 1 instance(s). 
  73.   Instance "htz", status UNKNOWN, has 1 handler(s) for this service... 
  74. The command completed successfully 

12 启动数据库并手动recover

 
  
  1. [oracle@11gdg ~]$ sqlplus / as sysdba 
  2.  
  3. SQL*Plus: Release 11.2.0.3.0 Production on Mon Sep 10 10:32:42 2012 
  4.  
  5. Copyright (c) 1982, 2011, Oracle.  All rights reserved. 
  6.  
  7. Connected to an idle instance. 
  8.  #注意如果这里直接用startup要报下面的错误 的
  9. SQL> startup 
  10. ORACLE instance started. 
  11.  
  12. Total System Global Area  313159680 bytes 
  13. Fixed Size                  2227944 bytes 
  14. Variable Size             255852824 bytes 
  15. Database Buffers           50331648 bytes 
  16. Redo Buffers                4747264 bytes 
  17. Database mounted. 
  18. ORA-01092: ORACLE instance terminated. Disconnection forced 
  19. ORA-00704: bootstrap process failure 
  20. ORA-39700: database must be opened with UPGRADE option 
  21. Process ID: 4233 
  22. Session ID: 1 Serial number: 5 
  23.  

 

 
  
  1. SQL>  
  2. #手动recover 
  3. SQL> recover managed standby database using current logfile disconnect; 
  4. Media recovery complete. 
  5.  
  6. alert日志 
  7. Completed: ALTER DATABASE RECOVER  managed standby database using current logfile disconnect   
  8. Mon Sep 10 10:42:12 2012 
  9. Clearing online redo logfile 1 complete 
  10. Clearing online redo logfile 2 /u01/app/oracle/oradata/htz/redo02.log 
  11. Clearing online log 2 of thread 1 sequence number 96 
  12. Clearing online redo logfile 2 complete 
  13. Clearing online redo logfile 3 /u01/app/oracle/oradata/htz/redo03.log 
  14. Clearing online log 3 of thread 1 sequence number 95 
  15. Clearing online redo logfile 3 complete 
  16. Media Recovery Log /u01/app/oracle/arch/htz/1_28_793318533.dbf 
  17. Identified End-Of-Redo (switchover) for thread 1 sequence 28 at SCN 0x0.121e16 
  18. Resetting standby activation ID 1848137735 (0x6e285807) 
  19. Media Recovery End-Of-Redo indicator encountered 
  20. Media Recovery Continuing 
  21. Media Recovery Log /u01/app/oracle/arch/htz/1_29_793318533.dbf 
  22. Media Recovery Log /u01/app/oracle/arch/htz/1_30_793318533.dbf 
  23. Media Recovery Log /u01/app/oracle/arch/htz/1_31_793318533.dbf 
  24. Media Recovery Log /u01/app/oracle/arch/htz/1_32_793318533.dbf 
  25. Media Recovery Log /u01/app/oracle/arch/htz/1_33_793318533.dbf 
  26. Media Recovery Log /u01/app/oracle/arch/htz/1_34_793318533.dbf 
  27. Media Recovery Log /u01/app/oracle/arch/htz/1_35_793318533.dbf 
  28. Mon Sep 10 10:42:44 2012 
  29. Media Recovery Log /u01/app/oracle/arch/htz/1_36_793318533.dbf 
  30. Mon Sep 10 10:42:58 2012 
  31. Media Recovery Log /u01/app/oracle/arch/htz/1_37_793318533.dbf 
  32. Mon Sep 10 10:43:11 2012 
  33. Media Recovery Log /u01/app/oracle/arch/htz/1_38_793318533.dbf 
  34.  
  35. 说明正在recover 
  36. 直接alert日志中出现下面的提示Media Recovery Log /u01/app/oracle/arch/htz/1_99_793318533.dbf 
  37. Media Recovery Log /u01/app/oracle/arch/htz/1_100_793318533.dbf 
  38. Media Recovery Log /u01/app/oracle/arch/htz/1_101_793318533.dbf 
  39. Media Recovery Log /u01/app/oracle/arch/htz/1_102_793318533.dbf 
  40. Media Recovery Waiting for thread 1 sequence 103 (in transit) 
  41. Recovery of Online Redo Log: Thread 1 Group 4 Seq 103 Reading mem 0 
  42.   Mem# 0: /u01/app/oracle/oradata/htz/standby01.log 
  43. 表示正在等待mem中的日志,recover完成了。 
  44. 这里启动数据库open read only状态 

收集陈旧的统计信息

 
  
  1. [oracle@11gdg sql]$ sqlplus  / as sysdba 
  2.  
  3. SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 11 00:20:15 2012 
  4.  
  5. Copyright (c) 1982, 2011, Oracle.  All rights reserved. 
  6.  
  7.  
  8. Connected to
  9. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
  10. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  11.  
  12. SQL> @check_stale_stats 
  13.  
  14. -- There are no stale statistics in APEX_030200 schema. 
  15.  
  16.  
  17. ------------------------------------------------------------------------------------------------------- 
  18. -- CTXSYS schema contains stale statistics use the following to gather the statistics -- 
  19. ------------------------------------------------------------------------------------------------------- 
  20.  
  21. EXEC DBMS_STATS.GATHER_DICTIONARY_STATS('CTXSYS',OPTIONS=>'GATHER STALE', ESTIMATE_PERCENT  => DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT => 'FOR ALL COLUMNS SIZE AUTO'CASCADE => TRUE); 
  22. -- There are no stale statistics in EXFSYS schema. 
  23.  
  24. -- There are no stale statistics in MDSYS schema. 
  25.  
  26.  
  27. ------------------------------------------------------------------------------------------------------- 
  28. -- OLAPSYS schema contains stale statistics use the following to gather the statistics -- 
  29. ------------------------------------------------------------------------------------------------------- 
  30.  
  31. EXEC DBMS_STATS.GATHER_DICTIONARY_STATS('OLAPSYS',OPTIONS=>'GATHER STALE', ESTIMATE_PERCENT  => DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT => 'FOR ALL COLUMNS SIZE AUTO'CASCADE => TRUE); 
  32.  
  33. ------------------------------------------------------------------------------------------------------- 
  34. -- ORDSYS schema contains stale statistics use the following to gather the statistics -- 
  35. ------------------------------------------------------------------------------------------------------- 
  36.  
  37. EXEC DBMS_STATS.GATHER_DICTIONARY_STATS('ORDSYS',OPTIONS=>'GATHER STALE', ESTIMATE_PERCENT  => DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT => 'FOR ALL COLUMNS SIZE AUTO'CASCADE => TRUE); 
  38. -- There are no stale statistics in OWBSYS schema. 
  39.  
  40.  
  41. ------------------------------------------------------------------------------------------------------- 
  42. -- SYS schema contains stale statistics use the following to gather the statistics -- 
  43. ------------------------------------------------------------------------------------------------------- 
  44.  
  45. EXEC DBMS_STATS.GATHER_DICTIONARY_STATS('SYS',OPTIONS=>'GATHER STALE', ESTIMATE_PERCENT  => DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT => 'FOR ALL COLUMNS SIZE AUTO'CASCADE => TRUE); 
  46.  
  47. ------------------------------------------------------------------------------------------------------- 
  48. -- SYSMAN schema contains stale statistics use the following to gather the statistics -- 
  49. ------------------------------------------------------------------------------------------------------- 
  50.  
  51. EXEC DBMS_STATS.GATHER_DICTIONARY_STATS('SYSMAN',OPTIONS=>'GATHER STALE', ESTIMATE_PERCENT  => DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT => 'FOR ALL COLUMNS SIZE AUTO'CASCADE => TRUE); 
  52. -- There are no stale statistics in WMSYS schema. 
  53.  
  54.  
  55. ------------------------------------------------------------------------------------------------------- 
  56. -- XDB schema contains stale statistics use the following to gather the statistics -- 
  57. ------------------------------------------------------------------------------------------------------- 
  58.  
  59. EXEC DBMS_STATS.GATHER_DICTIONARY_STATS('XDB',OPTIONS=>'GATHER STALE', ESTIMATE_PERCENT  => DBMS_STATS.AUTO_SAMPLE_SIZE, METHOD_OPT => 'FOR ALL COLUMNS SIZE AUTO'CASCADE => TRUE); 

照着上面执行吧。

13 升级完成后做切换。

主上:

 
  
  1. SYS@11g > set lines 100 
  2. SYS@11g > select open_mode,log_mode,switchover_status,database_role,flashback_on from v$database
  3.  
  4. OPEN_MODE            LOG_MODE     SWITCHOVER_STATUS    DATABASE_ROLE    FLASHBACK_ON 
  5. -------------------- ------------ -------------------- ---------------- ------------------ 
  6. READ WRITE           ARCHIVELOG   TO STANDBY           PRIMARY          YES 
  7.  
  8.  
  9. SYS@11g >  alter database commit to switchover to physical standby with session shutdown; 
  10.  
  11. Database altered. 
  12.  
  13. SYS@11g > shutdown immediate; 
  14. ORA-01092: ORACLE instance terminated. Disconnection forced 
  15. SYS@11g > startup 
  16. ORA-24324: service handle not initialized 
  17. ORA-01041: internal error. hostdef extension doesn't exist 
  18. SYS@11g > exit 
  19. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
  20. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  21. [oracle@11g ~]$ sqlplus  / as sysdba 
  22.  
  23. SQL*Plus: Release 11.2.0.3.0 Production on Tue Sep 11 18:26:13 2012 
  24.  
  25. Copyright (c) 1982, 2011, Oracle.  All rights reserved. 
  26.  
  27. Connected to an idle instance. 
  28.  
  29.      
  30.  > startup 
  31. ORACLE instance started. 
  32.  
  33. Total System Global Area  313159680 bytes 
  34. Fixed Size                  2227944 bytes 
  35. Variable Size             239075608 bytes 
  36. Database Buffers           67108864 bytes 
  37. Redo Buffers                4747264 bytes 
  38. Database mounted. 
  39. Database opened. 
  40.  > set lines 100 
  41.  > select open_mode,log_mode,switchover_status,database_role,flashback_on from v$database
  42.  
  43. OPEN_MODE            LOG_MODE     SWITCHOVER_STATUS    DATABASE_ROLE    FLASHBACK_ON 
  44. -------------------- ------------ -------------------- ---------------- ------------------ 
  45. READ ONLY            ARCHIVELOG   TO PRIMARY           PHYSICAL STANDBY YES 

备上

 
  
  1. SQL> set lines 100 
  2. SQL> select open_mode,log_mode,switchover_status,database_role,flashback_on from v$database
  3.  
  4. OPEN_MODE            LOG_MODE     SWITCHOVER_STATUS    DATABASE_ROLE    FLASHBACK_ON 
  5. -------------------- ------------ -------------------- ---------------- ------------------ 
  6. READ ONLY WITH APPLY ARCHIVELOG   TO PRIMARY           PHYSICAL STANDBY YES 
  7.  
  8. SQL> alter database commit to switchover to primary with session shutdown; 
  9.  
  10. Database altered. 
  11.  
  12. SQL> select open_mode,log_mode,switchover_status,database_role,flashback_on from v$database
  13.  
  14. OPEN_MODE            LOG_MODE     SWITCHOVER_STATUS    DATABASE_ROLE    FLASHBACK_ON 
  15. -------------------- ------------ -------------------- ---------------- ------------------ 
  16. MOUNTED              ARCHIVELOG   NOT ALLOWED          PRIMARY          YES 
  17.  
  18. SQL> alter database open
  19.  
  20. Database altered. 
  21.  
  22. SQL> select open_mode,log_mode,switchover_status,database_role,flashback_on from v$database
  23.  
  24. OPEN_MODE            LOG_MODE     SWITCHOVER_STATUS    DATABASE_ROLE    FLASHBACK_ON 
  25. -------------------- ------------ -------------------- ---------------- ------------------ 
  26. READ WRITE           ARCHIVELOG   TO STANDBY           PRIMARY          YES 

整个升级过程已经完成。

后面将会介绍临时的logical standby database升级方式。

 


     本文转自7343696 51CTO博客,原文链接:http://blog.51cto.com/luoping/988024,如需转载请自行联系原作者





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值