Set Character sets for All Oracle Databases - oracle

I'm using Oracle Database 12c on RHEL System, and I wanna to set the parameters NLS_CHARACTERSET=AL32UTF8 and NLS_NCHAR_CHARACTERSET=AL16UTF16 by default for all created databases with sql create statement to avoid to add them every time when I issue the create query.
I have tried to add these parameters to initSID.ora but it seems they are not valid as initialization parameters.
Thanks.

Related

H2 set schema changes schema_search_path

If I have a schema_search_path set and I wish to create a bunch of tables using a common script by setting the schema and not explicating the
schema in the table create (common script could be used in multiple schemas, this also sets the schema_search_path to just the specified schema.
This seems like an undesirable side affect.
Value set by SET SCHEMA_SEARCH_PATH is not affected by any other commands.
But this value is only used when an identified is not qualified with the schema and an object with this name doesn't exist in the current schema (affected by SET SCHEMA command).
For example, tables referenced by non-qualified names are searched in the following order:
Tables of the current schema.
Local temporary tables. (Currently they also include query aliases from the WITH clauses, but this may be changed when somebody will implement a separate scope of identifiers for these views.)
Tables of each schema from SCHEMA_SEARCH_PATH, if any. When multiple schemas are specified, they order has a meaning, they are processed in the same order.
Legacy or compatibility tables, such as DUAL or SYSDUMMY1 in DB2 and Derby compatibility modes.
The first table matched by its name will be used.
This is a complex case, for the most types of database objects only steps (1) and (3) are performed.
If you think that something is not going as described here and you can create a standalone test case (Java / JDBC / SQL only, no third-party libraries), you can create a bug report on GitHub:
https://github.com/h2database/h2database/issues

informatica execute sql in sql transformation

Background: I am really new. Informatica Developer for PowerCenter Express Version: 9.6.1 HotFix 2
I want to execute a t-sql statement as one step in a work flow:
truncate table dbo.stage_customer
I tried create a mapping, add a sql transformation on it. Input above query in sql query window. I added the mapping to a workflow of just start, the mapping, and the end. When I validate the flow I got this error:
The group [Input] in transformation xxx must have at least one port
I have no idea what ports are needed since this (the truncate statement) basically doesn't need input or output.
Use your query " truncate table dbo.stage_customer" in Pre-SQL command
As Aswin suggested use the built in option in the session property.
But in the production environments user may not have truncate table access for the table in a database. In this case, informatica workflow will fail if you check the truncate target table option. It is good to have a stored procedure to truncate the target table and use that stored procedure in informatica mapping to avoid workflow failures in case of user having no truncate access to the database.
if you would like to truncate a target table before loading why don't you use the in-built option present in session properties?
goto workflow manager-> open session->mapping tab->click on target table listed left side->choose the property "Truncate table option" just enable it
to answer you question, I think you have to connect at least one input and output port into SQL transformation (because it is not unconnected). Just create dummy ports and try again
try this article - click here

force full statistic on single table not all db

I'm in need to force a full statistic on a table on a oracle 10g DB
On 11g I can use DBMS_STATS.SET_TABLE_PREFS and set ESTIMATE_PERCENT to 100.
How can I do the same over a 10g Oracle DB?
Thanks
There is no method available in Oracle 10g, which you can use to control the default value for some parameters for statistics collection.
The DBMS_STATS.SET_PARAM procedure, can be used to set the values for few defined parameters, but they are cannot be enforced on a specific table, but are applicable for all tables, post their invocation.
You will have to specify the estimate_percent as a parameter while gathering stats for your table, as an individual statement (maybe executed, post GATHER_SCHEMA_STATS)

Is character set from the user or the database?

I'm trying to figure out where our project went wrong.
A long time ago, our database administrator created a user and a schema for the project we were working on.
We gave that user to a contractor who created the tables and installed the application.
Today I discovered that our database doesn't support UTF-8 characters and we need it to.
select value from nls_database_parameters
where parameter='NLS_CHARACTERSET'
The result is : WE8ISO8859P1
My question is, was the mistake made when the user was created, or was the mistake done by the contractor who created the tables?
Thanks
The character set is an attribute of the database. So whoever created the database presumably chose the wrong character set. There are no character set related settings when you create a user or create a table (other than determining whether to use the database character set (CHAR/ VARCHAR2) or the national character set (NCHAR/ NVARCHAR2) data types).
Changing the character set of an existing database may take a bit of effort. The Globalization Guide has a section on character set migration. Depending on the Oracle version (the procedure is different in 10g and 11g) and what data already exists, doing an export & import to a new database may be the easiest option.
I should add that the order of operations you specified in your post doesn't make sense. The database has to be created before the user or the schema can be created. So it doesn't make sense that the DBA could have created the user and the schema a long time ago and the contractor created the database more recently. Are you possibly using the terms "database" and "schema" in a non-Oracle context?

Store cyrillic in Oracle

I have Oracle database with following settings
NLS_CHARACTERSET EE8MSWIN1250
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_LANGUAGE AMERICAN
I've created test table with one column of type NVARCHAR2, where I'm going to store cyrillic.
I use SQL Developer to connect DB.
The problem is when I put a cyrillic chain into DB using SQL Developer cell, the data is stored correctly. But when I use INSERT query with the same data using N'' or not the data is stored as question marks.
Interesting thing is that query generated by SQL Developer, and written by me is identical.
I solved this problem by changing NLS_CHARACTERSET to UTF8, but on production server I can't do such a thing.
IMO it must be some way to store cyrillic into that DB in proper way using query if SQL Developer can do that.
Regards
Depending on the ODBC/JDBC in use, localization settings on your computer may override any config values in the database. Try using ALTER SESSION and set the proper NLS parameters before executing your query, and see if that helps. SQL developer might do this behind the scenes when you edit the data cell.

Resources