본문 바로가기
스터디북

[10/13] admin 기본 연습

by 파이어볼러 2015. 10. 13.

DBA group oracle os user 확인


[oracle@lnx04 dbs]$ cat /etc/group | grep dba

dba:x:5000:oracle


[oracle@lnx04 dbs]$ cat /etc/passwd | grep oracle

oracle:x:500:5001::/home/oracle:/bin/bash


[oracle@lnx04 dbs]$ ps -ef |grep ora_

oracle     922     1  0 17:30 ?        00:00:00 ora_arc0_orcl

oracle     945     1  0 17:30 ?        00:00:00 ora_arc1_orcl

oracle     949     1  0 17:30 ?        00:00:00 ora_arc2_orcl

oracle     953     1  0 17:30 ?        00:00:00 ora_arc3_orcl

oracle     957     1  0 17:30 ?        00:00:00 ora_qmnc_orcl


Oracle home base directory 확인


[oracle@lnx04 dbs]$ echo $ORACLE_BASE

/u01/app/oracle


[oracle@lnx04 dbs]$ echo $ORACLE_HOME

/u01/app/oracle/product/11.2.0/db_1


리스너 기동 상태 이름 확인


[oracle@lnx04 dbs]$ lsnrctl start


LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 13-OCT-2015 18:40:41


Copyright (c) 1991, 2009, Oracle.  All rights reserved.


Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...


TNSLSNR for Linux: Version 11.2.0.1.0 - Production

System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

Log messages written to /u01/app/oracle/diag/tnslsnr/lnx04/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lnx04.ocmkorea.com)(PORT=1521)))


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=lnx04.ocmkorea.com)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production

Start Date                13-OCT-2015 18:40:41

Uptime                    0 days 0 hr. 0 min. 0 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

Listener Log File         /u01/app/oracle/diag/tnslsnr/lnx04/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lnx04.ocmkorea.com)(PORT=1521)))

The listener supports no services

The command completed successfully

[oracle@lnx04 dbs]$ ps -ef |grep tns

oracle    7882     1  0 18:40 ?        00:00:00 /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr LISTENER -inherit

oracle    7898  4823  0 18:40 pts/1    00:00:00 grep tns


[oracle@lnx04 ~]$ lsnrctl status


LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 15-OCT-2015 06:34:57


Copyright (c) 1991, 2009, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=lnx04.ocmkorea.com)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production

Start Date                15-OCT-2015 06:12:48

Uptime                    0 days 0 hr. 22 min. 8 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

Listener Log File         /u01/app/oracle/diag/tnslsnr/lnx04/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lnx04.ocmkorea.com)(PORT=1521)))

Services Summary...

Service "orcl" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

The command completed successfully



[oracle@lnx04 ~]$ tnsping orcl


TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 15-OCT-2015 06:44:00


Copyright (c) 1997, 2009, Oracle.  All rights reserved.


Used parameter files:



Used TNSNAMES adapter to resolve the alias

Attempting to contact (description = (address_list = (address = (protocol=tcp)(host=lnx04.ocmkorea.com)(port=1521))) (connect_data = (server=dedicated) (sid=orcl)))

OK (10 msec)


[oracle@lnx04 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 15 06:44:37 2015

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SYS@orcl>startup

ORACLE instance started.


Total System Global Area 1707446272 bytes

Fixed Size                  1336988 bytes

Variable Size            1006635364 bytes

Database Buffers          687865856 bytes

Redo Buffers               11608064 bytes

Database mounted.

Database opened.



SYS@orcl>select status from v$instance;

STATUS
------------
OPEN

Checkpoint를 발생시키자

체크포인트를 발생시키면 CKPT는 컨트롤 파일과 Datafile Header의 내용을 갱신하여 리두 로그 파일에서 recovery가 시작되는 위치(checkpoint)를 발생시킴 또한 DBWR가 Buffer cache의 모든 수정된 내용을 해당 Database에 기록하는데 shutdown 전에 Data일관선을 유지하기 위해 실행한다



SYS@orcl>alter system checkpoint;


System altered.


SYS@orcl>shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@orcl>exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@lnx04 ~]$ lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 15-OCT-2015 06:49:21

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=lnx04.ocmkorea.com)(PORT=1521)))
The command completed successfully

Redo Log File


SYS@orcl>col member for a43

SYS@orcl>select * from v$logfile;


    GROUP# STATUS  TYPE    MEMBER                                      IS_

