dbconsole和sysman用户

dbconsole一直是我不怎么推荐的oracle工具,但是总有一些客户使用,这里对于dbconsole中sysman用户状态,密码修改做了一些基本的测试
sysman用户被锁

SQL>  alter user sysman account  lock;

User altered.

重启dbconsole

[oracle@localhost ~]$ emctl stop dbconsole
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

https://localhost:1158/em/console/aboutApplication

Stopping Oracle Enterprise Manager 11g Database Control ... 
 ...  Stopped. 
[oracle@localhost ~]$ emctl start dbconsole
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

https://localhost:1158/em/console/aboutApplication

Starting Oracle Enterprise Manager 11g Database Control ..... started. 
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/db_1/localhost_test/sysman/log 

sysman-lock


部分错误日志提示(这里可以明显dbconsole无法正常使用是由于sysman被锁)
2

解锁sysman用户

SQL> alter user sysman account unlock;

User altered.

重启dbconsole

[oracle@localhost ~]$ emctl stop dbconsole
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

https://localhost:1158/em/console/aboutApplication

Stopping Oracle Enterprise Manager 11g Database Control ... 
 ...  Stopped. 
[oracle@localhost ~]$ emctl start dbconsole
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

https://localhost:1158/em/console/aboutApplication

Starting Oracle Enterprise Manager 11g Database Control ..... started. 
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/db_1/localhost_test/sysman/log 

3


sysman解锁之后重启dbconsole恢复正常
修改sysman密码

SQL> alter user sysman identified by xifenfei;

User altered.

SQL> select account_status from dba_users where username='SYSMAN';

ACCOUNT_STATUS
--------------------------------
OPEN

重启dbconsole

[oracle@localhost ~]$  emctl stop dbconsole
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

https://localhost:1158/em/console/aboutApplication

Stopping Oracle Enterprise Manager 11g Database Control ... 
 ...  Stopped. 

[oracle@localhost ~]$  emctl start dbconsole
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

https://localhost:1158/em/console/aboutApplication

Starting Oracle Enterprise Manager 11g Database Control ..... started. 
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/db_1/localhost_test/sysman/log 
SQL>  select account_status from dba_users where username='SYSMAN';

ACCOUNT_STATUS
--------------------------------
LOCKED(TIMED)

由于dbconsole的密码存储在配置文件中,修改sysman密码,而配置文件的没有修改,因此使用错误是syman密码登录,超过了profile里面设置的10次,导致用户被锁.

解决sysman密码不对导致异常问题

[oracle@localhost ~]$ emctl stop dbconsole
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

https://localhost:1158/em/console/aboutApplication

Stopping Oracle Enterprise Manager 11g Database Control ... 
 ...  Stopped. 

[oracle@localhost config]$ pwd
/u01/app/oracle/product/11.2.0/db_1/localhost_test/sysman/config
[oracle@localhost config]$ ls -l emoms.properties 
-rw-r--r--. 1 oracle oinstall 1669 Nov 25 15:20 emoms.properties

[oracle@localhost config]$ grep emdRepPwd emoms.properties|grep -v emdRepPwdSeed
oracle.sysman.eml.mntr.emdRepPwd=e3299b5db6162f5d
oracle.sysman.eml.mntr.emdRepPwdEncrypted=TRUE


[oracle@localhost config]$ grep emdRepPwd emoms.properties|grep -v emdRepPwdSeed
oracle.sysman.eml.mntr.emdRepPwd=xifenfei
oracle.sysman.eml.mntr.emdRepPwdEncrypted=FALSE
SQL>  alter user sysman account unlock;

User altered.
[oracle@localhost ~]$ emctl start dbconsole
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

https://localhost:1158/em/console/aboutApplication

Starting Oracle Enterprise Manager 11g Database Control ..... started. 
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/db_1/localhost_test/sysman/log 

通过人工修改$ORACLE_HOME/localhost_sid/sysman/config/emoms.properties文件中的oracle.sysman.eml.mntr.emdRepPwd=密码,oracle.sysman.eml.mntr.emdRepPwdEncrypted=false实现修改密码

[oracle@localhost config]$ grep emdRepPwd emoms.properties|grep -v emdRepPwdSeed
oracle.sysman.eml.mntr.emdRepPwd=aa537afcbab41e05
oracle.sysman.eml.mntr.emdRepPwdEncrypted=TRUE

