ORACLE11gR2安装XDB



以下结果对于是否对数据库进行重启验证结果不一致
1.ORACLE LINUX 5.6 数据库11.2.0.4无psu环境首次安装后不用重启数据库
2.REDHAT6.5 数据库11.2.0.4 psu 20160119环境首次安装后需要各节点重启数据库
3.MOS文章里提到## IMPORTANT: You must shutdown and restart the database between removal and reinstall ##
但在单实例11.2.0.4版本数据库中卸载后重新安装XDB不需要重启数据库

NOTE
1.所有步骤,均使用sys用户
2.在remove和reinstall XDB过程间,需要重启数据库,RAC需要重启所有节点,否则会出现XDB相关用户失效问题。
3.安装过程中会清空share pool须谨慎操作。

1.验证XDB是否安装
验证是否安装XDB:(未安装XDB,查询没有结果)
set pagesize 1000                                                      
col comp_name format a36                                               
col version format a12                                                 
col status format a8                                                   
col owner format a12                                                   
col object_name format a35
col name format a25                                                    
select comp_name, version, status                                      
from dba_registry                                                      
where comp_id = 'XDB';

2.查看是否有使用XDB类型的表:
select owner, table_name
from dba_xml_tables
where storage_type in ('OBJECT-RELATIONAL', 'BINARY');

select owner, table_name
from dba_xml_tab_cols
where storage_type in ('OBJECT-RELATIONAL', 'BINARY');

---------------此步骤一般不需要操作---------------------------
授权:默认情况下它们授予PUBLIC权限,但某些情况(如出于安全考虑有些权限可能已被取消),则需要手动赋予
grant execute on DBMS_LOB to PUBLIC;
grant execute on UTL_FILE to PUBLIC;
grant execute on DBMS_SQL to PUBLIC;
grant execute on DBMS_JOB to PUBLIC;
grant execute on UTL_RAW  to PUBLIC;
--------------------------------------------------------------

3.安装XDB,输出日志很长,建议通过CRT保留log
@?/rdbms/admin/catqm.sql xdb sysaux temp yes

(   @?/rdbms/admin/catqm.sql <XDB pwd> <XDB default tbs> <XDB temporary tbs> <YES/NO>
          -- XDB_PASSWD: password for XDB user
          -- TABLESPACE: tablespace for XDB
          -- TEMP_TABLESPACE: temporary tablespace for XDB
          -- SECURE_FILES_REPO: if YES and compatibility is at least 11.2,
               then XDB repository will be stored as secure files;
               otherwise, old LOBS are used. There is no default value for
               this parameter, the caller must pass either YES or NO.
               是否将XDB的lobs字段存入secure file
               -查询源库中表的lob字段是否存入secure file:
                SELECT table_name,segment_name,index_name,securefile
                FROM dba_lobs
                WHERE table_name='table_name';


    NOTES
    Must be run connected as SYS
 
 xdb 默认表空间,不能设指定为SYSTEM、UNDO、TEMP,且表空间需要提前创建或已存在表空间。


   
4.编译失效对象(删除后重新安装对象 DBMS_METADATA 会失效)
@?/rdbms/admin/utlrp.sql

5.验证是否安装成功:
set pagesize 1000                                                      
col comp_name format a36                                               
col version format a12                                                 
col status format a8                                                   
col owner format a12                                                   
col object_name format a35
col name format a25                                                    
select comp_name, version, status                                      
from dba_registry                                                      
where comp_id = 'XDB';

扫描二维码关注公众号,回复: 4859165 查看本文章

COMP_NAME                            VERSION      STATUS                    
------------------------------------ ------------ --------                  
Oracle XML Database                  11.2.0.4.0   VALID                     
                                                                            
1 row selected.      


select owner, object_name, object_type, status                         
from dba_objects                                                       
where status = 'INVALID'                                               
and owner in ('SYS', 'XDB');

SQL> 
no rows selected

至此,XDB安装完成。

---------------remove卸载XDB--------------
卸载XDB,卸载后若再次安装需要重启数据库(若RAC需重启所有节点实例)
@?/rdbms/admin/catnoqm.sql

验证是否卸载XDB(卸载成功XDB,查询没有结果)
set pagesize 1000                                                      
col comp_name format a36                                               
col version format a12                                                 
col status format a8                                                   
col owner format a12                                                   
col object_name format a35
col name format a25
                                                   
select comp_name, version, status                                      
from dba_registry                                                      
where comp_id = 'XDB';


参考文章
Master Note for Oracle XML Database (XDB) Install / Deinstall (文档 ID 1292089.1)
http://www.itpub.net/forum.php?mod=viewthread&tid=1389810

猜你喜欢

转载自blog.csdn.net/whb234174124/article/details/52980275