简体   繁体   English

如何使用 node.js 在 PRELIM_AUTH 模式下连接到 SYSOPER 或 SYSDBA 中的 oracle 12C 数据库

[英]how to connect to a oracle 12C database in SYSOPER or SYSDBA in PRELIM_AUTH mode using node.js

I am trying to start the server from my node.js application using npm's oracledb package.我正在尝试使用 npm 的 oracledb 包从我的 node.js 应用程序启动服务器。 But In order to do that I need to connect to the database in PRELIM_AUTH mode with SYSOPER or SYSDBA privileges.但是为了做到这一点,我需要使用 SYSOPER 或 SYSDBA 权限以 PRELIM_AUTH 模式连接到数据库。

Below is the sample code:下面是示例代码:

var oracledb = require('oracledb');
var dbConfig = require('./dbconfig.js');

oracledb.getConnection(
  {
    user          : dbConfig.user,
    password      : dbConfig.password,
    connectString : dbConfig.connectString
  },
  async function(err, connection) {
    if (err) {
      console.error(err.message);
      return;
    }
    console.log('Connection was successful!');
    await connection.startup();
    connection.close(
      function(err) {
        if (err) {
          console.error(err.message);
          return;
        }
      });
  });

There's currently (in node-oracledb 2) no support for PRELIM_AUTH mode.目前(在 node-oracledb 2 中)不支持 PRELIM_AUTH 模式。 Please open an enhancement request on GitHub .请在GitHub 上打开增强请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM