Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        public string ListOperation()
        {
            string args   = "lsop";
            string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home);

            return(output);
        }
Esempio n. 5
0
        public string ListDGAttributes(string DG_name)
        {
            string args   = "lsattr -ml -G " + DG_name;
            string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home);

            return(output);
        }
Esempio n. 6
0
        public string ListCandidateDiskInfo()
        {
            string args   = "lsdsk -kp --candidate";
            string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home);

            return(output);
        }
Esempio n. 7
0
        public string ListDGinfo()
        {
            string args   = "lsdg";
            string output = ASMCMDExecutor.ASMCMDExector(cmd, args, crs_home);

            return(output);
        }
Esempio n. 8
0
        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);
        }
Esempio n. 9
0
        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);
        }
Esempio n. 10
0
        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);
        }
Esempio n. 11
0
        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);
        }
Esempio n. 12
0
        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);
        }
Esempio n. 13
0
        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);
        }
Esempio n. 14
0
        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);
        }
Esempio n. 15
0
        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);
        }
Esempio n. 16
0
        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);
        }
Esempio n. 17
0
        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);
        }
Esempio n. 18
0
        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);
        }
Esempio n. 19
0
        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);
        }
Esempio n. 20
0
        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);
        }
Esempio n. 21
0
        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);
        }
Esempio n. 22
0
        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);
        }
Esempio n. 23
0
        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);
        }