---------- ------- ------- ------------------------------------------- ---

         1         ONLINE  /u01/app/oracle/oradata/orcl/redo01.log     NO

         1         ONLINE  /u01/app/oracle/oradata/orcl/redo01_b.log   NO

         3         ONLINE  /u01/app/oracle/oradata/orcl/redo03.log     NO

         3         ONLINE  /u01/app/oracle/oradata/orcl/redo03_b.log   NO

         2         ONLINE  /u01/app/oracle/oradata/orcl/redo02.log     NO

         2         ONLINE  /u01/app/oracle/oradata/orcl/redo02_b.log   NO



SYS@orcl>select group#, members, archived, status from v$log;


    GROUP#    MEMBERS ARC STATUS

---------- ---------- --- ----------------

         1          2 YES INACTIVE

         2          2 YES INACTIVE

         3          2 NO  CURRENT



SYS@orcl>alter database drop logfile member

  2  '/u01/app/oracle/oradata/orcl/redo03_b.log';


Database altered.


SYS@orcl>select * from v$log;


    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIME   NEXT_CHANGE#

---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ------------------- ------------

NEXT_TIME

-------------------

         1          1         10   52428800        512          2 YES INACTIVE               1305686 2015-10-15:07:09:52      1305731

2015-10-15:07:10:15


         2          1         11   52428800        512          2 NO  CURRENT                1305731 2015-10-15:07:10:15   2.8147E+14



         3          1          9   52428800        512          1 YES INACTIVE               1301732 2015-10-15:06:27:48      1305686

2015-10-15:07:09:52


SYS@orcl>alter database add logfile member '/u01/app/oracle/oradata/orcl/redo03_b.log'

  2  to group 3;


Database altered.


SYS@orcl>select * from v$logfile;


    GROUP# STATUS  TYPE    MEMBER                                      IS_

---------- ------- ------- ------------------------------------------- ---

         1         ONLINE  /u01/app/oracle/oradata/orcl/redo01.log     NO

         1         ONLINE  /u01/app/oracle/oradata/orcl/redo01_b.log   NO

         3         ONLINE  /u01/app/oracle/oradata/orcl/redo03.log     NO

         3 INVALID ONLINE  /u01/app/oracle/oradata/orcl/redo03_b.log   NO

         2         ONLINE  /u01/app/oracle/oradata/orcl/redo02.log     NO

         2         ONLINE  /u01/app/oracle/oradata/orcl/redo02_b.log   NO


SYS@orcl>alter system switch logfile;

System altered.

Control File

Database의 무결성 유지를 위한 필수 File
Datafile의 위치, 물리적 Database의 현재 상태 등 기록


SYS@orcl>col name for a45
SYS@orcl>select * from v$controlfile;

STATUS  NAME                                          IS_ BLOCK_SIZE FILE_SIZE_BLKS
------- --------------------------------------------- --- ---------- --------------
        /u01/app/oracle/oradata/orcl/control01.ctl    NO       16384            742
        /u01/app/oracle/oradata/orcl/control02.ctl    NO       16384            742

SYS@orcl>alter database backup controlfile to '/home/oracle/control.bak';


Database altered.


SYS@orcl>!ls /home/oracle/con*

/home/oracle/control.bak 


Datafile


실제 Data가 저장되는 물리적 저장공간

하나의 TBS에 여러개의 Datafile이 존재할 수 있음


SYS@orcl>select file#, name, status from v$datafile;


     FILE# NAME                                          STATUS

---------- --------------------------------------------- -------

         1 /u01/app/oracle/oradata/orcl/system01.dbf     SYSTEM

         2 /u01/app/oracle/oradata/orcl/sysaux01.dbf     ONLINE

         3 /u01/app/oracle/oradata/orcl/undotbs01.dbf    ONLINE

         4 /u01/app/oracle/oradata/orcl/users01.dbf      ONLINE

         5 /u01/app/oracle/oradata/orcl/example01.dbf    ONLINE

         6 /u01/app/oracle/oradata/orcl/rman_tbs.dbf     ONLINE


6 rows selected.


SYS@orcl>col tablespace_name for a20

SYS@orcl>col file_name for a50

SYS@orcl>select tablespace_name, file_name, bytes/1024/1024 from dba_data_files;


TABLESPACE_NAME      FILE_NAME                                          BYTES/1024/1024

-------------------- -------------------------------------------------- ---------------

RMAN_TBS             /u01/app/oracle/oradata/orcl/rman_tbs.dbf                      100

EXAMPLE              /u01/app/oracle/oradata/orcl/example01.dbf                     100

USERS                /u01/app/oracle/oradata/orcl/users01.dbf                         5

