欧拉OpenEuler 22.03使用rpm包安装Oracle19c

教育   2024-11-20 20:55   陕西  

环境

 1docker rm -f lhropeneulerora19c
2docker run -itd --name lhropeneulerora19c -h lhropeneulerora19c \
3  -p 1621:1521 -p 3189:3389 \
4  -v /sys/fs/cgroup:/sys/fs/cgroup \
5  --restart=always \
6  --privileged=true lhrbest/openeuler22:6.0 \
7  /usr/sbin/init
8
9
10docker cp /soft/oracle/oracle-database-ee-19c-1.0-1.x86_64.rpm lhropeneulerora19c:/soft/
11
12
13[root@lhropeneulerora19c soft]# cat /etc/os-release 
14NAME="openEuler"
15VERSION="22.03 LTS"
16ID="openEuler"
17VERSION_ID="22.03"
18PRETTY_NAME="openEuler 22.03 LTS"
19ANSI_COLOR="0;31"

安装

1-- https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/index.html
2dnf install -y compat-libcap1 compat-libstdc++-33  #可从centos7系统镜像中拷贝
3
4rpm -ivh rlwrap-0.43-2.el7.x86_64.rpm --nodeps
5
6
7rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm --nodeps
8rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm

日志:

 1[root@lhropeneulerora19c soft]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm --nodeps
2warning: oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
3Verifying...                          ################################# [100%]
4Preparing...                          ################################# [100%]
5Updating / installing...
6   1:oracle-database-preinstall-19c-1.################################# [100%]
7[root@lhropeneulerora19c soft]# ll
8total 2631532
9-rw-r--r-- 1 root root 2694664264 May 10  2024 oracle-database-ee-19c-1.0-1.x86_64.rpm
10-rw-r--r-- 1 root root      18204 Nov 20 14:12 oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
11[root@lhropeneulerora19c soft]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm 
12warning: oracle-database-ee-19c-1.0-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
13Verifying...                          ################################# [100%]
14Preparing...                          ################################# [100%]
15Updating / installing...
16   1:oracle-database-ee-19c-1.0-1     ################################# [100%]
17[INFO] Executing post installation scripts...
18[INFO] Oracle home installed successfully and ready to be configured.
19To configure a sample Oracle Database you can execute the following service configuration script as root: /etc/init.d/oracledb_ORCLCDB-19c configure
20[root@lhropeneulerora19c soft]

初始化数据库

参数文件:/etc/init.d/oracledb_ORCLCDB-21c/etc/sysconfig/oracledb_ORCLCDB-21c.conf

1/etc/init.d/oracledb_ORCLCDB-19c configure #也可以重启数据库

此过程即静默建库的过程,我们也可以使用DBCA命令来直接创建数据库。

日志:

 1[root@lhropeneulerora19c soft]# /etc/init.d/oracledb_ORCLCDB-19c configure
2Configuring Oracle Database ORCLCDB.
3Prepare for db operation
48complete
5Copying database files
631complete
7Creating and starting Oracle instance
832complete
936complete
1040complete
1143complete
1246complete
13Completing Database Creation
1451complete
1554complete
16Creating Pluggable Databases
1758complete
1877complete
19Executing Post Configuration Actions
20100complete
21Database creation complete. For details check the logfiles at:
22 /opt/oracle/cfgtoollogs/dbca/ORCLCDB.
23Database Information:
24Global Database Name:ORCLCDB
25System Identifier(SID):ORCLCDB
26Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.
27
28Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database using 'sqlplus / as sysdba' as the oracle user.
29[root@lhropeneulerora19c soft]

配置数据库

 1-- 环境变量
2cat  >>  /home/oracle/.bash_profile << "EOF"
3
4export ORACLE_SID=ORCLCDB
5export ORACLE_BASE=/opt/oracle
6export ORACLE_HOME=$ORACLE_BASE/product/19c/dbhome_1
7export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib 
8export PATH=$ORACLE_HOME/bin:$PATH
9export TNS_ADMIN=$ORACLE_HOME/network/admin
10
11export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
12export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
13
14alias sqlplus='rlwrap sqlplus'
15alias rman='rlwrap rman'
16alias asmcmd='rlwrap asmcmd'
17alias sas='sqlplus / as sysdba'
18
19EOF
20
21source /home/oracle/.bash_profile
22
23cat >> $ORACLE_HOME/sqlplus/admin/glogin.sql << "EOF"
24
25set linesize 9999 pagesize 9999
26set sqlprompt "_USER'@'_CONNECT_IDENTIFIER> "
27
28EOF
29
30
31
32
33
34ln -s /usr/lib64/libtinfo.so.6.3  /usr/lib64/libtinfo.so.5
35
36echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
37
38
39
40alter pluggable database orclpdb1 open;
41alter pluggable database all save state;
42
43
44
45
46alter user sys identified by lhr;
47
48alter system set sga_max_size=2scope=spfile;
49alter system set pga_aggregate_target=100m;
50startup force
51alter system set sga_target=1g;
52
53
54https://192.168.8.8:5500/em
55
56
57--修改EM的展现方式
58@?/rdbms/admin/execemx emx




AiDBA
【PostgreSQL培训认证】【Oracle OCP、OCM、高可用(RAC+DG+OGG)培训认证】【MySQL OCP培训认证】【GreenPlum培训】【SQL Server培训】官网:www.dbaup.com,学习不止数据库
 最新文章