Oracle Database Common SQL

Source: Internet
Author: User

The process of creating an instance of an Oracle database is similar to SQL Server creating a database, one instance of Oracle can correspond to more than one table space, one table space corresponds to one user, and a different table space is logged in according to different user names and passwords.

Therefore, after you create the table space, you create the user and specify the tablespace for it immediately. and authorized to the user, typically connect, resource, DBA authority

Grant Connect,resource,dba to Yun

Query database name:

Select name from V$database;

How to find the SID, system environment variables of the database

Select name from V$database;

When you create a database, you typically specify a SID:

Query the table space under the database:

SELECT * from Dba_tablespaces;

To delete a table space:

Drop tablespace test_data including contents and datafiles cascade constraints;

Querying users under a database

SELECT * from Dba_users;

To delete a user:

Drop user TEST2 cascade;

Cascade: Cascade

To create a table:

CREATE TABLE student (ID int,name VARCHAR (20))

Insert data:

INSERT into student values (1, ' Busan ')

To modify the data:

Update student set name= ' Zhangsan ' where id=1

Delete data:

Delete student where id = 2

Oracle Database Common 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.