UNDOTBS1             /u01/app/oracle/oradata/orcl/undotbs01.dbf                     105

SYSAUX               /u01/app/oracle/oradata/orcl/sysaux01.dbf                      540

SYSTEM               /u01/app/oracle/oradata/orcl/system01.dbf                      700


Oracle Log 확인


SYS@orcl>show parameter p_d;


NAME                                 TYPE        VALUE

------------------------------- ----------- ------------------------------

background_dump_dest               string      /u01/app/oracle/diag/rdbms/orcl/orcl/trace

core_dump_dest                       string      /u01/app/oracle/diag/rdbms/orcl/orcl/cdump

ldap_directory_access                string      NONE

ldap_directory_sysauth               string      no

user_dump_dest                       string      /u01/app/oracle/diag/rdbms/orcl/orcl/trace


$ORACLE_HOME/network/log

리스너를 통해 오라클에 접속한 정보와 listener start/stop log가 기록되는 파일


[oracle@lnx04 log]$ df -k /u01

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/sdb1             30470144   8053436  20843948  28% /u01


[oracle@lnx04 ARC]$ find . -name "*.arc" -mtime +1
./ORCL_892658623_1_38.arc
./ORCL_892658623_1_25.arc
./ORCL_892905078_1_11.arc
./ORCL_892921262_1_6.arc
./ORCL_892658623_1_34.arc
./ORCL_892905078_1_3.arc
./ORCL_892658623_1_22.arc
./ORCL_892921262_1_8.arc
./ORCL_892658623_1_30.arc
./ORCL_892921262_1_3.arc
./ORCL_892921262_1_4.arc
./ORCL_892658623_1_24.arc
./ORCL_892658623_1_28.arc
./ORCL_892658623_1_18.arc
./ORCL_892918980_1_5.arc
./ORCL_892658623_1_45.arc
./ORCL_892658623_1_35.arc
./ORCL_892658623_1_41.arc
./ORCL_892658623_1_17.arc
./ORCL_892921262_1_1.arc
./ORCL_892919631_1_1.arc
./ORCL_892658623_1_14.arc
./ORCL_892658623_1_27.arc
./ORCL_892658623_1_33.arc
./ORCL_892658623_1_40.arc
./ORCL_892918980_1_2.arc
./ORCL_892658623_1_39.arc
./ORCL_892658623_1_43.arc
./ORCL_892918980_1_7.arc
./ORCL_892919631_1_3.arc
./ORCL_892919631_1_2.arc
./ORCL_892658623_1_13.arc
./ORCL_892905078_1_9.arc
./ORCL_892658623_1_36.arc
./ORCL_892905078_1_7.arc
./ORCL_892918980_1_6.arc
./ORCL_892918980_1_1.arc
./ORCL_892658623_1_47.arc
./ORCL_892919631_1_5.arc
./ORCL_892658623_1_11.arc
./ORCL_892905078_1_10.arc
./ORCL_892921262_1_2.arc
./ORCL_892905078_1_4.arc
./ORCL_892658623_1_50.arc
./ORCL_892658623_1_32.arc
./ORCL_892921262_1_11.arc
./ORCL_892905078_1_6.arc
./ORCL_892658623_1_49.arc
./ORCL_892658623_1_26.arc
./ORCL_892658623_1_19.arc
./ORCL_892921262_1_7.arc
./ORCL_892658623_1_16.arc
./ORCL_892658623_1_29.arc
./ORCL_892658623_1_21.arc
./ORCL_892658623_1_48.arc
./ORCL_892905078_1_1.arc
./ORCL_892918980_1_4.arc
./ORCL_892919631_1_4.arc
./ORCL_892658623_1_12.arc
./ORCL_892658623_1_15.arc
./ORCL_892658623_1_42.arc
./prod/PROD_892660019_1_14.arc
./prod/PROD_892660019_1_15.arc
./ORCL_892921262_1_10.arc
./ORCL_892658623_1_23.arc
./ORCL_892658623_1_10.arc
./ORCL_892905078_1_8.arc
./ORCL_892658623_1_31.arc
./ORCL_892658623_1_44.arc
./ORCL_892918980_1_3.arc
./ORCL_892921262_1_9.arc
./ORCL_892905078_1_5.arc
./ORCL_892905078_1_12.arc
./ORCL_892905078_1_2.arc
./ORCL_892658623_1_20.arc
./ORCL_892921262_1_5.arc

삭제하기 전 먼저 삭제될 파일의 리스트를 확인한다 rm 명령은 항상 조심해야 한다

