How to view ORACLE alarm logs? Page 1/2

Source: Internet
Author: User

1. Understand oracle External tables
External table definition: The structure is stored in the data dictionary, and the table data is stored in the OS file.
Purpose: query the OS file data in the database and load the OS file data to the database.
Differences from other tables: you cannot perform DML operations on External tables, nor create indexes on External tables. You can only perform select operations.
2. Create a simple External table 1. Create an OS file
Because external tables are mainly used to view files on the OS, a file is first created on the OS.
Mkdir-p/oracle/ext
Vi/oracle/ext. dat
10, 20, 30
40, 50, 60
70, 80, 90

2. Grant user permissions and create directory objects

Create a new user


Create user test identified by "123" defaultTablespaceTest quota unlimited on test;

User authorization


SQL> grant create any directory to test;

Create a directory object


SQL & gt; conn test/123
Connected.
SQL> create directory ext as '/oracle/ext ';
Directory created.

3. Create an External table
SQL> createTableExttable (
Id number, name varchar2 (10), I number
) Organization external
(Type oracle_loader
Default directory ext
  AccessParameters
(Records delimited by newline
Fields terminated ','
) Location ('ext. dat ')
);

4. Test


SQL> select * from exttable;
ID NAME I
------------------------------
10 20 30
40 50 60
708090

The test is successful. You can view the OS file data in the database.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.