oracle 在已有实力上创建用户 并导入数据

oracle@hpws:~$ cd /opt/ora12c/oradata/
oracle@hpws:/opt/ora12c/oradata$ ll
total 12
drwxr-x---  3 oracle oinstall 4096  6?.25 17:55 ./
drwxr-xr-x 11 oracle oinstall 4096  6?.26 08:31 ../
drwxr-x---  2 oracle oinstall 4096  6?.26 08:07 ora12c/
oracle@hpws:/opt/ora12c/oradata$ cd ora12c/
oracle@hpws:/opt/ora12c/oradata/ora12c$ ll
total 24065080
drwxr-x--- 2 oracle oinstall        4096  6?.26 08:07 ./
drwxr-x--- 3 oracle oinstall        4096  6?.25 17:55 ../
-rw-r----- 1 oracle oinstall    10272768 11?.13 15:03 control01.ctl
-rw-r----- 1 oracle oinstall 10737426432 11?.13 14:35 data01.dbf
-rw-r----- 1 oracle oinstall  5368717312 11?.13 14:35 data02.dbf
-rw-r----- 1 oracle oinstall   375529472 11?.13 14:35 example01.dbf
-rw-r----- 1 oracle oinstall   314580992 11?.13 14:35 example02.dbf
-rw-r----- 1 oracle oinstall  2147491840 11?.13 14:35 indx01.dbf
-rw-r----- 1 oracle oinstall    52429312 11?.13 14:29 redo01.log
-rw-r----- 1 oracle oinstall    52429312 11?.13 14:30 redo02.log
-rw-r----- 1 oracle oinstall    52429312 11?.13 15:02 redo03.log
-rw-r----- 1 oracle oinstall  1835016192 11?.13 15:02 sysaux01.dbf
-rw-r----- 1 oracle oinstall   828383232 11?.13 14:59 system01.dbf
-rw-r----- 1 oracle oinstall   524296192 11?.13 14:35 system02.dbf
-rw-r----- 1 oracle oinstall   996155392 11?.13 14:30 temp01.dbf
-rw-r----- 1 oracle oinstall  1342185472 11?.13 15:02 undotbs01.dbf
-rw-r----- 1 oracle oinstall     5251072 11?.13 14:35 users01.dbf
oracle@hpws:/opt/ora12c/oradata/ora12c$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Nov 13 15:04:27 2014

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

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select TABLESPACE_NAME from v$tablespace;
select TABLESPACE_NAME from v$tablespace
       *
ERROR at line 1:
ORA-00904: "TABLESPACE_NAME": invalid identifier

SQL> desc v$tablespace;
 Name                       Null?    Type
 ----------------------------------------- -------- ----------------------------
 TS#                            NUMBER
 NAME                            VARCHAR2(30)
 INCLUDED_IN_DATABASE_BACKUP                VARCHAR2(3)
 BIGFILE                        VARCHAR2(3)
 FLASHBACK_ON                        VARCHAR2(3)
 ENCRYPT_IN_BACKUP                    VARCHAR2(3)
 CON_ID                         NUMBER

SQL> select NAME from v$tablespace;

NAME
--------------------------------------------------------------------------------
SYSTEM
SYSAUX
UNDOTBS1
USERS
TEMP
EXAMPLE
DATA
INDX

8 rows selected.

SQL> create tablespace tbs_cpwebid datafile ‘/opt/ora12c/oradata/ora12c/cpwebid01.dbf‘ size 5g autoextend off;

Tablespace created.

SQL> create user cpwebid identified by cpwebid account unlock;

User created.

SQL> alter user cpwebid default tablespace tbs_cpwebid ;

User altered.

SQL> grant dba to cpwebid;

Grant succeeded.

SQL> grant create table to cpwebid;

Grant succeeded.

SQL> create tablespace tbs_cpserviceid datafile ‘/opt/ora12c/oradata/ora12c/cpserviceid01.dbf‘ size 5g autoextend off;

Tablespace created.

SQL> show container;
SP2-0158: unknown SHOW option "container"
SQL> create user cpserviceid identified by cpserviceid account unlock;

User created.

SQL> alter user cpserviceid default tablespace tbs_cpserviceid ;

User altered.

SQL> grant dba to cpserviceid;

Grant succeeded.

SQL> grant create table to cpserviceid;

Grant succeeded.

