Use Database statements to create a tablespace and import 11 GB of data to 10 Gb.

Source: Internet
Author: User
View information about tablespaces and data files: selecttablespace_name, file_name, ceil (bytes10241024) mbfromdba_data_filesorderby1; view idle tablespaces: selects. tablespace_name tablespace, sum (s. bytes) tablespace

View the tablespace and Data File Information select tablespace_name, file_name, ceil (bytes/1024/1024) mb from dba_data_files order by 1; view the idle select s of the tablespace. tablespace_name tablespace, sum (s. bytes)/1024/1024 mb from dba_free_space s group by s. tablespace_na

View table space and Data File Information

Select tablespace_name, file_name, ceil (bytes/1024/1024) mb
From dba_data_files order by 1;

View idle tablespace

Select s. tablespace_name "tablespace ",
Sum (s. bytes)/1024/1024 mb
From dba_free_space s
Group by s. tablespace_name
Order by 2

Create a tablespace

Create tablespace ecology logging datafile 'C: \ oa_data \ ecology. dbf'
SIZE 1024 m reuse extent management local segment space management auto;


-- Modify the size
Alter database datafile 'C: \ oa_data \ ecology. dbf' resize 100 m;

Automatic expansion of data files
Select FILE_NAME, AUTOEXTENSIBLE, MAXBLOCKS, INCREMENT_BY from dba_data_files;
Change to auto Scaling
Alter database datafile 'C: \ oa_data \ ecology. dbf' autoextend on next 1 m maxsize 2048 m;


-- Delete a user
Drop user ecology cascade;
-- Create a user
Create user ecology
Identified by ecology
Default tablespace ECOLOGY;
-- Grant/Revoke role privileges
Grant connect to ecology;
Grant resource to ecology;
Grant dba to ecology;

-- Connection test
SQL> conn ecology/ecology
--- Test table Creation

SQL> create table xjy_test (my_id number );

--- Insert data

Insert into xjy_test values (1 );

Delete from xjy_test;

Commit;


--- Import data files

Imp ecology/ecology fromuser = ecology touser = ecology file = 20140513_2.dmp log = 20140513_2.log ignore = y

11G cannot import 10G

Http://www.cnblogs.com/alxc/archive/2011/03/25/1995279.html

Solve this article
-- Question 1
Empty table not imported

Select table_name from user_tables where NUM_ROWS = 0;


--- Execute the following statement


Select 'alter table' | table_name | 'allocate extent; 'from user_tables where num_rows = 0

-- Execute the generated result
Alter table FNASYSTEMSET allocate extent;
Alter table BUDGETAUTOMOVE allocate extent;
Alter table TAKS_MAINLINETASK allocate extent;
Alter table TASK_ATTENTION allocate extent;

--- Reference http://vondon.iteye.com/blog/1316223

Exp username/password @ database name file =/home/oracle/exp. dmp log =/home/oracle/exp_smsrun.log

-- EXP
Exp xxxx/xxxxxx owner = xxx file = xxxx. dmp

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.