Exemple #1
0
        public void Test_DropTablespace()
        {
            Assert.IsTrue(Tablespaces.IsExists(ConnString, "uc"), "表空间uc不存在");

            Tablespaces.DropTablespace(ConnString, "uc");

            Assert.IsFalse(Tablespaces.IsExists(ConnString, "uc"), "表空间uc删除失败");
        }
Exemple #2
0
        /// <summary>
        /// 获取默认表空间
        /// </summary>
        /// <param name="connString"></param>
        //public void GetDefault(ConnectString connString)
        //{
        //    //TODO: 在展示层不要直接调用dal层
        //    string sql = "select * from user_tablespaces";
        //    DataGateway.ExecuteQuery(connString, sql);
        //}

        /// <summary>
        /// 获取临时表空间
        /// </summary>
        /// <param name="connString"></param>
        //public void GetTemporary(ConnectString connString)
        //{
        //    //TODO: 在展示层不要直接调用dal层
        //    string sql = "select * from user_tablespaces";
        //    DataGateway.ExecuteQuery(connString,sql);
        //}


        public void Drop(ConnectString connString, string spaceName)
        {
            try
            {
                Tablespaces.DropTablespace(connString, spaceName);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #3
0
        public void Test_CreateTablespace()
        {
            Tablespace space = new Tablespace
            {
                Name = "plangis4",
                Path = Path.Combine(@"D:\APP\ADMINISTRATOR\ORADATA\ORCL", "plangis4.dbf"),
                Size = 10,
                AutoExtend = true,
                ExtendSize = 1,
                MaxSize = 100
            };

            Assert.IsFalse(Tablespaces.IsExists(ConnString, "plangis4"), "表空间plangis4已经存在");

            Tablespaces.CreateTablespace(ConnString, space);
            Assert.IsTrue(Tablespaces.IsExists(ConnString, "plangis4"), "表空间plangis4创建失败");
        }
Exemple #4
0
        private void CreateTableSpaceForm_Load(object sender, EventArgs e)
        {
            string _path = Tablespaces.GetStorePath(Context.connString);

            this.tablespace_path.Text = _path;
        }
Exemple #5
0
        private void Confirm_click(object sender, EventArgs e)
        {
            if (tablespace_Name.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入表空间名称");
                return;
            }
            if (tablespace_size.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入文件大小");
                return;
            }
            if (tablespace_Extendsize.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入增量");
                return;
            }
            if (tablespace_Maxsize.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入最大文件大小");
                return;
            }
            string _Name = this.tablespace_Name.Text.Trim();
            string _path = Tablespaces.GetStorePath(Context.connString);
            //this.tablespace_path.Text = _path;
            //if(this.tablespace_path.Text.Trim().Equals(Tablespaces.GetStorePath(Context.connString)))
            //{
            //     _path = Tablespaces.GetStorePath(Context.connString);
            //}
            //else
            //{
            //     _path = this.tablespace_path.Text.Trim();
            //}
            int _size = int.Parse(this.tablespace_size.Text.ToString());

            if (isAutoextend.Checked == true)
            {
                _isAutoextend = true;
            }
            else
            {
                _isAutoextend = false;
            }
            int _Extendsize = int.Parse(this.tablespace_Extendsize.Text.Trim());
            int _Maxsize    = int.Parse(this.tablespace_Maxsize.Text.Trim());

            Migrate.Application.App.TablespaceApp app = new Application.App.TablespaceApp();
            Tablespace space = new Tablespace()
            {
                Name       = _Name,
                Path       = Path.Combine(_path, _Name + (".DBF")),
                Size       = _size,
                AutoExtend = _isAutoextend,
                ExtendSize = _Extendsize,
                MaxSize    = _Maxsize
            };

            try
            {
                app.Create(Context.connString, space);
                MessageBox.Show("创建成功");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #6
0
 public void Test_IsExists()
 {
     Assert.IsTrue(Tablespaces.IsExists(ConnString, "temp"), "temp不存在");
     Assert.IsFalse(Tablespaces.IsExists(ConnString, "temp1"), "temp1存在");
 }
Exemple #7
0
 public void Test_GetStorePath()
 {
     string path = Tablespaces.GetStorePath(ConnString);
     Debug.WriteLine(path);
 }
Exemple #8
0
 /// <summary>
 /// 获取表空间信息
 /// </summary>
 /// <param name="connString"></param>
 public IEnumerable <Tablespace> GetAllTableSpaces(ConnectString connString)
 {
     return(Tablespaces.GetTableSpaces(connString));
 }
Exemple #9
0
 public void Create(ConnectString connString, Domain.Model.Tablespace space)
 {
     Tablespaces.CreateTablespace(connString, space);
 }