SQL> quit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
oracle@hpws:/opt/ora12c/oradata/ora12c$ pwd
/opt/ora12c/oradata/ora12c
oracle@hpws:/opt/ora12c/oradata/ora12c$ ll
total 34550864
drwxr-x--- 2 oracle oinstall        4096 11?.13 15:07 ./
drwxr-x--- 3 oracle oinstall        4096  6?.25 17:55 ../
-rw-r----- 1 oracle oinstall    10272768 11?.13 15:09 control01.ctl
-rw-r----- 1 oracle oinstall  5368717312 11?.13 15:08 cpserviceid01.dbf
-rw-r----- 1 oracle oinstall  5368717312 11?.13 15:06 cpwebid01.dbf
-rw-r----- 1 oracle oinstall 10737426432 11?.13 14:35 data01.dbf
-rw-r----- 1 oracle oinstall  5368717312 11?.13 14:35 data02.dbf
-rw-r----- 1 oracle oinstall   375529472 11?.13 14:35 example01.dbf
-rw-r----- 1 oracle oinstall   314580992 11?.13 14:35 example02.dbf
-rw-r----- 1 oracle oinstall  2147491840 11?.13 14:35 indx01.dbf
-rw-r----- 1 oracle oinstall    52429312 11?.13 14:29 redo01.log
-rw-r----- 1 oracle oinstall    52429312 11?.13 14:30 redo02.log
-rw-r----- 1 oracle oinstall    52429312 11?.13 15:09 redo03.log
-rw-r----- 1 oracle oinstall  1835016192 11?.13 15:05 sysaux01.dbf
-rw-r----- 1 oracle oinstall   828383232 11?.13 15:05 system01.dbf
-rw-r----- 1 oracle oinstall   524296192 11?.13 14:35 system02.dbf
-rw-r----- 1 oracle oinstall   996155392 11?.13 14:30 temp01.dbf
-rw-r----- 1 oracle oinstall  1342185472 11?.13 15:05 undotbs01.dbf
-rw-r----- 1 oracle oinstall     5251072 11?.13 14:35 users01.dbf
oracle@hpws:/opt/ora12c/oradata/ora12c$ cd
oracle@hpws:~$ pwd
/home/oracle
oracle@hpws:~$ ll
total 58956
drwxr-xr-x 46 oracle oinstall     4096 11?.13 14:07 ./
drwxr-xr-x  7 root   root         4096 11?. 4 15:19 ../
-rw-r--r--  1 oracle oinstall      169  6?.25 18:33 afiedt.buf
drwxr-xr-x  2 oracle oinstall     4096  6?.25 18:08 backup/
-rwx--x--x  1 oracle oinstall    34490 11?.13 14:07 .bash_history*
-rw-r--r--  1 oracle oinstall      220  6?.25 18:08 .bash_logout
-rwxr-xr-x  1 oracle oinstall     1108  6?.26 08:01 .bash_profile*
-rwxr-xr-x  1 oracle oinstall     3559  6?.26 07:59 .bashrc*
drwx------ 22 oracle oinstall     4096  9?. 3 08:06 .cache/
drwxr-xr-x 23 oracle oinstall     4096  7?.11 17:45 .config/
drwx------  3 oracle oinstall     4096  6?.25 18:33 .dbus/
drwxr-xr-x  2 oracle oinstall     4096  7?.11 15:06 Desktop/
-rw-r--r--  1 oracle oinstall       64  6?.25 18:33 .dmrc
drwxr-xr-x  2 oracle oinstall     4096  6?.27 16:37 Documents/
drwxr-xr-x  2 oracle oinstall     4096  6?.27 16:37 Downloads/
drwxr-xr-x  3 oracle oinstall     4096  6?.27 16:57 .eclipse/
-r--------  1 root   root           20  6?.27 00:00 .erlang.cookie
-rw-r-----  1 root   root       302185  6?.27 18:07 erl_crash.dump
-rw-r--r--  1 root   root         1566  7?.11 15:08 erlide_debug.txt
-rw-------  1 oracle oinstall       16  6?.25 18:12 .esd_auth
drwxr-xr-x  8 oracle oinstall     4096  6?.25 18:33 .evolution/
-rw-r--r--  1 oracle oinstall      179  6?.25 18:12 examples.desktop
drwxr-xr-x  2 oracle oinstall     4096  6?.25 18:33 .fontconfig/
drwx------  4 oracle oinstall     4096  7?.31 14:48 .gconf/
drwx------  2 oracle oinstall     4096  6?.25 18:33 .gconfd/
-rw-r-----  1 oracle oinstall        0  6?.25 18:33 .gksu.lock
drwx------  7 oracle oinstall     4096  6?.27 16:36 .gnome2/
drwx------  2 oracle oinstall     4096  6?.25 18:12 .gnome2_private/
drwx------  2 oracle oinstall     4096  7?.31 14:48 .gnupg/
drwxr-xr-x  2 oracle oinstall     4096  6?.25 18:12 .gstreamer-0.10/
-rw-r--r--  1 oracle oinstall      142  6?.27 16:54 .gtk-bookmarks
drwx------  2 oracle oinstall     4096  6?.25 18:33 .gvfs/
-rw-------  1 oracle oinstall     4376  7?.31 14:48 .ICEauthority
drwxr-xr-x  2 oracle oinstall     4096  6?.25 18:12 .icons/
drwxr-xr-x  3 oracle oinstall     4096  6?.25 18:33 .local/
drwxr-xr-x  2 oracle oinstall     4096  6?.25 18:33 monitor/
drwx------  4 oracle oinstall     4096  6?.25 18:12 .mozilla/
drwxr-xr-x  2 oracle oinstall     4096  6?.27 16:37 Music/
drwxr-xr-x  2 oracle oinstall     4096  6?.27 16:36 .nautilus/
drwxr-xr-x  3 oracle oinstall     4096  6?.25 18:33 .oracle/
drwxr-x---  3 oracle oinstall     4096  6?.25 18:12 oradiag_oracle/
-rw-r--r--  1 oracle oinstall      267  7?.11 17:53 .pam_environment
drwxr-xr-x  2 oracle oinstall     4096  6?.27 16:37 Pictures/
-rwxr-xr-x  1 oracle oinstall      700  6?.25 18:12 .profile*
drwxr-xr-x  2 oracle oinstall     4096  6?.27 16:37 Public/
drwx------  2 oracle oinstall     4096  6?.27 16:36 .pulse/
-rw-------  1 oracle oinstall      256  6?.25 18:12 .pulse-cookie
-rw-------  1 oracle oinstall       75  6?.27 15:24 .python_history
drwx------  2 oracle oinstall     4096  6?.30 15:48 .remmina/
drwxr-xr-x  2 oracle oinstall     4096  6?.25 17:21 .rpmdb/
drwxr-xr-x  2 oracle oinstall     4096  6?.26 08:04 scripts/
-rw-r--r--  1 oracle oinstall       66  6?.25 18:33 .selected_editor
-rw-------  1 oracle oinstall      102  6?.25 18:12 .sh_history
drwx------  2 oracle oinstall     4096  6?.25 18:12 .ssh/
drwxr-xr-x  3 oracle oinstall     4096  7?.11 15:04 .swt/
drwxr-xr-x  5 oracle oinstall     4096 11?.13 13:48 SYNC_PRO_NEW/
drwxr-xr-x  2 oracle oinstall     4096  6?.27 16:37 Templates/
drwxr-xr-x  2 oracle oinstall     4096  6?.25 18:12 .themes/
drwx------  4 oracle oinstall     4096  6?.25 18:33 .thumbnails/
drwx------  2 oracle oinstall     4096  6?.25 18:33 .tsclient/
drwx------  2 oracle oinstall     4096  6?.25 18:12 .update-notifier/
drwxr-xr-x  2 oracle oinstall     4096  6?.27 16:37 Videos/
-rw-------  1 oracle oinstall     7915 11?.13 14:07 .viminfo
drwx------  2 oracle oinstall     4096  7?.11 15:03 .vnc/
drwxr-xr-x  4 oracle oinstall     4096  7?.11 16:42 workspace/
-rw-r--r--  1 oracle oinstall      131  7?.10 14:51 .xinputrc
-rw-r--r--  1 oracle oinstall       14  7?.11 15:00 .xsession
-rw-------  1 oracle oinstall 59739682  7?.21 09:05 .xsession-errors
-rw-------  1 oracle oinstall     4952  6?.25 18:12 .xsession-errors.old
drwxr-xr-x  2 oracle oinstall     4096  6?.25 18:12 涓.浇/
drwxr-xr-x  2 oracle oinstall     4096  6?.25 18:33 妗../
oracle@hpws:~$ ls -ltr
total 372
drwxr-xr-x 2 oracle oinstall   4096  6?.25 18:08 backup
-rw-r--r-- 1 oracle oinstall    179  6?.25 18:12 examples.desktop
drwxr-xr-x 2 oracle oinstall   4096  6?.25 18:12 涓.浇
drwxr-x--- 3 oracle oinstall   4096  6?.25 18:12 oradiag_oracle
-rw-r--r-- 1 oracle oinstall    169  6?.25 18:33 afiedt.buf
drwxr-xr-x 2 oracle oinstall   4096  6?.25 18:33 妗..
drwxr-xr-x 2 oracle oinstall   4096  6?.25 18:33 monitor
drwxr-xr-x 2 oracle oinstall   4096  6?.26 08:04 scripts
drwxr-xr-x 2 oracle oinstall   4096  6?.27 16:37 Videos
drwxr-xr-x 2 oracle oinstall   4096  6?.27 16:37 Templates
drwxr-xr-x 2 oracle oinstall   4096  6?.27 16:37 Public
drwxr-xr-x 2 oracle oinstall   4096  6?.27 16:37 Pictures
drwxr-xr-x 2 oracle oinstall   4096  6?.27 16:37 Music
drwxr-xr-x 2 oracle oinstall   4096  6?.27 16:37 Downloads
drwxr-xr-x 2 oracle oinstall   4096  6?.27 16:37 Documents
-rw-r----- 1 root   root     302185  6?.27 18:07 erl_crash.dump
drwxr-xr-x 2 oracle oinstall   4096  7?.11 15:06 Desktop
-rw-r--r-- 1 root   root       1566  7?.11 15:08 erlide_debug.txt
drwxr-xr-x 4 oracle oinstall   4096  7?.11 16:42 workspace
drwxr-xr-x 5 oracle oinstall   4096 11?.13 13:48 SYNC_PRO_NEW
oracle@hpws:~$ imp userid=cpwebid/cpwebid@ora12c fromuser=cpwebid touser=cpwebid log=user_data.log file=/home/oracle/cpweb.dmp

