You can use select * from user_sequence and select * from all_tables to obtain the names of sequence and table for concatenation.
The biggest fear is that the current account has insufficient permissions. It's a testing environment, so I can do whatever I want.
- Create or replace package extraction_dataIs
- -- Author: ADMINISTRATOR
- -- Created: 03:36:28
- -- Purpose: extract data
- Cursor TNAMEIsSELECT table_name AS table_name FROM all_tables@TB.REGRESS.RDBMS.DEV.US.Oracle.COM where owner = upper ('Tidba');
- PROCEDURE EXT_DATA;
- PROCEDURE EXT_SEQ;
- End extraction_data;
- /
- Create or replace package body extraction_dataIs
- PROCEDURE EXT_DATA IS
- BEGIN
- FOR T IN TNAME LOOP
- /* Dbms_output.put_line ('execute the insert process' | T. table_name );*/
- -- Delete a table to prevent repeated data insertion.
- Begin
- EXECUTE IMMEDIATE'Drop table'| T. table_name;
- Exception when others then null;
- End;
- -- Output the SQL statement to be executed
- Dbms_output.put_line ('Create table tieba .'| T. table_name |'As select * from'| T. table_name |'@ TB. REGRESS. RDBMS. DEV. US. ORACLE. COM');
- Dbms_output.put_line ('Commit ;');
- -- You may not be able to execute the remote table data to a local directory.
- /* Execute immediate 'create table tieba. '| T. table_name | 'as select * from '| T. table_name | '@ TB. REGRESS. RDBMS. DEV. US. ORACLE. COM ';*/
- End loop;
- END EXT_DATA;
- -- This process is not successfully executed. You can assemble sequence strings as needed.
- PROCEDURE EXT_SEQ IS
- BEGIN
- -- Create sequence
- -- Create sequence ADMIN_MESSAGE_SEQ minvalue 1 maxvalue 999999999 start with 100000 increment by 1 cache 20;
- -- Select * from user_sequence;
- For t in (select * from user_sequences@TB.REGRESS.RDBMS.DEV.US.ORACLE.COM) LOOP
- /* Dbms_output.put_line ('execute the insert process' | T. table_name );*/
- -- Delete a table to prevent repeated data insertion.
- Begin
- EXECUTE IMMEDIATE'Drop sequence'| T. sequence_name;
- Exception when others then null;
- End;
- -- Output the SQL statement to be executed
- Dbms_output.put_line ('Create sequence tieba .'| T. sequence_name |'Minvalue 1 maxvalue 999999999 start'| T. LAST_NUMBER |'Increment by 1 cache 20 ;');
- /* Execute immediate 'create sequence tieba. '| T. sequence_name | 'minvalue 1 maxvalue 999999999 start with' | T. LAST_NUMBER | 'crement by 1 cache 20 ;';*/
- End loop;
- Dbms_output.put_line ('Commit ;');
- END EXT_SEQ;
- End extraction_data;
- /