Database Reference
In-Depth Information
SQL> begin
2 for i in 1..100000 loop
3 insert into t1 (vc, t) values (i,systimestamp);
4 end loop;
5 end;
6 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:08.00
Beginning with Oracle 12c it is possible to add a sequence as the default value for a column. The code example
shown earlier changes to this:
SQL> alter table t1 modify id default s_t1.nextval;
Table altered.
The before insert trigger is disabled next. The same code block to insert 100,000 rows now takes a lot less time:
SQL> begin
2 for i in 1..100000 loop
3 insert into t1 (vc, t) values (i,systimestamp);
4 end loop;
5 end;
6 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:04.26
So not only does the code look cleaner, but it also executes a lot faster and there is a lot less maintenance to be
done. You can see the new default value in the user_tab_columns view for example:
SQL> select column_name,data_default
2 from user_tab_columns
3 where table_name = 'T1'
4 and column_name = 'ID';
COLUMN_NAME DATA_DEFAULT
------------------------------ ------------------------------
ID "MARTIN"."S_T1"."NEXTVAL"
Increased varchar2 Limit
An interesting change has been made to the maximum length of the familiar varchar2 and some related data types.
Instead of the previous limit of 4000 bytes for this field it is now possible to store up to 32 kilobytes. The initialization
parameter in charge of changing the behavior is max_string_size . It is a static parameter, and changing it requires
an instance restart. In addition, changing from the default standard string width to the extended string width requires
starting the database or PDB in UPGRADE mode and executing the script $ORACLE_HOME/rdbms/admin/utl32k.sql .
 
Search WWH ::




Custom Search