华为云oracle11.2.4安装

db1:
ip:10.240.0.109
sid:suzhi1
端口:1521
用户名密码:
create user USER624 identified by USER624 default tablespace users;
create user LE006A53201 identified by LE006A53201 default tablespace users;
create user KAIDUN identified by KAIDUN default tablespace users;
create user PD5516 identified by PD5516 default tablespace users;
create user LE008A55101 identified by LE008A55101 default tablespace users;
create user LE001A72801 identified by LE001A72801 default tablespace users;
create user LE004A79101 identified by LE004A79101 default tablespace users;
create user LE005A57401 identified by LE005A57401 default tablespace users;
create user DA5516 identified by DA5516 default tablespace users;
create user KDUSER identified by KDUSER default tablespace users;
create user LE003A51202 identified by LE003A51202 default tablespace users;
create user LE002A51201 identified by LE002A51201 default tablespace users;
create user PROD5516 identified by PROD5516 default tablespace users;
create user LE007A02501 identified by LE007A02501 default tablespace users;

 

create tablespace PD5516 datafile '/u01/app/oracle/oradata/suzhi1/PD5516.dbf' size 20G autoextend off;
create tablespace PRODDTA datafile '/u01/app/oracle/oradata/suzhi1/PRODDTA.dbf' size 20G autoextend off;
create tablespace TEST_T datafile '/u01/app/oracle/oradata/suzhi1/TEST_T.dbf' size 20G autoextend off;
create tablespace TLE001A72801 datafile '/u01/app/oracle/oradata/suzhi1/TLE001A72801.dbf' size 20G autoextend off;
create tablespace TLE002A51201 datafile '/u01/app/oracle/oradata/suzhi1/TLE002A51201.dbf' size 20G autoextend off;
create tablespace TLE003A51202 datafile '/u01/app/oracle/oradata/suzhi1/TLE003A51202.dbf' size 20G autoextend off;
create tablespace TLE004A79101 datafile '/u01/app/oracle/oradata/suzhi1/TLE004A79101.dbf' size 20G autoextend off;
create tablespace TLE005A57401 datafile '/u01/app/oracle/oradata/suzhi1/TLE005A57401.dbf' size 20G autoextend off;
create tablespace TLE006A53201 datafile '/u01/app/oracle/oradata/suzhi1/TLE006A53201.dbf' size 20G autoextend off;
create tablespace TLE007A02501 datafile '/u01/app/oracle/oradata/suzhi1/TLE007A02501.dbf' size 20G autoextend off;
create tablespace TLE008A55101 datafile '/u01/app/oracle/oradata/suzhi1/TLE008A55101.dbf' size 20G autoextend off;

 

alter tablespace PD5516 add datafile '/u01/app/oracle/oradata/suzhi1/PD551603.dbf' size 30G;

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

db2:
ip:10.240.0.55
sid:suzhi2
端口:1521

create user LE888A02101 identified by LE888A02101;
create user LE011A57101 identified by LE011A57101;
create user LE013A02901 identified by LE013A02901;
create user LE028A03572 identified by LE028A03572;
create user LE024A59201 identified by LE024A59201;
create user LE010A51302 identified by LE010A51302;
create user KDF4 identified by KDF4;
create user LE014A05101 identified by LE014A05101;
create user LE025A51901 identified by LE025A51901;
create user LE012A02502 identified by LE012A02502;
create user LE016A81301 identified by LE016A81301;
create user LE021A58001 identified by LE021A58001;
create user LE020A95101 identified by LE020A95101;
create user LE009A51301 identified by LE009A51301;
create user LE026A57102 identified by LE026A57102;
create user LE015A51203 identified by LE015A51203;
create user PROD5516 identified by PROD5516;
create user LE018A57301 identified by LE018A57301;
create user LE019A43101 identified by LE019A43101;
create user LE017A53501 identified by LE017A53501;
create user LE027A51001 identified by LE027A51001;
create user LE022A03571 identified by LE022A03571;
create user LE023A55201 identified by LE023A55201;

 

