[转][C#][Oracle]备份
时间:2021-07-01 10:21:17
帮助过:4人阅读
获取所有存储过程 -- owner,
string sql =
@"select object_name
from dba_objects
where object_type=‘PROCEDURE‘
and owner=‘DBO‘";
string sql2 =
@"select text from user_source where name = :a and type=‘PROCEDURE‘";
IEnumerable<
string> axs = conn.Query<
string>
(sql);
if(axs !=
null && axs.Count() >
0)
{
foreach (
var item
in axs)
{
IEnumerable<
string> proc = conn.Query<
string>(sql2,
new {
a =
item
});
if(proc !=
null && proc.Count()>
0)
{
var sw = File.CreateText(
@"D:\" + item +
".sql");
sw.Write(string.Join(
"", proc));
sw.Close();
}
}
}
转自:https://blog.csdn.net/qq_30189805/article/details/99288790
转自:https://blog.csdn.net/huangbaokang/article/details/95446606
[转][C#][Oracle]备份
标签:sel details oracl oracle roc tail procedure detail foreach