目录

Tag: Oracle

解决 ORACLE 修改表字段NUMBER精度报错

错误:column to be modified must be empty to decrease precision or scale

出现这样的错误,是由于 ORACLE 数据引擎不允许存在拥有数据的情况下,进行精度修改。于是可以按照以下方法进行解决

解决方案

步骤 1 :备份原来的表

CREATE TABLE MY_BAK AS SELECT * FROM YOUR_TABLE;

步骤 2 :删除原来的表数据

DELETE FROM YOUR_TABLE;

步骤 3:

手动进行相应的字段精度修改,比如 Navicat / PL SQL 工具。

步骤 4:恢复数据

INSERT INTO YOUR_TABLE SELECT * FROM MY_BAK;

以上操作即可完美修改 Number 的精度,并且保留现有的数据。

.Net Core 访问Oracle的连接字符串

  1. Nuget 搜索安装: Oracle.ManagedDataAccess.Core
  2. 使用以下代码即可连接
// 连接字符串 string cnnStr = "User ID=ITGFS;Password=itsds#oracle;Data Source=\"(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 118.13.222.237)(PORT = 1521)))(CONNECT_DATA = (SERVICE_NAME = ORCL)))\";"; // 连接对象 OracleConnection cnn = new OracleConnection(cnnStr); // 测试连接 cnn.Open(); cnn.Close();

通过以上代码就可以成功连接到 Oracle 服务器了,实际上 Nuget 搜索安装的包也就是 Oracle 为 .Net Core 提供的专用连接客户端。

运行电脑无需再安装其他的客户端即可运行。

oracle10G/11G官方下载地址集合 直接迅雷下载

Oracle Database 11g Release 2 (11.2.0.1.0) for Microsoft Windows (64-bit)

http://download.oracle.com/otn/nt/oracle11g/112010/win64_11gR2_database_1of2.zip

http://download.oracle.com/otn/nt/oracle11g/112010/win64_11gR2_database_2of2.zip

http://download.oracle.com/otn/nt/oracle11g/112010/win64_11gR2_client.zi

http://download.oracle.com/otn/nt/oracle11g/112010/win64_11gR2_grid.zip

Oracle Database 11g Release 2 (11.2.0.1.0) for Microsoft Windows (32-bit)

http://download.oracle.com/otn/nt/oracle11g/112010/win32_11gR2_database_1of2.zip

http://download.oracle.com/otn/nt/oracle11g/112010/win32_11gR2_database_2of2.zip

http://download.oracle.com/otn/nt/oracle11g/112010/win32_11gR2_client.zip

Oracle Database 11g Release 2 (11.2.0.1.0) for Microsoft Windows (64-bit)

http://download.oracle.com/otn/nt/oracle11g/112010/win64_11gR2_database_1of2.zip

http://download.oracle.com/otn/nt/oracle11g/112010/win64_11gR2_database_2of2.zip

http://download.oracle.com/otn/nt/oracle11g/112010/win64_11gR2_client.zip

http://download.oracle.com/otn/nt/oracle11g/112010/win64_11gR2_grid.zip

Oracle Database 11g Release 2 (11.2.0.1.0) for Microsoft Windows (32-bit)

http://download.oracle.com/otn/nt/oracle11g/112010/win32_11gR2_database_1of2.zip

http://download.oracle.com/otn/nt/oracle11g/112010/win32_11gR2_database_2of2.zip

http://download.oracle.com/otn/nt/oracle11g/112010/win32_11gR2_client.zip

Oracle Database 11g Release 2 (11.2.0.1.0) for Linux x86

http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_1of2.zip

http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_2of2.zip

http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_client.zip

http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_grid.zip

Oracle Database 11g Release 2 (11.2.0.1.0) for Linux x86-64

http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip

http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip

http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_client.zip

http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_grid.zip

Oracle Database 11g Release 2 (11.2.0.1.0) for Solaris Operating System (SPARC) (64-bit)

http://download.oracle.com/otn/solaris/oracle11g/R2/solaris.sparc64_11gR2_database_1of2.zip

http://download.oracle.com/otn/solaris/oracle11g/R2/solaris.sparc64_11gR2_database_2of2.zip

http://download.oracle.com/otn/solaris/oracle11g/R2/solaris.sparc64_11gR2_client.zip

http://download.oracle.com/otn/solaris/oracle11g/R2/solaris.sparc64_11gR2_client32.zip

http://download.oracle.com/otn/solaris/oracle11g/R2/solaris.sparc64_11gR2_grid.zip

Oracle Database 11g Release 2 (11.2.0.1.0) for Solaris Operating System (x86-64)

http://download.oracle.com/otn/solaris/oracle11g/R2/solaris.x64_11gR2_database_1of2.zip

http://download.oracle.com/otn/solaris/oracle11g/R2/solaris.x64_11gR2_database_2of2.zip

http://download.oracle.com/otn/solaris/oracle11g/R2/solaris.x64_11gR2_client.zip

