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