Through pl / sql to oracle types of two different hosts in the same sql database the way operations

2010-03-25  来源:本站原创  分类:Database  人气:170 

- Use the service name to create a dblink
create database link testjxreal connect to fruitking identified by f123456 using 'testjx_db78';
- Service name refers to $ (oracle_home) \ product \ 10.2.0 \ db_1 \ NETWORK \ ADMIN \ tnsnames.ora file to add the section of code
testjx_db78 = (DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.78) (PORT = 1521)))
(CONNECT_DATA = (SERVICE_NAME = orcl))
)
- Using dblink to access a database table
select * from enterprise @ testjxreal;
- Delete a dblink
drop database link testjxreal;

- View the global service name SID
SELECT * FROM GLOBAL_NAME;
- View the parameters of state of SID, this requires the implementation of the command line in the sql
show parameter global_name;

- Direct the establishment of a connection, so avoid using the service name, sometimes using the service name will lead to TNS service name not found error / exception, which can not connect
- The first parameter: Create a connection name, the name of freedom you can name with your actual
- The second parameter: database user name (to access the database to create the user, can be dba, can also be a regular user)
- The third parameter: database user password
- The fourth parameter: database host IP address
- The fifth parameter: the database SID
create database link testjxreal
connect to fruitking identified by f123456
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.78) (PORT = 1521)))
(CONNECT_DATA = (SERVICE_NAME = orcl)
)
) ';
- Using dblink to access a database table
select * from enterprise @ testjxreal;