Import: Release 12.1.0.1.0 - Production on Thu Nov 13 15:13:19 2014

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

省略数据库信息
IMP-00003: ORACLE error 959 encountered
ORA-00959: tablespace ‘TBS_CPWEB‘ does not exist
Import terminated successfully with warnings.
oracle@hpws:~$ imp userid=cpserviceid/cpserviceid@ora11g fromuser=cpserviceid touser=cpserviceid log=user_data.log file=/home/oracle/cpservice.dmp

Import: Release 12.1.0.1.0 - Production on Thu Nov 13 15:14:13 2014

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

IMP-00058: ORACLE error 12514 encountered
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
IMP-00000: Import terminated unsuccessfully
oracle@hpws:~$
oracle@hpws:~$ imp userid=cpserviceid/cpserviceid@ora12c fromuser=cpserviceid touser=cpserviceid log=user_data.log file=/home/oracle/cpservice.dmp

Import: Release 12.1.0.1.0 - Production on Thu Nov 13 15:14:41 2014

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

Export file created by EXPORT:V11.01.00 via conventional path
import done in UTF8 character set and AL16UTF16 NCHAR character set
import server uses WE8MSWIN1252 character set (possible charset conversion)
export client uses ZHS16GBK character set (possible charset conversion)
省略数据库信息
Import terminated successfully without warnings. oracle@hpws:~$ cpserviceid/cpserviceid@ora12c -su: cpserviceid/cpserviceid@ora12c: No such file or directory oracle@hpws:~$

核心命令

select FILE_NAME,TABLESPACE_NAME from dba_data_files;

create tablespace tbs_a datafile ‘/opt/ora12c/oradata/ora12c/a.dbf‘ size 5g autoextend off;
create tablespace tbs_b datafile ‘/opt/ora12c/oradata/ora12c/b.dbf‘ size 5g autoextend off;
create user a identified by ua account unlock;
create user b identified by ub account unlock;
alter user a default tablespace tbs_a ;
alter user b default tablespace tbs_b ;
grant dba to a;
grant dba to b;
grant create table to a;
grant create table to b;

select USERNAME  from dba_users where ACCOUNT_STATUS=‘OPEN‘
select TABLESPACE_NAME from v$tablespace;

导入导出命令

oracle---导出-----------------------------------------------------------------------------

exp a/a@ab file=/home/oracle/a.dmp
exp b/b@bb file=/home/oracle/a.dmp

oracle导入12导入11-----------------------------------------------------------------------
下载出来编辑 12 修改为11

imp userid=a/a@ab fromuser=a touser=a log=user_data.log file=/home/oracle/a.dmp

imp userid=b/b@bb fromuser=b touser=b log=user_data.log file=/home/oracle/b.dmp
时间: 2024-11-05 13:28:37

oracle 在已有实力上创建用户 并导入数据的相关文章

mysql 批处理文件--- 创建 用户 以及 导入数据

在window下,通过批处理文件(.bat),进行开启MYSQL服务,导入数据文件(.sql) 1)新建一个txt文件,写入以下内容 rem 启动mysql56服务  mysql56是我的mysql服务名称  若该服务已启动,则下面2行代码可省略 cd C:\Windows\system32   net start mysql56 rem 进入安装目录的路径下 C:\Program Files\MySQL\MySQL Server 5.6\bin  执行以下代码    数据库文件mysql_cr

在web上创建可视化的交互式数据javascript框架-JavaScript InfoVis Toolkit

原文:在web上创建可视化的交互式数据javascript框架-JavaScript InfoVis Toolkit 源代码下载地址:http://www.zuidaima.com/share/1554696025099264.htm 官方站点:http://philogb.github.io/jit/index.html 适应各种结构表现(机关.人际关系.文件路径...) 适应客户需求,找的表现机关级别关系图. 如: 这一款JS绘图框架,非常小,压缩后 只有150kb.目前只用到它的这一种表现

在服务器上创建用户

创建用户tianjiewang后,发现在自己权限不够,直接修改和root一样的权限 vim /etc/sudoers or gedit /etc/sudoers root ALL=(ALL) ALL tianjiewang ALL=(ALL) ALL 然后访问/var/log/nginx -bash: cd: /var/log/nginx/: Permission denied 然后我就用root用户进去,发现不太对,不是每次就要用root用户,查了nginx 属于adm分组 sudo user

oracle创建用户并导入数据库

#创建用户 create user 用户名 identified by 密码; #授权 grant connect, resource,dba to 用户名; #导入 imp 用户名/密码@orcl file=d:\xx.dmp full=y

数据库 ---39 索引 创建用户及授权 数据备份

一.索引 1.索引的数据结构( B+树 类型) B+树  的性质 a.索引字段要尽量的小 b.索引的最左匹配特性 1.聚焦索引 (主键索引)  primary  key(PRI) 加速查找   不为空  不重复 ①创建时添加 create table t1 ( id int primary key,.....); create table t1 (id int ,primary key(id) ); ②创建完之后添加 alter table 表名 add primary key(id); ③删除

oracle创建用户并导入dmp文件

SQL命令行执行以下命令:SQL> conn sys/111111 as sysdba; SQL> CREATE USER TEST11 IDENTIFIED BY "111111";SQL> GRANT CONNECT TO TEST11;SQL> GRANT DBA TO TEST11; CMD命令行执行以下命令:bin> imp TEST11/[email protected] file=e:\TEST11.dmp full=y;

oracle12c创建用户提示ORA-65096:公用用户名或角色无效

1.背景 以前一直用的是oracle11g,创建用户一直没有问题, 今天在oracle12c上创建用户,报错了.如下图: 我很郁闷, 就打开了oracle官方网站找了下, 发现创建用户是有限制的. 2.解决方案 创建用户的时候用户名以c##或者C##开头即可. 错误写法: create user zhaojiedi identified by oracle; 正确写法: create user c##zhaojiedi identified by oracle; 注: 如果你不纠结为啥的,上面的

分享知识-快乐自己:oracle12c创建用户提示ORA-65096:公用用户名或角色无效

今天在oracle12c上创建用户,报错了.如下图: 我很郁闷, 就打开了oracle官方网站找了下, 发现创建用户是有限制的. 2.解决方案 创建用户的时候用户名以c##或者C##开头即可. 错误写法: create user zhaojiedi identified by oracle; 正确写法: create user c##zhaojiedi identified by oracle; 注: 如果你不纠结为啥的,上面的解决方案就可以满足你的要求了,下面的内容可以不用看了. ======

Global Azure上创建、配置、管理SQL Server信息

近期写了很多关于Azure的相关的文档,今天忙完介绍一下,如何在Windows Azure上配置和管理SQL Server信息:我们今天的实验还是以Global Azure来操作:其实在Windows Azure上的SQL Server结构跟本地差不多,只是在Azure上创建的SQL Server数据不会具有系统默认的管理员权限:比如创建数据库的时候需要指定数据库的管理员信息:不能使用sa做为管理员账户:具体就不多介绍了,具体见下: 我们首先单击SQL 数据库---添加 因为我们环境内没有创建过