create tablespace PD5516 datafile '/u01/app/oracle/oradata/suzhi2/PD5516.dbf' size 20G autoextend off;
create tablespace TESTKDF4 datafile '/u01/app/oracle/oradata/suzhi2/TESTKDF4.dbf' size 20G autoextend off;
create tablespace TLE009A51301 datafile '/u01/app/oracle/oradata/suzhi2/TLE009A51301.dbf' size 20G autoextend off;
create tablespace TLE010A51302 datafile '/u01/app/oracle/oradata/suzhi2/TLE010A51302.dbf' size 20G autoextend off;
create tablespace TLE011A57101 datafile '/u01/app/oracle/oradata/suzhi2/TLE011A57101.dbf' size 20G autoextend off;
create tablespace TLE012A02502 datafile '/u01/app/oracle/oradata/suzhi2/TLE012A02502.dbf' size 20G autoextend off;
create tablespace TLE013A02901 datafile '/u01/app/oracle/oradata/suzhi2/TLE013A02901.dbf' size 20G autoextend off;
create tablespace TLE014A05101 datafile '/u01/app/oracle/oradata/suzhi2/TLE014A05101.dbf' size 20G autoextend off;
create tablespace TLE015A51203 datafile '/u01/app/oracle/oradata/suzhi2/TLE015A51203.dbf' size 20G autoextend off;
create tablespace TLE016A81301 datafile '/u01/app/oracle/oradata/suzhi2/TLE016A81301.dbf' size 20G autoextend off;
create tablespace TLE017A53501 datafile '/u01/app/oracle/oradata/suzhi2/TLE017A53501.dbf' size 20G autoextend off;
create tablespace TLE018A57301 datafile '/u01/app/oracle/oradata/suzhi2/TLE018A57301.dbf' size 20G autoextend off;
create tablespace TLE019A43101 datafile '/u01/app/oracle/oradata/suzhi2/TLE019A43101.dbf' size 20G autoextend off;
create tablespace TLE020A95101 datafile '/u01/app/oracle/oradata/suzhi2/TLE020A95101.dbf' size 20G autoextend off;
create tablespace TLE021A58001 datafile '/u01/app/oracle/oradata/suzhi2/TLE021A58001.dbf' size 20G autoextend off;
create tablespace TLE022A03571 datafile '/u01/app/oracle/oradata/suzhi2/TLE022A03571.dbf' size 20G autoextend off;
create tablespace TLE023A55201 datafile '/u01/app/oracle/oradata/suzhi2/TLE023A55201.dbf' size 20G autoextend off;
create tablespace TLE024A59201 datafile '/u01/app/oracle/oradata/suzhi2/TLE024A59201.dbf' size 20G autoextend off;
create tablespace TLE025A51901 datafile '/u01/app/oracle/oradata/suzhi2/TLE025A51901.dbf' size 20G autoextend off;
create tablespace TLE026A57102 datafile '/u01/app/oracle/oradata/suzhi2/TLE026A57102.dbf' size 20G autoextend off;
create tablespace TLE027A51001 datafile '/u01/app/oracle/oradata/suzhi2/TLE027A51001.dbf' size 20G autoextend off;
create tablespace TLE028A03572 datafile '/u01/app/oracle/oradata/suzhi2/TLE028A03572.dbf' size 20G autoextend off;
create tablespace TLE888A02101 datafile '/u01/app/oracle/oradata/suzhi2/TLE888A02101.dbf' size 20G autoextend off;

 

alter tablespace PD5516 add datafile '/u01/app/oracle/oradata/suzhi2/PD551602.dbf' size 30G;

 

导入:

/u01/app/oracle/admin/suzhi1/dpdump/

cp DB1.DMP /u01/app/oracle/admin/suzhi1/dpdump/

impdp alex/alex dumpfile=DB1.DMP full=y logfile=alex.log

 

impdp alex/alex dumpfile=DB2.DMP full=y logfile=blex.log

 

创建用户:

create user prod5516 identified by prod5516;

授权:

grant dba to prod5516;

 

凯顿导入:

imp prod5516/prod5516 FILE=prod55162023_09_04_23H55M01S.dmp LOG=/tmp/ALEX.LOG FULL=Y GRANTS=N DESTROY=Y BUFFER=409600000 STATISTICS=RECALCULATE

查用户表空间大小:

