[oracle@server1 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Nov 7 21:08:42 2013
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP MOUNT;
ORACLE instance started.
Total System Global Area 76619308 bytes
Fixed Size 454188 bytes
Variable Size 58720256 bytes
Database Buffers 16777216 bytes
Redo Buffers 667648 bytes
Database mounted.
SQL> ALTER SESSION SET SQL_TRACE=TRUE;
Session altered.
SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;
System altered.
SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
System altered.
SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0;
System altered.
SQL> ALTER DATABASE OPEN;
Database altered.
SQL> alter database character set zhs16gbk;alter database character set zhs16gbk*ERROR at line 1:ORA-12716: Cannot ALTER DATABASE CHARACTER SET when CLOB data exists
SQL> truncate table Metastylesheet; Table truncated.
SQL> alter database character set zhs16gbk;alter database character set zhs16gbk*ERROR at line 1:ORA-12716: Cannot ALTER DATABASE CHARACTER SET when CLOB data exists
-- 使用internal_convert来修改
SQL> alter database character set internal_convert zhs16gbk;
Database altered.
-- alert信息: SYS.WRI$_DBU_HWM_METADATA (LOGIC) - CLOB representation altered SYS.WRI$_DBU_FEATURE_METADATA (INST_CHK_LOGIC) - CLOB representation altered SYS.WRI$_DBU_FEATURE_METADATA (USG_DET_LOGIC) - CLOB representation altered SYS.WRI$_DBU_FEATURE_USAGE (FEATURE_INFO) - CLOB representation altered SYS.SCHEDULER$_EVENT_LOG (ADDITIONAL_INFO) - CLOB representation altered SYS.RULE$ (CONDITION) - CLOB representation alteredRefreshing type attributes with new character set informationCompleted: alter database character set internal_convert zhs1----
SQL>@?/rdbms/admin/catmeta.sqlSQL> ALTER SESSION SET SQL_TRACE=FALSE;
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP
ORACLE instance started.
Total System Global Area 235999352 bytes
Fixed Size 450680 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
但是之后做impdp发现报以下错误
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsORA-39006: internal errorORA-39213: Metadata processing is not available
SQL> exec dbms_metadata_util.load_stylesheets
PL/SQL procedure successfully completed.
//拼接数据库表名注释
Select 'comment on table ' || t.Owner || '.' || t.Table_Name || ' is ' ||
Chr(39) || t.Comments || Chr(39) || ';'
From Dba_Tab_Comments t
Where Owner In ('INSUR', 'JSCXYL')
And Comments Is Not Null
And Instr(t.Table_Name, '$') = 0;
//拼接数据库列名注释
Select ' comment on column ' || t.Owner || '.' || t.Table_Name || '.' ||
t.Column_Name || ' is ' || Chr(39) || t.Comments || Chr(39) || ';'
From Dba_Col_Comments t
Where Owner In ('INSUR', 'JSCXYL')
And Comments Is Not Null
And Instr(t.Table_Name, '$') = 0;