Impact of GLOBAL_NAMES=TRUE?
OK,
To set up our environment, we have OWB10R2 with the runtime repository running on an Oracle 9.2 instance.
Now, the instance in which the runtime repository is deployed includes schemas for our operational reporting copy of the source data, and our various datamart schemas. The Operational reporting copy of production is updated via streams.
My issue: The streams implementation as used on 9.2 requires GLOBAL_NAMES set to TRUE, but OWB requires GLOBAL_NAMES=FALSE.
So far, the runtime repository seems to be working correctly with GLOBAL_NAMES=TRUE with the exception that I can't seem to use the repository browser as it keeps dropping my login. Not a huge deal, although annoying to be without the gui.
Does anyone know of any other issues that this might cause which I will need to look out for?
Thanks,
Mike
Hello!
I had an environment where the design and runtime repositories were on a database where global_names was true (for the same reason as in your case). I had no problems at all (though it was OWB 10.1 and RDBMS 10.2).
One case I know it can cause problem when you have a mapping that requires database link (global_names=true restricts database link naming and OWB does not care about it; see metalink note 118244.1).
I don't think your RAB problem is related to this setting, but who knows.
Regards,
Robert
Similar Messages
-
Why should i set global_name=*'TRUE'*
if I create public database link its should be TRUE, What's the logic here ?
SQL>show parameter global_name;
NAME TYPE VALUE
global_names boolean FALSE
SQL>create public database link mydba connect to scott identified by tiger using 'ORCL';
Database link created.
SQL> select * from emp@mydba
select count(*) from emp@mydba;
COUNT(*)
14
Even i set global_name='FALSE' i can create public database link. then
why should i set global_name=*'TRUE'*>
if I create public database link its should be TRUE, What's the logic here ?
>
Says who? That isn't true at all. You don't have to see it to TRUE
>
Even i set global_name='FALSE' i can create public database link. then
why should i set global_name=*'TRUE'*
>
You do NOT have to set it to true but you can if you want your links to have the same name as the DB they connect to.
http://docs.oracle.com/cd/B28359_01/server.111/b28320/initparams088.htm
See the Database Reference
>
GLOBAL_NAMES specifies whether a database link is required to have the same name as the database to which it connects.
If the value of GLOBAL_NAMES is false, then no check is performed. If you use or plan to use distributed processing, then Oracle recommends that you set this parameter to true to ensure the use of consistent naming conventions for databases and links in a networked environment.
>
The CREATE DATABASE LINK section of the SQL Language Doc tells you what that setting means.
http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_5005.htm
>
If the value of the GLOBAL_NAMES initialization parameter is TRUE, then the database link must have the same name as the database to which it connects. If the value of GLOBAL_NAMES is FALSE, and if you have changed the global name of the database, then you can specify the global name.
>
If global_name is TRUE then, as the doc says, 'the database link must have the same name as the database to which it connection. -
Problems in registering Locations with global_name = true.
Hello,
I am facing problems registering locations using ombplus. Here is what I did.
OMB+> OMBCREATE LOCATION 'TEST_LOCATION' SET PROPERTIES (TYPE, VERSION, DESCRIPTION, BUSINESS_NAME) VALUES ('Oracle Database', \
'10.2','This is a location', 'TEST_LOCATION' )Location TEST_LOCATION created.
OMB+> OMBCOMMIT
Commit complete.
OMB+> source c:/code/ombscripts/qa-bofarac/allinit.tcl
C:/Code/OMBScripts/QA-BOFARAC/ImportParam.txt
OMB+> OMBALTER LOCATION 'TEST_LOCATION' SET PROPERTIES ( HOST, PORT, SERVICE_NAME , SCHEMA, CONNECT_AS_USER,PASSWORD, VERSION, UOID,DATABASE_NAME) \
VALUES ( '$HOST', $PORT,'$SERVICE', '$TgtDBUser', '$TgtDBUser', 'TgtDBPWD','$
dbversion','true','$SERVICE');
Location TEST_LOCATION altered.
OMB+> OMBCOMMIT
Commit complete.
OMB+> OMBREGISTER LOCATION 'TEST_LOCATION' REUSE
Location TEST_LOCATION is invalid and could not be deployed.
OMB+> OMBALTER LOCATION 'TEST_LOCATION' SET PROPERTIES ( PASSWORD ) VALUES ('ENT_STAR')
Location TEST_LOCATION altered.
OMB+> OMBCOMMIT
Commit complete.
OMB+> OMBREGISTER LOCATION 'TEST_LOCATION' REUSE
Location TEST_LOCATION registered.
OMB+>
Please note that I am setting global_names option in LOCATION objec by setting UOID
= 'true' . Is this correct ? I am using OWB 10.2.0.8
Am I missing any step before registering location ?
Please let me know. Any help is appreciated.
Thanks
MadhaviHi Madhavi,
You said:
OMB+> OMBALTER LOCATION 'TEST_LOCATION' SET PROPERTIES ( HOST, PORT, SERVICE_NAME , SCHEMA, CONNECT_AS_USER,PASSWORD, VERSION, UOID,DATABASE_NAME) \
VALUES ( '$HOST', $PORT,'$SERVICE', '$TgtDBUser', '$TgtDBUser', 'TgtDBPWD','$
dbversion','true','$SERVICE');
Did you leave out the "$"-character for the TgtDBPWD variable in purpose? Could this be the source of your problem?
Regards,
Ed -
Impact of DBFIPS_140 = true On Data Previously Encrypted w/ DBMS_CRYPTO
Provided I hold all other aspects of my use of dbms_crypto constant - type, key, iv, etc. - can I set DBFIPS_140 = true w/ no functional impact to previously encrypted data, or will I need to decrypted prior to making this change and re-encrypt afterwards?
Vlad,
Thanks for your response.
'... enc algorithms used already over there are supported by the fips setup ...' isn't quite clear to me.
We're using encrypt/decrypt members of the Oracle-supplied package dbms_crypto, which I understand to call components of the Oracle software distribution that implement crypto algorithms; currently doing so under 11.2.0.3. No 3rd party libraries are used. Are you saying that if I'm using software exclusively from the Oracle distribution there will be no need to decrypt then re-encrypt? -
ORA-02069: global_names parameter must be set to TRUE for this operation
I have 10g database and a schema 'TMAPP'
And I have two table in TMAPP as
create table user_menu_privs
company_code varchar2(5),
bu_code varchar2(12),
user_group varchar2(30),
user_group_type varchar2(1),
menu_option_code number(5),
enabled varchar2(1),
query_only varchar2(1),
default_lang varchar2(3),
created_by varchar2(10),
created_on date,
updated_by varchar2(10),
updated_on date,
constraint pk_user_menu_privs primary key (company_code,bu_code,user_group,user_group_type,menu_option_code),
constraint fk_user_menu_privs foreign key (company_code,bu_code,user_group,user_group_type)
references user_group(company_code,bu_code,user_group,user_group_type)
create table user_dst
company_code varchar2(5),
bu_code varchar2(12),
userid varchar2(10),
user_group varchar2(30) ,
user_group_type varchar2(1) ,
font_size number(2) ,
font_name varchar2(100) ,
address_id number(10),
created_by varchar2(10),
created_on date,
updated_by varchar2(10),
updated_on date,
constraint pk_user_dst primary key (company_code,bu_code,userid,user_group,user_group_type),
constraint fk_user_dst foreign key (company_code,bu_code,user_group,user_group_type)
references user_group(company_code,bu_code,user_group,user_group_type)
I have another database 11g with a schema TMAPP.
Here I have created a database link 'to_dev' is connecting to the 10g db
using this I can connect and see the data from 10g TMAPP
I have created two views
create or replace view user_menu_privs as
select *
from user_menu_privs@to_dev
where user_group in
(select user_group from user_dst
where user_group_type='F');
create or replace view user_dst as
select * from user_dst@to_dev;
and I executed
delete from user_menu_privs
where menu_option_code=108;
I am getting the error
ORA-02069: global_names parameter must be set to TRUE for this operation
after that I set the global_names in 11g as TRUE
then I am getting another error as
ORA-02085: database link TO_DEV connects to DEV.REGRESS.RDBMS.DEV.US.ORACLE.COM -- that means link is not wokring
Please help
Dennis
Edited by: DJ on Mar 13, 2012 5:49 AM
Edited by: DJ on Mar 13, 2012 5:51 AM
Edited by: DJ on Mar 13, 2012 5:53 AM
Edited by: DJ on Mar 13, 2012 5:55 AM
Edited by: DJ on Mar 13, 2012 5:56 AMOP wrote
>
But you said
create a database link in 11g database with 11g database global name and put 11g database global_name=true.
and put 10g database golba_name=false;
>
That isn't what I said at all. Reread my first reply. The first part is a copy of what you had stated.
>
ORA-02069: global_names parameter must be set to TRUE for this operation
after that I set the global_names in 11g as TRUE
>
And then I said
>
That is because when global_names is TRUE, the database link name MUST be same as the global db name of the database to which the link connects to.
You need to drop the database link and recreate it using the global name of the database it connects to.
'link name MUST be same as the global db name of the database to which the link connects to.' - I didn't say 11g.
And I didn't say 'put 11g database global_name=true' because you had already done that! 'after that I set the global_names in 11g as TRUE.
1. 11g - global_names MUST be TRUE
2. 11g - database link name MUST be the same as the global db name of the database to which the link connects to - 10g global db name
3. 10g - gloibal_names setting is irrelevant -
LINK to Database with different GLOBAL_NAME
Could anybody help me? We have two databases with different GLOBAL_NAME parameter. First database has GLOBAL_NAME=true, second - 'false'. I would like to make LINK from first database to second. If I make link name as a simple word ('DBST'- for example), ORACLE adds DOMAIN name and connects with error ORA-02085. Second database doesn't use DOMAIN name.
ThanksThis script will export the activeDocument as a jpg and gif
function exportSFWJpg( doc, saveFile, qty ) {
var exportOpts = new ExportOptionsSaveForWeb( );
// see guide for other options
exportOpts.format = SaveDocumentType.JPEG
exportOpts.includeProfile = true;//default false
exportOpts.quality = qty;
if ( saveFile.exists ) saveFile.remove( );
doc.exportDocument( saveFile, ExportType.SAVEFORWEB, exportOpts );
function exportSFWGif( doc, saveFile, qty ) {
var exportOpts = new ExportOptionsSaveForWeb( );// default format is gif
// see guide for other options
if ( saveFile.exists ) saveFile.remove( );
doc.exportDocument( saveFile, ExportType.SAVEFORWEB, exportOpts );
var doc = activeDocument;
var docPath = decodeURI( doc.path );
var docName = decodeURI ( doc.name );
docName = docName.match( /(.*)(\.[^\.]+)/ ) ? docName = docName.match( /(.*)(\.[^\.]+)/ ) : docName = [ docName, docName, undefined ];
var saveName = docName[ 1 ];
exportSFWJpg( doc, new File( docPath + '/' + saveName + 'POWERPOINT.jpg' ), 80 );
exportSFWGif( doc, new File( docPath + '/' + saveName + 'WEB.gif' ) ); -
Global_name object type
Hi,
To know global name of a db we use "SELECT * FROM *global_name*". But what is the type of the object global_name? I could not find anything abt it in dba_objects.
I am sure its not a parameter since there is a separate parameter global_names, and we are not using sho parameter but select *.
Please let me know what is this global_name
Regards,
SaikatI am sure its not a parameter since there is a separate parameter global_names, and we are not using sho parameter but select *.Are you sure? :
SQL> select table_name from dict where table_name='GLOBAL_NAME';
TABLE_NAME
GLOBAL_NAME
SQL> alter session set global_names=TRUE;
Sesi¾n modificada.
For more info, check in parameters documentation:
http://docs.oracle.com/cd/B28359_01/server.111/b28320/initparams088.htm -
Significance of Global_names parameter in Oracle CDC and Oracle Streams
Hi,
I am trying to implement a sample Oracle CDC example.
I read in some examples that we need to set a parameter *'global_names= TRUE'*. (which means that all dblink names should be same as their respective database names)
But my doubt is that what will happen if i use the default value 'FALSE' for this parameter without changing it to 'TRUE'.
Is it mandatory to make 'global_names= TRUE' ?
Could anyone please explain this.
Thanks in Advance
Regards,
Gowreesh.Hi Sybrand,
Thanks for the reply.
Currently there are some dblinks in my database(with dblink names different from the database).
My concern is,
If i make global_names=TRUE, then all my earlier dblinks with that database will not work.
and if I DONOT make global_names= TRUE, then i will not be able to work with Oracle CDC/Streams with the database.
I am looking to find out any work around to overcome this deadlock type of situation.
I would be very thankful if you can give some idea to come out of this problem.
Regards,
Gowreesh -
Databases link name required without global_name
Hi,
My global_name is "ORCL.REGRESS.RDBMS.DEV.US.ORACLE.COM" when i create any database link the name create like "U_NET_LINK.REGRESS.RDBMS.DEV.US.ORACLE.COM"
How i eliminate global_name without edit my initora file using SQL .
Regards
FaheemYou need to check parameter global_names
alter system set global_names=true scope=both;
System altered.http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams077.htm#CHDGEHBB
Also what's your DB_NAME and DB_DOMAIN set at?
Your global name looks rather erratic. -
Global_names in Oracle Streams?
Oracle recommends GLOBAL_NAMES=TRUE when setting the Oracle Streams environment. Are there any reasons why Oracle recommends this setting? Actually, I've used GLOBAL_NAMES=false without any issues though....
An excerpt from the Oracle Documentations.
GLOBAL_NAMES
Specifies whether a database link is required to have the same name as the database to which it connects.
To use Streams to share information between databases, set this parameter to true at each database that is participating in your Streams environment.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14229/strms_mprep.htm#i1006278
Regards,
Sabdar Syed. -
ORA-28536 & ORA-28508 & global_names
Hi all,
I set global_names to TRUE. I am working on db_link between Oracle and MS sql server.
The init file:
HS_FDS_CONNECT_INFO=MyHost,1433/master
HS_FDS_TRACE_LEVEL=debug
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
HS_DB_DOMAIN=MyDomain
HS_DB_NAME=SQLEXPRESS
alter session set global_names=TRUE;
drop public database link sqlexpress.MyDomain;
CREATE PUBLIC DATABASE LINK "SQLEXPRESS.MyDomain" CONNECT TO "SA" IDENTIFIED BY "xxxxxx" USING 'dg4msql';
select * from [email protected]; When I try to execute the this query I get the below error
ORA-28536: erreur de traitement des paramètres d'initialisation des services hétérogènes
ORA-28508: valeur SQLEXPRESS non valide pour le paramètre d'init. des services hétérogènes HS_DB_NAME
ORA-02063: précédant 2 lines de SQLEXPRESS.
do you have any idea how can I fix this?
Thanks,Hi sb92075 ,
I found the cause of this error HS_DB_NAME should not exceed 8 character.
Your suggestion about Uppercase is true
HS_FDS_CONNECT_INFO=MyHost,1433/master
HS_DB_DOMAIN=MYDOMAIN
HS_DB_NAME=MASTER
HS_FDS_TRACE_LEVEL=debug
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
alter system set global_names=true;
CREATE DATABASE LINK "MASTER.MYDOMAIN"
CONNECT TO "SA" IDENTIFIED BY "xxxxxxx"
USING 'dg4msql';
select * from dual@"MASTER.MYDOMAIN";
Thanks for your help -
DB links and GLOBAL_NAMES
Hello,
We are facing a situation where we need to do the following:
1.OracleDB1:user1.1, user1.2
2.OracleDB2:user2.1, user2.2
3.AdvancedReplication between OacleDB1 and OraleDB2
4.databaselinks:
DBL1:in user1.1 schema to user2.1
DBL2:in user1.2 schema to user2.2
The issue is that Oralce advanced replication need global_names=true, and this conflict with the 4th point listed above.
Please, is there any solution for that?
Thanks and Cheers,
TewfikThat wil not give me column names .
Thanks
Message was edited by:
aalishan -
Can't mount oracle database on linux system
This is same as previous posting just added
e-mail and username info fo forum posting.
I am not able to mount an Oracle database.
I am new to Oracle and am working on an Oracle8i installation on an
Intel Linux Suse 6.3 platform. I am using only one harddrive and am
not using the 4 mount points as mentioned for efficiecy purposes in
the Oracle documentation..I am using the installation cd from Oracle8i
for Linux Starter Kit by Oracle Press. If anyone has this book they
can refer to pages 41-44 for the examples I followed.
As sysdba in sqplplus using the STARTUP command I can not Mount the
database -step 2 of the 3 stage process (Start, Mount and Open the
database) of opening an Oracle database.
I show the errors I encountered when I did the first 2 of the 3 steps
in the step-by-step mode (STARTUP NOMOUNT pfile=, ALTER DATABASE
MOUNT) in the sqlplus session and alert log respectively with startup
nomount and alter database mount for this sqlplus session.
Additionally I show the init.ora file lines referring to control file
which seem to be referred to by the sqlplus error messages and the
alert.log file. Perhaps some can give me some advice as what I can try
to fix this problem.
At the end of this e-mail I added several questions I had in regard to the control
files. Any help is appreciated.
Well, here are the sqlplus session results and its alert.log file:
Oracle sqlplus session usr/oracle as sysdba
oracle@CHESTNUT:~ > sqlplus
SQL*Plus: Release 8.1.6.0.0 - Production on Mon Mar 19 20:47:49 2001
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Enter user-name: usr/oracle as sysdba
Connected to an idle instance.
SQL> startup nomount pfile=/usr/oracle/dbs/init.ora ;
ORACLE instance started.
Total System Global Area 24989680 bytes
Fixed Size 69616 bytes
Variable Size 24637440 bytes
Database Buffers 204800 bytes
Redo Buffers 77824 bytes
SQL> alter database mount ;
alter database mount
ERROR at line 1:
ORA-00205: error in identifying controlfile, check alert log for more
info
SQL> shutdown immediate ;
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> exit
Disconnected
oracle@CHESTNUT:~ >
alert.log file for above session
Mon Mar 19 20:48:38 2001
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
LICENSE_MAX_USERS = 0
Starting up ORACLE RDBMS Version: 8.1.6.1.0.
System parameters with non-default values:
processes = 50
shared_pool_size = 3500000
control_files = ora_control1, ora_control2
db_block_buffers = 100
log_buffer = 32768
log_checkpoint_interval = 10000
db_files = 80
db_file_multiblock_read_count= 8
global_names = TRUE
db_name = DEFAULT
parallel_max_servers = 5
max_dump_file_size = 10240
PMON started with pid=2
Load Indicator not supported by OS !
DBW0 started with pid=3
LGWR started with pid=4
CKPT started with pid=5
SMON started with pid=6
RECO started with pid=7
Mon Mar 19 20:48:58 2001
alter database mount
Mon Mar 19 20:48:58 2001
ORA-00202: controlfile: 'ora_control1'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Mon Mar 19 20:49:01 2001
ORA-205 signalled during: alter database mount
Mon Mar 19 20:49:12 2001
Shutting down instance (immediate)
License high water mark = 1
Mon Mar 19 20:49:12 2001
ALTER DATABASE CLOSE NORMAL
ORA-1507 signalled during: ALTER DATABASE CLOSE NORMAL...
archiving is disabled
init.ora control files
# define two control files by default
control_files = (ora_control1, ora_control2)
Here are my control file questions:
I need to know several points:
1) What are control files susposed to
contain and how would I recognize them?
I used the
unix find /usr/oracle \*ctl* -print
command to locate files with a ctl extension.
This resulted in about a dozen such files in
different directories as shown below:
./bin/lsnrctl
./bin/extractlib
./bin/agtctl
./bin/oidctl
./bin/lsnrctl0
./bin/agtctlO
./rdbms/demo/ulcase1.ctl
./rdbms/demo/ulcase10.ctl
./rdbms/demo/ulcase2.ctl
./rdbms/demo/ulcase3.ctl
./rdbms/demo/ulcase4.ctl
./rdbms/demo/ulcase5.ctl
./rdbms/demo/ulcase6.ctl
./rdbms/demo/ulcase7.ctl
./rdbms/demo/ulcase8.ctl
./rdbms/demo/ulcase9.ctl
./ldap/load/dn.ctl
./ldap/load/attr_store.ctl
./ord/ts/demo/tsquick/tsquick.ctl
./ord/ts/demo/usageutl/utildat.ctl
./ord/ts/demo/usage/stockdat.ctl
./ord/ts/demo/usage/stockinc.ctl
./ord/ts/demo/retrofit/sales.ctl
./ord/ts/demo/retrofit/sales2.ctl
./ord/ts/demo/applet/indexdemo.ctl
./javavm/admin/libjox8com_sun_jndi_ldap_ctl.so
./md/demo/examples/migctl.h
./md/demo/examples/migctl.c
2) On page 100 in the book Oracle 8i A Beginners's
by Oracle Press mention is made of a
CREATE CONTROLFILE command that can under
circumstances be used to re-create a control-file.
but that is all that is said about it. Perhaps
you might know something more about it.
3) Would you recommend any good text for
Oracle DBA's, especially for the problem of the sort
that I am encountering?
[email protected]
nullIt's probably not supported on RHEL5/Centos5/etc., but...
You can get the installer to function using the following steps:
- extract the cal_linux_*.tar.gz, and cd into the OracleCalendar_inst directory
In there is the actual installer, cal_linux.
- the cal_linux is shell script wrapped around some binary blobs. The installer's
problem is that Oracle is setting the LD_ASSUME_KERNEL=2.2.5 environment
variable, which is a mistake on RHEL5. You need to make it not set that variable,
but you need to do so in a way that the size of the shell script does not change at all,
and none of the binary blobs are impacted.
- the approach I took was
mv cal_linux cal_linux.BAK
sed -e 's/LD_ASSUME_KERNEL=2.2.5/LD_ASSUME_KERNEL= /g' < cal_linux.BAK > cal_linux
chmod a+rx cal_linux
cal_linux -i gui
Note: you must have exactly 5 spaces in the substitution part of the sed command, because you're replacing 5 characters (2.2.5), and the size of the shell script must not change.
If you do that, the installer should run (one warning from awk still) and you should be able to install the product.
Tim -
Database link with the alias and full description in the connect string
Hi,
i have created database link with alias in tnsentry and full description
and suppose i have removed the tnsnames.ora file what will be the impact on the database link that is whether database link will work or not i am sure db link created with alias won't work and how about db link created with full description and which one you prefer
Thanks# Parameter file initora for Database prd
### Global database name is db_name.db_domain
global_names = TRUE
db_name = prd
db_domain = world
# TNSNAMES.ORA for prd ###############################
prd.world = (DESCRIPTION = (ADDRESS = (COMMUNITY = tcp.world)
(PROTOCOL = TCP) (Host = 100.10.100.1) (Port = 1521))
(CONNECT_DATA = (SID = prd) (GLOBAL_NAME = prd.world)
(SERVER = DEDICATED)))
Our database link points from the local database test to the remote database prd. Therefore we need the global database name for prd. Ask the remote database administrator for these information or connect to prd and execute the following query on prd:
SQL> select GLOBAL_NAME from GLOBAL_NAME;
GLOBAL_NAME
prd.WORLD
CREATE DATABASE LINK prd
CONNECT TO system IDENTIFIED BY system_passwd
USING 'prd';--- alias
so the connection description will be ---select ename from [email protected]
useful link
http://www.akadia.com/services/ora_dblinks.html -
What is missing in whole process
Please spare some time and resolve my issue i have created a stream for single table, below are steps i performed for this. I have exp/imp to make table available in destination. After all this there is no impact on table in destination side.
This is first time i work on aracle streams.
-------------------------Destination------------------
--Step No.1
CREATE TABLESPACE streams_tbs
DATAFILE '/u01/app/oracle/
streams_tbs.dbf' SIZE 25M;
--Step No.2
CREATE USER strmadmin
IDENTIFIED BY strmadmin
DEFAULT TABLESPACE streams_tbs
TEMPORARY TABLESPACE temp
QUOTA UNLIMITED ON streams_tbs;
--Step No.3 (connect as sys )
GRANT CONNECT, RESOURCE, DBA
TO strmadmin;
--Step No.4 (connect as sys )
begin
DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE(
grantee => 'strmadmin',
grant_privileges => true);
END;
--Step No.5 (connect as sys )
GRANT SELECT_CATALOG_ROLE TO strmadmin;
--Step No.6 (connect as sys )
GRANT SELECT ANY DICTIONARY TO strmadmin;
--Step 7
alter system set global_names=true scope=spfile;
--Step 8
alter system set STREAMS_POOL_SIZE =50M ;
-- Name of database link should be same as name of the database it connecting to, because global_names=true otherwise
-- we can give database link anyname.
--Step 9 (Optional)
create public database link pcba connect to strmadmin identified by strmadmin use 'pcba';
--Step 10
begin
dbms_streams_adm.set_up_queue();
end;
--Step 11 Execute this command vis SYS
grant all on tariq.cb_insured_person to strmadmin;
--Step 12
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_RULES(
table_name => ' tariq.cb_insured_personp',
streams_type => 'apply',
streams_name => 'apply_stream',
queue_name =>
'strmadmin.streams_queue',
include_dml => true,
include_ddl => true,
source_database => 'PCBA',
inclusion_rule => true);
END;
--Step 13
BEGIN
DBMS_APPLY_ADM.SET_PARAMETER(
apply_name => 'apply_stream',
parameter => 'disable_on_error',
value => 'n');
END;
--Step 14
BEGIN
DBMS_APPLY_ADM.START_APPLY(
apply_name => 'apply_stream');
END;
------------------------------------------Source------------------------------
--Step 1
CREATE TABLESPACE streams_tbs
DATAFILE '/opt/oracle/
streams_tbs.dbf' SIZE 25M;
--Step 2
CREATE USER strmadmin
IDENTIFIED BY strmadmin
DEFAULT TABLESPACE streams_tbs
TEMPORARY TABLESPACE temp
QUOTA UNLIMITED ON streams_tbs;
--Step 3 (as sys user)
GRANT CONNECT, RESOURCE, DBA TO strmadmin;
--Step 4 (as sys user)
begin
DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE(
grantee => 'strmadmin',
grant_privileges => true);
END;
--Step 5 (as sys user)
GRANT SELECT_CATALOG_ROLE TO strmadmin;
--Step 6 (as sys user)
GRANT SELECT ANY DICTIONARY TO strmadmin;
--Step 7
alter system set global_names=true scope=spfile;
--Step 8
alter system set STREAMS_POOL_SIZE =200M ;
-- Name of database link should be same as name of the database it connecting to, because global_names=true otherwise
-- we can give database link anyname.
--Step 9
create public database link tmdb connect to strmadmin identified by strmadmin use 'tmdb';
--Step 10
begin
dbms_streams_adm.set_up_queue();
end;
--Step 11
alter table core_business.cb_insured_person
add supplemental log data
(primary key, unique) columns;
--Step 12
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_RULES(
table_name => 'core_business.cb_insured_person',
streams_type => 'capture',
streams_name => 'capture_stream',
queue_name =>
'strmadmin.streams_queue',
include_dml => true,
include_ddl => true,
inclusion_rule => true);
END;
--Step 13
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_PROPAGATION_RULES(
table_name => 'core_business.cb_insured_person',
streams_name => 'PCBA_to_TMDB',
source_queue_name => 'strmadmin.streams_queue',
destination_queue_name => 'strmadmin.streams_queue@TMDB',
include_dml => true,
include_ddl => true,
source_database => 'PCBA',
inclusion_rule => true);
END;
--Step 14
DECLARE
source_scn NUMBER;
BEGIN
source_scn := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER();
DBMS_APPLY_ADM.SET_TABLE_INSTANTIATION_SCN@TMDB(
source_object_name => 'core_business.cb_insured_person',
source_database_name => 'PCBA',
instantiation_scn => source_scn);
END;
--Step 15
BEGIN
DBMS_CAPTURE_ADM.START_CAPTURE(
capture_name =>
'capture_stream');
END;
/change your source and target db names and table names and use this script.
----------------------------TARGET------------------------------------------
Create Streams Administrator :
connect SYS/password as SYSDBA
create user STRMADMIN identified by STRMADMIN;
Grant the necessary privileges to the Streams Administrator
GRANT CONNECT, RESOURCE,DBA to STRMADMIN;
GRANT SELECT ANY DICTIONARY TO STRMADMIN;
GRANT EXECUTE ON DBMS_AQ TO STRMADMIN;
GRANT EXECUTE ON DBMS_AQADM TO STRMADMIN;
GRANT EXECUTE ON DBMS_FLASHBACK TO STRMADMIN;
GRANT EXECUTE ON DBMS_STREAMS_ADM TO STRMADMIN;
GRANT EXECUTE ON DBMS_CAPTURE_ADM TO STRMADMIN;
GRANT EXECUTE ON DBMS_APPLY_ADM TO STRMADMIN;
GRANT EXECUTE ON DBMS_RULE_ADM TO STRMADMIN;
GRANT EXECUTE ON DBMS_PROPAGATION_ADM TO STRMADMIN;
BEGIN
DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE(
privilege => 'ENQUEUE_ANY',
grantee => 'STRMADMIN',
admin_option => FALSE);
END;
BEGIN
DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE(
privilege => 'DEQUEUE_ANY',
grantee => 'STRMADMIN',
admin_option => FALSE);
END;
BEGIN
DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE(
privilege => 'MANAGE_ANY',
grantee => 'STRMADMIN',
admin_option => TRUE);
END;
BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_EVALUATION_CONTEXT_OBJ,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_RULE_SET_OBJ,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_RULE_OBJ,
grantee => 'STRMADMIN',
grant_option => TRUE);
END;
BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_ANY_RULE_SET,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.ALTER_ANY_RULE_SET,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.EXECUTE_ANY_RULE_SET,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_ANY_RULE,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.ALTER_ANY_RULE,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.EXECUTE_ANY_RULE,
grantee => 'STRMADMIN',
grant_option => TRUE);
END;
BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.EXECUTE_ANY_EVALUATION_CONTEXT,
grantee => 'STRMADMIN',
grant_option => TRUE);
END;
**********************TARGET***************************************************************
Create streams queue :
connect STRMADMIN/STRMADMIN
BEGIN
DBMS_STREAMS_ADM.SET_UP_QUEUE(
queue_table => 'STREAMS_QUEUE_TABLE',
queue_name => 'STREAMS_QUEUE',
queue_user => 'STRMADMIN');
END;
Add apply rules for the table at the destination database :
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_RULES(
table_name => 'PRISM.AQ_TEST',
streams_type => 'APPLY',
streams_name => 'STRMADMIN_APPLY2',
queue_name => 'STRMADMIN.STREAMS_QUEUE',
include_dml => true,
include_ddl => false,
source_database => 'COLE');
END;
Specify an 'APPLY USER' at the destination database:
BEGIN
DBMS_APPLY_ADM.ALTER_APPLY(
apply_name => 'STRMADMIN_APPLY2',
apply_user => 'PRISM');
END;
BEGIN
DBMS_APPLY_ADM.SET_PARAMETER(
apply_name => 'STRMADMIN_APPLY2',
parameter => 'DISABLE_ON_ERROR',
value => 'N' );
END;
Start the Apply process :
BEGIN
DBMS_APPLY_ADM.START_APPLY(apply_name => 'STRMADMIN_APPLY2');
END;
DECLARE source_scn NUMBER;
BEGIN
source_scn := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER();
DBMS_APPLY_ADM.SET_TABLE_INSTANTIATION_SCN@clnrtst
source_object_name => 'PRISM.AQ_TEST',
source_database_name=> 'cole',
instantiation_scn => source_scn
END;
**********************************SOURCE*********************************************************************
Create Streams Administrator :
connect SYS/password as SYSDBA
create user STRMADMIN identified by STRMADMIN;
CREATE TABLESPACE STREAMS DATAFILE 'logmnrts.dbf' SIZE 25M AUTOEXTEND ON
MAXSIZE UNLIMITED;
BEGIN
DBMS_LOGMNR_D.SET_TABLESPACE('STREAMS');
END;
Grant the necessary privileges to the Streams Administrator
GRANT CONNECT, RESOURCE,DBA to STRMADMIN;
GRANT SELECT ANY DICTIONARY TO STRMADMIN;
GRANT EXECUTE ON DBMS_AQ TO STRMADMIN;
GRANT EXECUTE ON DBMS_AQADM TO STRMADMIN;
GRANT EXECUTE ON DBMS_FLASHBACK TO STRMADMIN;
GRANT EXECUTE ON DBMS_STREAMS_ADM TO STRMADMIN;
GRANT EXECUTE ON DBMS_CAPTURE_ADM TO STRMADMIN;
GRANT EXECUTE ON DBMS_APPLY_ADM TO STRMADMIN;
GRANT EXECUTE ON DBMS_RULE_ADM TO STRMADMIN;
GRANT EXECUTE ON DBMS_PROPAGATION_ADM TO STRMADMIN;
BEGIN
DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE(
privilege => 'ENQUEUE_ANY',
grantee => 'STRMADMIN',
admin_option => FALSE);
END;
BEGIN
DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE(
privilege => 'DEQUEUE_ANY',
grantee => 'STRMADMIN',
admin_option => FALSE);
END;
BEGIN
DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE(
privilege => 'MANAGE_ANY',
grantee => 'STRMADMIN',
admin_option => TRUE);
END;
BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_EVALUATION_CONTEXT_OBJ,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_RULE_SET_OBJ,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_RULE_OBJ,
grantee => 'STRMADMIN',
grant_option => TRUE);
END;
BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_ANY_RULE_SET,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.ALTER_ANY_RULE_SET,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.EXECUTE_ANY_RULE_SET,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_ANY_RULE,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.ALTER_ANY_RULE,
grantee => 'STRMADMIN',
grant_option => TRUE);
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.EXECUTE_ANY_RULE,
grantee => 'STRMADMIN',
grant_option => TRUE);
END;
BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.EXECUTE_ANY_EVALUATION_CONTEXT,
grantee => 'STRMADMIN',
grant_option => TRUE);
END;
Create a database link to the destination database :
connect STRMADMIN/STRMADMIN
CREATE DATABASE LINK clnrtst connect to
STRMADMIN identified by STRMADMIN using 'clnrtst';
Create streams queue :
connect STRMADMIN/STRMADMIN
BEGIN
DBMS_STREAMS_ADM.SET_UP_QUEUE(
queue_table => 'STREAMS_QUEUE_TABLE',
queue_name => 'STREAMS_QUEUE',
queue_user => 'STRMADMIN');
END;
Add capture rules for the table at the source database:
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_RULES(
table_name => 'PRISM.aq_test',
streams_type => 'CAPTURE',
streams_name => 'STRMADMIN_CAPTURE',
queue_name => 'STRMADMIN.STREAMS_QUEUE',
include_dml => true,
include_ddl => false,
source_database => 'cole');
END;
Add propagation rules for the table at the source database.
This step will also create a propagation job to the destination database.
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_PROPAGATION_RULES(
table_name => 'prism.AQ_test',
streams_name => 'STRMADMIN_PROPAGATE',
source_queue_name => 'STRMADMIN.STREAMS_QUEUE',
destination_queue_name => 'STRMADMIN.STREAMS_QUEUE@clnrtst',
include_dml => true,
include_ddl => false,
source_database => 'cole')
inclusion_rule=> false,
and_condition=> :'lcr.GET_COMMAND_TYPE () = ''DELETE''');
END;
Finally start the Capture Process:
connect STRMADMIN/STRMADMIN
BEGIN
DBMS_CAPTURE_ADM.START_CAPTURE(capture_name => 'STRMADMIN_CAPTURE');
END;
Start the Apply process :
BEGIN
DBMS_APPLY_ADM.START_APPLY(apply_name => 'STRMADMIN_APPLY2');
END;
/
Maybe you are looking for
-
Monitor setup hangs / shared screens as default
Hi, I am using an external display together with my Retina MacBook Pro. When I want to give presentations and want to change the monitor setting to mirrored screens the system setting applications hangs. In order to change this setting I have to rebo
-
Document prints in reverse, what setting can I change to correct this?
Document prints in reverse, what setting can I change to correct this? Not a printer problem - documents print in correct order when using other programs. Using Acrobat X Pro on a Mac.
-
HT1626 i cant control my mac the lock is not responding?
i cant control my mac the lock is not responding?
-
Free upgrade redemption for Retina Display MBP
How do I redeem my free upgrade for my new retina mbp?
-
Hai all, I have problem with order by clause, My query is "select number from table1 order by number asc " and the output is displaying as 1 10 12 13 15 17 19 2 20 21 22 But if we give order by it should display as below only right ? 1 2 10 12 13 15