Tag Info

Hot answers tagged

3

If the USING INDEX clause is omitted, the index will be still created automatically with the same name as the constraint, in the same tablespace where table is created. This will not cause an error. http://docs.oracle.com/database/121/SQLRF/statements_7002.htm#i2095331 If you specify schema.index, then Oracle attempts to enforce the constraint ...


3

Yes, by using database links. For example, in db2: create database link db1_link connect to myuser identified by mypassword using 'db1'; create view myview as select * from mytable@db1link; select * from myview; Where using 'db1' refers to a TNS entry, but it could be replaced with the actual TNS descriptor.


2

Provide a name for the constraint: SQL> create table monkey(tail_count number); Table created. SQL> insert into monkey values (null); 1 row created. SQL> alter table monkey modify tail_count not null; alter table monkey modify tail_count not null * ERROR at line 1: ORA-02296: cannot enable (ANIMAL.) - null values found SQL> alter table ...


2

This version of Oracle XE is based on 11g2 edition, which is not compatible with CentOS 7. In fact, it isn't even 100% compatible with CentOS 6, however it will run there without problems, after you install a number of RPM packages not installed/required by Oracle installer (especially libaio both 32/64-bit). These are formal OS requirements for XE 11g2: ...


2

You can do it with Native dynamic SQL ( http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/dynamic.htm#LNPLS011 ) using the EXECUTE IMMEDIATE statement. Here's an example: DECLARE v_sql varchar2(128); v_username varchar(30); cursor c1 is select username from dba_users where username like ('PATT%'); BEGIN for REC in c1 loop v_sql := ...


2

Not possible, redo logs get transferred unprocessed. If you want to transfer changes related to just some specific objects or schemas, Streams (deprecated, but free) or GoldenGate (requires extra license) does that. Another option for reducing network traffic is to configure redo transport compression (requires the Advanced Compression option), but this ...


2

Choose Install database software only, then later you can upgrade your databases one by one with DBUA (Database Upgrade Assistant) from the new Oracle Home, or by performing a manual upgrade.


1

No. A date in Oracle will always have a year, month, day, hour, minute, and second. You can choose to display only certain components of the date in your front end and to give a consistent default to the other components of the date. It's pretty common, for example, to let the time component of the date default to midnight. You could force the year to be ...


1

The magic key word is NLS (National Language Support). It will define the dateformat, calender format etc. You can query your current NLS-settings with this command: SELECT * FROM nls_database_parameters; If you want to change it in a session or an instance you can query the current settings using this views: SELECT * FROM nls_session_parameters; -- or ...


1

define/& is a simple text substitution mechanism that does not know anything about sql. And sql and the Oracle Database server do not know anything about the text processing mechanism. So the text that results from the 'define/&'substitutuin must be valid sql statement. Otherwise you get an error. CREATE TABLE P747||_MU as Select percent from ...


1

You can edit the dump file and change the included NLS_LENGTH_SEMANTICS from BYTE to CHAR. Near the beginning of the file you find a line ending like this : ^@02:00:^@^@^D^@BYTE^F^@UNUSED^A^@2^K^INTERPRETED^K^@DISABLE:ALL^@^@ Change BYTE to CHAR using your favorite text editor and save the file. When you will imp that new dump file, all columns will be ...


1

XE changes the following: tnsnames.ora Path variables takes the default port 1521 for itself and this cannot be changed The best way to install XE and other products is to install XE first, then any other Oracle version afterwards. I think you can fix this by examining the path variables by entering PATH at the command line ensuring that each ...


1

If the problem is only cannot start sqlplus, there are two alternatives: 1) If one has the GUI (GNOME or KDE), do the search: "sql command line", and It will appear Run SQL Command Line. 2) Check again the environment variables. Edit the files /root/.bash_profile and /root/.bashrc (for example: # nano /root/.bash_profile) and put the line (at the end): ...


1

You are trying to output avg_sal.salary which is not defined. Use alias in the cursor body : .... cursor c1 is select avg(e.salary) AS salary ... Side notes. It seems that parameter passed (ddept_id ) is not used anywhere inside the procedure except printing. Also, it's been long time since JOIN syntax was introduced and it's much more readable ...


1

ALTER USER should be enough, see below. SQL> select banner from v$version where rownum = 1; BANNER -------------------------------------------------------------------------------- Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production SQL> create user u1 identified by u1; User created. SQL> create user u2 identified by u2 ...



Only top voted, non community-wiki answers of a minimum length are eligible