Beispiel #1
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创建失败");
        }
Beispiel #2
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);
            }
        }