Categotry Archives: 脚本

XDB is INVALID after ORA-31084 ORA-43853 errors during install

0

Posted on by

新安装的XDB组件状态是INVALID的,报下面的错:

SQL> set echo on
SQL> -- @catqm.sql    
SQL>
SQL> @?/rdbms/admin/catqm xdbpwd XDB TEMP NO
SQL> Rem
...
...

SQL> declare
  2    ACLXSD BFILE := dbms_metadata_hack.get_bfile('acl.xsd.11.2');
  3    ACLURL VARCHAR2(2000) := 'http://xmlns.oracle.com/xdb/acl.xsd';
  4  begin
  5  xdb.dbms_xmlschema.registerSchema(ACLURL, ACLXSD, FALSE, FALSE, FALSE, TRUE,
  6                                    FALSE, 'XDB',[......]

查看全文

拼出加分区表脚本

0

Posted on by

下面的脚本为新建2014年一年的分区。可根据不同的需求修改下。

sql:

select 'alter table ' || b.table_name || ' add partition PA_' ||
       TO_CHAR(a - 1, 'YYYYMM') ||
       
       ' values less than (TO_DATE( ''' ||
       TO_CHAR(a, 'YYYY-MM-DD HH24:MI:SS') || ''',''YYYY-MM-DD HH24:MI:SS'');'

  from (select add_months(trunc(DATE '2014-01-01', 'month'), level) a
          from dual
        connect by l[......]

查看全文