- Create external tables
- Alter external tables
- Drop externa tables
All About Oracle
This blog is created for the oracle Developers community.
Sunday, April 2, 2017
External Table
Tuesday, December 31, 2013
Introduction to Golden Gate
- Oracle Goldengate which includes GGSCI, DEFGEN, LOGDUMP and REVERSE.
- Oracle Goldengate Director which includes Director Service application, Monitor Agent, Director Client and Administrator client.
- Oracle Goldengate Veridata which includes Agent, CLI, Web interface.
- Start and manage Goldengate processes such as collector.
- Manage port numbers.
- Trail Management.
- Create error, event and reports.
- Process command GGSCI.
Wednesday, December 4, 2013
Introduction to Oracle Cluster Table
EMP and DEPT table are associated to each other via DEPTNO column and it is primary key
- Traversing DEPTNO index to get the next dept no.
- Fetch rows from DEPT table that correspond to DEPTNO using ROWID identified from Index scan.
- Find each row from EMP table correspond to DEPTNO unless there is another index available on DEPTNO.
- Fetch Row from EMP table.
- Traversing through DEPTNO ( cluster key) index.
- Fetch cluster row, consisting row from DEPT table and all rows from EMP table correspond to DEPTNO.
Create cluster, Table and Index
CREATE CLUSTER CLUS_EMP_DEPT (DEPTNO NUMBER (3)) -- Cluster Key
Wednesday, October 23, 2013
Autonomous Transactions
Following type of PL/SQL block can use PRAGMA autonomous transactions
· Stored procedure and function
· Procedure or function defined in declaration section of anonymous block
· Packaged procedure and Function
· Type Methods
An example to understand autonomous transactions
AS
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
INSERT INTO errorlog (id, errmsg, lstime)
VALUES (seq_errorlog.NEXTVAL, errmsg, SYSDATE);
END RecordError;
/
FOR X IN 1 .. 100
LOOP
RecordError ('Autonomous transactions message - ' || X);
VALUES (
seq_errorlog.NEXTVAL,
'Calling Program Message - ' || X,
SYSDATE);
END LOOP;
ROLLBACK;
END;
/
Thursday, July 5, 2012
Print Message using user defined procedure
create procedure print_line (
string_in IN VARCHAR2,
split_in IN PLS_INTEGER DEFAULT 255
) as
begin
for i in 1 .. ceil(length(string_in)/split_in) loop
dbms_output.put_line(substr(string_in,split_in*(i-1)+1,split_in));
end loop;
end;
/
create or replace public synonym put_line for put_line;
grant execute on put_line to public;
Thursday, April 26, 2012
Continue Statement
e.g. Addition of odd numbers.
DECLARE
total BINARY_INTEGER := 0;
BEGIN
FOR i in 1..10 LOOP
IF MOD(i/2) = 0 THEN
CONTINUE;
END IF;
SUM = SUM + i;
END LOOP,
DBMS_OUTPUT.PUT_LINE('Sum of odd numbers is '|| sum );
END;
/
Saturday, April 21, 2012
PL/ SQL Optimization
PL/ SQL Optimizer
Oracle 10g introduced a new PL/SQL optimization feature to optimize the PL/SQL code by rearranging codes for better performance. PLSQL optimizer do this for you. Optimizer is enabled by default for interpreted p-code and native compilation. The default value for the optimizer is set to 2 but it can be unset or modify compiler aggressiveness.
PLSQL_OPTIMIZE_LEVEL = 0 no optimization
PLSQL_OPTIMIZE_LEVEL = 1 moderate optimize may leave unused code and exception
PLSQL_OPTIMIZE_LEVEL = 2 Aggressive optimize may rearrange source code flow
ALTER SESSION SET PLSQL_OPTIMIZER_LEVEL = 1;
ALTER PROCEDURE procedure_01 COMPILE plsql_optimizer_level =1;
ALTER PROCEDURE procedure_02 COMPILE reuse settings;
Subprogram Inlining
Subprogram inlining replaces a subprogram invocation from the copy of invoked subprogram. To allow subprogram inlining invoking set PLSQL_OPTIMIZE_LEVEL to 2 (default value) or set it to 3. Subprogram inlining can also be done by using Pragma INLINE. PRAGMA INLINE can enable or disable subprogram inlining.
PRAGMA INLINE (subprogram, YES); # enable subprogram inlining
PRAGMA INLINE (subprogram, NO); # disable subprogram inlining
Candidates for Tuning
- Older code that does not take advantage of new PL/SQL language features.
- Older dynamic SQL statements written with the
DBMS_SQL
package. -
Code that spends much time processing SQL statements.
-
Functions invoked in queries, which might run millions of times.
-
Code that spends much time looping through query results.
-
Code that does many numeric computations.
External Table
Oracle External Table External tables are defined as tables that do not resides in the database allows you to access data that is stor...
-
Table clustering is an optional technique of storing data. In table clustering, rows from one or more tables those are associated with ea...
-
Oracle PL/SQL block accepts user input information with the help of substitution variable. Substitute variable can not be used to output va...
-
Finally continue statement added to oracle 11g PL/SQL language. It signals an immediate end to a loop iteration and return to first statemen...