http://download.oracle.com/otn/solaris/oracle11g/R2/solaris.x86_11gR2_client.zip

http://download.oracle.com/otn/solaris/oracle11g/R2/solaris.x64_11gR2_grid.zip

Oracle Database 11g Release 2 (11.2.0.1.0) for HP-UX Itanium

http://download.oracle.com/otn/hp/oracle11g/R2/hpia64_11gR2_database_1of2.zip

http://download.oracle.com/otn/hp/oracle11g/R2/hpia64_11gR2_database_2of2.zip

http://download.oracle.com/otn/hp/oracle11g/R2/hpia64_11gR2_client.zip

http://download.oracle.com/otn/hp/oracle11g/R2/hpia64_11gR2_client32.zip

http://download.oracle.com/otn/hp/oracle11g/R2/hpia64_11gR2_grid.zip

Oracle Database 11g Release 2 (11.2.0.1.0) for HP-UX PA-RISC (64-bit)

http://download.oracle.com/otn/hp/oracle11g/R2/hpux.parisc64_11gR2_database_1of2.zip

http://download.oracle.com/otn/hp/oracle11g/R2/hpux.parisc64_11gR2_database_2of2.zip

http://download.oracle.com/otn/hp/oracle11g/R2/hpux.parisc64_11gR2_client.zip

http://download.oracle.com/otn/hp/oracle11g/R2/hpux.parisc32_11gR2_client.zip

http://download.oracle.com/otn/hp/oracle11g/R2/hpux.parisc64_11gR2_grid.zip

Oracle Database 11g Release 2 (11.2.0.1.0) for AIX (PPC64)

http://download.oracle.com/otn/aix/oracle11g/R2/aix.ppc64_11gR2_database_1of2.zip

http://download.oracle.com/otn/aix/oracle11g/R2/aix.ppc64_11gR2_database_2of2.zip

http://download.oracle.com/otn/aix/oracle11g/R2/aix.ppc64_11gR2_client.zip

http://download.oracle.com/otn/aix/oracle11g/R2/aix.ppc32_11gR2_client.zip

http://download.oracle.com/otn/aix/oracle11g/R2/aix.ppc64_11gR2_grid.zip

ORACLE10GR2

Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Microsoft Windows (32-bit)

http://download.oracle.com/otn/nt/oracle10g/10201/10201_database_win32.zip

http://download.oracle.com/otn/nt/oracle10g/10201/10201_client_win32.zip

http://download.oracle.com/otn/nt/oracle10g/10201/10201_clusterware_win32.zip

http://download.oracle.com/otn/nt/oracle10g/10201/10201_gateways_win32.zip

Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Microsoft Windows (x64)

http://download.oracle.com/otn/nt/oracle10g/10201/102010_win64_x64_database.zip

http://download.oracle.com/otn/nt/oracle10g/10201/102010_win64_x64_client.zip

http://download.oracle.com/otn/nt/oracle10g/10201/102010_win64_x64_clusterware.zip

Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Linux x86

http://download.oracle.com/otn/linux/oracle10g/10201/10201_database_linux32.zip

http://download.oracle.com/otn/linux/oracle10g/10201/10201_client_linux32.zip

http://download.oracle.com/otn/linux/oracle10g/10201/10201_gateways_linux32.zip

Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Linux x86-64

http://download.oracle.com/otn/linux/oracle10g/10201/10201_database_linux_x86_64.cpio.gz

http://download.oracle.com/otn/linux/oracle10g/10201/10201_client_linux_x86_64.cpio.gz

http://download.oracle.com/otn/linux/oracle10g/10201/10201_clusterware_linux_x86_64.cpio.gz

http://download.oracle.com/otn/linux/oracle10g/10201/10201_gateways_linux_x86_64.cpio.gz

Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for AIX5L

http://download.oracle.com/otn/aix/oracle10g/10201/10gr2_aix5l64_database.cpio.gz

http://download.oracle.com/otn/aix/oracle10g/10201/10gr2_aix5l64_client.cpio.gz

http://download.oracle.com/otn/aix/oracle10g/10201/10gr2_aix5l64_cluster.cpio.gz

http://download.oracle.com/otn/aix/oracle10g/10201/10gr2_aix5l64_gateways.cpio.gz

Oracle Database 10g Release 2 (10.2.0.2) Enterprise/Standard Edition for Solaris Operating System (x86)

http://download.oracle.com/otn/solaris/oracle10g/10202/10202_database_solx86.zip

http://download.oracle.com/otn/solaris/oracle10g/10202/10202_client_solx86.zip

http://download.oracle.com/otn/solaris/oracle10g/10202/10202_clusterware_solx86.zip

Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Solaris Operating System (x86-64)

http://download.oracle.com/otn/solaris/oracle10g/10201/x8664/10201_database_solx86_64.zip

http://download.oracle.com/otn/solaris/oracle10g/10201/x8664/10201_client_solx86_64.zip

http://download.oracle.com/otn/solaris/oracle10g/10201/x8664/10201_clusterware_solx86_64.zip