yum install -y gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel automake autoconf libtool make
tar -xvf ./nginx-1.24.0.tar.gz
cd ./nginx
# 编译
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-stream
# 安装
make && make install
cd /usr/local/nginx
./sbin/nginx -c ./conf/nginx.conf
# 启动nginx
./sbin/nginx -c ./conf/nginx.conf
# 停止
./sbin/nginx -s stop
# 修改配置文件后重新加载配置文件
# 检测配置文件是否有错
./sbin/nginx -t
# 重新加载配置
./sbin/nginx -s reload
以上配置oracle代理时候可能会出现
unknown directive “stream” in /usr/local/nginx/conf/nginx.conf 报错
进入nginx文件解压目录,进行编译、安装,通过添加–with-stream参数指定安装stream模块。
[root@localhost nginx-1.12.2]# ./configure --with-stream
[root@localhost nginx-1.12.2]# make & make install
再次检查nginx.conf配置文件,确认配置无语法错误后,再次尝试启动服务。
[root@localhost sbin]# ./nginx
chmod 777 /home/mymount/oracle23c/oradata
docker run -d \
-p 1522:1521 -p 5501:5500 \
-e ORACLE_PDB=PDB \
-e ORACLE_PWD=123456 \
-e ORACLE_EDITION=standard \
-e ORACLE_CHARACTERSET=AL32UTF8 \
-v /home/mymount/oracle23c/oradata:/opt/oracle/oradata \
--name oracle23 \
container-registry.oracle.com/database/free:latest
docker logs -tf oracle23
6.进入容器
docker exec -it oracle23 bash
7.启动oracle
输入sqlplus 然后会提示你输入账号密码 或者直接输入
sqlplus / as sysdba
8.查询有哪些pdb库
select name,open_mode from v$pdbs;
9.然后切换到除了pdb开头的数据库
alter session set container=FREEPDB1;
10 .查找用户
select userName from dba_users;
11查看有哪些表空间
select tableSpace_name from Dba_tablespaces;
12 删除用户以及表结构(参照:https://blog.csdn.net/daxiang52/article/details/50408312)
drop user ZS_EDU cascade;
create temporary tablespace eduTem tempfile '/opt/oracle/oradata6' size 50m autoextend on next 50m maxsize 20480m extent management local;
14创建表空间(查看有哪些表空间select tableSpace_name from Dba_tablespaces;)
create tablespace edu logging datafile '/opt/oracle/oradata7' size 50m autoextend on next 50m maxsize 20480m extent management local;
17 删除表空间 Oracle删除表空间语法结构:(https://www.php.cn/faq/489137.html)
drop tablespace tab_name [including contents][cascade constraints]
案例、删除student表空间,并删除表空间的数据文件和完整性
drop tablespace student including contents cascade constraints;
create user zs_edu identified by zsShang default tablespace edu temporary tablespace eduTem;
grant connect,resource,dba to 用户名;
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
stream {
upstream oracle {
server 128.0.0.1:1522 weight=1 max_fails=2 fail_timeout=30s;
}
server {
listen 9003;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass oracle;
}
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
server {
listen 19003;
server_name localhost;
charset utf-8;
location /edu-evaluate {
proxy_pass http://localhost:8080/renren-admin/;
}
location / {
alias /home/edu/edu-evaluate-vue/dist/;
index index.html index.htm;
}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}