1.select all db links from oracle using below statement select db_link from user_db_links; 2.db link creation statement is below CREATE DATABASE LINK prod_link CONNECT TO test_user IDENTIFIED BY test_pass USING ‘(DESCRIPTION=(ADDRESS_LIST=( ADDRESS=(PROTOCOL=TCP)(HOST=test_server)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME=test_db)))’ 3.Table data using db link select * from t@prod_link;   Enjoy!

Run the select query to run all jobs select * from user_jobs; Need to get the JOB job column and execute: begin dbms_job.broken(50,TRUE);–change the correct job number in place of 50 commit; end; This will stop MVIEW to auto refresh. to refresh the mviews again we have to use below code begin dbms_job.run(50);–change the correct […]

I have two column in excel like below A        B 100  100 200  600 300  700 400  800 500  900 I want a result like below Ans: In MS Excel,use below steps 1.Tools > Macro > Visual Basic Editor. 2.Select the sheet. 3.Insert > Module. 4. Sub compare_cols()     ‘Get the last row     Dim […]

I have created a module in Excel 2003. 1.Tools > Macro > Visual Basic Editor. 2.Select the sheet. 3.Insert > Module. 4. Function csvRange(myRange As Range) Dim csvRangeOutput For Each entry In myRange csvRangeOutput = csvRangeOutput & “‘ ” & entry.Value & “‘, ” Next csvRange = csvRangeOutput End Function Then call using =csvRange(A1:A10) It […]

I have a table like this: ID | VAL | DATE ———————- 1 | 10 | 25/12/2013 1 | 2000 | 25/12/2012 2 | 5 | 25/12/2012 2 | 3 | 25/12/2013 I want to make a SELECT that will return just the first row for each ID, ordering by Date. Sample output: ID | […]

—Before 8i SELECT ROWNUM FROM ALL_OBJECTS WHERE ROWNUM <= &N; –SQL 8i SELECT ROWNUM FROM (SELECT 1 FROM DUAL GROUP BY CUBE(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) WHERE ROWNUM <= &N; –SQL 9i SELECT * FROM (SELECT ROWNUM FROM DUAL CONNECT BY LEVEL <= &N); –SQL 10g SELECT ROWNUM FROM DUAL […]

BEGIN DBMS_SNAPSHOT.REFRESH(‘MV_CURRENT_OPERATIONS’); end;