前段时间一个数据库发现没有安装XDB组件,查了下mos:
注意:在安装前和删除前必须重启数据库。
XDB Removal
The catnoqm.sql script drops XDB.
spool xdb_removal.log
set echo on;
connect / as sysdba
shutdown immediate;
startup
@?/rdbms/admin/catnoqm.sql
spool off;
Some XDB related objects in the SYS schema are not dropped during the removal of XDB. Also, the SYS.KU$_% views will become invalid. Please see the following document for cleaning up these objects:
(Doc ID 1269470.1) XDB Deinstallation script catnoqm.sql leads to Invalid SYS Objects
可参考:删除XDB组件导致的对象失效
XDB Installation
The catqm.sql script requires the following parameters be passed to it when run:
A. XDB user password
B. XDB user default tablespace
* The SYSTEM, UNDO and TEMP tablespace cannot be specified.
* The specified tablespace must already exist prior to running the script.
* A tablespace other than SYSAUX should be specified, especially if you expect Oracle XML DB Repository to contain a large amount of data.
* For example:
create tablespace XDB
datafile 'xxxxxxxxx.dbf' size 2000M
extent management local uniform size 256K segment space management auto;
C. XDB user temporary tablespace
D. YES or NO
* If YES is specified, the XDB repository will use SecureFile storage.
* If NO is specified, LOBS will be used.
* To use SecureFiles, compatibility must be set to 11.2.
* The tablespace specified for the XDB repository must be using Automatic Segment Space Management (ASSM) for SecureFiles to be used.
The syntax to run catqm.sql is the following:
SQL> catqm.sql A B C D
For Example:
SQL> @?/rdbms/admin/catqm.sql xdb XDB TEMP YES
## IMPORTANT: You must shutdown and restart the database between removal and reinstall ##
spool xdb_install.log
set echo on;
connect / as sysdba
shutdown immediate;
startup;
@?/rdbms/admin/catqm.sql <XDB pwd> <XDB default tbs> <XDB temporary tbs> <YES or NO> — substitute the parameters with appropriate values
@?/rdbms/admin/utlrp.sql
spool off
其中在11.2版本后,默认的表空间segment_space_management为AUTO
参考:XDB is INVALID after ORA-31084 ORA-43853 errors during install
在安装XDB后,有一些包为失效状态:
sys.dbms_network_acl_admin, sys.dbms_xs_principal_events_int, sys.xs$catview_util, xdb.dbms_resconfig
可参考: XDB is INVALID in DBA_REGISTRY after Fresh Installation
参考:Master Note for Oracle XML Database (XDB) Install / Deinstall (文档 ID 1292089.1)