本文内容待完善
本文内容待完善
本文内容待完善
1)查询所有表空间select tablespace_name from dba_tablespaces;select tablespace_name from user_tablespaces;2)查询使用过的表空间 select distinct tablespace_name from dba_all_tables;select distinct tablespace_name from user_all_tables;3)查询表空间中所有表的名称select * from dba_all_tables where tablespace_name = 'SYNC_PLUS_1' and owner='GDSDCZJ'
3)查询系统用户select * from all_usersselect * from dba_users
4)删除用户:drop user user-name cascade;
加了cascade就可以把用户连带的数据全部删掉。
5)删除表空间:drop tablespace tablespace_name;
包括物理文件:drop tablespace tablespace_nameincluding contents and datafiles cascade constraint;
C:\Users\11021>sqlplusSQL*Plus: Release 11.2.0.1.0 Production on 星期一 3月 15 17:01:27 Copyright (c) 1982, , Oracle. All rights reserved.请输入用户名: system输入口令:连接到:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> drop user yz_test cascade;用户已删除。SQL> select tablespace_name from user_tablespaces;TABLESPACE_NAME------------------------------SYSTEMSYSAUXUNDOTBS1TEMPUSERSEXAMPLEYZ_TEST_SPACE已选择7行。SQL> drop tablespace yz_test_space including datafiles;drop tablespace yz_test_space including datafiles*第 1 行出现错误:ORA-01911: 需要 CONTENTS 关键字SQL> drop tablespace yz_test_space including contents and datafiles cascade constraint;表空间已删除。SQL> select tablespace_name from user_tablespaces;TABLESPACE_NAME------------------------------SYSTEMSYSAUXUNDOTBS1TEMPUSERSEXAMPLE已选择6行。
7)查看字符集:select * from nls_database_parameters where parameter='NLS_CHARACTERSET'
1、在windows的dos命令 登陆 oracle数据库。
2、创建新用户:create user yz_test identified by 123456; 注释:create user 用户名 identified by 密码;
3、创建表空间:create tablespace yz_test_space datafile 'D:\exeFile\installPackage\OracleDB\oracle-tableSpace\yz_test_space.dbf' size 2048M;
注释:create tablespace 表空间名 datafile 位置及名称 size 大小;
前提:D:\exeFile\installPackage\OracleDB\oracle-tableSpace,有这个文件夹,不会自动创建文件夹。
4、授权用户使用表空间:alter user yz_test quota unlimited on yz_test_space;
注释:alter user 用户名 quota unlimited on 表空间名;
5、给用户授权:grant connect,resource,dba to yz_test;
注释:grant 权限,权限 to 用户名;
6、创建directory:create directory yzTestDirectory as 'D:\exeFile\installPackage\OracleDB\databaseFile';
注释:create directory 目录名 as 位置
7、授权用户使用directory:grant read,write on directory yzTestDirectory to yz_test;
注释:grant 权限,权限 on directory 目录名 to 用户名;
8、把oracle数据库的备份.dmp文件拷贝到directory目录下。
9、输入quit,退出Oracle数据库;
10、导入:imp yz_test/123456 file=D:\exeFile\installPackage\OracleDB\databaseFile\UO_EC_60722_6.0.2.dmp full=y;
如果觉得《Oracle创建新用户 并利用imp导入.dmp文件数据》对你有帮助,请点赞、收藏,并留下你的观点哦!