标签:xtend 数据库 rop read ide tor 数据库实例 dba alt
CREATE TABLESPACE demon DATAFILE ‘/data/oradata/demon.dbf‘ SIZE 1024 M AUTOEXTEND ON EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1 M;
CREATE USER demon
IDENTIFIED BY demon
DEFAULT TABLESPACE demon_default
TEMPORARY TABLESPACE temp
PROFILE DEFAULT
ACCOUNT UNLOCK;
GRANT DBA TO demon;
GRANT RESOURCE TO demon;
ALTER USER demon DEFAULT ROLE ALL;
GRANT SELECT ANY TABLE TO demon;
GRANT UNLIMITED TABLESPACE TO demon;
GRANT CREATE ANY TABLE to demon;
#报错:ORA-65096: 公用用户名或角色名无效###
alter session set "_ORACLE_SCRIPT"=true; create user c##demon identified by demon default tablespace demon;
alter user demon identified by demontest;
drop user demon cascade;
drop tablespace demon including contents and datafiles cascade constraint;
切换到oracle用户:su - oracle sqlplus sys/ as sysdba 登录
select name from v$database;
select instance_name from v$instance;
expdp demon/demon directory=DATA_PUMP_DIR dumpfile=demon_`date +%Y%m%d`.dmp job_name=expdp_demon logfile=demon_`date +%Y%m%d`.log schemas=demon reuse_dumpfiles=true
导出指定版本
expdp demon/demon DIRECTORY=DIR_DP DUMPFILE=demon_`date +%Y%m%d`.dmp job_name=demon LOGFILE=demon_`date +%Y%m%d`.log schemas=demon version=11.2.0.4.0
SELECT * FROM dba_directories;
create or replace directory exppump as ‘/data/‘; grant read,write on directory exppump to demon;
impdp demon/demon DUMPFILE=demon_20200107.dmp job_name=demon LOGFILE=demon_20200107.log version=11.2.0.4.0
select name from v$database;
查询当前数据库实例名
select instance_name from v$instance;
查看oracle所有表空间
select tablespace_name from user_tablespaces;
删除用户及表空间
drop user demon cascade;
drop tablespace demon including contents and datafiles cascade constraint;
标签:xtend 数据库 rop read ide tor 数据库实例 dba alt
原文地址:https://www.cnblogs.com/yanxinjiang/p/12785383.html