当前位置:网站首页>Installing Oracle EE

Installing Oracle EE

2022-07-01 08:45:00 sirwsl

In the early

Enter the directory you need to set , Create folder , Folder Authorization

mkdir xxx
chmod o+w /oracle/oradata
chmod 777 /oracle/oradata

install ORACLE EE

1: Find image

docker search oracle19c

2: Select the appropriate mirror

docker pull heartu41/oracle19c

3: function

docker run -p 1521:1521 -p 5500:5500 \
--name oracletest \
--privileged=true \
--restart=always \
-e ORACLE_SID=ORCL \
-e ORACLE_PDB=ORCLTEST \
-e ORACLE_PWD=123456 \
-e ORACLE_CHARACTERSET=AL32UTF8 \
-e ORACLE_BASE=/opt/oracle \
-e ORACLE_EDITION=standard \
-e ORACLE_HOME=/opt/oracle/product/19c/dbhome_1 \
-e ORACLE_ALLOW_REMOTE=true \
-e TZ=Asia/Chongqing \
-e PATH=/opt/oracle/product/19c/dbhome_1/bin:/opt/oracle/product/19c/dbhome_1/OPatch/:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
-e NLS_LANG=AMERICAN_AMERICA.AL32UTF8 \
NLS_DATE_LANGUAGE
-it \
-v /data/oracle/oradata:/opt/oracle/oradata \
-d f59790109034 

see :

 docker logs -ft oracletest

4: Check whether the time zone setting is effective

docker exec -it oracletest date +"%Z %z"

5: Into the container

docker exec -it oracletest /bin/bash

6: Change Password

./setPassword.sh 123456

7: Set up PDB

grep $ORACLE_HOME /etc/oratab | cut -d: -f1
export ORACLE_SID=ORCL

8: Connect to database

sqlplus / as sysdba

10: Cancel restricted mode

 alter system disable restricted session;

9: perform

alter session set "_ORACLE_SCRIPT"=true; 

9: see

show pdbs;

image-20220518004536828

10: Authorization of tablespaces after schema creation

 ALTER USER    user name  QUOTA UNLIMITED ON  Table space 

11 If you need to modify the character set or environment variables

Inquire about :

SELECT USERENV('language') FROM dual; 

Install vim

docker exec -it --user root oracletest /bin/bash
yum install vim

Edit the file

vim ~/.bash_profile

add to

export NLS_LANG="SIMPLIFIED CHINESE_CHINA".ZHS16GBK
or
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
or
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

Load the file

source ~/.bash_profile

modify oracle Parameter form

select * from v$nls_parameters;

image-20220527023344358

Create a user table space

--  Remove tablespaces 
DROP TABLESPACE HTHSETEMP INCLUDING CONTENTS AND DATAFILES

--  Remove users 
drop user HSE_TEMP CASCADE

--  Create tablespace 
CREATE TABLESPACE NTHSETESTPSPACE
DATAFILE '/opt/oracle/oradata/ORCL/ORCLTEST/NTHSETESTPSPACE.dbf' 
SIZE 20G AUTOEXTEND ON next 4G

--  Create user 
CREATE USER HSE_TEMP IDENTIFIED  BY 000000

---  Change Password 
alter user  user name  identified by  New password ; 

--  Modify user tablespaces 
ALTER USER HSE_TEMP quota unlimited ON HTHSETEMP

--  The practical application 
create user <username> identified by <password> 
default tablespace <tablespace_name> --  Default tablespace 
temporary tablespace temp --  Temporary table space 
quota unlimited on <tablespace_name> --  Table space quota 

--  Permission settings 
grant create session to HSE_TEMP
grant create table to HSE_TEMP
grant create tablespace to HSE_TEMP;
grant create any view to HSE_TEMP;
grant connect,resource to HSE_TEMP;
grant create any sequence to HSE_TEMP;
grant create any table to HSE_TEMP;
grant delete any table to HSE_TEMP;
grant insert any table to HSE_TEMP;
grant select any table to HSE_TEMP;
grant unlimited tablespace to HSE_TEMP;
grant execute any procedure to HSE_TEMP;
grant update any table to HSE_TEMP;

--  View the permissions of the current user 
select * from role_sys_privs;


Common commands

startup mount  # start-up 
shutdown immediate;  close 
sqlplus / as sysdba   Get into 
 lsnrctl status  Check the listening status 
 lsnrctl start   Turn on monitoring 
 lsnrctl reload   restart 
 lsnrctl stop   stop it 

Other questions

problem

cannot mount database in EXCLUSIVE mode

solve :

cd $ORACLE_HOME/dbs
ls lk*
rm lk*

problem

ORA-00205: error in identifying control file, check alert log for more info   : (

solve

ipcs -s
ipcrm -s semid-NO.

problem

ORA-00214: control file '/opt/oracle/oradata/ORCL/control01.ctl' version 2647
inconsistent with file '/opt/oracle/oradata/ORCL/control02.ctl' version 2613

solve

cd /opt/oracle/oradata/ORCL/
ls
cp control01.ctl control02.ctl


原网站

版权声明
本文为[sirwsl]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/182/202207010838599732.html