Oracle Learning (1)

Source: Internet
Author: User

/* Create a tablespace
Create a tablespace tbs_01 in 1 MB local management and specify the data file D:/oradata/tbs_01.dbf;
View the created tablespace information.
*/

Create tablespace tbs_01 datafile 'd:/oradata/tbs_01.dbf 'size 1 m extent management local;

Select * From dba_free_space where tablespace_name = 'tbs _ 01 ';
/*
Modify tablespace
Change the tablespace data file to D:/oradata/tbs_01_new.dbf.
Add a 5 MB data file for the preceding tablespace.
View the modified tablespace information from the data dictionary. */

Alter tablespace tbs_01 offline;

Alter tablespace tbs_01
Rename datafile 'd:/oradata/tbs_01.dbf'
To 'd:/oradata/tbs_01_new.dbf ';

Alter tablespace tbs_01 online;
Alter tablespace tbs_01 add datafile 'tbs _ 02. dbf' size 5 m;
Select * From dba_free_space where tablespace_name = 'tbs _ 01 ';
/*
Move tablespace
Move the tablespace file from D:/oradata/to the C:/oradata/directory. */
Alter tablespace tbs_01
Rename datafile 'd:/oradata/tbs_01_new.dbf'
To 'C:/oradata/tbs_01_new.dbf ';

/* Delete a tablespace
Delete the tablespace created in the preceding step, including the content of the tablespace and the files occupied. */


Drop tablespace tbs_01 including contents and datafiles;

/* Change the password of the local Oracle user SYS and system to Oracle .*/
Alter user system identified by Oracle;
Alter user SYS identified by Oracle;

/* Create a locally managed tablespace tbs_estore and set the partition (extent) to 128 K */
Create tablespace tbs_estore datafile 'estore. dbf' size 2 m
Extent management local uniform size 128 K;

/* Create a user estore and set the password to estore. The default tablespace is tbs_estore.
Set the following permissions for your estore:
Connect to database
Create and execute PL/SQL programs
Any table can be created, modified, or deleted.
Any view can be created or deleted.

*/
Create user estore identified by estore default tablespace tbs_estore;
Grant connect to estore;
Grant resource to estore;
Grant create any table to estore;
Grant create any view to estore;

-- Oracle logon --
Connect estore/estore as normal

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.