public string DropDisk(string DG_name, string disk_name, string failgroup_name = "", bool isForce = false) { string disk_clause = ""; if (isForce == true) { disk_clause = string.Format("<dsk name=\"{0}\" force=\"true\"/>", disk_name); } else { disk_clause = string.Format("<dsk name=\"{0}\"/>", disk_name); } string args = ""; if (failgroup_name != "") { args = string.Format("'<chdg name=\"{0}\"><drop><fg name=\"{1}\">{2}</fg></drop></chdg>'", DG_name, failgroup_name, disk_clause); } else { args = string.Format("'<chdg name=\"{0}\"><drop>{1}</drop></chdg>'", DG_name, disk_clause); } string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string SetDGAttribute(string DG_name, string attr_name, string attr_value) { string args = "setattr -G " + DG_name + " " + attr_name + " " + attr_value; string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string ConvertRedundToFlex(string DG_name) { string args = string.Format("chdg '<chdg name=\"{0}\" redundancy=\"flex\"/>'", DG_name); string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string ListOperation() { string args = "lsop"; string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string ListDGAttributes(string DG_name) { string args = "lsattr -ml -G " + DG_name; string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string ListCandidateDiskInfo() { string args = "lsdsk -kp --candidate"; string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string ListDGinfo() { string args = "lsdg"; string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string MoveFGtoQG(string DG_name, string quotagroup_name, string filegroup_name) { string args = string.Format("mvfg -G {0} --filegroup {1} {2}", DG_name, filegroup_name, quotagroup_name); string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string RemoveQuotagroup(string DG_name, string quotagroup_name) { string args = string.Format("rmqg -G {0} {1}", DG_name, quotagroup_name); string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string ModifyQuotagroup(string DG_name, string quotagroup_name, string property_name, string property_value) { string args = string.Format("chqg -G {0} {1} {2} {3}", DG_name, quotagroup_name, property_name, property_value); string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string RunASMCMD(string command) { string crs_home = CrsEnv.GetCurrentCrsHome(); string asmcmd = Path.Combine(crs_home, "bin", "asmcmd.bat"); string output = ASMCMDExecutor.ASMCMDExector(asmcmd, command, crs_home); return(output); }
public string ModifyFilegroup(string DG_name, string filegroup_name, string property_name, string property_value, string file_type = "") { string filetype_clause = ""; if (file_type != "") { filetype_clause = string.Format("file_type=\"{0}\"", file_type); } string config_xml = string.Format("'<filegroup name=\"{0}\" dg_name=\"{1}\"><p name=\"{2}\" value=\"{3}\" {4}/>", filegroup_name, DG_name, property_name, property_value, filetype_clause); string args = "chfg " + config_xml; string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string RemoveFilegroup(string DG_name, string filegroup_name, bool isRecursive = false) { string args = ""; if (isRecursive == false) { args = string.Format("rmfg {0} {1}", DG_name, filegroup_name); } else { args = string.Format("rmfg -r {0} {1}", DG_name, filegroup_name); } string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string DGRebalance(string DG_name, int power = 1, bool isWait = false) { string args = ""; if (isWait == false) { args = "rebal --power " + power.ToString() + " " + DG_name; } else { args = "rebal --power " + power.ToString() + " " + DG_name + " -w"; } string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string ListMemberDiskInfo(string DG_name = "") { string args = ""; if (DG_name == "") { args = "lsdsk -kp --member"; } else { args = "lsdsk -kp -G " + DG_name; } string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string ListQuotagroup(string DG_name = "", string quotagroup_name = "") { string DGname_clause = ""; string QGname_clasue = ""; if (DG_name != "") { DGname_clause = "-G " + DG_name; } if (quotagroup_name != "") { QGname_clasue = "--quotagroup " + quotagroup_name; } string args = string.Format("lsqg {0} {1}", DGname_clause, QGname_clasue); string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string ListFilegroup(string DG_name = "", string filegroup_name = "") { string DGname_clause = ""; string FGname_clause = ""; if (DG_name != "") { DGname_clause = "-G " + DG_name; } if (filegroup_name != "") { FGname_clause = "--filegroup " + filegroup_name; } string args = string.Format("lsfg {0} {1}", DGname_clause, FGname_clause); string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string DropDG(string DG_name, bool isForce = false, bool isRecursive = false) { string force = ""; string recursive = ""; if (isForce == true) { force = "-f"; } if (isRecursive == true) { recursive = "-r"; } string args = string.Format("dropdg {0} {1} {2}", recursive, force, DG_name); string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string DismountDG(string DG_name = "", bool isALL = false, bool isForce = false) { string all = ""; string force = ""; if (isALL == true) { all = "-a"; } if (isForce == true) { force = "-f"; } string args = string.Format("umount {0} {1} {2}", all, force, DG_name); string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string OnlineDisk(string DG_name, string disk_name = "", string failgroup_name = "", bool isAll = false, bool isWait = false, int power = 1) { string args = ""; string power_clause = ""; string wait_clause = ""; if (power != 1) { power_clause = "--power " + power.ToString(); } if (isWait == true) { wait_clause = "-w"; } if (isAll == true) { args = string.Format("online -G {0} -a {1} {2}", DG_name, power_clause, wait_clause); } else { string disk_clause = ""; string failgroup_clause = ""; if (disk_name != "") { disk_clause = "-D " + disk_name; } if (failgroup_name != "") { failgroup_clause = "-F " + failgroup_clause; } args = string.Format("online -G {0} {1} {2} {3} {4}", DG_name, failgroup_clause, disk_clause, power_clause, wait_clause); } string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string MakeFilegroup(string DG_name, string filegroup_name, string client_name, string client_type, string property_name = "", string property_value = "", string file_type = "") { string property_clause = ""; if (property_name != "") { if (file_type != "") { property_clause = string.Format("<p name=\"{0}\" value=\"{1}\" file_type=\"{2}\"/>'", property_name, property_value, file_type); } else { property_clause = string.Format("<p name=\"{0}\" value=\"{1}\"/>", property_name, property_value); } } string config_xml = string.Format("'<filegroup name=\"{0}\" dg=\"{1}\" client_type=\"{2}\" client_name=\"{3}\">{4}</filegroup>", filegroup_name, DG_name, client_type, client_name, property_clause); string args = "mkfg " + config_xml; string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string OfflineDisk(string DG_name, string disk_name = "", string failgroup_name = "", string drop_time = "") { string disk_clause = ""; string failgroup_clause = ""; string droptime_clause = ""; if (disk_name != "") { disk_clause = "-D " + disk_name; } if (failgroup_name != "") { failgroup_clause = "-F " + failgroup_name; } if (drop_time != "") { droptime_clause = "-t " + drop_time; } string args = string.Format("offline -G {0} {1} {2} {3}", DG_name, disk_clause, failgroup_clause, droptime_clause); string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }
public string MountDG(string DG_name = "", bool isAll = false, bool isRestrict = false, bool isForce = false) { string all = ""; string restrict = ""; string force = ""; if (isAll == true) { all = "-a"; } if (isRestrict == true) { restrict = "--restrict"; } if (isForce == true) { force = "-f"; } string args = string.Format("mount {0} {1} {2} {3}", restrict, all, force, DG_name); string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home); return(output); }