take backup [message #167786] |
Mon, 17 April 2006 01:57 |
emadbsb
Messages: 334 Registered: May 2005 Location: egypt
|
Senior Member |
|
|
hii all
i take backup from a database user to another database user
and i take it fine with no problems
it exports the tables and the packages i have on that user
i want to export the packages only without the tables
how can i do that if it is possible??
|
|
|
|
|
|
|
|
Re: take backup [message #167877 is a reply to message #167871] |
Mon, 17 April 2006 12:00 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
>> but i hope not to tell me copy the source code
I said,
>> using simple sql or dbms_metadata or any tool
Which part of it asks you to copy one-by-one?
Did you even try any of those?
Or atleast search the forum?
All you need to do is, spool the output and run against destination.
scott@9i > desc emp_actions
PROCEDURE FIRE_EMPLOYEE
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
EMP_ID NUMBER IN
PROCEDURE HIRE_EMPLOYEE
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
ENAME VARCHAR2 IN
JOB VARCHAR2 IN
MGR NUMBER IN
SAL NUMBER IN
COMM NUMBER IN
DEPTNO NUMBER IN
scott@9i > @get_package
CREATE OR REPLACE PACKAGE "SCOTT"."EMP_ACTIONS" AS -- spec
TYPE EmpRecTyp IS RECORD (emp_id INT, salary REAL);
CURSOR desc_salary RETURN EmpRecTyp;
PROCEDURE hire_employee (
ename VARCHAR2,
job VARCHAR2,
mgr NUMBER,
sal NUMBER,
comm NUMBER,
deptno NUMBER);
PROCEDURE fire_employee (emp_id NUMBER);
END emp_actions;
CREATE OR REPLACE PACKAGE BODY "SCOTT"."EMP_ACTIONS" AS -- body
CURSOR desc_salary RETURN EmpRecTyp IS
SELECT empno, sal FROM emp ORDER BY sal DESC;
PROCEDURE hire_employee (
ename VARCHAR2,
job VARCHAR2,
mgr NUMBER,
sal NUMBER,
comm NUMBER,
deptno NUMBER) IS
BEGIN
INSERT INTO emp VALUES (empno_seq.NEXTVAL, ename, job,
mgr, SYSDATE, sal, comm, deptno);
END hire_employee;
PROCEDURE fire_employee (emp_id NUMBER) IS
BEGIN
DELETE FROM emp WHERE empno = emp_id;
END fire_employee;
END emp_actions;
;
scott@9i > get get_package
1 set long 500000
2 set linesize 1000
3 SET HEAD off
4 set trimspool on
5 set verify off
6 column XXXX format a300
7 SELECT DBMS_METADATA.GET_DDL ('PACKAGE',d.object_name)||';' from dba_objects D WHERE owner ='SCOTT' and OBJECT_TYPE ='PACKAGE';
8* set head on;
scott@9i >
|
|
|