create or replace procedure drop_all as cursor cur_obj is select uo.OBJECT_NAME, uo.OBJECT_TYPE from user_objects uo where uo.OBJECT_NAME not in ('DROP_ALL') and uo.OBJECT_TYPE not in ('LOB'); /* cursor cur_tablespace is select ut.TABLESPACE_NAME fro…
如何杀掉一个用户下的所有进程并drop掉这个用户 Copy the sample code below into a file named kill_drop_user.sql.Open SQL*Plus and connect as user SYS to your databaseSQL> CONNECT sys/change_on_install@orcl AS SYSDBACreate a user called TEST with password TESTSQL> GRANT co…
-- 创建一个用户并分配表空间和分配权限 -- 以sysdba登录 oracle@sha-col-oracle-2:~> sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Mon Mar 7 18:48:59 2016 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Ed…
在Oracle 12C中,账号分为两种,一种是公用账号,一种是本地账号(亦可理解为私有账号).共有账号是指在CDB下创建,并在全部PDB中生效的账号,另一种是在PDB中创建的账号. 针对这两种账号的测试如下: 1.1 在PDB中创建测试账号 SQL> alter session set container=pdb01; Session altered. SQL> select username from dba_users where username like 'GUI%'; no rows…
根据需求的不同,也分为好几种方法,且看下文. 先构造基本的环境:创建两个用户AA,BB,基本需求为用户AA能够访问用户BB下所有的表,即用户AA有对BB下所有的表有"select on"权限. SYS@zkm> create user aa identified by oracle account unlock; User created. SYS@zkm> create user bb identified by oracle account unlock; User c…