首页 > 数据库 >Oracle DB add new user from windows

Oracle DB add new user from windows

时间:2022-10-14 13:46:11浏览次数:41  
标签:name windows DB add command user SQL password runid

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

1: key in sqlplus from command window, input user name and pw, pw is created when install oracle db, user name is system default user name

C:\Users\Administrator>sqlplus

SQL*Plus: Release 18.0.0.0.0 - Production on Thu Oct 13 22:21:32 2022
Version 18.4.0.0.0

Copyright (c) 1982, 2018, Oracle. All rights reserved.

Enter user-name: SYSTEM
Enter password:
Last Successful login time: Thu Oct 13 2022 22:12:27 -07:00

Connected to:
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
Version 18.4.0.0.0

 

2: run below command

SQL> ALTER SESSION SET"_ORACLE_SCRIPT"=TRUE;

Session altered.

 

3: create new user ''comfort" and password "password"

SQL> CREATE USER comfort IDENTIFIED BY password;

User created.

 

4: Grant dba to this new user, 

SQL> grant dba to comfort;

Grant succeeded.

 

Try import db here(do exp first from original db server with below command: exp SYSTEM/[email protected]:1521/XE owner=SYSTEM file=C:\Temp\test.dmp)

Take note, imp and exp command is not under sqlplus mode, just normal command window key in exp and imp command

imp comfort/password@XE file=C:\CastlesTMSDb\XE_220407.dmp log=C:\CastlesTM
below is part of import success log for reference only:

----------------------------------------------------------------------------------------

IMP-00041: Warning: object created with compilation warnings
"CREATE FORCE VIEW "COMFORT"."MVIEW_EXCEPTIONS" "
" "
" ("RUNID","OWNER","TABLE_NAME","DIMENSION_NAME","RELATION"
"SHIP","BAD_ROWID") AS "
"select"
" t1.runid# as runid,"
" owner,"
" table_name,"
" dimension_name,"
" relationship,"
" bad_rowid"
"from SYSTEM.MVIEW$_ADV_EXCEPTIONS t1, SYSTEM.MVIEW$_ADV_LOG t2, ALL_USERS u"
"where"
" t1.runid# = t2.runid# and"
" u.username = t2.uname and"
" u.user_id = userenv('SCHEMAID')"
Import terminated successfully with warnings.

C:\Users\Administrator>

----------------------------------------------------------------------------------------

标签:name,windows,DB,add,command,user,SQL,password,runid
From: https://www.cnblogs.com/renren0113/p/16791339.html

相关文章

  • java核心技术第四篇之JDBC第二篇
    01.JDBC连接池_连接池的概念:1).什么是连接池:对于多用户程序,为每个用户单独创建一个Connection,会使程序降低效率。这时我们可以创建一个"容器",这个容器中,先缓存一些Connect......
  • Python爬虫之mongodb介绍和安装
    Mongodb的介绍和安装学习目标了解非关系型数据库的优势了解mongodb的安装1.mongodb的介绍1.1什么是mongodbmongodb是一个功能最丰富的NoSQL非关系数据库。由C++语言......
  • torch进行多GPU卡训练时,报错RuntimeError: Address already in use
    torch进行GPU卡训练时,报错RuntimeError:Addressalreadyinuse参考:https://www.it610.com/article/1279180977062559744.htm问题在于,TCP的端口被占用,一种解决方法是,运行......
  • 一款DBA开发的Oracle迁移MySQL工具-oracle_mig_mysql
    这是一款由业余DBA写的数据迁移工具,可在线一键迁移Oracle数据库到MySQL数据库,包含表元数据、数据行迁移、视图、部分触发器、自增列、索引约束等对象自动创建。操作简单,开......
  • 546 JDBC练习_insert语句和547JDBC练习_update语句
    JDBC练习_insert语句publicstaticvoidmain(String[]args)throwsException{Statementstmt=null;Connectionconn=null;try{......
  • JDBC
    概念:JavaDataBaseConnectivityJava数据库连接,Java语言操作数据库JDBC本质:其实就算官方(sun公司)定义的一套操作所有关系型数据库的规则,即接口。各个数据库厂商去实现这......
  • Python爬虫之mongodb的聚合操作
    mongodb的聚合操作学习目标了解mongodb的聚合原理掌握mongdb的管道命令掌握mongdb的表达式1mongodb的聚合是什么聚合(aggregate)是基于数据处理的聚合管道,每个文档通过......
  • Python爬虫之mongodb的索引操作
    Mongodb的索引操作学习目标掌握mongodb索引的创建,删除操作掌握mongodb查看索引的方法掌握mongodb创建唯一索引的方法1.为什么mongdb需要创建索引加快查询速度进行数据的......
  • JDBC概念和JDBC快速入门
    1.概念:JavaDataBaseConnectivityJava数据库连接,Java语言操作数据库 *JDBC本质:其实是官方(sun公司)定义的一套操作所有关系型数据库的规则,即接口。各个数据库厂商......
  • 544JDBC各个类详解connection和545JDBC各个类详解_Statement
    详解个个对象1.OriverManager驱动管理对象上一个博客有讲解2.获取数据库连接上一个博客有讲解3.connection:数据库连接对象功能:1.获取执行sql的对象statement......