dbconsole重启之后,密码又重新被修改为加密方式,在11.2之前修改sysman密码,注意要同步修改emoms.properties中相关密码信息

sysman修改密码( 11.2 and higher)

[oracle@localhost config]$ emctl stop dbconsole
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

https://localhost:1158/em/console/aboutApplication

Stopping Oracle Enterprise Manager 11g Database Control ... 
 ...  Stopped. 
SQL> alter user sysman identified by xifenfei123;

User altered.
[oracle@localhost ~]$ emctl setpasswd dbconsole
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

https://localhost:1158/em/console/aboutApplication

Please enter new repository password: 
Repository password successfully updated.

[oracle@localhost ~]$ emctl start dbconsole
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "c"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.

https://localhost:1158/em/console/aboutApplication

Starting Oracle Enterprise Manager 11g Database Control ..... started. 
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/db_1/localhost_test/sysman/log 
发表在 Oracle | 标签为 , , , , | 评论关闭

move lob导致index失效

在一次数据库升级过程中,因为blug需要move lob,导致表相关index失效,这里通过实验重现
数据库版本

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE    11.2.0.4.0      Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

创建用户

SQL> create user xff identified by oracle;

User created.

SQL> grant dba to xff;

Grant succeeded.

创建测试表和插入数据

SQL> conn xff/oracle
Connected.

SQL> create table t_xff (id int primary key not null,name varchar2(20),c_lob clob);

Table created.

SQL> insert into t_xff values(1,'www.xifenfei.com','//www.xifenfei.com');

1 row created.

SQL>  insert into t_xff values(2,'www.xifenfei.com','//www.xifenfei.com');

1 row created.

SQL> commit;

Commit complete.

SQL> select index_name,status from user_indexes;

INDEX_NAME                     STATUS
------------------------------ --------
SYS_IL0000090094C00003$$       VALID
SYS_C0011148                   VALID

move lob

SQL> ALTER TABLE t_xff MOVE LOB (c_lob) store as (tablespace users);

Table altered.

SQL>  select index_name,status from user_indexes;

INDEX_NAME                     STATUS
------------------------------ --------
SYS_IL0000090094C00003$$       VALID
SYS_C0011148                   UNUSABLE

SQL>  insert into t_xff values(3,'www.xifenfei.com','//www.xifenfei.com');
 insert into t_xff values(3,'www.xifenfei.com','//www.xifenfei.com')
*
ERROR at line 1:
ORA-01502: index 'XFF.SYS_C0011148' or partition of such index is in unusable
state

这里很明显,当我们move lob之后,表的index变为无效,插入操作无法进行

rebuind index

SQL> alter index xff.SYS_C0011148 rebuild;

Index altered.

SQL> select index_name,status from user_indexes;

INDEX_NAME                     STATUS
------------------------------ --------
SYS_IL0000090094C00003$$       VALID
SYS_C0011148                   VALID

SQL> insert into t_xff values(3,'www.xifenfei.com','//www.xifenfei.com');

1 row created.

SQL> commit;

Commit complete.

这个测试就是告诫自己,做oracle 不要想当然,move lob之后,表相关的index 都会失效,需要rebuild。具体参见:
Bug 6525073 : STBH: INDEX IS IN UNUSABLE STATE AFTER A LOB COLUMN IS MOVED
ALTER TABLE MOVE LOB makes indexes unusable on the parent table (Doc ID 1228324.1)

发表在 Oracle | 标签为 , , | 评论关闭

XTTS实战分享

迁移目标
源库:hp-unix RAC 裸设备 10.2.0.5
目标库:Linux RAC ASM 11.2.0.4
停机时间:8小时
数据量:16T

迁移方法
使用基于rman备份的xtts实现(因为使用裸设备,无法使用dbms_file_transfer方法实现)

迁移步骤
1)迁移之前检查

--查询无效对象
select owner, object_name, object_type from dba_objects 
where status !='VALID' order by owner, object_type, object_name;

--检查无效index
select owner, index_name, status from dba_indexes 
where status='UNUSABLE' order by 1,2;

select i.owner, i.index_name, p.partition_name, p.status 
from dba_ind_partitions p,dba_indexes i 
where p.index_name=i.index_name and p.status='UNUSABLE'
order by 1,2,3;

