Task-based SQL

Source: Internet
Author: User

1. Create table space and user, because the data file does not specify the path, so need to modify the data file path, the following requirements.

Create tablespace wo datafile ' wo.dbf ' size 20m;
Create user wo identified by "123abc" Default Tablespace wo;
Grant Connect,resource to Wo;

For non-system tablespaces, the same applies to sysaux,users table spaces
SELECT * from V$datafile;
Select Tablespace_name,file_name,online_status from Dba_data_files where tablespace_name= ' WO ';
Alter tablespace WO offline;
Host mv/u01/app/oracle/product/11.2/db_1/dbs/wo.dbf/u01/app/oracle/oradata/lcp1/datafile/
Alter tablespace WO rename datafile '/u01/app/oracle/product/11.2/db_1/dbs/wo.dbf ' to '/u01/app/oracle/oradata/lcp1/ DATAFILE/WO.DBF ';
Select Tablespace_name,file_name,online_status from Dba_data_files where tablespace_name= ' WO ';
Alter tablespace WO Online;

For the system table space, the UNDOTBS1 and temp table spaces are also applicable. This method requires the database to be in the Mount State
Shutdown immediate
Startup Mount
Host mv/u01/app/oracle/product/11.2/db_1/dbs/system01.dbf/u01/app/oracle/oradata/lcp1/datafile/
Alter tablespace WO rename datafile '/u01/app/oracle/product/11.2/db_1/dbs/system01.dbf ' to '/u01/app/oracle/oradata/ LCP1/DATAFILE/SYSTEM01.DBF ';
ALTER DATABASE open;
Select Tablespace_name,file_name,online_status from Dba_data_files where tablespace_name= ' SYSTEM ';

Task-based SQL

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.