相关文章
  • Through pl / sql to oracle types of two different hosts in the same sql database the way operations 2010-03-25

    - Use the service name to create a dblink create database link testjxreal connect to fruitking identified by f123456 using 'testjx_db78'; - Service name refers to $ (oracle_home) \ product \ 10.2.0 \ db_1 \ NETWORK \ ADMIN \ tnsnames.ora file to add

  • Free installation of Oracle client to use PL / SQL Connect Oracle 2010-11-03

    We all know that, with the PL / SQL connection Oracle, is the need to install the Oracle client software. Are not to be thought not to install Oracle Oracle client connected directly to it? In fact, I always wanted to do this because the client was t

  • PL/SQL实现Oracle数据库任务调度 2014-09-21

    正在看的ORACLE教程是:PL/SQL实现Oracle数据库任务调度.摘要:本文主要就数据库恢复与系统任务的调度,在结合一般性的数据库后台处理的经验上,提出较为实用而新颖的解决方法,拓宽了数据库后台开发的思路. 关键词:数据恢复,任务调度,ORACLE,PL/SQL 在数据库操作中时常会有这样的情况发生,由于一时的疏忽而误删或误改了一些重要的数据,另外还有一些重要的任务需要周期性地运行.显然,前一类问题主要是数据备份与恢复方面的,而后一类则主要是系统的任务调度.本文将针对这两类问题,从应用程序

  • 免安装Oracle客户端使用PL/SQL连接Oracle 2014-01-16

    大家都知道,用PL/SQL连接Oracle,是需要安装Oracle客户端软件的.有没要想过不安装Oracle客户端直接连接Oracle呢? 其实我一直想这样做,因为这个客户端实在太让人讨厌了!!!不但会安装一个JDK,而且还会把自己放在环境变量的最前面,会造成不小的麻烦. 其实我之前问过很多人的,但是他们都说一定需要安装Oracle客户端的.......直到昨天无意中发现了以下这个方法: 只需要在Oracle下载一个叫Instant Client Package的软件就可以了,这个软件不需要安装

  • 免安装Oracle客户端使用PL/SQL连接Oracle的2种方法 2015-01-03

    免安装Oracle客户端使用PL/SQL连接Oracle的2种方法 作者:netshuai 来源:博客园 发布时间:2009-10-23 09:19 阅读:171 次 原文链接 [收藏] 方法一: 大家都知道,用PL/SQL连接Oracle,是需要安装Oracle客户端软件的.有没要想过不安装Oracle客户端直接连接Oracle呢? 其实我一直想这样做,因为这个客户端实在太让人讨厌了!!!不但会安装一个JDK,而且还会把自己放在环境变量的最前面,会造成不小的麻烦. 其实我之前问过很多人的,但是

  • SQL Server, Oracle, DB2 database, SQL statements more 2010-04-21

    SQL Server, Oracle, DB2 database, SQL statements more 1.1.1 fetch the first n records SQL Server: Select top n * from xtable Oracle: Select * from xtable where rownum <= n DB2: Select * from xtable fetch first n rows only 1.1.2 take the current date

  • Analysis of the implementation plan optimization SQL <2> ORACLE optimizer (change) 2010-05-27

    Optimizer is sometimes called the query optimizer, which is affecting database query performance because the most important part, do not think that only the SELECT statement is the query. In fact, with any WHERE conditions DML (INSERT, UPDATE, DELETE

  • Analysis of the implementation plan optimization SQL <3> ORACLE implementation plan (transfer) 2010-05-27

    Background: In order to better carry out the following elements we must understand some conceptual terms: Sql statement to not share the same The SQL statement parsing Zhong Fu (Yinweijiexi Caozuobijiao costs of resources, can cause performance degra

  • SQL Server, Oracle, DB2 database, SQL statements more (Reprinted) 2010-09-01

    Reprinted: honeydh (http://www.51testing.com/?uid-191521-action-viewspace-itemid-101702) 1.1.1 fetch the first n records SQL Server: Select top n * from xtable Oracle: Select * from xtable where rownum <= n DB2: Select * from xtable fetch first n row

  • SQL Server, Oracle, DB2 database, comparing SQL statement 2010-10-26

    Source: http://www.cnblogs.com/cwy173/archive/2010/09/20/1831611.html Reprinted from: Long tangwan 1.1.1 fetch the first n records SQL Server: Select top n * from xtable Oracle: Select * from xtable where rownum <= n DB2: Select * from xtable fetch f

  • SQL Server, Oracle, DB2 database, comparing the SQL statement (reproduced) 2010-09-01

    Reproduced: honeydh (http://www.51testing.com/?uid-191521-action-viewspace-itemid-101702) 1.1.1 take the first n records SQL Server: Select top n * from xtable Oracle: Select * from xtable where rownum <= n DB2: Select * from xtable fetch first n row

  • PowerDesigner generates sql statements oracle link 2010-03-22

    1. Configuration link information Open PowerDesigner, in the main menu, click Database ---> Configure Connections select Connection Profiles 2. Add the data source, click the image above the Add DataSource 3. Click Test Connection test the connection

  • C # connection Access.SQL Server.Oracle.MySQL.DB2 and SyBase six different database source code 2010-06-17

    This article lists the C # to connect Access, SQL Server, Oracle, MySQL, DB2 and SyBase six different database programs and the need to pay attention to the point source. 1.C # Connection Access Code: using System.Data; using System.Data.OleDb; strin

  • C # connection Access.SQL Server.Oracle.MySQL.DB2 and SyBase six different database procedure source 2010-06-17

    This article lists the C # to connect Access, SQL Server, Oracle, MySQL, DB2 and SyBase six different database programs and the need to pay attention to the point source. 1.C # Connection Access Code: using System.Data; using System.Data.OleDb; strin

  • Remove Powerdesigner generate sql script oracle table the quotation marks when 2010-07-05

    Remove Powerdesigner generate sql script oracle table the quotation marks when Oracle database used to do when it quotes very irritating. With the following methods to remove: powerdesigner Menu / Edit Current Database / Menu script / format / Enable

  • Comparison of four databases (SQL Server.Oracle.Sybase and DB2) 2010-07-14

    This master reference database of articles on the company. My personal opinions. Open: SQL Server Run only in windows, not the slightest opening, operating system stability to the database is very important. Windows9X series emphasizes the desktop ap

  • SQL Server data types 2010-07-16

    SQL Server Standard data types data type Type Description bit integer whose value can only be 0,1 or NULL, such as Yes or No int integer can be stored to the database in almost all numerical data smallint integer often limited to some specific range

  • SQL Server data types are easily confused 2010-07-21

    SQL Server data types are easily confused MSSQL database Clicks: 434 (1) char, varchar, text, and nchar, nvarchar, ntext the length of char and varchar are between 1 to 8000, their difference is that char is a fixed length character data, and varchar

  • sql server data types char and nchar, varchar and nvarchar, text and ntext (Reprinted) 2010-09-09

    the difference between varchar and nvarchar: varchar (n) Length of n bytes of variable length and non-Unicode character data. n must be a range of values between 1 and 8,000. Storage size of the input data byte actual length, not n bytes (such as var

  • SQL Server data types conversion (Abstract) 2010-12-28

    Simplify the Java programming language data types to SQL Server data types conversion, Microsoft SQL Server JDBC Driver provided by the JDBC specification requires the data type conversion. To increase flexibility, all types with Object, String and b