select i.owner,i.index_name,s.subpartition_name,s.status from 
dba_ind_subpartitions s,dba_indexes i where 
s.index_name=i.index_name and s.status='UNUSABLE'
order by 1,2,3;

--compatible Advanced Queues检查
select owner,queue_table,recipients,compatible from dba_queue_tables
where recipients='MULTIPLE' and compatible like '%8.0%';

--基于XMLSchema的XMLType对象检查
SELECT distinct OWNER FROM DBA_XML_SCHEMAS;

select distinct p.tablespace_name
from dba_tablespaces p, dba_xml_tables x, dba_users u, all_all_tables t
where t.table_name=x.table_name and
      t.tablespace_name=p.tablespace_name and
      x.owner=u.username;

--SPATIAL空间组件对象检查
select owner,index_name from dba_indexes
where ityp_name = 'SPATIAL_INDEX';


select owner, table_name, column_name
from dba_tab_columns
where data_type = 'SDO_GEOMETRY'
and owner != 'MDSYS'
order by 1,2,3;

--外部表检查
select distinct owner from DBA_EXTERNAL_TABLES;

--IOT表检查
select distinct owner from dba_tables where IOT_TYPE is not null;

--检查临时表
SELECT owner,table_name FROM DBA_TABLES WHERE 
TEMPORARY='Y' AND OWNER IN(用户列表);

--物化视图检查
select owner,count(*) from dba_mviews group by owner;

--检查永久表空间
select t.TABLESPACE_NAME TABLESPACE_NAME,count(f.FILE_ID),
sum(f.bytes/1024/1024/1024) GB
FROM dba_tablespaces t, dba_data_files f
where t.TABLESPACE_NAME=f.TABLESPACE_NAME
	and t.tablespace_name not in (根据需求排除)
	and t.contents = 'PERMANENT'
group by t.TABLESPACE_NAME
order by 2;


--检查命令进行自包含检查
EXEC sys.dbms_tts.transport_set_check('需要迁移的表空间列表',TRUE);

select * from transport_set_violations;

--回收站检查
select count(*) from dba_recyclebin;
Purge dba_recyclebin;

--检查是否存在应用户使用TSTZ 字段
select c.owner || '.' || c.table_name || '(' || c.column_name || ') -'
    || c.data_type || ' ' col
  from dba_tab_cols c, dba_objects o
 where c.data_type like '%WITH TIME ZONE'
    and c.owner=o.owner
   and c.table_name = o.object_name
   and o.object_type = 'TABLE' 
order by col;

--检查表空间是否加密
select tablespace_name,ENCRYPTED from dba_tablespaces;

--检查是否存在加密字段
select * from DBA_ENCRYPTED_COLUMNS;

--检查Opaque Types类型字段
select distinct owner ,DATA_TYPE from dba_tab_columns where
 owner in (需要迁移用户列表);

--检查表空间和数据文件状态
select tablespace_name,status from dba_tablespaces;

select STATUS,ONLINE_STATUS,count(*) from dba_data_files 
group by STATUS,ONLINE_STATUS;

--比对新旧环境profile是否一致
select distinct(t.pro) from
(select s.profile pro, l.profile pro2
from dba_profiles@XTTS_DBLINK s, dba_profiles l
where s.profile = l.profile(+)) t where t.pro2 is null
order by t.pro;

2)迁移之前新库创建
其他类似profile,不需要xtts迁移的东西,均可以创建

--在新环境中比对并创建角色
select 'create role '||role ||';' from dba_roles@XTTS_DBLINK 
minus
select 'create role '||role ||';' from dba_roles;

