呵呵,如果过程函数很多,这个方法不行了。 你是想导出这些过程的创建语句吗? 方法很多,: 1.用lL说的exp,加个rows=n就不导出数据了。不过这个根据你的需要,还要加别的参数,然后导入时加indexfile,就可以看到存储过程的DDL了。 2.用工具比如TOAD可以导出。 3.写个过程: 比如导出oper用户下的所有存储过程到指定文件中: spool /u01/getddl.txtdeclare v_sql clob; cursor aaa is select owner,object_name from dba_objects where object_type='PROCEDURE' and owner='OPER'; begin for rec in aaa loop select dbms_metadata.get_ddl('PROCEDURE',rec.object_name,'OPER') into v_sql from dual; dbms_output.put_line(v_sql); dbms_output.put_line('---------------------------------'); end loop; end; /spool off 可以修改这个过程,做成传参数的类型,然后传入用户名,对象类型,比如过程、函数、触发器等等。
或者
select text from user_source
order by name,line
你是想导出这些过程的创建语句吗?
方法很多,:
1.用lL说的exp,加个rows=n就不导出数据了。不过这个根据你的需要,还要加别的参数,然后导入时加indexfile,就可以看到存储过程的DDL了。
2.用工具比如TOAD可以导出。
3.写个过程:
比如导出oper用户下的所有存储过程到指定文件中:
spool /u01/getddl.txtdeclare
v_sql clob;
cursor aaa is select owner,object_name
from dba_objects
where object_type='PROCEDURE'
and owner='OPER';
begin
for rec in aaa loop
select dbms_metadata.get_ddl('PROCEDURE',rec.object_name,'OPER')
into v_sql from dual;
dbms_output.put_line(v_sql);
dbms_output.put_line('---------------------------------');
end loop;
end;
/spool off
可以修改这个过程,做成传参数的类型,然后传入用户名,对象类型,比如过程、函数、触发器等等。
exp system/neusoft321@ahsimis file=e:\ahlb20080718.dmp log=e:\ahlb20080718.log owner=ahlbimp ahsimis/ahsimis@orcl file=e:\ahsimis20081010,dmp fromuser=ahsimis touser=ahsimis
去网上查下语句就OK了,EXP/IMP
exp user/user@sid full=y file=d:\backup.dmp --方案备份
exp user/user@sid owner=username file=d:\backup.dmp
2、pl/sql-->工具---〉导出用户对象 可以找到你要导的东东。
两者都可以的很方便!
不能停的话,数据量大的化,搬移表空间,小的话直接exp,当然也可以用RMAN估计你不懂。