- CREATE SMALLFILE
- TABLESPACE "表空间名"
- LOGGING
- DATAFILE '/home/oracle/app/oradata/表空间名.dbf' SIZE 1024M AUTOEXTEND ON NEXT 512M MAXSIZE 3048M
- EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
- CREATE USER C##用户名 PROFILE DEFAULT IDENTIFIED BY 用户密码 DEFAULT
- TABLESPACE 表空间名 TEMPORARY
- TABLESPACE TEMP ACCOUNT UNLOCK;
- GRANT CONNECT TO C##用户名;
- GRANT RESOURCE TO C##用户名;
- GRANT DBA TO C##用户名 WITH ADMIN OPTION;
- ALTER USER C##用户名 DEFAULT ROLE DBA;
-
- alter user C##用户名 quota unlimited on 表空间名;
- select user#,name from user$;---查到到所需修改用户名
- update user$ set name='新的用户名称' where user#=139;
- commit;
- ALTER SYSTEM CHECKPOINT;
- ALTER SYSTEM FLUSH SHARED_POOL;
- ALTER USER 用户名 IDENTIFIED BY 密码;
- COMMIT;
ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON=FALSE;
- lsnrctl stop
- sqlplus / as sysdba
- shutdown immediate;
- lsnrctl start
- sqlplus / as sysdba
- startup;
--a.创建dmp文件存储路径
create directory dump_dir as '/home/oracle/dmp';
--为用户目录赋读写权限
grant read,write on directory dump_dir to userName;
--b.导出
expdp 用户名/密码 directory=dump_dir dumpfile=name.dmp logfile=name.log schema=用户名
--c.导入
-
- impdp 用户名/密码 directory=dump_dir dumpfile=name.dmp logfile=name.log remap_schema=老用户名:新用户名remap_tablespace=老表空间名:新表空间名