--在新环境中比对并创建用户 
select 'create user "'||a.username ||'" identified by values '''||b.password||
 ''' default tablespace USERS '|| 'temporary tablespace '||
 a.TEMPORARY_TABLESPACE||';'
from dba_users@XTTS_DBLINK a,sys.user$@XTTS_DBLINK b,
dba_users c,sys.user$   d
where a.username=b.name  and
a.username=d.name(+)
and a.username = c.username(+) and c.username is null
order by a.username;

3)停业务之前xtts迁移操作
源库
备注:由于源库的perl的版本不能满足需求,下载新的perl版本

--xtt.properties文件编辑
tablespaces=需要迁移表空间列表
platformid=4
dfcopydir=/backup/temp1/rmanback
backupformat=/backup/temp1/rmanback
stageondest=/temp1/rmanback
storageondest=+DATA/xifenfei/datafile
backupondest=/temp3/covntemp
parallel=16
rollparallel=16
getfileparallel=16

--xtts全备发起
cat /home/oracle/xttsscript/full_backup.sh

export TMPDIR=/home/oracle/tmpxtts
cd /home/oracle/xtts
export ORACLE_SID=xifenfei2
/home/oracle/perl/bin/perl xttdriver.pl -p -d

nohup /home/oracle/xttsscript/full_backup.sh > /home/oracle/xttsscript/full_backup.log &

--完成之后拷贝rmanconvert.cmd到共享目录
cp  /home/oracle/tmpxtts/rmanconvert.cmd  /backup/temp1/tempfile/

目标库

--拷贝源库的rmanconvert.cmd到目标库
cp /temp1/tempfile/rmanconvert.cmd /home/oracle/tmpxtts/

--目标库启动到mount
shutdown immediate;
startup mount

--xtts转换数据文件
cd /home/oracle/xttsscript/
cat > /home/oracle/xttsscript/full_restore.sh

export TMPDIR=/home/oracle/tmpxtts
export ORACLE_SID=xifenfei2
cd /home/oracle/xtts
$ORACLE_HOME/perl/bin/perl xttdriver.pl -c -d

chmod +x /home/oracle/xttsscript/full_restore.sh
nohup /home/oracle/xttsscript/full_restore.sh > /home/oracle/xttsscript/full_restore.log &

源库第一次增量备份

cd /home/oracle/xttsscript
cat /home/oracle/xttsscript/incre_backup.sh

export XTTDEBUG=1
export TMPDIR=/home/oracle/tmpxtts
cd /home/oracle/xtts
export ORACLE_SID=xifenfei2
/home/oracle/perl/bin/perl xttdriver.pl -i -d

nohup /home/oracle/xttsscript/incre_backup.sh > /home/oracle/xttsscript/incre_backup1.log &

--拷贝文件到共享目录
cp /home/oracle/tmpxtts/xttplan.txt /backup/temp1/tempfile/
cp /home/oracle/tmpxtts/tsbkupmap.txt /backup/temp1/tempfile/

目标库第一次增量恢复

--拷贝共享目录文件
cp /temp1/tempfile/xttplan.txt /home/oracle/tmpxtts/xttplan.txt
cp /temp1/tempfile/tsbkupmap.txt /home/oracle/tmpxtts/tsbkupmap.txt

--xtts增量还原
cd /home/oracle/xttsscript
cat  /home/oracle/xttsscript/ince_restore.sh

export XTTDEBUG=1
export TMPDIR=/home/oracle/tmpxtts
export ORACLE_SID=xifenfei1
cd /home/oracle/xtts
$ORACLE_HOME/perl/bin/perl xttdriver.pl -r -d

nohup /home/oracle/xttsscript/ince_restore.sh > /home/oracle/xttsscript/ince_restore1.log &

源端更新scn

cd /home/oracle/xttsscript/
cat /home/oracle/xttsscript/getscn.sh

export XTTDEBUG=1
export TMPDIR=/home/oracle/tmpxtts
cd /home/oracle/xtts
export ORACLE_SID=xifenfei2
date
/home/oracle/perl/bin/perl xttdriver.pl -s -d

nohup /home/oracle/xttsscript/getscn.sh >> /home/oracle/xttsscript/getscn.log &

在停业务之前,依次进行上面三步的增量备份,恢复,更新scn,一直持续到最后停业务,表空间只读。
4)正式停业务后xtts操作
原库

--设置表空间只读
select 'alter tablespace '||t.TABLESPACE_NAME||' read only;'
FROM dba_tablespaces t, dba_data_files f
where t.TABLESPACE_NAME=f.TABLESPACE_NAME
	and t.tablespace_name not in (选择排除的表空间)
	and t.contents = 'PERMANENT'
group by t.TABLESPACE_NAME
order by count(f.FILE_ID);

--xtts增量备份
cd /home/oracle/xttsscript
nohup /home/oracle/xttsscript/incre_backup.sh > /home/oracle/xttsscript/incre_backup_end.log &

--拷贝文件到共享目录
cp /home/oracle/tmpxtts/xttplan.txt /backup/temp1/tempfile/
cp /home/oracle/tmpxtts/tsbkupmap.txt /backup/temp1/tempfile/

目标库

--拷贝共享目录文件
cp /temp1/tempfile/xttplan.txt /home/oracle/tmpxtts/xttplan.txt
cp /temp1/tempfile/tsbkupmap.txt /home/oracle/tmpxtts/tsbkupmap.txt

cd /home/oracle/xttsscript
nohup /home/oracle/xttsscript/ince_restore.sh > /home/oracle/xttsscript/ince_restore_end.log &

5)元数据迁移

--源库(导出表空间和用户元数据)
nohup expdp "'/ as sysdba'" parfile=/archive2/dmpdir/expdp_xtts_tbs_metadata.par &

nohup expdp "'/ as sysdba'" parfile=/archive2/dmpdir/expdp_xtts_users_metadata.par &

--目标库(导入表空间和用户元数据)
nohup impdp "'/ as sysdba'"  parfile=/temp3/dmpdir/impdp_xtts_tbs_metadata.par &

nohup impdp "'/ as sysdba'" parfile=/temp3/dmpdir/impdp_xtts_users_metadata.par &

6)后续操作

--设置表空间读写
select 'alter tablespace '||t.TABLESPACE_NAME||' read write;'
FROM dba_tablespaces t, dba_data_files f
where t.TABLESPACE_NAME=f.TABLESPACE_NAME
	and t.tablespace_name not in (排除表空间列表)
	and t.contents = 'PERMANENT'
group by t.TABLESPACE_NAME
order by count(f.FILE_ID);

--编译无效对象
@?/rdbms/admin/utlprp.sql 32

--对比无效对象
select r.owner, r.object_type, r.remote_cnt Source_Cnt, l.local_cnt Target_Cnt
from ( select owner, object_type, count(owner) remote_cnt
from dba_objects@XTTS_DBLINK
where owner not in
(select name
from system.logstdby$skip_support
where action=0) group by owner, object_type ) r
, ( select owner, object_type, count(owner) local_cnt
from dba_objects
where owner not in
(select name
from system.logstdby$skip_support
where action=0) group by owner, object_type ) l
where l.owner (+) = r.owner
and l.object_type (+) = r.object_type 
and nvl(l.local_cnt,-1) != r.remote_cnt
order by 1, 3 desc;

--对比sequence大小
select * from(
select a.SEQUENCE_OWNER,a.sequence_name,a.last_number prod_number, 
b.last_number dr_number,(b.last_number - a.last_number) gap_than_zero
 from dba_sequences@XTTS_DBLINK a,dba_sequences b
  where a.sequence_owner not in 
 ('SYS','SYSTEM','XDB','WMSYS','TSMSYS','SYSMAN','PRECISE1',
'ORDSYS','OUTLN','OLAPSYS','ORDPLUGINS','MDSYS','EXFSYS',
'DMSYS','DSG','DBSNMP','PRECISE2','SI_INFORMTN_SCHEMA','SPA','TSMSYS','PUBLIC','GOLDENGATE',
'ORDDATA','PRECISE4','PRECISE3','CTXSYS','SCOTT','PERFSTAT')
and a.sequence_owner=b.sequence_owner (+)
and a.sequence_name=b.sequence_name(+)
 order by 5,1,2 desc) where gap_than_zero < 0 ;

--检查无效index
select owner, index_name, status from dba_indexes 
where status='UNUSABLE' order by 1,2;

select i.owner, i.index_name, p.partition_name, p.status 
from dba_ind_partitions p,dba_indexes i 
where p.index_name=i.index_name and p.status='UNUSABLE'
order by 1,2,3;

select i.owner,i.index_name,s.subpartition_name,s.status from 
dba_ind_subpartitions s,dba_indexes i where 
s.index_name=i.index_name and s.status='UNUSABLE'
order by 1,2,3;

--创建迁移之前删除的物化视图,index,临时表等

由于xtts迁移是一种物理方法结合逻辑方法的迁移,本身是一个复杂的过程,这里只是列举出来了主要的操作过程和步骤,可能涉及很多细节工作需要考虑比如public对象,统计信息,dblink,权限等所有逻辑迁移中需要注意的问题,在这里易于需要注意,另外还要关注xtts本身物理转换所带来的各种bug.
特别感谢Lunar,Oracle的Gary Zhou,存储的黄长老等所有朋友的帮助和支持

发表在 Oracle | 标签为 , , | 评论关闭