Oracle Backup Import, delete user commands, and ... ____oracle

Source: Internet
Author: User
Remote Import Backup command: Imp cpqlzf/cpqlzf@cpql20080505 file=d:\data\20080505xzfw_new.dmp fromuser=sa touser=cpqlzf ignore=y notes: The CPQLZF is the table space name and the login password; cpql20080505 is the database SID name, the backup database path is behind file, and the Fromuser value is the user name when the database is backed up; the Touser value is the tablespace user name;------------------ -----------------------------------------------------------------Oracle Delete user commands and partial commands 2007-01-18 09:26

Drop user user_name cascade;

Create a table space

CREATE tablespace DATA01
DataFile '/oracle/oradata/db/data01.dbf ' SIZE 500M
Uniform SIZE 128k; #指定区尺寸为128k, if not specified, the zone size defaults to 64k

Delete a table space

DROP tablespace data01 including CONTENTS and datafiles;

First, create a table space

CREATE tablespace DATA01
DataFile '/oracle/oradata/db/data01.dbf ' SIZE 500M
Uniform SIZE 128k; #指定区尺寸为128k, if not specified, the zone size defaults to 64k

Second, create the undo table space

CREATE UNDO tablespace UNDOTBS02
DataFile '/oracle/oradata/db/undotbs02.dbf ' SIZE 50M

#注意: You can only use one undo table space at some point in the open state, and if you want to use a new tablespace, you must switch to that table space:

ALTER SYSTEM SET Undo_tablespace=undotbs02;

Iii. establishment of temporary table spaces

CREATE Temporary tablespace temp_data
Tempfile '/oracle/oradata/db/temp_data.dbf ' SIZE 50M

Four, change the table space state

1. Make Tablespace offline

ALTER tablespace game OFFLINE;

If you accidentally delete a data file, you must have the recover option

ALTER tablespace game OFFLINE for RECOVER;

2. Bring the table space online

ALTER tablespace game ONLINE;


3. Make data files offline

ALTER DATABASE datafile 3 OFFLINE;

4. Bring the data file online

ALTER DATABASE datafile 3 ONLINE;

5. Make table space Read-only

ALTER tablespace game READ only;

6. Make the table space readable and writable

ALTER tablespace game READ WRITE;

Five, delete table space

DROP tablespace data01 including CONTENTS and datafiles;

Vi. expansion of the table space

First look at the name of the tablespace and the file that belongs to it

Select Tablespace_name, file_id, file_name,
Round (bytes/(1024*1024), 0) Total_space
From Dba_data_files
Order BY Tablespace_name;

1. Additional Data files
ALTER tablespace Game
ADD datafile '/oracle/oradata/db/game02.dbf ' SIZE 1000M;

2. Manually increase the size of the data file
ALTER DATABASE datafile '/oracle/oradata/db/game.dbf '
RESIZE 4000M;

3. Set up data file automatic expansion
ALTER DATABASE datafile '/oracle/oradata/db/game.dbf
Autoextend on NEXT 100M
MAXSIZE 10000M;

View table space Information after setting

SELECT a.tablespace_name,a.bytes total,b.bytes USED, c.bytes free,
(b.bytes*100)/a.bytes "% USED", (c.bytes*100)/a.bytes "% free"
From SYS. Sm$ts_avail A,sys. Sm$ts_used B,sys. Sm$ts_free C
WHERE A.tablespace_name=b.tablespace_name and A.tablespace_name=c.tablespace

Related Article

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.