精华内容
下载资源
问答
  • oracle 创建PWD文件
    千次阅读
    2013-08-31 20:25:12

    1. 在创建pwd文件时,不能在结尾加分号否则会出现如下错误

    [oracle@localhost pfile]$ orapwd file=$ORACLE_HOME/dbs/orapwtest.ora password=jume123456 entries =30;
    Usage: orapwd file=<fname> entries=<users> force=<y/n> ignorecase=<y/n> nosysdba=<y/n>

      where
        file - name of password file (required),
        password - password for SYS will be prompted if not specified at command line,
        entries - maximum number of distinct DBA (optional),
        force - whether to overwrite existing file (optional),
        ignorecase - passwords are case-insensitive (optional),
        nosysdba - whether to shut out the SYSDBA logon (optional Database Vault only).
       
      There must be no spaces around the equal-to (=) character.

     

    更多相关内容
  • linux/unix默认路径是$ORACLE_HOME/rdbms/admin/utlpwdmg.sql。windows路径位置可以通过搜索来获得首先我们先看一下Oracle默认安装后密码策略设置是怎样的图2通过配置文件可以发现目前密码策略中密码长度设置为不...
  • #Oracle 数据库密码工具 Oracle 数据库 12c 密码... 请注意,此脚本仅适用于“12a”协议版本,该版本是 Oracle 数据库 12.1.0.2 的最新版本。 有关 Oracle Database 12c (12.1.0.2) 中密码散列的详细信息,请参阅 。
  • 1.oracle的密码文件存在于:oracle_home/database/pwd<sid>.ora 2.使用orapwd 重置SYS密码 C:oracleproduct10.2.0db_1database>orapwd Usage: orapwd file=<fname> password=<password> entries=<users> force=<y> ...
  • 本文实例讲述了oracle跨库查询dblink的用法。分享给大家供大家参考,具体如下: 1.创建之前的工作 在创建dblink之前,首先要查看用户是否有相应的权限。针对特定的用户,使用 sqlplus user/pwd登录后,执行如下语句...
  • cx_Oracle.connect('username','pwd','IP/HOSTNAME:PORT/TNSNAME') import cx_Oracle db1=cx_Oracle.connect('yang','yang','127.0.0.1:1523/yangdb') db2=cx_Oracle.connect('yang/yang@127.0.0.1:1523/yangdb') ...
  • 本文实例讲述了Python使用cx_Oracle模块将oracle中数据导出到csv文件的方法。...connection = raw_input(Enter Oracle DB connection (uid/pwd@database) : ) orcl = cx_Oracle.connect(connection) curs = orcl.cur
  • [oracle@11g dbs]$ pwd /home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs [oracle@11g dbs]$ ll total 24 -rw-rw----. 1 oracle oinstall 1544 Mar 11 13:46 hc_orcl.dat -rw-r--r--. 1 oracle oinstall 2851 ...
  • ORACLE APEX 21.2安装及一键部署

    千次阅读 2021-11-12 15:28:54
    本文记录下从一个新环境从0开始如何安装Oralce及APEX的,...数据库:Oracle 19C Web服务器 apache-tomcat-9.0.45 ORDS:官网最新 JDK:系统自带的OPEN JDK 11 安装Oracle 19C数据库-采用RPM包形式安装 12C之前安装oracl.

    本文记录下从一个新环境从0开始如何安装Oralce及APEX的,基础知识可参考之前文章:
    https://blog.csdn.net/x6_9x/article/details/116260464?spm=1001.2014.3001.5501

    目标环境

    操作系统:CentOS7

    数据库:Oracle 19C

    Web服务器 apache-tomcat-9.0.45

    ORDS:官网最新

    JDK:系统自带的OPEN JDK 11

    安装Oracle 19C数据库-采用RPM包形式安装

    18C之前安装oracle数据库一步一步有点麻烦,要么使用图形化指导安装或者配置参数文件进行静默安装。oracle"与时俱进"自从18C开始才推出了采用rpm包安装的方式,今天我们来体验一把,只需要5个命令就能得到一个带CDB和PDB的数据库。

    配置秘钥兼容ORACLE LINUX

    wget https://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    

    配置YUM源

    wget -O /etc/yum.repos.d/oracle.repo http://public-yum.oracle.com/public-yum-ol7.repo
    wget -O /etc/yum.repos.d/epel.repo  http://mirrors.aliyun.com/repo/epel-7.repo
    yum clean all
    yum makecache
    

    安装依赖包及配置系统账号参数

    yum -y install oracle-database-preinstall-19c
    

    这个命令做了很多工作,调整内核参数、创建数据库用户和组,安装依赖包。

    安装数据库

    准备工作:将下载的rpm包放到/tmp目录下,cd到/tmp目录

    yum install -y oracle-database-ee-19c-1.0-1.x86_64.rpm
    

    安装完成后,如果需要更改默认数据文件的位置可以到 /etc/sysconfig/oracledb_ORCLCDB-19c.conf 配置文件去修改,修改完成后。可以执行数据库配置工作了。

    /etc/init.d/oracledb_ORCLCDB-19c configure
    

    上面这个脚本本质是调用DBCA进行数据库静默配置,只是官方进一步封装了,用起来更友好。

    APEX 安装

    su - oracle
    cd $ORACLE_HOME/apex
    --切换到PDB
    alter session set container=$ORACLE_PDB;
    --创建专用表空间
    CREATE TABLESPACE apex DATAFILE '$ORACLE_BASE/oradata/$ORACLE_SID/$ORACLE_PDB/apex01.dbf'
            SIZE 300M AUTOEXTEND ON NEXT 1M;
    --安装       
    @apexins.sql APEX APEX TEMP /i/
    --修改管理员密码
    @apxchpwd.sql
    --解锁APEX_PUBLIC_USER账号及密码
    ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;
    ALTER USER APEX_PUBLIC_USER IDENTIFIED BY APEX_PUBLIC_USER;
    --启用REST(设置APEX_LISTENER 和APEX_REST_PUBLIC_USER  密码)
    @apex_rest_config.sql
    --安装语言包(APEX_210200 )
    cd builder/zh-cn
    ALTER SESSION SET CURRENT_SCHEMA = APEX_210200;
    @load_zh-cn.sql
    --配置网络策略
    BEGIN
        DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
            host => '*',
            ace => xs$ace_type(privilege_list => xs$name_list('connect'),
                               principal_name => 'APEX_210200',
                               principal_type => xs_acl.ptype_db));
    END;
    /
    

    Tomcat 安装

    tar -zxvf apache-tomcat-9.0.45.tar.gz
    useradd -d /data/tomcat/home -s /bin/bash tomcat
    chown -R tomcat:tomcat /data/tomcat
    
    
    cat > /etc/systemd/system/tomcat.service << "EOF"
    [Unit]
    Description=Apache Tomcat 9 Servlet Container
    Wants=network.target
    After=network.target
    
    [Service]
    User=tomcat
    Group=tomcat
    Type=forking
    UMask=0007
    RestartSec=10
    ExecStart=/data/tomcat/apache-tomcat-9.0.45/bin/startup.sh
    ExecStop=/data/tomcat/apache-tomcat-9.0.45/bin/shutdown.sh
    SuccessExitStatus=143
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    EOF
    

    配置ORDS

    切换到tomcat用户下

    java -jar ords.war install advanced # 卸载命令是:java -jar ords.war uninstall
    

    配置如下

    This Oracle REST Data Services instance has not yet been configured.
    Please complete the following prompts
    
    
    Enter the location to store configuration data: config
    Specify the database connection type to use.
    Enter number for [1] Basic  [2] TNS  [3] Custom URL [1]:
    Enter the name of the database server [localhost]:localhost
    Enter the database listen port [1521]:
    Enter 1 to specify the database service name, or 2 to specify the database SID [1]:
    Enter the database service name:UAT
    Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step [1]:
    Enter the database password for ORDS_PUBLIC_USER:
    Confirm password:
    Requires to login with administrator privileges to verify Oracle REST Data Services schema.
    
    Enter the administrator username:sys
    Enter the database password for sys:
    Confirm password:
    Connecting to database user: sys url: jdbc:oracle:thin:@//localhost:1521/UAT
    
    Retrieving information.
    Enter the default tablespace for ORDS_METADATA [SYSAUX]:APEX_INSTALL
    Enter the temporary tablespace for ORDS_METADATA [TEMP1]:TEMP_APEX
    Enter the default tablespace for ORDS_PUBLIC_USER [SYSAUX]:APEX_INSTALL
    Enter the temporary tablespace for ORDS_PUBLIC_USER [TEMP1]:TEMP_APEX
    Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step.
    If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]:
    Enter the PL/SQL Gateway database user name [APEX_PUBLIC_USER]:APEX_PUBLIC_USER
    Enter the database password for APEX_PUBLIC_USER:
    Confirm password:
    Enter 1 to specify passwords for Application Express RESTful Services database users (APEX_LISTENER, APEX_REST_PUBLIC_USER) or 2 to skip this step [1]:
    Enter the database password for APEX_LISTENER:
    Confirm password:
    Enter the database password for APEX_REST_PUBLIC_USER:
    Confirm password:
    Enter a number to select a feature to enable:
       [1] SQL Developer Web  (Enables all features)
       [2] REST Enabled SQL
       [3] Database API
       [4] REST Enabled SQL and Database API
       [5] None
    Choose [1]:
    2021-04-22T05:43:10.479Z INFO        reloaded pools: []
    Installing Oracle REST Data Services version 20.4.3.r0501904
    ... Log file written to /home/tomcat/ords_install_core_2021-04-22_134310_00605.log
    ... Verified database prerequisites
    ... Created Oracle REST Data Services proxy user
    ... Created Oracle REST Data Services schema
    ... Granted privileges to Oracle REST Data Services
    ... Created Oracle REST Data Services database objects
    ... Log file written to /home/tomcat/ords_install_datamodel_2021-04-22_134331_00645.log
    ... Log file written to /home/tomcat/ords_install_apex_2021-04-22_134332_00859.log
    Completed installation for Oracle REST Data Services version 20.4.3.r0501904. Elapsed time: 00:00:23.882 
    
    Enter 1 if you wish to start in standalone mode or 2 to exit [1]:2
    
    

    如果在生产环境建议创建一个ORDS_INSTALL专用用户,然后用ords自带的脚本@ords_installer_privileges.sql授权,来替代用sys连接数据库,参考命令:

    create user ords_install
      identified by xxxxxx
      default tablespace APEX
      temporary tablespace TEMP_APEX;
    

    配置Tomcat

    将上一步产生的ords.war及apex的images复制到tomcat的webapps目录下,启动tomcat

    优化:一键部署

    可以考虑一键部署,参考Oracle官方封装的vagrant脚本,来源

    https://github.com/oracle/vagrant-projects/tree/main/OracleAPEX/scripts

    下面粘贴如下,可以参考学习之,看看老外是怎么写shell脚本及注释的,写的是真规范。

    安装数据库的

    #!/bin/bash
    #
    # LICENSE UPL 1.0
    #
    # Copyright © 1982-2019 Oracle and/or its affiliates. All rights reserved.
    # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
    #
    #    NAME
    #      database.sh
    #
    #    DESCRIPTION
    #      Install and Configure Oracle Database XE 18.4
    #
    #    NOTES
    #       DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    #
    #    AUTHOR
    #       Simon Coter
    #
    #    MODIFIED   (MM/DD/YY)
    #    scoter     03/19/19 - Creation
    #
    
    # set environment variables
    echo "export ORACLE_BASE=/opt/oracle" >> /home/oracle/.bashrc && \
    echo "export ORACLE_HOME=/opt/oracle/product/18c/dbhomeXE" >> /home/oracle/.bashrc && \
    echo "export ORACLE_SID=XE" >> /home/oracle/.bashrc && \
    echo "export PATH=\$PATH:\$ORACLE_HOME/bin" >> /home/oracle/.bashrc
    
    timedatectl set-timezone "$SYSTEM_TIMEZONE"
    echo 'INSTALLER: Timezone updated'
    
    echo 'INSTALLER: Environment variables set'
    
    echo 'INSTALLER: Oracle Database Installation Started up'
    
    # Install Oracle
    yum -y localinstall /vagrant/oracle-database-xe-18c-*.x86_64.rpm
    
    echo 'INSTALLER: Oracle software installed'
    
    # Auto generate ORACLE PWD if not passed on
    export ORACLE_PWD=${ORACLE_PWD:-"`openssl rand -base64 8`1"}
    
    # Create database
    mv /etc/sysconfig/oracle-xe-18c.conf /etc/sysconfig/oracle-xe-18c.conf.original && \
    cp /vagrant/ora-response/oracle-xe-18c.conf.tmpl /etc/sysconfig/oracle-xe-18c.conf && \
    chmod g+w /etc/sysconfig/oracle-xe-18c.conf && \
    sed -i -e "s|###ORACLE_CHARACTERSET###|$ORACLE_CHARACTERSET|g" /etc/sysconfig/oracle-xe-18c.conf && \
    sed -i -e "s|###ORACLE_PWD###|$ORACLE_PWD|g" /etc/sysconfig/oracle-xe-18c.conf
    
    # required for database creation
    . /home/oracle/.bashrc
    su - oracle -c "mkdir -p $ORACLE_BASE/admin"
    
    # start listener and datbase configuration
    /etc/init.d/oracle-xe-18c configure
    
    echo 'INSTALLER: Database created'
    
    # add tns entry for XEPDB1
    chmod o+r /opt/oracle/product/18c/dbhomeXE/network/admin/tnsnames.ora
    
    # add tnsnames.ora entry for PDB
    echo 'XEPDB1 =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = XEPDB1)
        )
      )
    ' >> /opt/oracle/product/18c/dbhomeXE/network/admin/tnsnames.ora
    
    echo 'INSTALLER: TNS entry added'
    
    # configure systemd to start oracle instance on startup
    systemctl daemon-reload
    systemctl enable oracle-xe-18c
    systemctl restart oracle-xe-18c
    echo "INSTALLER: Created and enabled oracle-xe-18c systemd's service"
    
    # enable global port for EM Express
    su -l oracle -c 'sqlplus / as sysdba <<EOF
       EXEC DBMS_XDB_CONFIG.SETGLOBALPORTENABLED (TRUE);
       exit
    EOF'
    
    echo 'INSTALLER: Global EM Express port enabled'
    
    echo $ORACLE_PWD > /vagrant/apex-pwd
    
    echo "ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: $ORACLE_PWD";
    
    echo "INSTALLER: Installation complete, database ready to use!";
    
    

    安装APEX的

    #!/bin/bash
    #
    # LICENSE UPL 1.0
    #
    # Copyright © 1982-2019 Oracle and/or its affiliates. All rights reserved.
    # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
    #
    #    NAME
    #      apex.sh
    #
    #    DESCRIPTION
    #      Execute Oracle Application Express installation and configuration
    #
    #    NOTES
    #       DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    #
    #    AUTHOR
    #       Simon Coter
    #
    #    MODIFIED   (MM/DD/YY)
    #    scoter     03/19/19 - Creation
    #
    
    . /home/oracle/.bashrc 
    
    export ORACLE_PWD=`cat /vagrant/apex-pwd`
    ORACLE_PDB="`ls -dl $ORACLE_BASE/oradata/$ORACLE_SID/*/ | grep -v pdbseed | awk '{print $9}' | cut -d/ -f6`"
    echo "export ORACLE_PDB=$ORACLE_PDB" >> /home/oracle/.bashrc
    
    # Install new apex release
    cd $ORACLE_HOME
    APEX_INSTALL=$(find /vagrant -maxdepth 1 -name "apex_*.*.zip" -type f | tail -1)
    
    if [[ -z ${APEX_INSTALL} || ! -r "${APEX_INSTALL}" ]]; then
      echo 'INSTALLER: Could not find APEX installer file. Exiting.'
      exit 1
    fi
    
    unzip $APEX_INSTALL
    chown -R oracle:oinstall $ORACLE_HOME/apex
    cd -
    
    echo 'INSTALLER: Updated APEX extracted to the ORACLE_HOME'
    
    # Prepare APEX tablespaces
    su -l oracle -c "sqlplus / as sysdba <<EOF
    	ALTER DATABASE DATAFILE '$ORACLE_BASE/oradata/$ORACLE_SID/system01.dbf' resize 1024m;
    	ALTER DATABASE DATAFILE '$ORACLE_BASE/oradata/$ORACLE_SID/sysaux01.dbf' resize 1024m;
    	alter session set container=$ORACLE_PDB;
    	CREATE TABLESPACE apex DATAFILE '$ORACLE_BASE/oradata/$ORACLE_SID/$ORACLE_PDB/apex01.dbf'
            SIZE 300M AUTOEXTEND ON NEXT 1M;
    	exit;
    EOF"
    
    echo 'INSTALLER: APEX tablespaces created'
    
    # Install APEX into the PDB Oracle Database
    su -l oracle -c "cd $ORACLE_HOME/apex; sqlplus / as sysdba <<EOF
    	alter session set container=$ORACLE_PDB;
    	@apexins.sql APEX APEX TEMP /i/
    	exit;
    EOF"
    
    echo 'INSTALLER: Oracle APEX Installation completed'
    
    # unlock APEX_PUBLIC_USER
    su -l oracle -c "cd $ORACLE_HOME/apex; sqlplus / as sysdba <<EOF
    	alter session set container=$ORACLE_PDB;
    	alter user APEX_PUBLIC_USER identified by \"${ORACLE_PWD}\" account unlock;
    	exit;
    EOF"
    
    # Create the APEX Instance Administration user and set the password
    su -l oracle -c "sqlplus / as sysdba <<EOF
    	alter session set container=$ORACLE_PDB;
    	begin
    	    apex_util.set_security_group_id( 10 );
    	    apex_util.create_user(
    	        p_user_name => 'ADMIN',
    	        p_email_address => 'your@emailaddress.com',
    	        p_web_password => '${ORACLE_PWD}',
    	        p_developer_privs => 'ADMIN' );
    	    apex_util.set_security_group_id( null );
    	    commit;
    	end;
    	/
    	exit;
    EOF"
    
    # config APEX REST and set the passwords of APEX_REST_PUBLIC_USER and APEX_LISTENER
    su -l oracle -c "cd $ORACLE_HOME/apex; sqlplus / as sysdba <<EOF
            alter session set container=$ORACLE_PDB;
            @apex_rest_config_core.sql $ORACLE_HOME/apex/ ${ORACLE_PWD} ${ORACLE_PWD}
            exit;
    EOF"
    
    # Create a network ACE for APEX (this is used when consuming Web services or sending outbound mail)
    cat > /tmp/apex-ace.sql << EOF
            alter session set container=$ORACLE_PDB;
            declare
                l_acl_path varchar2(4000);
                l_apex_schema varchar2(100);
            begin
                for c1 in (select schema
                             from sys.dba_registry
                            where comp_id = 'APEX') loop
                    l_apex_schema := c1.schema;
                end loop;
                sys.dbms_network_acl_admin.append_host_ace(
                    host => '*',
                    ace => xs\$ace_type(privilege_list => xs\$name_list('connect'),
                    principal_name => l_apex_schema,
                    principal_type => xs_acl.ptype_db));
                commit;
            end;
    	/
    	exit;
    EOF
    su -l oracle -c "sqlplus / as sysdba @/tmp/apex-ace.sql"
    rm -f /tmp/apex-ace.sql
    
    echo 'INSTALLER: Oracle APEX Configuration completed'
    
    

    ORDS配置

    官方的这个使用的Oracle自带的http网关,没有使用tomcat。

    #!/bin/bash
    #
    # LICENSE UPL 1.0
    #
    # Copyright © 1982-2019 Oracle and/or its affiliates. All rights reserved.
    # Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
    #
    #    NAME
    #      ords.sh
    #
    #    DESCRIPTION
    #      Execute Oracle Rest Data Services installation and configuration
    #
    #    NOTES
    #       DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    #
    #    AUTHOR
    #       Simon Coter
    #
    #    MODIFIED   (MM/DD/YY)
    #    scoter     03/19/19 - Creation
    #
    
    . /home/oracle/.bashrc 
    
    export ORACLE_PWD=`cat /vagrant/apex-pwd`
    rm -f /vagrant/apex-pwd
    
    # Install ORDS
    mkdir $ORACLE_BASE/ords
    export ORDS_HOME=$ORACLE_BASE/ords
    echo "export ORDS_HOME=$ORACLE_BASE/ords" >> /home/oracle/.bashrc
    cd  $ORDS_HOME
    ORDS_INSTALL=$(find /vagrant -maxdepth 1 -name "ords[_-]*.*.zip" -type f | tail -1)
    
    if [[ -z ${ORDS_INSTALL} || ! -r "${ORDS_INSTALL}" ]]; then
      echo 'INSTALLER: Could not find ORDS installer file. Exiting.'
      exit 1
    fi
    
    unzip $ORDS_INSTALL
    chown -R oracle:oinstall $ORDS_HOME
    
    echo 'INSTALLER: Oracle Rest Data Services extracted to ORACLE_BASE'
    
    # Create config directory
    su -l oracle -c "$ORACLE_HOME/jdk/bin/java -jar $ORDS_HOME/ords.war configdir $ORDS_HOME/config"
    su -l oracle -c "mkdir -p $ORDS_HOME/config/ords/standalone"
    su -l oracle -c "mkdir -p $ORDS_HOME/config/ords/doc_root"
    
    # Configure ORDS
    cat > $ORDS_HOME/params/ords_params.properties << EOF
    db.hostname=localhost
    db.port=1521
    # CUSTOMIZE db.servicename
    db.servicename=${ORACLE_PDB}
    db.username=APEX_PUBLIC_USER
    db.password=${ORACLE_PWD}
    migrate.apex.rest=false
    plsql.gateway.add=true
    rest.services.apex.add=true
    rest.services.ords.add=true
    schema.tablespace.default=SYSAUX
    schema.tablespace.temp=TEMP
    sys.user=sys
    sys.password=${ORACLE_PWD}
    standalone.mode=TRUE
    standalone.http.port=8080
    standalone.use.https=false
    # CUSTOMIZE standalone.static.images to point to the directory 
    # containing the images directory of your APEX distribution
    standalone.static.images=${ORACLE_HOME}/apex/images
    user.apex.listener.password=${ORACLE_PWD}
    user.apex.restpublic.password=${ORACLE_PWD}
    user.public.password=oracle
    user.tablespace.default=SYSAUX
    user.tablespace.temp=TEMP
    EOF
    
    su -l oracle -c "cd $ORACLE_HOME/apex; sqlplus / as sysdba <<EOF
            alter session set container=$ORACLE_PDB;
            alter user APEX_LISTENER identified by \"${ORACLE_PWD}\" account unlock;
            alter user APEX_REST_PUBLIC_USER identified by \"${ORACLE_PWD}\" account unlock;
            exit;
    EOF"
    
    cat > $ORDS_HOME/config/ords/standalone/standalone.properties << EOF
    jetty.port=8080
    standalone.context.path=/ords
    standalone.doc.root=$ORDS_HOME/config/ords/doc_root
    standalone.scheme.do.not.prompt=true
    standalone.static.context.path=/i
    standalone.static.path=$ORACLE_HOME/apex/images
    EOF
    
    # Fix permissions on ORDS standalone directories
    chown -R oracle:oinstall $ORACLE_BASE/ords
    
    echo 'INSTALLER: Oracle Rest Data Services configuration created'
    
    # Create and configure ORDS Database Users/Objects
    su -l oracle -c "$ORACLE_HOME/jdk/bin/java -jar $ORDS_HOME/ords.war setup --parameterFile $ORDS_HOME/params/ords_params.properties --silent"
    
    echo 'INSTALLER: Oracle Rest Data Services installation completed'
    
    # Start ORDS service
    export JAVA_HOME=$ORACLE_HOME/jdk/bin
    cat > /etc/systemd/system/ords.service << EOF
    [Unit]
    Description=Start Oracle REST Data Services
    After=oracle-xe-18c.service
    
    [Service]
    User=oracle
    ExecStart=${JAVA_HOME}/java -jar ${ORDS_HOME}/ords.war
    StandardOutput=syslog
    SyslogIdentifier=ords
    
    [Install]
    WantedBy=multi-user.target
    EOF
    systemctl enable --now ords
    echo 'INSTALLER: Oracle Rest Data Services started'
    
    echo ""
    echo "INSTALLER: APEX/ORDS Installation Completed";
    echo "INSTALLER: You can access APEX by your Host Operating System at following URL:";
    echo "INSTALLER: http://localhost:8080/ords/";
    echo "INSTALLER: Access granted with:";
    echo "INSTALLER: Workspace: internal";
    echo "INSTALLER: Username:  admin";
    echo "INSTALLER: Password:  ${ORACLE_PWD}";
    echo ""
    
    

    参考资料

    本文部分代码复制自下面文章

    https://blog.csdn.net/shilukun/article/details/107055848

    https://blog.csdn.net/bisal/article/details/100909708

    https://yum.oracle.com/getting-started.html#installing-software-from-oracle-linux-yum-server

    https://yum.oracle.com/faq.html#a10

    展开全文
  • *输入: vi_sConStr:配置格式字符串 (user/pwd@dbservname) *输出: 无 *返回: 成功解析则大于0,解析失败则小于0 *调用: 使用该函数的程序 *描述: 字符串解析 *******************************************...
  • adrci、agtctl、amdu、asmtool、asmtoolg、CreatDep、csscan、dbv、dg4odbc、dg4pwd、dgmgrl、diskmon、dsml2ldif、e2eme、emagent、emagtm、emagtmc、emdctl、emtgtctl2、exp、expdp、extjob、extjobo、extproc、...
  • 连接oracle数据库的几种方式: 语法: cx_Oracle.connect('username','pwd','IP/HOSTNAME:PORT/TNSNAME') import cx_Oracle db1=cx_Oracle.连接数据库的几种方式:语法:cx_Oracle.connect('username','pwd','IP/...

    连接oracle数据库的几种方式: 语法: cx_Oracle.connect('username','pwd','IP/HOSTNAME:PORT/TNSNAME') import cx_Oracle db1=cx_Oracle.

    连接数据库的几种方式:

    语法:cx_Oracle.connect('username','pwd','IP/HOSTNAME:PORT/TNSNAME')

    import cx_Oracle

    db1=cx_Oracle.connect('yang','yang','127.0.0.1:1523/yangdb')

    db2=cx_Oracle.connect('yang/yang@127.0.0.1:1523/yangdb')

    对于dsn 方式:makedsn(IP/HOST,PORT,TNSNAME)

    dsn=cx_Oracle.makedsn('127.0.0.1','1523','yangdb')

    db3=cx_Oracle.connect('yang','yang',dsn)

    例子:oracle@rac3:/home/oracle/python>vim conndb4.py

    import cx_Oracle

    username = "yang"

    pwd = "yang"

    --建立连接dsn=cx_Oracle.makedsn('127.0.0.1','1523','yangdb')

    db1=cx_Oracle.connect(username,pwd,dsn)

    --获取游标cursor = db1.cursor()

    --执行查询sql = "select * from tab"

    cursor.execute(sql)

    --获取数据 ,可以有多种方式 fetchall(),fetchmang(N)(N 为正整数),fetchone()result = cursor.fetchall()

    count = cursor.rowcount

    print "====================="

    print "Total:", count

    print "====================="

    for row in result:

    print row

    cursor.close

    db1.close()

    oracle@rac3:/home/oracle/python>python conndb4.py

    =====================

    Total: 9

    =====================

    ('BIG_TABLE', 'TABLE', None)

    ('BIN$sgD3dAkmWHfgQPoK8Qcq3Q==$0', 'TABLE', None)

    ('BIND', 'TABLE', None)

    ('IM_SMS_ADD_FRIEND', 'TABLE', None)

    ('PARALTAB', 'TABLE', None)

    ('T1', 'TABLE', None)

    ('T2', 'TABLE', None)

    ('T3', 'TABLE', None)

    ('T4', 'TABLE', None)

    1  分析: cx_Oracle.Cursor.parse([statement]) 在执行语句之前对其进行验证,当此类语句检测出错误的时候,会引发DatabaseError异常

    2 执行a cx_Oracle.Cursor.execute(statement,[parameters],**keyword_parameters)

    此方法可以接受单个参数--一条sql语句直接针对数据库来运行。通过parameters或keyword_parameters 参数赋值的绑定变量可以指定为字典,学列或者一组关键字参数。如果已经提供了字典或关键字参数,那么这些值将与名称绑定。如果给出的是序列,将根据这些值的位置对他们进行解析。如果是查询操作,此方法返回一个变量对象列表;如果不是则返回None

    b cx_Oracle.Cursor.executemany(statement,parameter) 对于批量插入尤其有用,因为操作的数量限制为仅仅一个。

    3 获取 仅仅适用于查询--DDL,DCL 语句不返回结果。在不执行查询的游标上,这些方法将引发InterfaceError异常

    3.1 cx_Oracle.Cursor.fetchall() 以字节组列表形式获取结果集中的所有剩余行,如果没有剩余行。它返回一个空白列表。获取操作可以通过设置游标的arraysize 属性进行调整,该属性可以设置在每个底层请求中从数据库中返回的行数。arraysize 的设置越高,需要在网络中往返传输的次数越少,arraysize 的默认值为1.

    3.2 cx_Oracle.Cursor.fetchmany(N) 从数据库中获取N行。默认为arraysize的值。如果N的值大于获取到的行的数目,该方法获取的行数是真实的行数。oracle@rac3:/home/oracle/python>cat conndb2.py

    import cx_Oracle

    username = "yang"

    pwd = "yang"

    db1=cx_Oracle.connect(username,pwd,'127.0.0.1:1523/yangdb')

    cursor = db1.cursor()

    sql = "select * from tab"

    cursor.execute(sql)

    result = cursor.fetchmany(5)

    oracle@rac3:/home/oracle/python>python conndb2.py

    =====================

    Total: 5

    =====================

    ('BIG_TABLE', 'TABLE', None)

    ('BIN$sgD3dAkmWHfgQPoK8Qcq3Q==$0', 'TABLE', None)

    ('BIND', 'TABLE', None)

    ('IM_SMS_ADD_FRIEND', 'TABLE', None)

    ('PARALTAB', 'TABLE', None)

    3.3cx_Oracle.Cursor.fetchone() 获取一个行数据,单个字节组。如果无剩余行则返回none。

    oracle@rac3:/home/oracle/python>cat conndb2.py

    import cx_Oracle

    username = "yang"

    pwd = "yang"

    db1=cx_Oracle.connect(username,pwd,'127.0.0.1:1523/yangdb')

    cursor = db1.cursor()

    sql = "select * from tab"

    cursor.execute(sql)

    result = cursor.fetchmany(1)

    count = cursor.rowcount

    print "====================="

    print "Total:", count

    print "====================="

    for row in result:

    print row

    cursor.close

    db1.close()

    oracle@rac3:/home/oracle/python>python conndb2.py

    =====================

    Total: 1

    =====================

    ('BIG_TABLE', 'TABLE', None)

    4 绑定变量模式 cx_Oracle 支持oracle绑定变量的特性bind_val={'dept_id':20,'sal':700}

    query1=cursor.execute('select * from emp where deptno=:dept_id and salary>:sal',bind_val)

    query2=cursor.execute('select * from emp where deptno=:dept_id and salary>:sal',bind_val,dept_id=20,sal=700)

    可以使用print coursor.bindnames()来查看绑定变量的值。

    oracle@rac3:/home/oracle/python>python conndb4.py

    =====================

    Total: 5

    =====================

    (7369, 'SMITH', 'CLERK', 7902, datetime.datetime(1980, 12, 17, 0, 0), 800.0, None, 20)

    (7566, 'JONES', 'MANAGER', 7839, datetime.datetime(1981, 4, 2, 0, 0), 2975.0, None, 20)

    (7788, 'SCOTT', 'ANALYST', 7566, datetime.datetime(1987, 4, 19, 0, 0), 3000.0, None, 20)

    (7876, 'ADAMS', 'CLERK', 7788, datetime.datetime(1987, 5, 23, 0, 0), 1100.0, None, 20)

    (7902, 'FORD', 'ANALYST', 7566, datetime.datetime(1981, 12, 3, 0, 0), 3000.0, None, 20)

    bind_val={'dept_id':20,'sal':700}

    cursor.execute('select * from emp where deptno=:dept_id and sal>:sal',bind_val)

    该过程使用的变量为:

    ['DEPT_ID', 'SAL']

    该文由职坐标整理并发布,了解更多相关内容,请关注职坐标Oracle数据库频道!

    展开全文
  • Oracle中password file的作用及说明
  • 登录Oracle sqlplus scott/scott@orcl sqlplus程序,scott参数一是用户名,scott参数二是密码,@分隔符后面是实例名。(Oracle的sqlplus是与oracle数据库进行交互的客户端工具,借助sqlplus可以查看、修改数据库...
    • 登录Oracle

    sqlplus scott/scott@orcl
    sqlplus程序,scott参数一是用户名,scott参数二是密码,@分隔符后面是实例名。(Oracle的sqlplus是与oracle数据库进行交互的客户端工具,借助sqlplus可以查看、修改数据库记录。在sqlplus中,可以运行sqlplus命令与sql语句。)
    超级管理员登录 sqlplus /as sysdba
    Oracle重要的服务,一个是监听,一个是实例。

    • Oracle运算符
      **关系运算符:>、<、>=、<=、<>、(!=);
      **逻辑运算符:AND、OR、NOT;
      **范围运算符:BETWEEN、AND;
      **谓词范围:IN、NOTIN
      **空判断:IS NULL、IS NOT NULL;
      **模糊查询:LIKE

    • 网络连接
      telnet是连接服务器(别的电脑)它对应的端口是23
      操作系统的端口:21 ftp,23 telnet, 80 浏览器
      ping命令是测试网络是否连通
      ping xxx.xxx.xxx.xxx或者主机名
      当前电脑的IP地址 ipconfig

    • pwd
      print work directory 显示当前目录
      ls:列出当前目录下的文件
      who:当前登录用户信息
      cp:文件复制
      mkdir:创建目录
      ls-al:列出文件的详细信息
      ls-al | grep logs :是在ls列出的文件信息中过滤名字叫logs的文件
      windows中查找信息是find
      linux 下隐藏文件是以点"."开头
      vi/view 打开一个文本文件 vi test.txt
      退出vi shift+:在:后输入q,回车,没有修改内容的退出
      more 文件名 输出文件的内容
      cp源文件 空格 目标文件 复制文件

    展开全文
  • 用Python写的Oracle数据库配置链接源码,实现数据导入导出,并新建表。数据库链接配置如IP/port/database/username/pwd等信息自行填写。
  • PAGE / NUMPAGES 如何查看Oracle 11g中OEM的访问地址已经端口号 查看/u01/app/oracle/sysman/config/perties文件获取OEM地址 [oracle@CentOS config]$ pwd /u01/app/oracle/sysman/config [oracle@CentOS config]$ ...
  • 实战篇:Linux7 安装 Oracle 19C RAC 详细图文教程

    千次阅读 多人点赞 2021-07-17 22:03:37
    sysctl -p 12、系统资源限制配置(rac01&rac02) 配置limits.conf: cat <<EOF>>/etc/security/limits.conf oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 32768 ...
  • docker-alpine-oraclejdk7 ...$ docker run --rm -v ` pwd ` :/tmp --workdir /tmp caarlos0/alpine-oraclejdk7 \ sh -c ' javac Main.java && java Main ' 运行此命令后,您将从 Java 打印“Hello World”!
  • 实战篇:SUSE 15 SP3 安装 Oracle 19C RAC 数据库

    万次阅读 多人点赞 2021-11-07 10:30:43
    从零开始 SUSE 15 SP3 安装 Oracle 19C RAC 数据库!
  • pwdpwd命令的简单用法

    千次阅读 2020-12-28 20:09:31
    在Linux系统中,pwd命令用作显示工作目录的复路径名称,全称是“PrintWorkingDirectory”。在科研领域,pwd可看作是“PeopleWithDisabiliy”的缩写,意思是残疾人制。pwd还可以表示压力随钻监测系统或者物理媒介相关...
  • mysql有limit,分页的时候,我们可以用limit 30,40,而oracle没有limit,用其他的方法来代替--rownum. 一、底层方法 /** * 数据连接 */ function connect($db_user, $db_pwd, $db_name, $db_nls) { $this->dbh ...
  • 1. pwd 显示当前文件的路径2.cdcd /path/to 绝对路径cd ./path/to 相对路径cd ../path/to 相对路径绝对路径和相对路径3.ls 查看目录下有哪些文件 显示不同颜色的文件夹表示被赋予了不同的权限4.如果命令的终端里 ...
  • 使用docker 安装oracle12c

    2020-12-14 18:29:58
    环境:centos7,Docker 20.10.0,安装oracle12c 1查找 Oracle 镜像docker search oracle 选择了 truevoly/oracle-12c镜像 ...docker run -d --name oracle -m 1g -p 8080:8080 -p 1521:1521 -v $PWD/data:/mn
  • 本文介绍在Oracle和MySQL上安装hr示例数据库的方法,和在Oracle上安装example示例数据库的方法,以及Scott示例数据库的安装方法。
  • 列出顶部的Windows线程。 例如,在Windows上使用oracle时非常有用,其中oracle是一个具有多个线程的大进程(而Windows任务管理器不显示进程的线程...)。 如果传递了odbc连接... PWD = manager; -p oracle --sort = 2
  • Oracle学习笔记(四)

    2020-12-16 07:20:28
    例:create user user_1 indentified by pwd_1 alter user user_1 identified by pwd_2 2、给用户授予权限 grant privilege[,privilege] to user [,user|role,public…] 一些系统权限: create session/table/...
  • CREATE OR REPLACE FUNCTION "F_GET_COMPILE_PWD"(login_name varchar2) RETURN VARCHAR2 as /*** 用sys登录,执行 grant execute on DBMS_CRYPTO to username; --将DBMS_CRYPTO授权给username或其他用户MD5...
  • 借助Oracle数据库交互客户端工具sqlplussqlplus连接数据库的常用四种方式详见http://www.2cto.com/database/201307/226125.html本文中均采用万金油的远程连接oracle命令方式作为例子。1. 使用sqlplus进入cmd模式后...
  • docker-alpine-oraclejdk7-mvn 该镜像基于 Alpine Linux 镜像,只有 5MB 镜像,并且包含捆绑了 3.2.5 的 ...$ docker run --rm -v ` pwd ` :/tmp --workdir /tmp caarlos0/alpine-oraclejdk7-mvn \ mvn clean install
  • 使用cx_Oracle将数据写入Oracle数据库

    千次阅读 2019-03-22 14:26:33
    # coding=utf-8 import cx_Oracle import os import json os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8' """python version 3.7""" ...class TestOracle(object)... def __init__(self,user,pwd,ip,p...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 50,490
精华内容 20,196
热门标签
关键字:

oracle pwd