find . -name "*.arc" -mtime +1 -exec rm -f {} \;
find . -name "*.arc" -mtime +1

다시 확인하면 지금 시간으로부터 하루전 데이터를 제외한 데이터들이 삭제된걸 알 수 있다.

RMAN> crosscheck archivelog all;

삭제한 데이터들을 RMAN 상에서 확인하고

RMAN> delete expired archivelog all;

삭제해서 catalog의 정보와 OS의 파일 정보를 동기화한다.

TBS 생성 및 추가

SYS@orcl>create tablespace test datafile '/u01/app/oracle/oradata/orcl/test.dbf' size 100m;

Tablespace created.

SYS@orcl>select tablespace_name, status from dba_tablespaces;

TABLESPACE_NAME                STATUS
------------------------------ ---------
SYSTEM                         ONLINE
SYSAUX                         ONLINE
UNDOTBS1                       ONLINE
TEMP                           ONLINE
USERS                          ONLINE
EXAMPLE                        ONLINE
RMAN_TBS                       ONLINE
TEST                           ONLINE

SYS@orcl>!ls /u01/app/oracle/oradata/orcl/test*
/u01/app/oracle/oradata/orcl/test.dbf

SYS@orcl>alter tablespace test add datafile '/u01/app/oracle/oradata/orcl/test2.dbf' size 200m;

Tablespace altered.

SYS@orcl>select file#, name, status, bytes/1024/1024 from v$datafile;

     FILE#
----------
NAME
------------------------------------------------------------------------------------------------------------------------------------------------------
STATUS  BYTES/1024/1024
------- ---------------
         1
/u01/app/oracle/oradata/orcl/system01.dbf
SYSTEM              700

         2
/u01/app/oracle/oradata/orcl/sysaux01.dbf
ONLINE              540

         3
/u01/app/oracle/oradata/orcl/undotbs01.dbf
ONLINE              105

         4
/u01/app/oracle/oradata/orcl/users01.dbf
ONLINE                5

         5
/u01/app/oracle/oradata/orcl/example01.dbf
ONLINE              100

         6
/u01/app/oracle/oradata/orcl/rman_tbs.dbf
ONLINE              100

         7
/u01/app/oracle/oradata/orcl/test.dbf
ONLINE              100

         8
/u01/app/oracle/oradata/orcl/test2.dbf
ONLINE              200


8 rows selected.

SYS@orcl>!ls /u01/app/oracle/oradata/orcl/test*
/u01/app/oracle/oradata/orcl/test2.dbf  /u01/app/oracle/oradata/orcl/test.dbf

Datafile 위치 이동


SYS@orcl>alter tablespace test offline;


Tablespace altered.


SYS@orcl>select tablespace_name, status from dba_tablespaces;


TABLESPACE_NAME                STATUS

------------------------------ ---------

SYSTEM                         ONLINE

SYSAUX                         ONLINE

UNDOTBS1                       ONLINE

TEMP                           ONLINE

USERS                          ONLINE

EXAMPLE                        ONLINE

RMAN_TBS                       ONLINE

TEST                           OFFLINE


8 rows selected.


SYS@orcl>select file#, name, status from v$datafile;


     FILE#

----------

NAME

------------------------------------------------------------------------------------------------------------------------------------------------------

STATUS

-------

         1

/u01/app/oracle/oradata/orcl/system01.dbf

SYSTEM


         2

/u01/app/oracle/oradata/orcl/sysaux01.dbf

ONLINE


         3

/u01/app/oracle/oradata/orcl/undotbs01.dbf

ONLINE


         4

/u01/app/oracle/oradata/orcl/users01.dbf

ONLINE


         5

/u01/app/oracle/oradata/orcl/example01.dbf

ONLINE


         6

/u01/app/oracle/oradata/orcl/rman_tbs.dbf

ONLINE


         7

/u01/app/oracle/oradata/orcl/test.dbf

OFFLINE


         8

/u01/app/oracle/oradata/orcl/test2.dbf

OFFLINE



8 rows selected.


SYS@orcl>!cp /u01/app/oracle/oradata/orcl/test.dbf /home/oracle/test.dbf


SYS@orcl>alter tablespace test rename datafile '/u01/app/oracle/oradata/orcl/test.dbf' to'/home/oracle/test.dbf';


Tablespace altered.


SYS@orcl>select file#, name, status from v$datafile;                                     

     FILE#

----------

NAME

------------------------------------------------------------------------------------------------------------------------------------------------------

STATUS

-------

         1

