Free for PREMIUM members
Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium
We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
CREATE OR REPLACE PROCEDURE why_use_shell_script
INSERT INTO TABLE_B (SELECT * FROM TABLE_A WHERE users NOT IN XX);
( job => X
,what => 'why_use_shell_script;'
,next_date => to_date('20081009','yyyymmdd')
,interval => 'TRUNC(SYSDATE) + 1 + 8/24 + 30/1440'
,no_parse => FALSE
SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
Open in new window
# Set Oracle environment
export ORACLE_HOME ORACLE_SID PATH
# Export TABLE_A
# NOTE: This should log in as the owner of the table
exp userid=user/pass file=? tables=table_a compress=n
# Copy data to TABLE_B and truncate TABLE_A
# NOTE: This should log in as the owner of the table and the owner of both tables
# is assumed to be the same
sqlplus << EOF
WHENEVER SQLERROR EXIT;
INSERT into TABLE_B
(SELECT a, b, c
WHERE user NOT IN XXX
truncate table table_a;
) > "$logfile" 2>&1
Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.