25:
26: BEGIN
27: edw_misc_util.globalNamesOff;
28:
29: cid := DBMS_SQL.open_cursor;
30:
31: dbms_sql.parse(cid, 'SELECT 1 FROM dual@'||p_db_link, dbms_sql.native);
32: dbms_sql.close_cursor(cid);
33:
27: edw_misc_util.globalNamesOff;
28:
29: cid := DBMS_SQL.open_cursor;
30:
31: dbms_sql.parse(cid, 'SELECT 1 FROM dual@'||p_db_link, dbms_sql.native);
32: dbms_sql.close_cursor(cid);
33:
34: Exception
35: WHEN OTHERS THEN
28:
29: cid := DBMS_SQL.open_cursor;
30:
31: dbms_sql.parse(cid, 'SELECT 1 FROM dual@'||p_db_link, dbms_sql.native);
32: dbms_sql.close_cursor(cid);
33:
34: Exception
35: WHEN OTHERS THEN
36: bRunning := FALSE;
33:
34: Exception
35: WHEN OTHERS THEN
36: bRunning := FALSE;
37: dbms_sql.close_cursor(cid);
38:
39: END;
40:
41:
104:
105: IF isInstanceRunning(0, l_db_link, l_temp) THEN
106:
107: -- get sydate from remote db
108: cid := DBMS_SQL.open_cursor;
109: DBMS_SQL.PARSE(cid, 'SELECT sysdate FROM dual@'||l_db_link, dbms_sql.native);
110: dbms_sql.define_column(cid, 1, remote_date);
111: l_dummy:=dbms_sql.execute(cid);
112: if dbms_sql.fetch_rows(cid)<>0 then
105: IF isInstanceRunning(0, l_db_link, l_temp) THEN
106:
107: -- get sydate from remote db
108: cid := DBMS_SQL.open_cursor;
109: DBMS_SQL.PARSE(cid, 'SELECT sysdate FROM dual@'||l_db_link, dbms_sql.native);
110: dbms_sql.define_column(cid, 1, remote_date);
111: l_dummy:=dbms_sql.execute(cid);
112: if dbms_sql.fetch_rows(cid)<>0 then
113: dbms_sql.column_value(cid, 1, remote_date);
106:
107: -- get sydate from remote db
108: cid := DBMS_SQL.open_cursor;
109: DBMS_SQL.PARSE(cid, 'SELECT sysdate FROM dual@'||l_db_link, dbms_sql.native);
110: dbms_sql.define_column(cid, 1, remote_date);
111: l_dummy:=dbms_sql.execute(cid);
112: if dbms_sql.fetch_rows(cid)<>0 then
113: dbms_sql.column_value(cid, 1, remote_date);
114: end if;
107: -- get sydate from remote db
108: cid := DBMS_SQL.open_cursor;
109: DBMS_SQL.PARSE(cid, 'SELECT sysdate FROM dual@'||l_db_link, dbms_sql.native);
110: dbms_sql.define_column(cid, 1, remote_date);
111: l_dummy:=dbms_sql.execute(cid);
112: if dbms_sql.fetch_rows(cid)<>0 then
113: dbms_sql.column_value(cid, 1, remote_date);
114: end if;
115: DBMS_SQL.close_cursor(cid);
108: cid := DBMS_SQL.open_cursor;
109: DBMS_SQL.PARSE(cid, 'SELECT sysdate FROM dual@'||l_db_link, dbms_sql.native);
110: dbms_sql.define_column(cid, 1, remote_date);
111: l_dummy:=dbms_sql.execute(cid);
112: if dbms_sql.fetch_rows(cid)<>0 then
113: dbms_sql.column_value(cid, 1, remote_date);
114: end if;
115: DBMS_SQL.close_cursor(cid);
116:
109: DBMS_SQL.PARSE(cid, 'SELECT sysdate FROM dual@'||l_db_link, dbms_sql.native);
110: dbms_sql.define_column(cid, 1, remote_date);
111: l_dummy:=dbms_sql.execute(cid);
112: if dbms_sql.fetch_rows(cid)<>0 then
113: dbms_sql.column_value(cid, 1, remote_date);
114: end if;
115: DBMS_SQL.close_cursor(cid);
116:
117: /*
111: l_dummy:=dbms_sql.execute(cid);
112: if dbms_sql.fetch_rows(cid)<>0 then
113: dbms_sql.column_value(cid, 1, remote_date);
114: end if;
115: DBMS_SQL.close_cursor(cid);
116:
117: /*
118: l_stmt:='SELECT distinct column_name
119: FROM all_tab_columns@' ||l_db_link ||
149: end if;
150: end loop;
151:
152: -- First delete existing date from the source db
153: cid := DBMS_SQL.open_cursor;
154: l_progress := '030';
155: DBMS_SQL.PARSE(cid, 'DELETE EDW_LOCAL_SYSTEM_PARAMETERS@'||l_db_link, dbms_sql.native);
156: l_dummy := dbms_sql.execute(cid);
157: l_stmt := 'INSERT INTO EDW_LOCAL_SYSTEM_PARAMETERS@'||l_db_link||' ( last_update_date, creation_date, ';
151:
152: -- First delete existing date from the source db
153: cid := DBMS_SQL.open_cursor;
154: l_progress := '030';
155: DBMS_SQL.PARSE(cid, 'DELETE EDW_LOCAL_SYSTEM_PARAMETERS@'||l_db_link, dbms_sql.native);
156: l_dummy := dbms_sql.execute(cid);
157: l_stmt := 'INSERT INTO EDW_LOCAL_SYSTEM_PARAMETERS@'||l_db_link||' ( last_update_date, creation_date, ';
158: l_stmt := l_stmt ||l_colList||') SELECT :x1, :x1, '||l_colList||' FROM EDW_SYSTEM_PARAMETERS';
159: -- Now we can insert into these tables
152: -- First delete existing date from the source db
153: cid := DBMS_SQL.open_cursor;
154: l_progress := '030';
155: DBMS_SQL.PARSE(cid, 'DELETE EDW_LOCAL_SYSTEM_PARAMETERS@'||l_db_link, dbms_sql.native);
156: l_dummy := dbms_sql.execute(cid);
157: l_stmt := 'INSERT INTO EDW_LOCAL_SYSTEM_PARAMETERS@'||l_db_link||' ( last_update_date, creation_date, ';
158: l_stmt := l_stmt ||l_colList||') SELECT :x1, :x1, '||l_colList||' FROM EDW_SYSTEM_PARAMETERS';
159: -- Now we can insert into these tables
160: l_progress := '060';
159: -- Now we can insert into these tables
160: l_progress := '060';
161:
162:
163: DBMS_SQL.PARSE(cid, l_stmt, dbms_sql.native);
164: DBMS_SQL.BIND_VARIABLE(cid, ':x1', remote_date);
165:
166: l_dummy := dbms_sql.execute(cid);
167: l_progress := '070';
160: l_progress := '060';
161:
162:
163: DBMS_SQL.PARSE(cid, l_stmt, dbms_sql.native);
164: DBMS_SQL.BIND_VARIABLE(cid, ':x1', remote_date);
165:
166: l_dummy := dbms_sql.execute(cid);
167: l_progress := '070';
168:
162:
163: DBMS_SQL.PARSE(cid, l_stmt, dbms_sql.native);
164: DBMS_SQL.BIND_VARIABLE(cid, ':x1', remote_date);
165:
166: l_dummy := dbms_sql.execute(cid);
167: l_progress := '070';
168:
169: ELSE
170: inst_down := inst_down ||l_temp;
172:
173:
174: END LOOP;
175:
176: DBMS_SQL.close_cursor(cid);
177:
178: CLOSE sources;
179: COMMIT;
180:
182: when others then
183:
184: ROLLBACK TO start_push_to_source;
185: CLOSE instances;
186: DBMS_SQL.close_cursor(cid);
187: edw_message_s.sql_error('push_to_source',l_progress,SQLCODE);
188: inst_down:=null;
189: raise;
190: