linux7安装oracle

1、安装最小化linux系统

 

2、升级Linux图形界面:

在命令行下 输入下面的命令来安装Gnome包。

# yum groupinstall "GNOME Desktop" "Graphical Administration Tools"

非常慢,建议安装系统时,直接选择带图形界面的安装方式。

 

更新系统的默认选择的启动界面为图形界面:

 ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

 

https://blog.csdn.net/zhagzheguo/article/details/79433307

 

3、安装vnc图形化远程桌面

 https://blog.csdn.net/hffwj/article/details/124450231

  • 关闭系统防火墙;https://blog.csdn.net/the_shy369/article/details/127036896
  • 禁用 selinux 模块;https://zhuanlan.zhihu.com/p/465175395

 systemctl stop firewalld.service

sudo setenforce 0

yum -y install tigervnc*

[root@nginx ~]# vncserver
[root@nginx ~]# vncserver -list

 

4、进行oracle安装前的linux系统参数配置:

https://blog.csdn.net/demonson/article/details/79753766

 同事说上一个链接的配置有坑,下面的链接比较好

https://www.cnblogs.com/shenlanzifa/p/5288749.html

以下是大致的配置过程,具体参数再上面的文章里有。

 

[root@orcltest Downloads]#vim /etc/sysctl.conf

(没法通过sysctl -p命令生效,估计需要重启生效)

 

建用户建组

[root@orcltestDownloads]# groupadd oinstall

[root@orcltestDownloads]# groupadd dba

[root@orcltestDownloads]# groupadd oper

[root@orcltestDownloads]# useradd -g oinstall -G dba,oper oracle

[root@orcltestDownloads]# passwd oracle

[root@orcltestDownloads]# vim /etc/security/limits.conf

 

[root@orcltestDownloads]# vim /etc/pam.d/login

(不知道干嘛用)

 

[root@orcltest Downloads]# vim /etc/profile

(这种配置方式比较原始了,一般在profile.d中另建一个文件)

 

[oracle@orcltest ~]$ vim .bash_profile

(原文好多配置不对,明显是拼凑的)

[oracle@orcltest ~]$ source .bash_profile

 

[root@orcltest~]# mkdir /data/oracle

[root@orcltest~]# chown oracle:oinstall /data

[root@azure_earth_dbm1_3_112 app]# mkdir /data/oraInventory

其他ln -s  /data/oracle oracle等命令我认为没有必要,我都放到data下不行么?

 

5、安装oracle程序

直接在图形界面的终端窗口执行$./runInstaller就能进入图形安装向导:

$./runInstaller

但是字符集有问题,许多汉字显示为方块(□),而且退出后窗口不能关闭,修改.bash_profile中的字符集好像不管用... 系统语言切换为英语

oracle安装客户端的弹窗很小只有一个竖条:

Linux解决方法1:https://blog.csdn.net/sdut406/article/details/81463758

./runInstaller -jreLoc /etc/alternatives/jre_1.8.0

2:https://blog.csdn.net/loveLAxin/article/details/121648213
./runInstaller -jreLoc JRE_LOCATION
##jdk默认路径就在/etc/alternatives/目录下,寻找jre_目录,1.7和1.8都可以。

 

如果修改过主机名hostname 则需要统一 /etc/hosts里的主机名

https://blog.csdn.net/fanghongxia2008/article/details/50068053

 

安装程序检测缺少的rpm包,一般都能yum安装, 比如:

sudo yum -y install gcc gcc-c++ kernel-devel

依赖包详见:https://cloud.tencent.com/developer/article/2130136

pdksh用yum安装找不到包,下载地址:

https://blog.csdn.net/lbp0123456/article/details/113939756

拷贝到服务器用rpm安装:

rpm -ivh pdksh-5.2.14-37.el5.x86_64.rpm

 

根据监听启动 lsnrctl start 时显示的监听配置文件路径:

[oracle@bogon ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 20-JUL-2022 17:59:23

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /opt/oracle/product/11gR2/db/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /opt/oracle/product/11gR2/db/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/bogon/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.0.2.136)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.2.136)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                20-JUL-2022 17:59:23
Uptime                    0 days 0 hr. 2 min. 7 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/11gR2/db/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/bogon/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.0.2.136)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

 

/opt/oracle/product/11gR2/db/network/admin/listener.ora

/opt/oracle/product/11gR2/db/network/admin/tnsnames.ora

修改监听配置文件(listener.ora和tnsnames.ora)中的ip地址

# tnsnames.ora Network Configuration File: /opt/oracle/product/11gR2/db/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.2.136)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
# listener.ora Network Configuration File: /opt/oracle/product/11gR2/db/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.2.136)(PORT = 1521))
    )
  )
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = orcl)
      # (ORACLE_HOME = /u01/oracle/app/oracle/product/10.2.0/db)
      (SID_NAME = orcl)
    )
  )
ADR_BASE_LISTENER = /opt/oracle

 

 

 

 

下载 监听配置文件(tnsnames.ora)到客户端instantclient路径中:

 

 

plsql配置instantclient路径,即可通过网络链接到数据库。

 

 

如果plsqldeveloper连不上,一定要检查防火墙是不是没有关闭或放开端口:

 

[root@bogon ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since 三 2022-07-20 15:31:22 CST; 2h 48min ago
     Docs: man:firewalld(1)
 Main PID: 4000 (firewalld)
    Tasks: 2
   CGroup: /system.slice/firewalld.service
           └─4000 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

7月 20 15:31:22 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
7月 20 15:31:22 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
[root@bogon ~]# systemctl stop firewalld
[root@bogon ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@bogon ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

7月 20 15:31:22 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
7月 20 15:31:22 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
7月 20 18:19:51 bogon systemd[1]: Stopping firewalld - dynamic firewall daemon...
7月 20 18:19:52 bogon systemd[1]: Stopped firewalld - dynamic firewall daemon.

 

 

 

 

 

监听遇到The listener supports no services问题,看这里:

https://blog.csdn.net/qq_39065491/article/details/120578465

 

导入impdp遇到(ORA-01917: user or role 'QUERY' does not exist)问题,看这里:

https://blog.csdn.net/qq_21271511/article/details/118495438

[oracle@bogon ~]$ impdp jlrcweb/jlrcWEB600718 dumpfile =20220718040001.dmp logfile=jlrcweb.log directory=DATA_PUMP_DIR table_exists_action=replace tables=AB01,cb20,cb21,AB0A,cc20,cc21,ca11,aa11,SYS_USER_ACCOUNT,SYS_USER_ACCOUNT_EXT,AA10,aa12,AC0D,GA02,AAD_CELL_NEW,CC22,AAD_TYPE_NEW

Import: Release 11.2.0.1.0 - Production on Wed Jul 20 14:52:56 2022

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "JLRCWEB"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
Starting "JLRCWEB"."SYS_IMPORT_TABLE_01":  jlrcweb/******** dumpfile=20220718040001.dmp logfile=jlrcweb.log directory=DATA_PUMP_DIR table_exists_action=replace tables=AB01,cb20,cb21,AB0A,cc20,cc21,ca11,aa11,SYS_USER_ACCOUNT,SYS_USER_ACCOUNT_EXT,AA10,aa12,AC0D,GA02,AAD_CELL_NEW,CC22,AAD_TYPE_NEW
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
. . imported "JLRCWEB"."SYS_USER_ACCOUNT"                16.11 MB  137842 rows
. . imported "JLRCWEB"."SYS_USER_ACCOUNT_EXT"            16.50 MB  137826 rows
. . imported "JLRCWEB"."CB21"                            37.48 MB   92484 rows
. . imported "JLRCWEB"."CC21"                            22.39 MB   89698 rows
. . imported "JLRCWEB"."CC20"                            19.08 MB  106769 rows
. . imported "JLRCWEB"."CB20"                            11.92 MB   34420 rows
. . imported "JLRCWEB"."AB01"                            11.17 MB   34419 rows
. . imported "JLRCWEB"."CC22"                            7.420 MB   24026 rows
. . imported "JLRCWEB"."AAD_CELL_NEW"                    1.896 MB    4916 rows
. . imported "JLRCWEB"."AB0A"                            1.213 MB    4622 rows
. . imported "JLRCWEB"."AC0D"                            1.067 MB    4851 rows
. . imported "JLRCWEB"."GA02"                            477.3 KB    5256 rows
. . imported "JLRCWEB"."AA12"                            350.1 KB    3786 rows
. . imported "JLRCWEB"."AA10"                            252.5 KB    3159 rows
. . imported "JLRCWEB"."AA11"                            88.31 KB     790 rows
. . imported "JLRCWEB"."CA11"                            98.49 KB     764 rows
. . imported "JLRCWEB"."AAD_TYPE_NEW"                    26.26 KB      83 rows
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."AA10" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."AA11" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."AA12" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."AAD_CELL_NEW" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."AAD_TYPE_NEW" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."AB01" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."AB0A" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."AC0D" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."CA11" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."CB20" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."CB21" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."CC20" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."CC21" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."CC22" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."GA02" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."SYS_USER_ACCOUNT" TO "QUERY"

ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'QUERY' does not exist
Failing sql is:
GRANT SELECT ON "JLRCWEB"."SYS_USER_ACCOUNT_EXT" TO "QUERY"

Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/INDEX
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/CONSTRAINT/CONSTRAINT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/COMMENT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/STATISTICS/TABLE_STATISTICS
Job "JLRCWEB"."SYS_IMPORT_TABLE_01" completed with 17 error(s) at 14:54:28

 

 

创建数据库空间:https://blog.csdn.net/starnight_cbj/article/details/6792364/

create tablespace DEMOSPACE 
datafile 'E:/oracle_tablespaces/DEMOSPACE_TBSPACE.dbf' 
size 1500M 
autoextend on next 5M maxsize 3000M;

 

posted on 2021-09-23 21:08  梓沂  阅读(276)  评论(0编辑  收藏  举报