1.取得指定用户的所有表名:
- SELECT OWNER AS "对象所有者",OBJECT_NAME AS "表名",OBJECT_ID AS "对象编号" from dba_objects where owner = 'RAXNYB' AND OBJECT_TYPE = 'TABLE' ORDER BY OWNER,OBJECT_TYPE;
- 或 (dba_objects包含表、视图、索引、分区等等)
- select OWNER AS "对象所有者",TABLE_NAME AS "表名" from DBA_TABLES where owner = 'RAXNYB' ORDER BY OWNER,TABLE_NAME;
2.取得指定用户的所有视图名称:
SELECT OWNER AS "对象所有者",VIEW_NAME AS "视图名称" from DBA_VIEWS where owner = 'RAXNYB' ORDER BY OWNER,VIEW_NAME;
3.数据库链:
select * from dba_db_links;
在spbase下建数据库链
create database link dbl_spnew
connect to spnew identified by spnew using 'jhhx';
insert into acc_nbr@dbl_spnew
select * from acc_nbr where nxx_nbr='237' and line_nbr='8888';