Establish a table space, user, authorization, and build

xiaoxiao2021-03-06  52

Log in to SQL * Plus1 with the SYS account, create a table space in YANGBCTABLESPACE2 under "Storage" -> Table Space, make sure there is no yangbcTableSpace2.ora this file, then execute the command, pay attention to quotation marks to use single quotes

SQL> CREATE TABLESPACE YANGBCTABLESPACE2 2 DataFile 'C: /yangbctablesPace2.ora' size 300m; table space has been created.

Or CREATE TABLESPACE "KHZ_HS" DataFile 'C: /kkk.ora' size 100m Autoextend On Next 4M

2. Create a user and assign the table space just created to it; (create a user, and assign the original table space to authorize)

SQL> CREATE USER YANGBC2 2 Identified by yang9812; user has created

SQL> Grant Connect, Create Table, Create Any Index, Create Session To YANGBC2; Authorized Success.

SQL> ALTER USER YANGBC2 Quota 300M on yangbctablespace2; user has changed.

SQL> Grant DBA TO YANGBC2; Authorized Success.

You can create a table with yangbc2.

SQL> CREATE TABLE YANGBC2.A1 (ID varcha2 (10)); Table has been created.

SQL> INSERT INTO YANGBC2.A1 VALUES ('adskd'); 1 line has been created.

SQL> SELECT * from yangbc2.a1;

ID ---------- ADSKD

3. Execute other SQL statements;

转载请注明原文地址:https://www.9cbs.com/read-60327.html

New Post(0)