Oracle 12c中的
SQL Translator Profiles可能会帮助应用程序假装Oracle支持相当长的对象名称.这可以允许您在不修改应用程序的情况下更改数据库.
下面是将大于30字节的名称转换为短名称的简单示例:
sql> create table short_table_name(a varchar2(100));
Table created.
sql> insert into short_table_name values ('Success');
1 row created.
sql> begin
2 dbms_sql_translator.create_profile('LONG_OBJECT_NAMES');
3 dbms_sql_translator.register_sql_translation(
4 profile_name => 'LONG_OBJECT_NAMES',5 sql_text => 'select * from because_30_bytes_just_isnt_enough_sometimes',6 translated_text => 'select * from short_table_name');
7 end;
8 /
PL/sql procedure successfully completed.
sql> alter session set sql_translation_profile = LONG_OBJECT_NAMES;
Session altered.
sql> alter session set events = '10601 trace name context forever,level 32';
Session altered.
sql> select * from because_30_bytes_just_isnt_enough_sometimes;
A
----------------------------------------------------------------------------------------------------
Success
这可能有用,但我可以想到十几个原因,这是一个坏主意.只考虑这是最后的手段.