当前位置:网站首页>Oracle database user creation, restart, import and export
Oracle database user creation, restart, import and export
2022-08-04 14:36:00 【Dreamer DBA】
--Database user creation process
--a. Create tablespace:
CREATE SMALLFILETABLESPACE "tablespace name"LOGGINGDATAFILE '/home/oracle/app/oradata/tablespace name.dbf' SIZE 1024M AUTOEXTEND ON NEXT 512M MAXSIZE 3048MEXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
--b. Create a normal new user
CREATE USER C##username PROFILE DEFAULT IDENTIFIED BY user password DEFAULTTABLESPACE tablespace name TEMPORARYTABLESPACE TEMP ACCOUNT UNLOCK;
--c.Authorization
GRANT CONNECT TO C##username;GRANT RESOURCE TO C##username;GRANT DBA TO C##username WITH ADMIN OPTION;ALTER USER C##username DEFAULT ROLE DBA;alter user C##username quota unlimited on tablespace name;
--d. Remove C## from the username
select user#,name from user$;--- find the user name to be modifiedupdate user$ set name='new user name' where user#=139;commit;
--force refresh
ALTER SYSTEM CHECKPOINT;ALTER SYSTEM FLUSH SHARED_POOL;
--e.Change password
ALTER USER username IDENTIFIED BY password;COMMIT;
--close case limit
ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON=FALSE;
--Restart the database
--a.Close
lsnrctl stopsqlplus / as sysdbashutdown immediate;
--b.Start
lsnrctl startsqlplus / as sysdbastartup;
--Database import and export
--use expdp/impdp command
--a. Create dmp file storage path
create directory dump_dir as '/home/oracle/dmp';
--Assign read and write permissions to the user directory
grant read,write on directory dump_dir to userName;
--b.Export
expdp username/password directory=dump_dir dumpfile=name.dmp logfile=name.log schema=username
--c.Import
impdp username/password directory=dump_dir dumpfile=name.dmp logfile=name.log remap_schema=old username:new username remap_tablespace=old tablespace name:new tablespace name
边栏推荐
- Crawler - basic use of selenium, no interface browser, other uses of selenium, cookies of selenium, crawler cases
- 杭电校赛(逆袭指数)
- 自监督学习未来是掩码自编码器?KAIST最新《自监督学习掩码自编码器》研究进展
- 属于程序猿的浪漫
- Theory 1: Deep Learning - Detailed Explanation of the LetNet Model
- 利用决策树找出最优特征组合
- leetcode:259. 较小的三数之和
- 记录都有哪些_js常用方法总结
- 物联网应用发展趋势
- Rust from entry to proficient 04-variables
猜你喜欢
随机推荐
【剑指offer59】队列的最大值
技术分享| 小程序实现音视频通话
Technology sharing | Mini program realizes audio and video calls
Keycloak 6.0.0 正式发布,身份和访问管理系统
期货开户之前要谈好最低手续费和交返
Qt的QItemDelegate使用
开发者独立搭建一个跨模态搜索应用有多难?
leetcode:215无序数组中找第k大的元素
【剑指offer33】二叉搜索树的后序遍历序列
How to Identify Asynchronous I/O Bottlenecks
九州云出席领航者线上论坛,共话5G MEC边缘计算现状、挑战和未来
如何确定异步 I/O 瓶颈
字符串类的设计与实现_C语言字符串编程题
Rust from entry to proficient 04-variables
How to install postgresql and configure remote access in ubuntu environment
leetcode:254. 因子的组合
How to write SQL statements: the usage of Update, Case, and Select together
Database recovery
快解析结合友加畅捷U+
从理论到实践:MySQL性能优化和高可用架构,一次讲清