select * from (
Select a.tablespace_name,
(a.bytes- b.bytes) "表空间使用大小(BYTE)",
a.bytes/(1024*1024*1024) "表空间大小(GB)",
b.bytes/(1024*1024*1024) "表空间剩余大小(GB)",
(a.bytes- b.bytes)/(1024*1024*1024) "表空间使用大小(GB)",
to_char((1 - b.bytes/a.bytes)*100,'99.99999') || '%' "使用率"
from (select tablespace_name,
sum(bytes) bytes
from dba_data_files
group by tablespace_name) a,
(select tablespace_name,
sum(bytes) bytes
from dba_free_space
group by tablespace_name) b
where a.tablespace_name = b.tablespace_name
union all
select c.tablespace_name,
d.bytes_used "表空间使用大小(BYTE)",
c.bytes/(1024*1024*1024) "表空间大小(GB)",
(c.bytes-d.bytes_used)/(1024*1024*1024) "表空间剩余大小(GB)",
d.bytes_used/(1024*1024*1024) "表空间使用大小(GB)",
to_char(d.bytes_used*100/c.bytes,'99.99999') || '%' "使用率"
from
(select tablespace_name,sum(bytes) bytes
from dba_temp_files group by tablespace_name) c,
(select tablespace_name,sum(bytes_cached) bytes_used
from v$temp_extent_pool group by tablespace_name) d
where c.tablespace_name = d.tablespace_name
)
order by tablespace_name

 

增加用户表空间:

alter tablespace users add datafile '/u01/app/oracle/oradata/suzhi/users06.dbf' size 30G;

 

centos7.9

32核64g200g2T

hostnamectl set-hostname o11g

echo "10.240.0.200 o11g" >>/etc/hosts

wget https://ecs-instance-driver.obs.cn-north-1.myhuaweicloud.com/datadisk/LinuxVMDataDiskAutoInitialize.sh

bash LinuxVMDataDiskAutoInitialize.sh 

 

 

 

yum groupinstall -y 'Server with GUI'

yum install -y tigervnc-server

systemctl stop firewalld

systemctl disable firewalld

vim /etc/sysconfig/selinux         #SELINUXTYPE=minimum

groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba,oper oracle
echo redhat | passwd --stdin oracle
mkdir -p /u01/app
chown -R oracle.oinstall /u01/app
chmod -R 775 /u01/app
cd /
wget p13390677_112040_Linux-x86-64_1of7.zip
wget p13390677_112040_Linux-x86-64_2of7.zip
unzip p13390677_112040_Linux-x86-64_1of7.zip
unzip p13390677_112040_Linux-x86-64_2of7.zip
 
dd if=/dev/zero of=/swap bs=1M count=17384
mkswap /swap
vim /etc/sysctl.conf
vm.swappiness=60
sysctl -p
swapon /swap
echo "/swap swap swap defaults    0  0" >> /etc/fstab
reboot
 
su - oracle
vncpasswd  #oracle
vncserver
然后vnc viwere连
 
oracle用户图形界面:
/database/runInstaller  -jreLoc /etc/alternatives/jre_1.8.0 

 加入中文语言

enterprise Edition

 

 

 

root用户执行:
yum install gcc libaio-devel compat-libstdc++-33 elfutils-libelf-devel glibc-devel glibc-headers gcc-c++ libstdc++-devel pdksh
wget -O /tmp/pdksh-5.2.14-37.el5_8.1.x86_64.rpm http://vault.centos.org/5.11/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm
rpm -ivh /tmp/pdksh-5.2.14-37.el5_8.1.x86_64.rpm 
点fix and Check again:
root用户执行修复程序:

 root执行完,再点ok

然后点ignore

 点install

安装中碰到报错:
vi /u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk
$(MK_EMAGENT_NMECTL) -lnnz11
然后点retry
 
最后用root执行两个脚本:

 bash /u01/app/oraInventory/orainstRoot.sh 

bash /u01/app/oracle/product/11.2.0/dbhome_1/root.sh

安装完成

oracle 用户执行:
vim ~/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
source .bash_profile
 
图形界面oracle用户登录,使用dbca创建数据库:
sid :suzhi

 em没打勾

这里密码oracle

 

 

 

 

 完成

 

配置网络

netca

lsnrctl start

lsnrctl stop
 
测试:linux用户oracle
export ORACLE_SID=suzhi
sqlplus / as sysdba
新建用户:
create user alex identified by alex;

grant dba to alex;

 
 
posted @ 2023-09-22 11:34  alexhe  阅读(82)  评论(0编辑  收藏  举报