/u01/app/oracle/oradata/orcl/system01.dbf

SYSTEM


         2

/u01/app/oracle/oradata/orcl/sysaux01.dbf

ONLINE


         3

/u01/app/oracle/oradata/orcl/undotbs01.dbf

ONLINE


         4

/u01/app/oracle/oradata/orcl/users01.dbf

ONLINE


         5

/u01/app/oracle/oradata/orcl/example01.dbf

ONLINE


         6

/u01/app/oracle/oradata/orcl/rman_tbs.dbf

ONLINE


         7

/home/oracle/test.dbf

OFFLINE


         8

/u01/app/oracle/oradata/orcl/test2.dbf

OFFLINE



8 rows selected.


SYS@orcl>alter tablespace test online;


Tablespace altered.


SYS@orcl>select tablespace_name, status from dba_tablespaces;                            

TABLESPACE_NAME                STATUS

------------------------------ ---------

SYSTEM                         ONLINE

SYSAUX                         ONLINE

UNDOTBS1                       ONLINE

TEMP                           ONLINE

USERS                          ONLINE

EXAMPLE                        ONLINE

RMAN_TBS                       ONLINE

TEST                           ONLINE


TBS / datafile 관리


SYS@orcl>alter database datafile '/u01/app/oracle/oradata/orcl/test2.dbf' resize 300m;


Database altered.


SYS@orcl>select file#, name, status, bytes/1024/1024 from v$datafile;

     FILE#

----------

NAME

------------------------------------------------------------------------------------------------------------------------------------------------------

STATUS  BYTES/1024/1024

------- ---------------

         1



         8

/u01/app/oracle/oradata/orcl/test2.dbf

ONLINE              300



8 rows selected.


Datafile 자동 확장 관리

SYS@orcl>select file_name, autoextensible from dba_data_files
  2  where file_name='/home/oracle/test.dbf';

FILE_NAME
------------------------------------------------------------------------------------------------------------------------------------------------------
AUT
---
/home/oracle/test.dbf
NO


SYS@orcl>alter database datafile '/home/oracle/test.dbf' autoextend on next 1m maxsize 1000m;

Database altered.

SYS@orcl>select file_name, autoextensible from dba_data_files                              2  where file_name='/home/oracle/test.dbf';                                            
FILE_NAME
------------------------------------------------------------------------------------------------------------------------------------------------------
AUT
---
/home/oracle/test.dbf
YES

Datafile Error 체크


SYS@orcl>select * from v$recover_file;

no rows selected

User 생성

유저가 사용할 테이블 스페이스 생성

SYS@orcl>create tablespace test datafile '/home/oracle/test.dbf' size 10m;

Tablespace created.

SYS@orcl>select tablespace_name, file_name from dba_data_files
  2  where tablespace_name='TEST';

TABLESPACE_NAME
------------------------------
FILE_NAME
------------------------------------------------------------------------------------------------------------------------------------------------------
TEST
/home/oracle/test.dbf


SYS@orcl>select file#, name, status bytes/1024/1024 from v$datafile;
select file#, name, status bytes/1024/1024 from v$datafile
                                *
ERROR at line 1:
ORA-00923: FROM keyword not found where expected


SYS@orcl>select file#, name, status, bytes/1024/1024 from v$datafile;

     FILE#
----------
NAME
------------------------------------------------------------------------------------------------------------------------------------------------------
STATUS  BYTES/1024/1024
------- ---------------
         1
/u01/app/oracle/oradata/orcl/system01.dbf
SYSTEM              700

         2
/u01/app/oracle/oradata/orcl/sysaux01.dbf
ONLINE              540

         3
/u01/app/oracle/oradata/orcl/undotbs01.dbf
ONLINE              105

         4
/u01/app/oracle/oradata/orcl/users01.dbf
ONLINE                5

         5
/u01/app/oracle/oradata/orcl/example01.dbf
ONLINE              100

         6
/u01/app/oracle/oradata/orcl/rman_tbs.dbf
ONLINE              100

         7
/home/oracle/test.dbf
ONLINE               10


7 rows selected.

유저 생성 및 권한 부여


SYS@orcl>create user insa identified by oracle default tablespace TEST

  2  temporary tablespace TEMP;


User created.


SYS@orcl>grant connect, resource to insa;


Grant succeeded.


INSA@orcl>select username from all_users where username='INSA';

USERNAME
------------------------------
INSA

SYS@orcl>drop user INSA cascade;


User dropped.


SYS@orcl>drop tablespace test including contents and datafiles;


Tablespace dropped.